51#include <lal/definitions.hpp>
52#include <lal/numeric/rational.hpp>
53#include <lal/graphs/graph.hpp>
88(
const std::vector<G>& L,
const std::vector<linear_arrangement>& P = {})
91 static_assert(std::is_base_of_v<graphs::graph, G>);
96 assert(P.size() == 0 or L.size() == P.size());
103 for (
size_t i = 0; i < L.size(); ++i) {
105 sumM += L[i].get_num_edges();
109 for (
size_t i = 0; i < L.size(); ++i) {
111 sumM += L[i].get_num_edges();
134(
const std::vector<G>& L,
const std::vector<linear_arrangement>& P = {})
137 static_assert(std::is_base_of_v<graphs::graph, G>);
Exact rational number.
Definition rational.hpp:63
double to_double() const noexcept
Converts this rational to a double-precision floating-point value.
Definition rational.hpp:736
uint32_t sum_edge_lengths(const graphs::directed_graph &g, const linear_arrangement &pi={}) noexcept
Computes the sum of the length of the edges in a linear arrangement.
double mean_dependency_distance_1level(const std::vector< G > &L, const std::vector< linear_arrangement > &P={}) noexcept
1-level Mean Dependency Distance over an ensemble of graphs.
Definition 1level.hpp:134
numeric::rational mean_dependency_distance_1level_rational(const std::vector< G > &L, const std::vector< linear_arrangement > &P={}) noexcept
1-level Mean Dependency Distance over an ensemble of graphs.
Definition 1level.hpp:88
rational rational_from_ui(uint64_t n, uint64_t d=1) noexcept
Make a rational value from two 64-bit unsigned integers.
Definition rational.hpp:800
Main namespace of the library.
Definition definitions.hpp:48
std::vector< position > linear_arrangement
A linear arrangement of the nodes of a graph.
Definition definitions.hpp:72