Class xlifepp::ClusterNode#

template<typename T>
class ClusterNode#

Inheritence diagram for xlifepp::ClusterNode:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "2" [label="xlifepp::ClusterNode< FeDof >" tooltip="xlifepp::ClusterNode< FeDof >"] "3" [label="xlifepp::ClusterNode< I >" tooltip="xlifepp::ClusterNode< I >"] "4" [label="xlifepp::ClusterNode< xlifepp::FeDof >" tooltip="xlifepp::ClusterNode< xlifepp::FeDof >"] "1" [label="xlifepp::ClusterNode< T >" tooltip="xlifepp::ClusterNode< T >" fillcolor="#BFBFBF"] "2" -> "1" [dir=forward tooltip="template-instance"] "3" -> "1" [dir=forward tooltip="template-instance"] "4" -> "1" [dir=forward tooltip="template-instance"] }

Collaboration diagram for xlifepp::ClusterNode:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "7" [label="std::list< xlifepp::ClusterNode< T > * >" tooltip="std::list< xlifepp::ClusterNode< T > * >"] "8" [label="std::list< T >" tooltip="std::list< T >"] "4" [label="std::vector< T >" tooltip="std::vector< T >"] "6" [label="std::vector< RealPair >" tooltip="std::vector< RealPair >"] "3" [label="std::vector< number_t >" tooltip="std::vector< number_t >"] "9" [label="std::vector< xlifepp::Element * >" tooltip="std::vector< xlifepp::Element * >"] "5" [label="xlifepp::BoundingBox" tooltip="xlifepp::BoundingBox"] "2" [label="xlifepp::ClusterNode< T >" tooltip="xlifepp::ClusterNode< T >"] "1" [label="xlifepp::ClusterNode< T >" tooltip="xlifepp::ClusterNode< T >" fillcolor="#BFBFBF"] "7" -> "8" [dir=forward tooltip="template-instance"] "6" -> "4" [dir=forward tooltip="template-instance"] "3" -> "4" [dir=forward tooltip="template-instance"] "9" -> "4" [dir=forward tooltip="template-instance"] "5" -> "6" [dir=forward tooltip="usage"] "2" -> "2" [dir=forward tooltip="usage"] "2" -> "3" [dir=forward tooltip="usage"] "2" -> "5" [dir=forward tooltip="usage"] "2" -> "7" [dir=forward tooltip="usage"] "2" -> "9" [dir=forward tooltip="usage"] "1" -> "2" [dir=forward tooltip="usage"] "1" -> "3" [dir=forward tooltip="usage"] "1" -> "5" [dir=forward tooltip="usage"] "1" -> "7" [dir=forward tooltip="usage"] "1" -> "9" [dir=forward tooltip="usage"] }

describes a node of a hierarchical cluster of T objects (mean Point for instance) it manages

  • a pointer to the cloud object (objects_)

  • a xyz bounding box of the node, may be not the smallest

  • a xyz real bounding box of the node if required

  • some pointers to move in the tree (parent_, child_, next_)

  • the indices of objects belonging to the box (numbers_), may be deallocated for node that are not leaf (see storeNodeData_)

  • an optional list of dof numbers

  • an optional list of element pointers

Note

a node is never void

Public Functions

const BoundingBox &box() const#

return the real bounding box if allocated else return the bounding box

real_t boxDiameter() const#

diameter ot the (real) bounding box

void clear()#

clear cluster node (recursive)

void divideNode(ClusteringMethod, number_t, number_t = 0, bool = true, bool = true)#

divide set of points along the clustering method (create children)

divide set of points along the clustering method (create children) - recursive meth: clustering method: _regularBisection: split along the maximal direction the current box in two boxes of same size _boundingBoxBisection: same spliting as regular method but set the split boxes to their xyz minimal bounding box _cardinalityBisection) : split along the maximal direction in two boxes having the same number of points (to 1 near) maxinleaf: the maximum number of points in a leaf maxdepth: the maximal depth of the tree, if maxdepth=0, depth criteria is not used storeNodeData: if true, data (numbers, bounding boxes, …) are stored for each node else they are only stored for each leaves rmEmptyBox: if true empty box are removed from tree

const std::vector<number_t> &dofNumbers() const#

direct access to dofNumbers vector (no copy)

const std::vector<Element*> &elements() const#

direct access to element pointers vector (no copy)

std::vector<number_t> getDofNumbers(bool store = false) const#

list of dof numbers related to a node, can build on fly

std::vector<Element*> getElements(bool store = false) const#

list of element numbers related to a node, can build on fly

std::vector<ClusterNode*> getLeaves() const#

get leave pointers of the tree

std::list<number_t> getNumbers(bool store) const#

get numbers as a list (recursive) with a storing option

get numbers if numbers_ vector already exists return it as a list else build the list recursively when store is true, the number lists are stored

const std::vector<number_t> &getParentNumbers() const#

get parentNumbers_ vector

get parentNumbers_ vector parentNumbers[i] gives the rank of the ith object in parent numbering if does not exist, built on the fly

bool isCloseTo(const ClusterNode<T>&, real_t = 1.) const#

test if a node is close to an other one

test if a node is close to an other one, for the moment use dist(b1,b2) <= eta*max(diam(b1), diam(b2))

void print(std::ostream&) const#

print tree from current node (recursive)

void printLeaves(std::ostream&) const#

print leaves of the tree

void printNode(std::ostream&, bool shift = true) const#

print node

void saveToFile(const string_t&, number_t, bool withRealBox = false) const#

save points and bounding boxes or real bounding boxes on file

void setBoundingBox()#

set the bounding box from characteristic point of objects

set the bounding box of a cluster node

void setRealBoundingBox()#

set the real bounding box, i.e from bounding box of objects

set the real bounding box of a cluster node from bounding boxes of objects, numbers_ has to be allocated !

void updateAllParentNumbers()#

update recursively all parentNumbers_ vector

update recursively parentNumbers_ vectors of all nodes parentNumbers[i] gives the rank of the ith object in parent numbering

void updateBoundingBoxes()#

update recursively bounding boxes

update recursively the real bounding boxes of a cluster node, numbers_ has to be allocated !

void updateCloseNodes(CloseNodeRule, real_t = 1.)#

update recursively closeNodes vector

void updateDofNumbers()#

update recursively dofNumbers

void updateElements()#

update recursively elements

void updateNumbers()#

update recursively numbers_ vector

update recursively numbers_ vectors if they are are empty

void updateParentNumbers()#

update parentNumbers_ vector

update parentNumbers_ vector of current node parentNumbers[i] gives the rank of the ith object in parent numbering

void updateRealBoundingBoxes()#

update recursively real bounding boxes

update recursively the real bounding boxes of a cluster node, numbers_ has to be allocated !

Public Members

BoundingBox boundingBox_#

bounding box from characteristic points of objects

ClusterNode *child_#

pointer to its first child, if 0 no child

mutable std::list<ClusterNode<T>*> closeNodes_#

list of close nodes, built on demand

number_t depth_#

depth of node/leaf in tree, root has 0 depth

mutable std::vector<number_t> dofNumbers_#

list of dof numbers related to the node

mutable std::vector<Element*> elements_#

list of element numbers related to the node

ClusterNode *next_#

pointer to its brother, if 0 no brother

mutable std::vector<number_t> numbers_#

list of object numbers related to objects vector (start at 0)

std::vector<T> *objects_#

pointer to the list of objects

ClusterNode *parent_#

pointer to its parent, if 0 root node

mutable std::vector<number_t> parentNumbers_#

numbers of dof/objects in parent numbering

BoundingBox realBoundingBox_#

bounding box from bounding boxes of objects, differs from boundingBox_ if T is larger than a point