mCRL2
Loading...
Searching...
No Matches
SCC.h
Go to the documentation of this file.
1// Copyright (c) 2009-2013 University of Twente
2// Copyright (c) 2009-2013 Michael Weber <michaelw@cs.utwente.nl>
3// Copyright (c) 2009-2013 Maks Verver <maksverver@geocities.com>
4// Copyright (c) 2009-2013 Eindhoven University of Technology
5//
6// Distributed under the Boost Software License, Version 1.0.
7// (See accompanying file LICENSE_1_0.txt or copy at
8// http://www.boost.org/LICENSE_1_0.txt)
9
10#ifndef MCRL2_PG_SCC_H
11#define MCRL2_PG_SCC_H
12
13#include "mcrl2/pg/SCC_impl.h"
14
31template<class Callback>
32int decompose_graph(const StaticGraph &graph, Callback &callback)
33{
34 return SCC<Callback>(graph, callback).run();
35}
36
53class SCCs
54{
55 std::vector<std::vector<verti> > sccs;
56
57public:
59 void clear() { sccs.clear(); }
60
62 std::size_t size() const { return sccs.size(); }
63
65 std::vector<verti> &operator[](std::size_t i) { return sccs[i]; }
66
68 const std::vector<verti> &operator[](std::size_t i) const { return sccs[i]; }
69
74 int operator()(const verti scc[], std::size_t size)
75 {
76 sccs.resize(sccs.size() + 1);
77 sccs.back().assign(&scc[0], &scc[size]);
78 return 0;
79 }
80};
81
82#endif /* ndef MCRL2_PG_SCC_H */
std::size_t verti
type used to number vertices
Definition Graph.h:24
Definition SCC_impl.h:36
int run()
Definition SCC_impl.h:43
Definition SCC.h:54
const std::vector< verti > & operator[](std::size_t i) const
Definition SCC.h:68
std::vector< std::vector< verti > > sccs
Definition SCC.h:55
std::vector< verti > & operator[](std::size_t i)
Definition SCC.h:65
std::size_t size() const
Definition SCC.h:62
void clear()
Clear the list of collected SCCs.
Definition SCC.h:59
int operator()(const verti scc[], std::size_t size)
Definition SCC.h:74
int decompose_graph(const StaticGraph &graph, Callback &callback)
Definition SCC.h:32