48#include <lal/graphs/directed_graph.hpp>
49#include <lal/graphs/undirected_graph.hpp>
67 std::is_base_of_v<graphs::directed_graph, G> ||
68 std::is_base_of_v<graphs::undirected_graph, G>,
71inline void get_bool_neighbours
72(
const G& g,
node u,
char *
const neighs)
74 if constexpr (std::is_base_of_v<graphs::directed_graph, G>) {
75 const auto& in_u = g.get_in_neighbours(u);
76 std::for_each(in_u.begin(), in_u.end(), [&](
node v) { neighs[v] = 1; });
77 const auto& out_u = g.get_out_neighbours(u);
78 std::for_each(out_u.begin(), out_u.end(), [&](
node v) { neighs[v] = 1; });
81 const auto& neighs_u = g.get_neighbours(u);
82 std::for_each(neighs_u.begin(), neighs_u.end(), [&](
node v) { neighs[v] = 1; });
89inline void append_adjacency_lists
90(std::vector<neighbourhood>& target,
const std::vector<neighbourhood>& source)
92 const uint32_t n_target =
static_cast<uint32_t
>(target.size());
94 for (
size_t u = 0; u < source.size(); ++u) {
96 target.push_back( source[u] );
98 for (
node& v : target.back()) {
Main namespace of the library.
Definition definitions.hpp:48
uint32_t node
Node type.
Definition definitions.hpp:51