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;
k-- > 0; )
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.
List_Graph< Graph_Node< Node_Info >, Graph_Arc< Arc_Info > > GT
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.
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.
and
Check uniqueness with explicit hash + equality functors.
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.
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.