48#include <lal/graphs/directed_graph.hpp>
49#include <lal/graphs/undirected_graph.hpp>
69 std::is_base_of_v<graphs::graph, graph_t>
70 && std::is_integral_v<char_type>,
76 if constexpr (std::is_base_of_v<graphs::directed_graph, graph_t>) {
77 const auto& in_u = g.get_in_neighbours(u);
78 std::for_each(in_u.begin(), in_u.end(), [&](
node v) { neighs[v] = 1; });
79 const auto& out_u = g.get_out_neighbours(u);
80 std::for_each(out_u.begin(), out_u.end(), [&](
node v) { neighs[v] = 1; });
83 const auto& neighs_u = g.get_neighbours(u);
84 std::for_each(neighs_u.begin(), neighs_u.end(), [&](
node v) { neighs[v] = 1; });
95(std::vector<neighbourhood>& target,
const std::vector<neighbourhood>& source)
98 const uint64_t n_target = target.size();
99 for (std::size_t u = 0; u < source.size(); ++u) {
101 target.push_back( source[u] );
103 for (
node& v : target.back()) {
void get_bool_neighbours(const graph_t &g, node u, char_type *const neighs) noexcept
Retrieves the neighbours of a node in an undirected graph as a list of 0-1 values.
Definition: utils.hpp:73
void append_adjacency_lists(std::vector< neighbourhood > &target, const std::vector< neighbourhood > &source) noexcept
Append adjacency list 'source' to list 'target'.
Definition: utils.hpp:95
Main namespace of the library.
Definition: basic_types.hpp:50
uint64_t node
Node type. See Node / Vertex page for further details.
Definition: basic_types.hpp:53