50#include <gtest/gtest.h>
113 auto n2 = g.insert_node(2);
114 g.insert_arc(n1, n2);
128 auto n2 = g.insert_node(2);
129 auto n3 = g.insert_node(3);
130 g.insert_arc(n1, n2);
131 g.insert_arc(n2, n3);
132 g.insert_arc(n3, n1);
147 auto n2 = g.insert_node(2);
148 g.insert_arc(n1, n2);
150 auto n3 = g.insert_node(3);
151 auto n4 = g.insert_node(4);
152 g.insert_arc(n3, n4);
168 auto n2 = g.insert_node(20);
169 g.insert_arc(n1, n2);
189 auto n2 = g.insert_node(2);
190 auto n3 = g.insert_node(3);
191 g.insert_arc(n1, n2);
192 g.insert_arc(n2, n3);
206 auto n2 = g.insert_node(2);
207 auto n3 = g.insert_node(3);
208 g.insert_arc(n1, n2);
209 g.insert_arc(n2, n3);
236 auto n2 = g.insert_node(2);
237 auto n3 = g.insert_node(3);
238 g.insert_arc(n1, n2);
239 g.insert_arc(n2, n3);
253 auto n2 = g.insert_node(2);
254 g.insert_arc(n1, n2);
257 auto n3 = g.insert_node(3);
258 auto n4 = g.insert_node(4);
259 g.insert_arc(n3, n4);
301 auto n2 = g.insert_node(2);
302 g.insert_arc(n1, n2);
316 auto n2 = g.insert_node(2);
317 g.insert_arc(n1, n2);
330 auto n2 = g.insert_node(2);
331 auto n3 = g.insert_node(3);
332 g.insert_arc(n1, n2);
333 g.insert_arc(n2, n3);
343 auto n2 = g.insert_node(2);
344 g.insert_arc(n1, n2);
376 for (
int i = 0; i < 50; ++i)
389 for (
int i = 0; i <
N; ++i)
393 for (
int i = 0; i <
N - 1; ++i)
406template <
typename GraphType>
426template <
typename GraphType>
588 ::testing::InitGoogleTest(&
argc,
argv);
Build a mapped subgraph from a graph starting at a given node.
Generic directed graph (digraph) wrapper template.
T & append()
Allocate a new entry to the end of array.
Dynamic singly linked list with functional programming support.
T & get_first() const
Return the first item of the list.
Arc for graphs implemented with simple adjacency lists.
size_t size() const noexcept
Count the number of elements of the list.
virtual Node * insert_node(Node *node) noexcept
Insertion of a node already allocated.
Arc * insert_arc(Node *src_node, Node *tgt_node, void *a)
Graph class implemented with singly-linked adjacency lists.
Compute the connected components of a graph.
void reset_arcs() const
Reset all the arcs of graph (the control bits, the state, the counter and the cookie)
constexpr size_t get_num_nodes() const noexcept
Return the total of nodes of graph.
constexpr size_t get_num_arcs() const noexcept
void reset_nodes() const
Reset all the nodes of graph (the control bits, the state, the counter and the cookie)
::testing::Types< ListGraph, SparseGraph, ArrayGraph > UndirectedGraphTypes
DynArray< Graph::Node * > nodes
Main namespace for Aleph-w library functions.
DynList< T > maps(const C &c, Op op)
Classic map operation.
Arc of graph implemented with double-linked adjacency lists.
Array-based graph implementation.
Graph connectivity and connected components.
::testing::Types< ListGraph, ListDigraph, SparseGraph, SparseDigraph, ArrayGraph, ArrayDigraph > GraphTypes
TYPED_TEST(ComponentsAllGraphs, BuildSubgraphSingleNode)
List_Digraph< Graph_Node< int >, Graph_Arc< int > > ListDigraph
TYPED_TEST_SUITE(ComponentsAllGraphs, GraphTypes)
List_Graph< Graph_Node< int >, Graph_Arc< int > > ListGraph
Array_Graph< Graph_Anode< int >, Graph_Aarc< int > > ArrayGraph
List_SDigraph< Graph_Snode< int >, Graph_Sarc< int > > SparseDigraph
TEST_F(BuildSubgraphTest, SingleNode)
List_SGraph< Graph_Snode< int >, Graph_Sarc< int > > SparseGraph
Generic graph and digraph implementations.
Simple graph implementation with adjacency lists.