21 std::ostringstream stm;
31 double reg_strength = 0,
34 char* buffer =
new char[inName.size() + 10];
36 std::string
extension = inName.substr(inName.find_last_of(
".") + 1);
38 std::string baseName =
39 inName.substr(0, inName.size() -
extension.size() - 1);
41 sprintf(buffer,
"%s_out_%1.0f_%.0f.%s", baseName.c_str(),
fidelity,
43 this->
out_name = std::string(buffer);
59 std::string
toc()
const {
60 std::ostringstream stm;
61 stm << static_cast<double>(clock() -
lastTime) / CLOCKS_PER_SEC;
66 double x =
static_cast<double>(clock() -
lastTime) / CLOCKS_PER_SEC;
103 template <
typename T>
111 this->centroids = std::vector<std::vector<std::vector<T>>>(
113 std::vector<std::vector<T>>(2, std::vector<T>(dim, 0.0)));
116 template <
typename T>
127 template <
typename T>
130 if (lhs.
x != rhs.
x) {
131 return lhs.
x < rhs.
x;
133 if (lhs.
y != rhs.
y) {
134 return lhs.
y < rhs.
y;
137 return lhs.
z < rhs.
z;
std::vector< std::vector< std::vector< T > > > centroids
VectorOfCentroids(std::size_t nb_comp, std::size_t dim)
std::string to_string(const T &n)
ComponentsFusion(std::size_t c1, std::size_t c2, std::size_t ind=0, T gain=0.)
std::vector< T > merged_value
GenericParameter(std::string inName="in_name", double reg_strength=0, double fidelity=0)
Point3D(T x=0., T y=0., T z=0.)
bool operator()(const ComponentsFusion< T > lhs, const ComponentsFusion< T > rhs) const
bool operator()(const Point3D< T > lhs, const Point3D< T > rhs) const