Skip to content

Commit 2d1bf04

Browse files
committed
doxygen tweak: graph.h
1 parent 6b47fa0 commit 2d1bf04

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

src/util/graph.h

+27-27
Original file line numberDiff line numberDiff line change
@@ -256,13 +256,24 @@ class grapht
256256
void disconnect_unreachable(node_indext src);
257257
void disconnect_unreachable(const std::vector<node_indext> &src);
258258

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

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

267278
void make_chordal();
268279

@@ -287,6 +298,13 @@ class grapht
287298
std::function<void(const node_indext &)> f) const;
288299

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

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
607619
template <class N>
608620
std::set<typename N::node_indext> grapht<N>::depth_limited_search(
609-
const std::vector<node_indext> &from, size_t depth) const
621+
const std::vector<node_indext> &from,
622+
size_t depth) const
610623
{
611624
std::set<node_indext> result;
612625
for(const node_indext src : from)
613626
depth_limited_search(src, depth, result);
614627
return result;
615628
}
616629

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
623630
template <class N>
624-
std::set<typename N::node_indext> grapht<N>::depth_limited_search(
625-
const node_indext from, size_t depth) const
631+
std::set<typename N::node_indext>
632+
grapht<N>::depth_limited_search(const node_indext from, size_t depth) const
626633
{
627634
std::set<node_indext> result;
628-
depth_limited_search(from, depth, result);
635+
depth_limited_search(from, depth, result);
629636
return result;
630637
}
631638

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
639639
template <class N>
640640
void grapht<N>::depth_limited_search(
641641
node_indext from,
642642
std::size_t depth,
643643
std::set<node_indext> &result) const
644644
{
645-
if(depth==0)
645+
if(depth == 0)
646646
return;
647647

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

0 commit comments

Comments
 (0)