SMIL  0.8
 All Classes Functions Variables Groups Pages
Graph< nodeT, edgeWT > Class Template Reference

Non-oriented graph. More...

#include <DGraph.hpp>

+ Inheritance diagram for Graph< nodeT, edgeWT >:
+ Collaboration diagram for Graph< nodeT, edgeWT >:

Public Member Functions

void addEdge (const EdgeType &e, bool checkIfExists=true)
 Add an edge to the graph. More...
 
void addEdge (const size_t src, const size_t targ, edgeWT weight=1, bool checkIfExists=true)
 Add an edge to the graph given two nodes src and targ and an optional weight If checkIfExists is true: If the edge doen't exist, create a new one. More...
 
void addNode (const size_t &ind, const nodeT &val=0)
 Add a node given its index and its optional value.
 
void clear ()
 Clear graph content.
 
Graph< nodeT, edgeWT > computeMST ()
 Compute the Minimum Spanning Tree graph.
 
vector< EdgeType > & getEdges ()
 Get a vector containing the graph edges.
 
std::vector< size_t > getNodeEdges (const size_t &node)
 Get a map containing the edges linked to a given node.
 
 Graph ()
 Default constructor.
 
 Graph (const Graph &rhs)
 Copy constructor.
 
map< size_t, size_t > labelizeNodes () const
 Labelize the nodes. Give a different label to each group of connected nodes. Return a map [ node_index, label_value ].
 
void removeEdge (const size_t index)
 Remove an edge.
 
void removeEdge (const size_t src, const size_t targ)
 Find and remove an edge linking src to targ.
 
void removeNodeEdges (const size_t nodeIndex)
 Remove all edges linked to the node nodeIndex.
 

Detailed Description

template<class nodeT = size_t, class edgeWT = size_t>
class smil::Graph< nodeT, edgeWT >

Non-oriented graph.

See Also
Edge

Member Function Documentation

void addEdge ( const EdgeType e,
bool  checkIfExists = true 
)
inline

Add an edge to the graph.

If checkIfExists is true: If the edge doen't exist, create a new one. If the edge already exists, the edge weight will be the minimum between the existing a the new weight.

void addEdge ( const size_t  src,
const size_t  targ,
edgeWT  weight = 1,
bool  checkIfExists = true 
)
inline

Add an edge to the graph given two nodes src and targ and an optional weight If checkIfExists is true: If the edge doen't exist, create a new one.

If the edge already exists, the edge weight will be the minimum between the existing a the new weight.


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