Skip to content

Commit 2c68bde

Browse files
committed
doxygen tweak: graph.h
1 parent 1b79e31 commit 2c68bde

File tree

1 file changed

+30
-31
lines changed

1 file changed

+30
-31
lines changed

src/util/graph.h

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ Author: Daniel Kroening, [email protected]
1919
#include <list>
2020
#include <map>
2121
#include <queue>
22-
#include <stack>
23-
#include <vector>
2422
#include <set>
23+
#include <vector>
2524

2625
#include "invariant.h"
2726

@@ -256,13 +255,24 @@ class grapht
256255
void disconnect_unreachable(node_indext src);
257256
void disconnect_unreachable(const std::vector<node_indext> &src);
258257

258+
/// Run recursive depth-limited search on the graph, starting
259+
/// from a vector of start nodes, to find the nodes reachable within n steps,
260+
/// excluding the start node unless a self loop exists.
261+
/// \param from: vector of node indices to start from
262+
/// \param depth: depth limit
263+
/// \return set of node indices of reachable nodes
259264
std::set<node_indext> depth_limited_search(
260265
const std::vector<node_indext> &from,
261-
std::size_t steps) const;
266+
std::size_t depth) const;
262267

263-
std::set<node_indext> depth_limited_search(
264-
node_indext from,
265-
std::size_t steps) const;
268+
/// Run recursive depth-limited search on the graph, starting
269+
/// from a vector of start nodes, to find the nodes reachable within n steps,
270+
/// excluding the start node unless a self loop exists.
271+
/// \param from: node index to start from
272+
/// \param depth: depth limit
273+
/// \return set of node indices of reachable nodes
274+
std::set<node_indext>
275+
depth_limited_search(node_indext from, std::size_t depth) const;
266276

267277
void make_chordal();
268278

@@ -287,6 +297,13 @@ class grapht
287297
std::function<void(const node_indext &)> f) const;
288298

289299
protected:
300+
/// Run recursive depth-limited search on the graph, starting
301+
/// from a vector of start nodes, to find the nodes reachable within n steps,
302+
/// excluding the start node unless a self loop exists.
303+
/// \param from: node index to start from
304+
/// \param depth: depth limit
305+
/// \param result: set of nodes that have been visited so far.
306+
/// Reachable nodes are inserted into this set
290307
void depth_limited_search(
291308
node_indext from,
292309
std::size_t depth,
@@ -598,51 +615,33 @@ std::vector<typename N::node_indext> grapht<N>::get_reachable(
598615
return result;
599616
}
600617

601-
/// Run recursive depth-limited search on the graph, starting
602-
/// from a vector of start nodes, to find the nodes reachable within n steps,
603-
/// excluding the start node unless a self loop exists.
604-
/// \param from : vector of node indices to start from
605-
/// \param depth : depth limit
606-
/// \return set of node indices of reachable nodes
607618
template <class N>
608-
std::set<typename N::node_indext> grapht<N>::depth_limited_search(
609-
const std::vector<node_indext> &from, size_t depth) const
619+
std::set<typename grapht<N>::node_indext> grapht<N>::depth_limited_search(
620+
const std::vector<node_indext> &from,
621+
size_t depth) const
610622
{
611623
std::set<node_indext> result;
612624
for(const node_indext src : from)
613625
depth_limited_search(src, depth, result);
614626
return result;
615627
}
616628

617-
/// Run recursive depth-limited search on the graph, starting
618-
/// from a single start node, to find the nodes reachable within n steps,
619-
/// excluding the start node unless a self loop exists.
620-
/// \param from : index of node to start from
621-
/// \param depth : depth limit
622-
/// \return set of node indices of reachable nodes
623629
template <class N>
624-
std::set<typename N::node_indext> grapht<N>::depth_limited_search(
625-
const node_indext from, size_t depth) const
630+
std::set<typename grapht<N>::node_indext>
631+
grapht<N>::depth_limited_search(const node_indext from, size_t depth) const
626632
{
627633
std::set<node_indext> result;
628-
depth_limited_search(from, depth, result);
634+
depth_limited_search(from, depth, result);
629635
return result;
630636
}
631637

632-
/// Run recursive depth-limited search on the graph, starting
633-
/// from a single start node, to find the nodes reachable within n steps,
634-
/// excluding the start node unless a self loop exists.
635-
/// \param from : index of node to start from
636-
/// \param depth : depth limit
637-
/// \param result : set of node indices of nodes visited so far. Reachable
638-
/// nodes are added to this set
639638
template <class N>
640639
void grapht<N>::depth_limited_search(
641640
node_indext from,
642641
std::size_t depth,
643642
std::set<node_indext> &result) const
644643
{
645-
if(depth==0)
644+
if(depth == 0)
646645
return;
647646

648647
for(const auto o : nodes[from].out)

0 commit comments

Comments
 (0)