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);
74 const SplitInfo& splitInfo);
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)
118 #include "ub_tree_split_impl.hpp" Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
size_t PerformSplit(MatType &data, const size_t begin, const size_t count, const typename SplitType::SplitInfo &splitInfo)
This function implements the default split behavior i.e.
Split a node into two parts according to the median address of points contained in the node...
int CompareAddresses(const AddressType1 &addr1, const AddressType2 &addr2)
Compare two addresses.