Merge pull request #1185 from zoq/octree_perform_split_fix
Octree: adjust SplitType/TypeInfo structure.
This commit is contained in:
@@ -428,15 +428,18 @@ class Octree
|
||||
/**
|
||||
* This is used for sorting points while splitting.
|
||||
*/
|
||||
struct SplitInfo
|
||||
struct SplitType
|
||||
{
|
||||
//! Create the SplitInfo object.
|
||||
SplitInfo(const size_t d, const arma::vec& c) : d(d), center(c) {}
|
||||
struct SplitInfo
|
||||
{
|
||||
//! Create the SplitInfo object.
|
||||
SplitInfo(const size_t d, const arma::vec& c) : d(d), center(c) {}
|
||||
|
||||
//! The dimension we are splitting on.
|
||||
size_t d;
|
||||
//! The center of the node.
|
||||
const arma::vec& center;
|
||||
//! The dimension we are splitting on.
|
||||
size_t d;
|
||||
//! The center of the node.
|
||||
const arma::vec& center;
|
||||
};
|
||||
|
||||
template<typename VecType>
|
||||
static bool AssignToLeftNode(const VecType& point, const SplitInfo& s)
|
||||
|
||||
@@ -695,8 +695,8 @@ void Octree<MetricType, StatisticType, MatType>::SplitNode(
|
||||
// children of index 2^(d - 1) - 1 and less will be on the left side, and
|
||||
// all points belonging to children of index 2^(d - 1) and above will be on
|
||||
// the right side.
|
||||
SplitInfo s(d, center);
|
||||
const size_t firstRight = split::PerformSplit<MatType, SplitInfo>(*dataset,
|
||||
typename SplitType::SplitInfo s(d, center);
|
||||
const size_t firstRight = split::PerformSplit<MatType, SplitType>(*dataset,
|
||||
childBegin, childCount, s);
|
||||
|
||||
// We can set the first index of the right child. The first index of the
|
||||
@@ -797,8 +797,8 @@ void Octree<MetricType, StatisticType, MatType>::SplitNode(
|
||||
// children of index 2^(d - 1) - 1 and less will be on the left side, and
|
||||
// all points belonging to children of index 2^(d - 1) and above will be on
|
||||
// the right side.
|
||||
SplitInfo s(d, center);
|
||||
const size_t firstRight = split::PerformSplit<MatType, SplitInfo>(*dataset,
|
||||
typename SplitType::SplitInfo s(d, center);
|
||||
const size_t firstRight = split::PerformSplit<MatType, SplitType>(*dataset,
|
||||
childBegin, childCount, s, oldFromNew);
|
||||
|
||||
// We can set the first index of the right child. The first index of the
|
||||
|
||||
Reference in New Issue
Block a user