Radium Engine  1.5.0
Ra::Core::AdjacencyList Class Reference

#include <Core/Containers/AdjacencyList.hpp>

+ Collaboration diagram for Ra::Core::AdjacencyList:

Public Types

enum class  ConsistencyStatus {
  Valid , IncompatibleChildrenAndParentList , WrongParentOrdering , WrongParentIndex ,
  InconsistentParentIndex , NonLeafNodeWithoutChild
}
 

Public Member Functions

 AdjacencyList ()
 CONSTRUCTOR.
 
 AdjacencyList (const uint n)
 
 AdjacencyList (const AdjacencyList &adj)
 
AdjacencyListoperator= (const AdjacencyList &)=default
 
 ~AdjacencyList ()
 DESTRUCTOR.
 
uint addRoot ()
 Return the index of the added root. More...
 
uint addNode (const uint parent)
 Return the index of the added leaf.
 
void pruneLeaves (std::vector< uint > &pruned, std::vector< bool > &delete_flag)
 Prune the leaves of the graph and returns the changes.
 
void pruneLeaves ()
 Prune the leaves of the graph.
 
VectorArray< Eigen::Matrix< uint, 2, 1 > > extractEdgeList (bool include_leaf=false) const
 
uint size () const
 Return the number of nodes in the graph.
 
void clear ()
 Clear the vectors.
 
ConsistencyStatus computeConsistencyStatus () const
 Return true if the graph is consistent.
 
bool isEmpty () const
 Return true if the graph is empty.
 
bool isRoot (const uint i) const
 Return true if a node is a root node.
 
bool isLeaf (const uint i) const
 Return true if the node is a leaf node.
 
bool isBranch (const uint i) const
 Return true if the node is a branch node. ( |child| > 1 )
 
bool isJoint (const uint i) const
 Return true if the node is a joint node. ( |child| == 1 )
 
bool isEdge (const uint i, const uint j) const
 Return true if the edge { i, j } exists.
 
const Adjacency & children () const
 
const ParentList & parents () const
 

Detailed Description

The AdjacencyList contains the adjacency matrix expressed as a vector of indices and a vector containing the index of the parents indices of the i-th node.

Definition at line 20 of file AdjacencyList.hpp.

Member Function Documentation

◆ addRoot()

uint Ra::Core::AdjacencyList::addRoot ( )

Return the index of the added root.

NODE.

Definition at line 18 of file AdjacencyList.cpp.

+ Here is the call graph for this function:

◆ extractEdgeList()

VectorArray< Eigen::Matrix< uint, 2, 1 > > Ra::Core::AdjacencyList::extractEdgeList ( bool  include_leaf = false) const

Return the edge list built from the given adjacency list. If include_leaf is true, the list will contain the pairs: ... { i, i } ... where i is the index of a leaf node.

Definition at line 78 of file AdjacencyList.cpp.

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: