HLIBpro  2.4
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 annodes, const size_t anedges, const bool aglobal=false)
 
virtual weight_t edge_weight (const idx_t i) const noexcept
 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 noexcept
 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 nnodes () const noexcept
 return number of nodes in graph
 
size_t nedges () const noexcept
 return number of edges in graph
 
bool has_global_names () const noexcept
 return true, if graph stores global names
 
size_t degree (const node_t node) const noexcept
 return degree of node, e.g. number of incident edges
 
TNodes nodes () const noexcept
 return set of graph nodes
 
TAdjNodes adj_nodes (const node_t node) const noexcept
 return set of adjacent nodes in graph
 
TAdjNodesWeights adj_nodes_weights (const node_t node) const noexcept
 return set of adjacent nodes with edge weights in graph
 
std::vector< node_t > & global_name () noexcept
 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
 
auto restrict (const TNodeSet &nodes) const -> std::unique_ptr< TGraph >
 restrict graph to nodes in nodes and return resulting subgraph
 
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  annodes,
const size_t  anedges,
const bool  aglobal = false 
)
inlinevirtual

initialise graph for nnnodes nodes and nedges edges

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

Reimplemented from TGraph.