Use snake case (max_length) for style consistency

This commit is contained in:
Sven Gato Redsun 2023-03-09 18:17:35 -07:00
parent b9509fd9a8
commit e17d6f9ff8
2 changed files with 22 additions and 22 deletions

View File

@ -13,13 +13,13 @@
<h1 id="hawick_circuits"><code>hawick_circuits</code></h1> <h1 id="hawick_circuits"><code>hawick_circuits</code></h1>
<pre><code>template &lt;typename Graph, typename Visitor, typename VertexIndexMap&gt; <pre><code>template &lt;typename Graph, typename Visitor, typename VertexIndexMap&gt;
void hawick_circuits(Graph const&amp; graph, Visitor visitor, VertexIndexMap const&amp; vim = get(vertex_index, graph), unsigned int const maxLength = 0); void hawick_circuits(Graph const&amp; graph, Visitor visitor, VertexIndexMap const&amp; vim = get(vertex_index, graph), unsigned int const max_length = 0);
template &lt;typename Graph, typename Visitor, typename VertexIndexMap&gt; template &lt;typename Graph, typename Visitor, typename VertexIndexMap&gt;
void hawick_unique_circuits(Graph const&amp; graph, Visitor visitor, VertexIndexMap const&amp; vim = get(vertex_index, graph), unsigned int const maxLength = 0); void hawick_unique_circuits(Graph const&amp; graph, Visitor visitor, VertexIndexMap const&amp; vim = get(vertex_index, graph), unsigned int const max_length = 0);
</code></pre> </code></pre>
<p>Enumerate all the elementary circuits (of length &le; <code>maxLength</code>, if nonzero) in a directed multigraph. Specifically, <p>Enumerate all the elementary circuits (of length &le; <code>max_length</code>, if nonzero) in a directed multigraph. Specifically,
self-loops and redundant circuits caused by parallel edges are enumerated too. self-loops and redundant circuits caused by parallel edges are enumerated too.
<code>hawick_unique_circuits</code> may be used if redundant circuits caused by parallel <code>hawick_unique_circuits</code> may be used if redundant circuits caused by parallel
edges are not desired.</p> edges are not desired.</p>
@ -59,10 +59,10 @@ edges are not desired.</p>
the vertex index map provided by the <code>graph</code>.</p> the vertex index map provided by the <code>graph</code>.</p>
</blockquote> </blockquote>
<p><strong>IN:</strong> <code>unsigned int const maxLength = 0</code></p> <p><strong>IN:</strong> <code>unsigned int const max_length = 0</code></p>
<blockquote> <blockquote>
<p>The maximum circuit length to consider. Beyond this it truncates the depth-first search, reducing the computation time by ignoring longer circuits. The default value of <code>maxLength = 0</code> implies no maximum.</p> <p>The maximum circuit length to consider. Beyond this it truncates the depth-first search, reducing the computation time by ignoring longer circuits. The default value of <code>max_length = 0</code> implies no maximum.</p>
</blockquote> </blockquote>
<hr /> <hr />

View File

@ -153,14 +153,14 @@ namespace hawick_circuits_detail
public: public:
hawick_circuits_from(Graph const& graph, Visitor& visitor, hawick_circuits_from(Graph const& graph, Visitor& visitor,
VertexIndexMap const& vim, Stack& stack, ClosedMatrix& closed, VertexIndexMap const& vim, Stack& stack, ClosedMatrix& closed,
VerticesSize n_vertices, unsigned int const maxLength) VerticesSize n_vertices, unsigned int const max_length)
: graph_(graph) : graph_(graph)
, visitor_(visitor) , visitor_(visitor)
, vim_(vim) , vim_(vim)
, stack_(stack) , stack_(stack)
, closed_(closed) , closed_(closed)
, blocked_(n_vertices, vim_) , blocked_(n_vertices, vim_)
, maxLength_(maxLength) , max_length_(max_length)
{ {
BOOST_ASSERT(blocked_map_starts_all_unblocked()); BOOST_ASSERT(blocked_map_starts_all_unblocked());
@ -225,9 +225,9 @@ namespace hawick_circuits_detail
stack_.push_back(v); stack_.push_back(v);
block(v); block(v);
// Truncate the search if any circuits would exceed maxLength_. // Truncate the search if any circuits would exceed max_length_.
bool const truncate_search = bool const truncate_search =
(maxLength_ > 0 && stack_.size() >= maxLength_); (max_length_ > 0 && stack_.size() >= max_length_);
// Cache some values that are used more than once in the function. // Cache some values that are used more than once in the function.
VertexIndex const index_of_start = index_of(start); VertexIndex const index_of_start = index_of(start);
@ -298,14 +298,14 @@ namespace hawick_circuits_detail
Stack& stack_; Stack& stack_;
ClosedMatrix& closed_; ClosedMatrix& closed_;
BlockedMap blocked_; BlockedMap blocked_;
unsigned int const maxLength_; unsigned int const max_length_;
}; };
template < typename GetAdjacentVertices, typename Graph, typename Visitor, template < typename GetAdjacentVertices, typename Graph, typename Visitor,
typename VertexIndexMap > typename VertexIndexMap >
void call_hawick_circuits(Graph const& graph, void call_hawick_circuits(Graph const& graph,
Visitor /* by value */ visitor, VertexIndexMap const& vertex_index_map, Visitor /* by value */ visitor, VertexIndexMap const& vertex_index_map,
unsigned int const maxLength) unsigned int const max_length)
{ {
typedef graph_traits< Graph > Traits; typedef graph_traits< Graph > Traits;
typedef typename Traits::vertex_descriptor Vertex; typedef typename Traits::vertex_descriptor Vertex;
@ -336,7 +336,7 @@ namespace hawick_circuits_detail
// member variables of the sub algorithm. // member variables of the sub algorithm.
SubAlgorithm sub_algo( SubAlgorithm sub_algo(
graph, visitor, vertex_index_map, stack, closed, n_vertices, graph, visitor, vertex_index_map, stack, closed, n_vertices,
maxLength); max_length);
sub_algo(*start); sub_algo(*start);
stack.clear(); stack.clear();
typename ClosedMatrix::iterator row, last_row = closed.end(); typename ClosedMatrix::iterator row, last_row = closed.end();
@ -348,11 +348,11 @@ namespace hawick_circuits_detail
template < typename GetAdjacentVertices, typename Graph, typename Visitor > template < typename GetAdjacentVertices, typename Graph, typename Visitor >
void call_hawick_circuits( void call_hawick_circuits(
Graph const& graph, BOOST_FWD_REF(Visitor) visitor, Graph const& graph, BOOST_FWD_REF(Visitor) visitor,
unsigned int const maxLength) unsigned int const max_length)
{ {
call_hawick_circuits< GetAdjacentVertices >(graph, call_hawick_circuits< GetAdjacentVertices >(graph,
boost::forward< Visitor >(visitor), get(vertex_index, graph), boost::forward< Visitor >(visitor), get(vertex_index, graph),
maxLength); max_length);
} }
} // end namespace hawick_circuits_detail } // end namespace hawick_circuits_detail
@ -360,22 +360,22 @@ namespace hawick_circuits_detail
template < typename Graph, typename Visitor, typename VertexIndexMap > template < typename Graph, typename Visitor, typename VertexIndexMap >
void hawick_circuits(BOOST_FWD_REF(Graph) graph, BOOST_FWD_REF(Visitor) visitor, void hawick_circuits(BOOST_FWD_REF(Graph) graph, BOOST_FWD_REF(Visitor) visitor,
BOOST_FWD_REF(VertexIndexMap) vertex_index_map, BOOST_FWD_REF(VertexIndexMap) vertex_index_map,
unsigned int const maxLength = 0) unsigned int const max_length = 0)
{ {
hawick_circuits_detail::call_hawick_circuits< hawick_circuits_detail::call_hawick_circuits<
hawick_circuits_detail::get_all_adjacent_vertices >( hawick_circuits_detail::get_all_adjacent_vertices >(
boost::forward< Graph >(graph), boost::forward< Visitor >(visitor), boost::forward< Graph >(graph), boost::forward< Visitor >(visitor),
boost::forward< VertexIndexMap >(vertex_index_map), maxLength); boost::forward< VertexIndexMap >(vertex_index_map), max_length);
} }
template < typename Graph, typename Visitor > template < typename Graph, typename Visitor >
void hawick_circuits(BOOST_FWD_REF(Graph) graph, BOOST_FWD_REF(Visitor) visitor, void hawick_circuits(BOOST_FWD_REF(Graph) graph, BOOST_FWD_REF(Visitor) visitor,
unsigned int const maxLength = 0) unsigned int const max_length = 0)
{ {
hawick_circuits_detail::call_hawick_circuits< hawick_circuits_detail::call_hawick_circuits<
hawick_circuits_detail::get_all_adjacent_vertices >( hawick_circuits_detail::get_all_adjacent_vertices >(
boost::forward< Graph >(graph), boost::forward< Visitor >(visitor), boost::forward< Graph >(graph), boost::forward< Visitor >(visitor),
maxLength); max_length);
} }
/*! /*!
@ -386,23 +386,23 @@ template < typename Graph, typename Visitor, typename VertexIndexMap >
void hawick_unique_circuits(BOOST_FWD_REF(Graph) graph, void hawick_unique_circuits(BOOST_FWD_REF(Graph) graph,
BOOST_FWD_REF(Visitor) visitor, BOOST_FWD_REF(Visitor) visitor,
BOOST_FWD_REF(VertexIndexMap) vertex_index_map, BOOST_FWD_REF(VertexIndexMap) vertex_index_map,
unsigned int const maxLength = 0) unsigned int const max_length = 0)
{ {
hawick_circuits_detail::call_hawick_circuits< hawick_circuits_detail::call_hawick_circuits<
hawick_circuits_detail::get_unique_adjacent_vertices >( hawick_circuits_detail::get_unique_adjacent_vertices >(
boost::forward< Graph >(graph), boost::forward< Visitor >(visitor), boost::forward< Graph >(graph), boost::forward< Visitor >(visitor),
boost::forward< VertexIndexMap >(vertex_index_map), maxLength); boost::forward< VertexIndexMap >(vertex_index_map), max_length);
} }
template < typename Graph, typename Visitor > template < typename Graph, typename Visitor >
void hawick_unique_circuits( void hawick_unique_circuits(
BOOST_FWD_REF(Graph) graph, BOOST_FWD_REF(Visitor) visitor, BOOST_FWD_REF(Graph) graph, BOOST_FWD_REF(Visitor) visitor,
unsigned int const maxLength = 0) unsigned int const max_length = 0)
{ {
hawick_circuits_detail::call_hawick_circuits< hawick_circuits_detail::call_hawick_circuits<
hawick_circuits_detail::get_unique_adjacent_vertices >( hawick_circuits_detail::get_unique_adjacent_vertices >(
boost::forward< Graph >(graph), boost::forward< Visitor >(visitor), boost::forward< Graph >(graph), boost::forward< Visitor >(visitor),
maxLength); max_length);
} }
} // end namespace boost } // end namespace boost