13 #ifndef MLPACK_CORE_TREE_BINARY_SPACE_TREE_UB_TREE_SPLIT_HPP 14 #define MLPACK_CORE_TREE_BINARY_SPACE_TREE_UB_TREE_SPLIT_HPP 17 #include "../address.hpp" 28 template<
typename BoundType,
typename MatType = arma::mat>
33 typedef typename std::conditional<
34 sizeof(
typename MatType::elem_type) * CHAR_BIT <= 32,
36 uint64_t>::type AddressElemType;
42 std::vector<std::pair<arma::Col<AddressElemType>,
size_t>>* addresses;
56 bool SplitNode(BoundType& bound,
60 SplitInfo& splitInfo);
71 static size_t PerformSplit(MatType& data,
74 const SplitInfo& splitInfo);
88 static size_t PerformSplit(MatType& data,
91 const SplitInfo& splitInfo,
92 std::vector<size_t>& oldFromNew);
96 std::vector<std::pair<arma::Col<AddressElemType>,
size_t>> addresses;
103 void InitializeAddresses(
const MatType& data);
106 static bool ComparePair(
107 const std::pair<arma::Col<AddressElemType>,
size_t>& p1,
108 const std::pair<arma::Col<AddressElemType>,
size_t>& p2)
110 return bound::addr::CompareAddresses(p1.first, p2.first) < 0;
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
The core includes that mlpack expects; standard C++ includes and Armadillo.
Split a node into two parts according to the median address of points contained in the node...
Definition: ub_tree_split.hpp:29