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 and std::is_integral_v<char_type>,
76 char_type *
const neighs
80 if constexpr (std::is_base_of_v<graphs::directed_graph, graph_t>) {
81 const auto& in_u = g.get_in_neighbors(u);
82 std::for_each(in_u.begin(), in_u.end(), [&](
node v) { neighs[v] = 1; });
83 const auto& out_u = g.get_out_neighbors(u);
84 std::for_each(out_u.begin(), out_u.end(), [&](
node v) { neighs[v] = 1; });
87 const auto& neighs_u = g.get_neighbors(u);
88 std::for_each(neighs_u.begin(), neighs_u.end(), [&](
node v) { neighs[v] = 1; });
98(std::vector<neighbourhood>& target,
const std::vector<neighbourhood>& source)
101 const uint64_t n_target = target.size();
102 for (std::size_t u = 0; u < source.size(); ++u) {
104 target.push_back( source[u] );
106 for (
node& v : target.back()) {
void get_bool_neighbors(const graph_t &g, const node u, char_type *const neighs) noexcept
Retrieves the neighbors 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:98
Main namespace of the library.
Definition basic_types.hpp:48
uint64_t node
Node type. See Node / Vertex page for further details.
Definition basic_types.hpp:51