185 <<
"There is nodes in graph";
188 <<
"The minimun size must be 2 x 2";
191 for (
size_t i = 0; i < height; ++i)
195 map[i] =
new typename GT::Node *[width];
196 for (
size_t j = 0; j < width; ++j)
216 if (j + 1 < width
and i > 0)
225 for (
size_t k = i - 1;
k >= 0; --
k)
233 for (
size_t i = 0; i < height; ++i)
#define ah_length_error_if(C)
Throws std::length_error if condition holds.
#define ah_domain_error_if(C)
Throws std::domain_error if condition holds.
Functor to build a 2D grid graph with 8-connectivity.
void operator()(GT &g, const size_t &width, const size_t &height)
Build a grid graph.
virtual Node * insert_node(Node *node) noexcept
Insertion of a node already allocated.
typename Node::Node_Type Node_Type
The arc class type.
Arc * insert_arc(Node *src_node, Node *tgt_node, void *a)
constexpr size_t get_num_nodes() const noexcept
Return the total of nodes of graph.
List_Graph< Graph_Node< int >, Graph_Arc< int > > GT
void clear_graph(GT &g) noexcept
Clean a graph: all its nodes and arcs are removed and freed.
Main namespace for Aleph-w library functions.
DynList< T > maps(const C &c, Op op)
Classic map operation.
Default no-op operation for arc initialization.
void operator()(GT &g, typename GT::Arc *a, const size_t &row, const size_t &col)
Called for each created arc.
Default no-op operation for node initialization.
void operator()(GT &g, typename GT::Node *n, const size_t &row, const size_t &col)
Called for each created node.
Arc of graph implemented with double-linked adjacency lists.