46 for (
int i = 0; i < (
int)
V; ++i)
49 for (
int i = 0; i < (
int)
V - 1; ++i)
52 for (
int j = i + 1; j < (
int)
V; ++j)
63 for (
size_t i = 0; i <
V; ++i)
67 for (
typename GT::Node_Iterator it(g); it.has_curr(); it.next())
69 const auto info = it.get_curr()->get_info();
72 cout <<
"Inconsistencia en el nodo " <<
info <<
endl;
78 cout <<
"Nodo duplicado " <<
info <<
endl;
86 for (
size_t i = 0; i <
V; ++i)
89 cout <<
"Falta el nodo " << i <<
endl;
95 cout <<
"Cantidad incorrecta de nodos " <<
count <<
endl;
99 for (
typename GT::Arc_Iterator it(g); it.has_curr(); it.next())
101 typename GT::Arc * a = it.get_curr();
106 cout <<
"Inconsistencia en el arco " << a->
get_info() <<
endl;
117 cout <<
"R value ctor test" <<
endl;
123 cout <<
"L value ctor test" <<
endl;
130 cout <<
"L value = test" <<
endl;
137 cout <<
"R value = test" <<
endl;
148 for (
int i =
beg; i <= end; ++i)
159 for (
typename L::Iterator it(
l); it.has_curr(); it.next())
160 if (it.get_curr() != i++)
162 cout <<
"Inconsistencia en el nodo " << i - 1
163 <<
"(" << it.get_curr() <<
")" <<
endl;
173 for (
typename L::Iterator it(
l); it.has_curr(); it.next())
174 cout << it.get_curr() <<
" ";
181 cout <<
"R value ctor test" <<
endl;
187 cout <<
"L value ctor test" <<
endl;
194 cout <<
"L value = test" <<
endl;
201 cout <<
"R value = test" <<
endl;
207 cout <<
"R value list append test" <<
endl;
214 cout <<
"R value list insert test" <<
endl;
221 cout <<
"L value list append test" <<
endl;
229 cout <<
"L value list insert test" <<
endl;
242 cout <<
"Probando con contenedor tipo arbol" <<
endl;
247 t.for_each([] (
const std::pair<int, int> & p)
249 cout << p.first <<
"," << p.second <<
" ";
256 for (
int i = 0; i < n; ++i)
263 for (
int i = 0; i < (
int) n; ++i)
268 Tree t2 = (*create_tree)(n);
270 t2 = (*create_tree)(2*n);
280 cout <<
"Probando diferentes combinaciones de insert\n"
285 int i = n + 1, j = n + 2;
288 cout <<
"\n\nL val R val\n";
292 cout <<
"\n\nR val L val\n";
295 cout <<
"\n\nR val R val\n";
296 tt.insert(i + 6, j + 7);
299 (*print)(
tt); cout <<
endl;
308 const int tmp = std::stoi(
argv[1]);
311 std::cout <<
"V must be positive" << std::endl;
314 V =
static_cast<size_t>(
tmp);
316 catch (
const std::exception & e)
318 std::cerr <<
"Error parsing V: " << e.what() << std::endl;
325 cout <<
"V must be positive" <<
endl;
333 cout <<
"Testing DynList" <<
endl;
337 cout <<
"Testing List_Graph" <<
endl;
341 cout <<
"Testing List_Digraph" <<
endl;
345 cout <<
"Testing List_SGraph" <<
endl;
349 cout <<
"Testing List_SDigraph" <<
endl;
353 cout <<
"Testing Array_Graph" <<
endl;
357 cout <<
"Testing Array_Digraph" <<
endl;
void reserve(const size_t l, const size_t r)
Allocate a range of entries.
Doubly-linked list (defined in tpl_dynList.H).
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
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
@ 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.