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>
67 const arrangement_t& arr
71 uint64_t edges_to_right = 0;
73 const auto [u,v] = e_it.get_edge_t();
74 edges_to_right += arr[u] < arr[v];
76 return edges_to_right;
86template <
typename result_t,
class arrangement_t>
89 const arrangement_t& arr
94 std::is_same_v<result_t, numeric::rational> or
95 std::is_same_v<result_t, double>
99 assert(g.get_num_edges() > 0);
104 if constexpr (std::is_same_v<result_t, numeric::rational>) {
Directed graph class.
Definition: directed_graph.hpp:68
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:62
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:65
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:87
Main namespace of the library.
Definition: basic_types.hpp:50