TTK
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ttk::DynamicTree Class Reference

Implements the Dynamic Tree data-structure (or ST-Tree) More...

#include <DynamicTree.h>

Public Member Functions

void alloc (const std::size_t nbNodes)
 
DynTreeNodegetNode (const std::size_t nid)
 get the node with the id: nid
 
const DynTreeNodegetNode (const std::size_t nid) const
 
std::size_t getNodeId (DynTreeNode *node)
 get the id of the node: node
 
bool insertEdge (DynTreeNode *const n1, DynTreeNode *const n2)
 
bool insertEdge (const std::size_t n1, const std::size_t n2)
 inert or replace existing edge between n1 and n2
 
void removeEdge (DynTreeNode *const n)
 remove the link btwn n and its parent
 
void removeEdge (const std::size_t nid)
 remove the link btwn n and its parent
 
int removeEdge (DynTreeNode *const n1, DynTreeNode *const n2)
 
int removeEdge (const std::size_t nid1, const std::size_t nid2)
 
std::size_t getCCFromNode (const std::size_t n0) const
 
void retrieveNbCC (std::vector< size_t > &nbccIds) const
 
size_t getNbCC () const
 
std::string print () const
 
std::string printNbCC () const
 

Detailed Description

Implements the Dynamic Tree data-structure (or ST-Tree)

Author
Gueunet Charles charl.nosp@m.es.g.nosp@m.ueune.nosp@m.t+tt.nosp@m.k@gma.nosp@m.il.c.nosp@m.om
Jules Vidal jules.nosp@m..vid.nosp@m.al@li.nosp@m.p6.f.nosp@m.r
Date
2019-09-15

Adapted by Jules Vidal from the ttk::ftr::DynamicGraph class from FTRGraph.h

See also
ttk::FTRGraph

Definition at line 66 of file DynamicTree.h.

Member Function Documentation

◆ alloc()

void ttk::DynamicTree::alloc ( const std::size_t  nbNodes)
inline

Definition at line 73 of file DynamicTree.h.

◆ getCCFromNode()

std::size_t ttk::DynamicTree::getCCFromNode ( const std::size_t  n0) const
inline

Definition at line 132 of file DynamicTree.h.

◆ getNbCC()

size_t ttk::DynamicTree::getNbCC ( ) const
inline

Definition at line 141 of file DynamicTree.h.

◆ getNode() [1/2]

DynTreeNode * ttk::DynamicTree::getNode ( const std::size_t  nid)
inline

get the node with the id: nid

Definition at line 78 of file DynamicTree.h.

◆ getNode() [2/2]

const DynTreeNode * ttk::DynamicTree::getNode ( const std::size_t  nid) const
inline

Definition at line 82 of file DynamicTree.h.

◆ getNodeId()

std::size_t ttk::DynamicTree::getNodeId ( DynTreeNode node)
inline

get the id of the node: node

Definition at line 87 of file DynamicTree.h.

◆ insertEdge() [1/2]

bool ttk::DynamicTree::insertEdge ( const std::size_t  n1,
const std::size_t  n2 
)
inline

inert or replace existing edge between n1 and n2

Definition at line 98 of file DynamicTree.h.

◆ insertEdge() [2/2]

bool ttk::DynamicTree::insertEdge ( DynTreeNode *const  n1,
DynTreeNode *const  n2 
)
inline
Returns
true if we have merged two tree, false if it was just an intern operation

Definition at line 93 of file DynamicTree.h.

◆ print()

std::string ttk::DynamicTree::print ( ) const

Definition at line 7 of file DynamicTree.cpp.

◆ printNbCC()

std::string ttk::DynamicTree::printNbCC ( ) const

Definition at line 24 of file DynamicTree.cpp.

◆ removeEdge() [1/4]

void ttk::DynamicTree::removeEdge ( const std::size_t  nid)
inline

remove the link btwn n and its parent

Definition at line 108 of file DynamicTree.h.

◆ removeEdge() [2/4]

int ttk::DynamicTree::removeEdge ( const std::size_t  nid1,
const std::size_t  nid2 
)
inline

remove the edge btwn n1 and n2

Returns
0 if not an edge

Definition at line 128 of file DynamicTree.h.

◆ removeEdge() [3/4]

void ttk::DynamicTree::removeEdge ( DynTreeNode *const  n)
inline

remove the link btwn n and its parent

Definition at line 103 of file DynamicTree.h.

◆ removeEdge() [4/4]

int ttk::DynamicTree::removeEdge ( DynTreeNode *const  n1,
DynTreeNode *const  n2 
)
inline

remove the edge btwn n1 and n2

Returns
0 if not an edge

Definition at line 114 of file DynamicTree.h.

◆ retrieveNbCC()

void ttk::DynamicTree::retrieveNbCC ( std::vector< size_t > &  nbccIds) const
inline

Definition at line 135 of file DynamicTree.h.


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