HLIBpro  2.1
Public Member Functions | List of all members
TEWGraph Class Reference

Represents undirected graph with edge weights.

#include <TGraph.hh>

Inheritance diagram for TEWGraph:
TGraph

Public Member Functions

 TEWGraph ()
 construct empty graph
 
 TEWGraph (const TSparseMatrix *S, const std::vector< bool > &nodemask, const bool sym_edge_weights)
 
 TEWGraph (const TGraph &graph)
 
virtual ~TEWGraph ()
 dtor
 
virtual void init (const size_t nnodes, const size_t nedges, const bool global=false)
 
virtual weight_t edge_weight (const idx_t i) const
 return edge weight for i'th edge
 
virtual void set_edge_weight (const idx_t i, const weight_t w)
 set edge weight for i'th edge
 
virtual bool has_edge_weights () const
 return false to show that Graph has no edge weights
 
virtual weight_t min_edge_weight () const
 return the minimal absolute value of the edge weights of TEWGraph which is bigger than zero
 
virtual void write (const std::string &filename) const
 export graph in Chaco/Jostle/Metis format to filename
 
TEWGraphoperator= (const TEWGraph &graph)
 copy operator
 
virtual TGraphcreate () const
 virtual constructor, e.g. return object of same type
 
- Public Member Functions inherited from TGraph
 TGraph ()
 construct empty graph
 
 TGraph (const TSparseMatrix *S, const std::vector< bool > &nodemask)
 
virtual ~TGraph ()
 dtor
 
size_t n_nodes () const
 return number of nodes in graph
 
size_t n_edges () const
 return number of edges in graph
 
bool has_global_names () const
 return true, if graph stores global names
 
size_t degree (const node_t node) const
 return degree of node, e.g. number of incident edges
 
TIterator adj_nodes_iter (const node_t node) const
 return iterator to adjacent nodes of node
 
std::vector< node_t > & adj_nodes ()
 return adjacency data
 
std::vector< idx_t > & adj_list_ptr ()
 return adjacency pointer data
 
std::vector< node_t > & global_name ()
 return global name data
 
node_t min_degree_node () const
 return node with minimal degree in given graph
 
node_t max_degree_node () const
 return node with maximal degree in given graph
 
void build_scc (std::list< TNodeSet > &scc, const std::vector< uint > &label, const uint mark) const
 compute strongly connected components and build graph for each component More...
 
void build_scc (std::list< TNodeSet > &scc) const
 compute strongly connected components and build nodeset for each component
 
virtual TGraphrestrict (const TNodeSet &nodes) const
 restrict graph to nodes in nodes and store result in subgraph More...
 
void vertex_separator (std::vector< uint > &label, const TNodeSet &left, const TNodeSet &right, TNodeSet &vertex_sep, const uint if_label) const
 
void print (const std::string &filename, const bool global=false) const
 print graph in GraphViz format to filename
 
void print (const std::string &filename, const std::vector< uint > &label, const bool global=false) const
 print graph in GraphViz format to filename with labels in label
 
TGraphoperator= (const TGraph &graph)
 copy operator
 

Additional Inherited Members

- Protected Attributes inherited from TGraph
std::vector< idx_t > _adj_list_ptr
 contains pointers into adjacency list for each node
 
std::vector< node_t_adj_nodes
 contains list of adjacent nodes for each node
 
std::vector< node_t_global_name
 global name of local nodes
 

Constructor & Destructor Documentation

TEWGraph ( const TSparseMatrix S,
const std::vector< bool > &  nodemask,
const bool  sym_edge_weights 
)

construct graph using symmetrised sparsity pattern of matrix S; nodes marked in nodemask, i.e. nodemask[node] = true, will be excluded from graph; matrix coefficients will be used for edge weights

TEWGraph ( const TGraph graph)
inline

construct an edge weighted graph using a normal graph and initialising edge weights with 1

Member Function Documentation

virtual void init ( const size_t  nnodes,
const size_t  nedges,
const bool  global = false 
)
inlinevirtual

initialise graph for nnnodes nodes and nedges edges

  • if global is true, global names will also be initialised

Reimplemented from TGraph.