44# ifndef NEGATIVE_CYCLES_TEST_SUPPORT_H
45# define NEGATIVE_CYCLES_TEST_SUPPORT_H
57 using namespace Aleph;
65 using Edge_Def = std::tuple<size_t, size_t, long long>;
71 std::vector<typename GT::Node *>
nodes;
72 std::vector<typename GT::Arc *>
arcs;
75 template <
class GT,
typename Weight_Type>
78 const std::vector<std::tuple<size_t, size_t, Weight_Type>> & edges)
81 built.
nodes.reserve(n);
82 built.
arcs.reserve(edges.size());
84 for (
size_t i = 0; i < n; ++i)
87 for (
const auto & [u, v,
w] : edges)
117 return arc->get_info();
139 return std::isfinite(arc->get_info());
154 for (
size_t i = 0; i < built.
nodes.size(); ++i, ++
k)
160 for (
size_t i = 0; i < built.
arcs.size(); ++i, ++
k)
171 for (
size_t i = 0; i < built.
nodes.size(); ++i, ++
k)
176 for (
size_t i = 0; i < built.
arcs.size(); ++i, ++
k)
Generic directed graph (digraph) wrapper template.
typename BaseGraph::Arc Arc
typename BaseGraph::Node Node
Graph implemented with double-linked adjacency lists.
virtual Node * insert_node(Node *node) noexcept
Insertion of a node already allocated.
Arc * insert_arc(Node *src_node, Node *tgt_node, void *a)
#define ARC_COOKIE(p)
Return the arc cookie
#define IS_NODE_VISITED(p, bit)
Determine whether the control bit is set or not to one.
#define ARC_BITS(p)
Return the control bits of arc p.
#define NODE_COOKIE(p)
Return the node cookie
#define IS_ARC_VISITED(p, bit)
Determine whether the bit field is or not set to one.
#define NODE_BITS(p)
Get the control bits of a node.
Main namespace for Aleph-w library functions.
std::tuple< size_t, size_t, long long > Edge_Def
Built_Graph_T< GT > build_graph_generic(const size_t n, const std::vector< std::tuple< size_t, size_t, Weight_Type > > &edges)
Built_Graph_T< Graph > build_graph(const size_t n, const std::vector< Edge_Def > &edges)
Arc of graph implemented with double-linked adjacency lists.
std::vector< typename GT::Arc * > arcs
std::vector< typename GT::Node * > nodes
Distance_Type operator()(Arc *arc) const
bool operator()(Arc *arc) const
bool operator()(Float_Graph::Arc *arc) const noexcept
bool operator()(Arc *arc) const noexcept
void plant(Built_Graph_T< GT > &built)
bool intact(const Built_Graph_T< GT > &built) const
Array-based graph implementation.
Generic graph and digraph implementations.