Radium Engine
1.5.20
|
#include <Core/Containers/AdjacencyList.hpp>
Public Types | |
enum class | ConsistencyStatus { Valid , IncompatibleChildrenAndParentList , WrongParentOrdering , WrongParentIndex , InconsistentParentIndex , NonLeafNodeWithoutChild } |
Public Member Functions | |
AdjacencyList () | |
CONSTRUCTOR. | |
AdjacencyList (const uint n) | |
AdjacencyList (const AdjacencyList &adj) | |
AdjacencyList & | operator= (const AdjacencyList &)=default |
~AdjacencyList () | |
DESTRUCTOR. | |
uint | addRoot () |
Return the index of the added root. | |
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 |
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.
|
strong |
Definition at line 23 of file AdjacencyList.hpp.
Ra::Core::AdjacencyList::AdjacencyList | ( | ) |
CONSTRUCTOR.
Definition at line 9 of file AdjacencyList.cpp.
|
explicit |
Definition at line 10 of file AdjacencyList.cpp.
Ra::Core::AdjacencyList::AdjacencyList | ( | const AdjacencyList & | adj | ) |
Definition at line 11 of file AdjacencyList.cpp.
Ra::Core::AdjacencyList::~AdjacencyList | ( | ) |
DESTRUCTOR.
Definition at line 15 of file AdjacencyList.cpp.
uint Ra::Core::AdjacencyList::addNode | ( | const uint | parent | ) |
Return the index of the added leaf.
Definition at line 26 of file AdjacencyList.cpp.
uint Ra::Core::AdjacencyList::addRoot | ( | ) |
Return the index of the added root.
NODE.
Definition at line 18 of file AdjacencyList.cpp.
|
inline |
Definition at line 92 of file AdjacencyList.hpp.
|
inline |
Clear the vectors.
Definition at line 114 of file AdjacencyList.hpp.
AdjacencyList::ConsistencyStatus Ra::Core::AdjacencyList::computeConsistencyStatus | ( | ) | const |
Return true if the graph is consistent.
Definition at line 101 of file AdjacencyList.cpp.
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.
|
inline |
Return true if the node is a branch node. ( |child| > 1 )
Definition at line 129 of file AdjacencyList.hpp.
|
inline |
Return true if the edge { i, j } exists.
Definition at line 139 of file AdjacencyList.hpp.
|
inline |
Return true if the graph is empty.
Definition at line 80 of file AdjacencyList.hpp.
|
inline |
Return true if the node is a joint node. ( |child| == 1 )
Definition at line 134 of file AdjacencyList.hpp.
|
inline |
Return true if the node is a leaf node.
Definition at line 124 of file AdjacencyList.hpp.
|
inline |
Return true if a node is a root node.
Definition at line 119 of file AdjacencyList.hpp.
|
inline |
Definition at line 94 of file AdjacencyList.hpp.
void Ra::Core::AdjacencyList::pruneLeaves | ( | ) |
Prune the leaves of the graph.
Definition at line 72 of file AdjacencyList.cpp.
void Ra::Core::AdjacencyList::pruneLeaves | ( | std::vector< uint > & | pruned, |
std::vector< bool > & | delete_flag ) |
Prune the leaves of the graph and returns the changes.
Definition at line 36 of file AdjacencyList.cpp.
|
inline |
Return the number of nodes in the graph.
Definition at line 109 of file AdjacencyList.hpp.