14 #ifndef MLPACK_CORE_TREE_BINARY_SPACE_TREE_MIDPOINT_SPLIT_IMPL_HPP 15 #define MLPACK_CORE_TREE_BINARY_SPACE_TREE_MIDPOINT_SPLIT_IMPL_HPP 23 template<
typename BoundType,
typename MatType>
37 for (
size_t d = 0; d < data.n_rows; d++)
39 const double width = bound[d].Width();
55 for (
size_t i = begin; i < begin + count; ++i)
58 for (
size_t d = 0; d < data.n_rows; ++d)
60 const double val = data(d, i);
61 if (val < ranges[d].Lo())
63 if (val > ranges[d].Hi())
69 for (
size_t d = 0; d < data.n_rows; d++)
71 const double width = ranges[d].
Width();
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
Bounds that are useful for binary space partitioning trees.
double splitVal
The split in dimension splitDimension is based on this value.
Definition: midpoint_split.hpp:39
T Hi() const
Get the upper bound.
Definition: range.hpp:66
A struct that contains an information about the split.
Definition: midpoint_split.hpp:34
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: midpoint_split_impl.hpp:24
size_t splitDimension
The dimension to split the node on.
Definition: midpoint_split.hpp:37
T Width() const
Gets the span of the range (hi - lo).
Definition: range_impl.hpp:47
T Mid() const
Gets the midpoint of this range.
Definition: range_impl.hpp:59