HLIBpro  2.0
Classes | Public Member Functions | Protected Member Functions | List of all members
TDiGraph Class Reference

Class for directed graph represented by adjacency matrix in sparse format (assuming sparse graph!)

#include <TDiGraph.hh>

Classes

class  TIterator
 iterator to predecessor/successor lists More...
 

Public Member Functions

 TDiGraph ()
 construct empty digraph
 
 TDiGraph (const TSparseMatrix *S, const real eps=0.0)
 
size_t n_nodes () const
 return number of nodes in graph
 
size_t n_edges () const
 return number of edges in graph
 
TIterator predecessors (const node_t node) const
 return iterator to predecessors of node
 
TIterator successors (const node_t node) const
 return iterator to successors of node
 
void print (std::ostream &os) const
 print graph
 
void print (std::ostream &os, const std::vector< uint > &label) const
 print graph with labels
 
void write (std::ostream &os) const
 write in Chaco/Jostle/Metis file format
 
TDiGraphoperator= (const TDiGraph &graph)
 copy operator
 

Protected Member Functions

virtual void init (const size_t nnodes, const size_t npred, const size_t nsucc)
 initialise graph for n nodes, m1 pred. edges and m2 succ. edges
 

Constructor & Destructor Documentation

TDiGraph ( const TSparseMatrix S,
const real  eps = 0.0 
)

construct digraph based on pattern in S using coefficients a_ij with |a_ij| > ε