50#include <lal/graphs/directed_graph.hpp>
51#include <lal/iterators/E_iterator.hpp>
52#include <lal/numeric/rational.hpp>
53#include <lal/detail/macros/basic_convert.hpp>
64template <
class arrangement_t>
69 uint64_t edges_to_right = 0;
71 const auto [u, v] = e_it.get_edge_t();
72 edges_to_right += arr[u] < arr[v];
74 return edges_to_right;
84template <
typename result_t,
class arrangement_t>
90 std::is_same_v<result_t, numeric::rational> or
91 std::is_same_v<result_t, double>
95 assert(g.get_num_edges() > 0);
100 if constexpr (std::is_same_v<result_t, numeric::rational>) {
Directed graph class.
Definition directed_graph.hpp:67
Iterator over the set of edges of a graph.
Definition E_iterator.hpp:97
bool end() const noexcept
Returns true if the end of the iteration was reached.
Definition E_iterator.hpp:117
Exact rational number.
Definition rational.hpp:63
constexpr double to_double(const T &t) noexcept
Conversion to double.
Definition basic_convert.hpp:72
uint64_t right_branching_edges(const graphs::directed_graph &g, const arrangement_t &arr) noexcept
Number of right branching edges in a directed graph.
Definition headedness.hpp:66
result_t head_initial(const graphs::directed_graph &g, const arrangement_t &arr) noexcept
Proposition of right branching edges in a directed graph.
Definition headedness.hpp:86
Main namespace of the library.
Definition basic_types.hpp:48