HLIBpro 3.1
|
Class for a undirected graph stored as adjacency matrix in CRS representation.
#include <TGraph.hh>
Classes | |
class | TAdjNodes |
class | TAdjNodesWeights |
struct | TNodes |
Public Member Functions | |
TGraph () | |
construct empty graph | |
TGraph (any_const_sparse_matrix_t 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 | |
virtual void | init (const size_t annodes, const size_t anedges, const bool aglobal=false) |
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 | |
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 |
virtual bool | has_edge_weights () const noexcept |
return false to show that Graph has no edge weights | |
virtual weight_t | edge_weight (const idx_t) const noexcept |
return edge weight for i'th edge | |
virtual void | set_edge_weight (const idx_t, const weight_t) |
set edge weight for i'th edge | |
virtual weight_t | min_edge_weight () const |
return the minimal absolute value of the edge weights of TEWGraph | |
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 | |
virtual void | write (const std::string &filename) const |
export graph in Chaco/Jostle/Metis format to filename | |
TGraph & | operator= (const TGraph &graph) |
copy operator | |
virtual TGraph * | create () const |
virtual constructor, e.g. return object of same type | |
construct graph using symmetrised sparsity pattern of matrix S; nodes marked in nodemask, i.e. nodemask[node] = true, will be excluded from graph
void build_scc | ( | std::list< TNodeSet > & | scc, |
const std::vector< uint > & | label, | ||
const uint | mark | ||
) | const |
compute strongly connected components but restrict computation to nodes marked by mark, where node marks are stored in label
|
inlinevirtual |
initialise graph for nnnodes nodes and nedges edges
Reimplemented in TEWGraph.