Radium Engine  1.5.20
Loading...
Searching...
No Matches
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.
 
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 Adjacencychildren () const
 
const ParentListparents () 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 Enumeration Documentation

◆ ConsistencyStatus

enum class Ra::Core::AdjacencyList::ConsistencyStatus
strong

Definition at line 23 of file AdjacencyList.hpp.

Constructor & Destructor Documentation

◆ AdjacencyList() [1/3]

Ra::Core::AdjacencyList::AdjacencyList ( )

CONSTRUCTOR.

Definition at line 9 of file AdjacencyList.cpp.

◆ AdjacencyList() [2/3]

Ra::Core::AdjacencyList::AdjacencyList ( const uint n)
explicit

Definition at line 10 of file AdjacencyList.cpp.

◆ AdjacencyList() [3/3]

Ra::Core::AdjacencyList::AdjacencyList ( const AdjacencyList & adj)

Definition at line 11 of file AdjacencyList.cpp.

◆ ~AdjacencyList()

Ra::Core::AdjacencyList::~AdjacencyList ( )

DESTRUCTOR.

Definition at line 15 of file AdjacencyList.cpp.

Member Function Documentation

◆ addNode()

uint Ra::Core::AdjacencyList::addNode ( const uint parent)

Return the index of the added leaf.

Definition at line 26 of file AdjacencyList.cpp.

+ Here is the call graph for this function:

◆ 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:

◆ children()

const Adjacency & Ra::Core::AdjacencyList::children ( ) const
inline

Definition at line 92 of file AdjacencyList.hpp.

◆ clear()

void Ra::Core::AdjacencyList::clear ( )
inline

Clear the vectors.

Definition at line 114 of file AdjacencyList.hpp.

+ Here is the call graph for this function:

◆ computeConsistencyStatus()

AdjacencyList::ConsistencyStatus Ra::Core::AdjacencyList::computeConsistencyStatus ( ) const

Return true if the graph is consistent.

Definition at line 101 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:

◆ isBranch()

bool Ra::Core::AdjacencyList::isBranch ( const uint i) const
inline

Return true if the node is a branch node. ( |child| > 1 )

Definition at line 129 of file AdjacencyList.hpp.

+ Here is the call graph for this function:

◆ isEdge()

bool Ra::Core::AdjacencyList::isEdge ( const uint i,
const uint j ) const
inline

Return true if the edge { i, j } exists.

Definition at line 139 of file AdjacencyList.hpp.

+ Here is the call graph for this function:

◆ isEmpty()

bool Ra::Core::AdjacencyList::isEmpty ( ) const
inline

Return true if the graph is empty.

Definition at line 80 of file AdjacencyList.hpp.

◆ isJoint()

bool Ra::Core::AdjacencyList::isJoint ( const uint i) const
inline

Return true if the node is a joint node. ( |child| == 1 )

Definition at line 134 of file AdjacencyList.hpp.

+ Here is the call graph for this function:

◆ isLeaf()

bool Ra::Core::AdjacencyList::isLeaf ( const uint i) const
inline

Return true if the node is a leaf node.

Definition at line 124 of file AdjacencyList.hpp.

+ Here is the call graph for this function:

◆ isRoot()

bool Ra::Core::AdjacencyList::isRoot ( const uint i) const
inline

Return true if a node is a root node.

Definition at line 119 of file AdjacencyList.hpp.

+ Here is the call graph for this function:

◆ parents()

const ParentList & Ra::Core::AdjacencyList::parents ( ) const
inline

Definition at line 94 of file AdjacencyList.hpp.

◆ pruneLeaves() [1/2]

void Ra::Core::AdjacencyList::pruneLeaves ( )

Prune the leaves of the graph.

Definition at line 72 of file AdjacencyList.cpp.

+ Here is the call graph for this function:

◆ pruneLeaves() [2/2]

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.

+ Here is the call graph for this function:

◆ size()

uint Ra::Core::AdjacencyList::size ( ) const
inline

Return the number of nodes in the graph.

Definition at line 109 of file AdjacencyList.hpp.

+ Here is the call graph for this function:

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