41 for (
int i = 0; i < (
int)
V; ++i)
44 for (
int i = 0; i < (
int)
V - 1; ++i)
47 for (
int j = i + 1; j < (
int)
V; ++j)
58 for (
size_t i = 0; i <
V; ++i)
62 for (
typename GT::Node_Iterator it(g); it.has_curr(); it.next())
64 const auto info = it.get_curr()->get_info();
67 cout <<
"Inconsistencia en el nodo " <<
info <<
endl;
73 cout <<
"Nodo duplicado " <<
info <<
endl;
81 for (
size_t i = 0; i <
V; ++i)
84 cout <<
"Falta el nodo " << i <<
endl;
90 cout <<
"Cantidad incorrecta de nodos " <<
count <<
endl;
94 for (
typename GT::Arc_Iterator it(g); it.has_curr(); it.next())
96 typename GT::Arc * a = it.get_curr();
101 cout <<
"Inconsistencia en el arco " << a->
get_info() <<
endl;
112 cout <<
"R value ctor test" <<
endl;
118 cout <<
"L value ctor test" <<
endl;
125 cout <<
"L value = test" <<
endl;
132 cout <<
"R value = test" <<
endl;
143 for (
int i =
beg; i <= end; ++i)
154 for (
typename L::Iterator it(
l); it.has_curr(); it.next())
155 if (it.get_curr() != i++)
157 cout <<
"Inconsistencia en el nodo " << i - 1
158 <<
"(" << it.get_curr() <<
")" <<
endl;
168 for (
typename L::Iterator it(
l); it.has_curr(); it.next())
169 cout << it.get_curr() <<
" ";
176 cout <<
"R value ctor test" <<
endl;
182 cout <<
"L value ctor test" <<
endl;
189 cout <<
"L value = test" <<
endl;
196 cout <<
"R value = test" <<
endl;
202 cout <<
"R value list append test" <<
endl;
209 cout <<
"R value list insert test" <<
endl;
216 cout <<
"L value list append test" <<
endl;
224 cout <<
"L value list insert test" <<
endl;
237 cout <<
"Probando con contenedor tipo arbol" <<
endl;
242 t.for_each([] (
const std::pair<int, int> & p)
244 cout << p.first <<
"," << p.second <<
" ";
251 for (
int i = 0; i < n; ++i)
258 for (
int i = 0; i < (
int) n; ++i)
263 Tree t2 = (*create_tree)(n);
265 t2 = (*create_tree)(2*n);
275 cout <<
"Probando diferentes combinaciones de insert\n"
280 int i = n + 1, j = n + 2;
283 cout <<
"\n\nL val R val\n";
287 cout <<
"\n\nR val L val\n";
290 cout <<
"\n\nR val R val\n";
291 tt.insert(i + 6, j + 7);
294 (*print)(
tt); cout <<
endl;
303 const int tmp = std::stoi(
argv[1]);
306 std::cout <<
"V must be positive" << std::endl;
309 V =
static_cast<size_t>(
tmp);
311 catch (
const std::exception & e)
313 std::cerr <<
"Error parsing V: " << e.what() << std::endl;
320 cout <<
"V must be positive" <<
endl;
328 cout <<
"Testing DynList" <<
endl;
332 cout <<
"Testing List_Graph" <<
endl;
336 cout <<
"Testing List_Digraph" <<
endl;
340 cout <<
"Testing List_SGraph" <<
endl;
344 cout <<
"Testing List_SDigraph" <<
endl;
348 cout <<
"Testing Array_Graph" <<
endl;
352 cout <<
"Testing Array_Digraph" <<
endl;
void reserve(const size_t l, const size_t r)
Allocate a range of entries.
Dynamic singly linked list with functional programming support.
T & insert(const T &item)
T & append(const T &item)
T & get_first() const
Return the first item 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)
ArcInfo & get_info() noexcept
Return a modifiable reference to the arc data.
NodeInfo & get_info() noexcept
Return a modifiable reference to the data contained in the node.
Node * get_src_node(Arc *arc) const noexcept
Return the source node of arc (only for directed graphs)
Node * get_tgt_node(Arc *arc) const noexcept
Return the target node of arc (only for directed graphs)
QuadTree - Hierarchical spatial index for 2D points.
Point * insert(Node *&r, const Point &p)
Recursive insert helper.
DynArray< Graph::Node * > nodes
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.
@ Tree
Basic arc (in spanning tree).
Itor::difference_type count(const Itor &beg, const Itor &end, const T &value)
Count elements equal to a value.
void print(const DynList< Parc< Net > > &sp)
Print a semi-path to stdout.
void test_map_tree(size_t n)
bool check_list(const L &l)
L create_list(int beg=0, int end=V - 1)
void print_list(const L &l)
Array-based graph implementation.
Dynamic key-value map based on balanced binary search trees.