mCRL2
Loading...
Searching...
No Matches
SCCs Class Reference

#include <SCC.h>

Public Member Functions

void clear ()
 Clear the list of collected SCCs.
 
std::size_t size () const
 
std::vector< verti > & operator[] (std::size_t i)
 
const std::vector< verti > & operator[] (std::size_t i) const
 
int operator() (const verti scc[], std::size_t size)
 

Private Attributes

std::vector< std::vector< verti > > sccs
 

Detailed Description

A utility class to collect strongly connected components in a graph when used as the callback functor in the SCC class defined above.

Note that it's usually more efficient to handle SCCs directly as they are found, rather than collect them explicitly, but this class may be easier to use in situation were performance is not critical.

Usage example:

std::cout << sccs.size() << " SCCs found!" << std::endl;
Definition SCC.h:54
std::vector< std::vector< verti > > sccs
Definition SCC.h:55
int decompose_graph(const StaticGraph &graph, Callback &callback)
Definition SCC.h:32

Definition at line 53 of file SCC.h.

Member Function Documentation

◆ clear()

void SCCs::clear ( )
inline

Clear the list of collected SCCs.

Definition at line 59 of file SCC.h.

◆ operator()()

int SCCs::operator() ( const verti  scc[],
std::size_t  size 
)
inline

Add a strongly connected component to the list.

Parameters
sccan array of length size giving indices of the vertices
sizethe size of the component
Returns
zero

Definition at line 74 of file SCC.h.

◆ operator[]() [1/2]

std::vector< verti > & SCCs::operator[] ( std::size_t  i)
inline
Returns
the i-th SCC as vector of vertex indices.

Definition at line 65 of file SCC.h.

◆ operator[]() [2/2]

const std::vector< verti > & SCCs::operator[] ( std::size_t  i) const
inline
Returns
the i-th SCC as const vector of vertex indices.

Definition at line 68 of file SCC.h.

◆ size()

std::size_t SCCs::size ( ) const
inline
Returns
the number of collected SCCs.

Definition at line 62 of file SCC.h.

Member Data Documentation

◆ sccs

std::vector<std::vector<verti> > SCCs::sccs
private

Definition at line 55 of file SCC.h.


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