13 #ifndef MLPACK_CORE_TREE_BINARY_SPACE_TREE_MEAN_SPLIT_IMPL_HPP 14 #define MLPACK_CORE_TREE_BINARY_SPACE_TREE_MEAN_SPLIT_IMPL_HPP 21 template<
typename BoundType,
typename MatType>
36 for (
size_t d = 0; d < data.n_rows; d++)
38 const double width = bound[d].Width();
51 for (
size_t i = begin; i < begin + count; ++i)
54 for (
size_t d = 0; d < data.n_rows; ++d)
56 const double val = data(d, i);
57 if (val < ranges[d].Lo())
59 if (val > ranges[d].Hi())
65 for (
size_t d = 0; d < data.n_rows; d++)
67 const double width = ranges[d].
Width();
83 for (
size_t i = begin; i < begin + count; ++i)
T Lo() const
Get the lower bound.
Definition: range.hpp:61
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
A class to obtain compile-time traits about BoundType classes.
Definition: bound_traits.hpp:26
static bool SplitNode(const BoundType &bound, MatType &data, const size_t begin, const size_t count, SplitInfo &splitInfo)
Find the partition of the node.
Definition: mean_split_impl.hpp:22
An information about the partition.
Definition: mean_split.hpp:33
size_t splitDimension
The dimension to split the node on.
Definition: mean_split.hpp:36
T Hi() const
Get the upper bound.
Definition: range.hpp:66
double splitVal
The split in dimension splitDimension is based on this value.
Definition: mean_split.hpp:38
T Width() const
Gets the span of the range (hi - lo).
Definition: range_impl.hpp:47
static void Assert(bool condition, const std::string &message="Assert Failed.")
Checks if the specified condition is true.
Definition: log.cpp:38