diff --git a/CPPFImdlp.cpp b/CPPFImdlp.cpp index 7aa0beb..0cd833c 100644 --- a/CPPFImdlp.cpp +++ b/CPPFImdlp.cpp @@ -8,16 +8,11 @@ #include "Metrics.h" namespace mdlp { - CPPFImdlp::CPPFImdlp():min_length(3), depth(0), max_depth(numeric_limits::max()), proposed_cuts(0), - indices(indices_t()), X(samples_t()), y(labels_t()), - metrics(Metrics(y, indices)), num_cut_points(numeric_limits::max()) - { - } - CPPFImdlp::CPPFImdlp(size_t min_length_, int max_depth_, float proposed): min_length(min_length_), depth(0), - max_depth(max_depth_), proposed_cuts(proposed), indices(indices_t()), X(samples_t()), y(labels_t()), - metrics(Metrics(y, indices)), num_cut_points(numeric_limits::max()) + CPPFImdlp::CPPFImdlp(size_t min_length_, int max_depth_, float proposed): min_length(min_length_), + max_depth(max_depth_), proposed_cuts(proposed) { } + CPPFImdlp::CPPFImdlp() = default; CPPFImdlp::~CPPFImdlp() = default; size_t CPPFImdlp::compute_max_num_cut_points() diff --git a/CPPFImdlp.h b/CPPFImdlp.h index a24ffaf..f7364c2 100644 --- a/CPPFImdlp.h +++ b/CPPFImdlp.h @@ -7,15 +7,16 @@ namespace mdlp { class CPPFImdlp { protected: - size_t min_length; - int depth, max_depth; - float proposed_cuts; - indices_t indices; - samples_t X; - labels_t y; - Metrics metrics; + size_t min_length = 3; + int depth = 0; + int max_depth = numeric_limits::max(); + float proposed_cuts = 0; + indices_t indices = indices_t(); + samples_t X = samples_t(); + labels_t y = labels_t(); + Metrics metrics = Metrics(y, indices); cutPoints_t cutPoints; - size_t num_cut_points; + size_t num_cut_points = numeric_limits::max(); static indices_t sortIndices(samples_t&, labels_t&); void computeCutPoints(size_t, size_t, int);