27 #ifndef MPBLOCKS_SIMPLEX_TREE_SIMPLEX_HPP_
28 #define MPBLOCKS_SIMPLEX_TREE_SIMPLEX_HPP_
32 namespace simplex_tree {
34 template <
class Traits>
40 m_children.reserve(n);
41 for(
int i=0; i < n; i++)
47 const Point_t& xi = m_points[i]->getPoint();
56 const Point_t& xj = m_points[i]->getPoints();
59 Format_t dj = nj.dot(xi) + 0.5*v.norm();
69 template <
class Traits>
76 template <
class Traits>
81 m_points.push_back(x);
82 if(m_points.size() > Traits::NDim+1 )
87 const int n = m_children.size();
88 for(
int i=0; i < n; i++)
90 if( m_children[i]->contains(x) )
92 m_children[i]->insert(x);
108 #endif // SIMPLEX_HPP_
Eigen::Matrix< Format_t, Traits::NDim, 1 > Vector_t
void insert(Node_t *)
insert the point into the simplex, recursively inserting into children or splitting as necessary ...
void initAsLeaf(Simplex_t *parent, Index_t i, Point_t &v)
initialize the simplex as leaf, reserving storage for all the child node pointers ...
std::vector< Node_t * > NodeList_t
void split()
list of points in this node, if it's a leaf
base class for nodes, implements storage and interface for the simplex tree
Eigen::Matrix< Format_t, Traits::NDim, 1 > Point_t