14namespace sequoia::testing
16 namespace undirected_embedded_graph{
20 nodew = graph_description::end,
51 node_0w_0_interleaved,
57 node_0_0w_interleaved,
63 node_0w_0w_interleaved,
81 node_1w_1w_node_0w_0w,
93 node_1_1w_1x_node_0_0w_0x,
99 node_0y_1_1w_1x_node_0_0w_0x,
107 class EdgeStorageConfig,
108 class NodeWeightStorage
114 using edge_t =
typename graph_t::edge_init_type;
115 using node_weight_type =
typename graph_t::node_weight_type;
116 using edges_equivalent_t = std::initializer_list<std::initializer_list<edge_t>>;
121 auto trg{make_weighted_transition_graph(t)};
124 [&t](std::string_view description,
const graph_t& obtained,
const graph_t& prediction,
const graph_t& parent, std::size_t host, std::size_t target) {
125 t.check(equality, {description, no_source_location}, obtained, prediction);
126 if(host != target) t.check_semantics({description, no_source_location}, prediction, parent);
134 static graph_t make_and_check(
regular_test& t, std::string_view description, edges_equivalent_t edgeInit, std::initializer_list<node_weight_type> nodeInit)
139 static void check_initialization_exceptions(
regular_test& t)
141 using nodes = std::initializer_list<node_weight_type>;
144 t.check_exception_thrown<std::logic_error>(
"Mismatched weights", [](){
return graph_t{{{0, 1, 1.0}, {0, 0, 0.0}}}; });
147 t.check_exception_thrown<std::logic_error>(
"IMismatched weights", [](){
return graph_t{{{1, 0, 1.0}}, {{0, 0, 2.0}}}; });
149 t.check_exception_thrown<std::logic_error>(
"Mismatched edge/node initialization", [](){
return graph_t{{}, nodes{1.0}}; });
150 t.check_exception_thrown<std::logic_error>(
"Mismatched edge/node initialization", [](){
return graph_t{{{}}, nodes{1.0, 2.0}}; });
151 t.check_exception_thrown<std::logic_error>(
"Mismatched edge/node initialization", [](){
return graph_t{{{edge_t{0, 1, 1.0}, edge_t{0, 0, 1.0}}}, nodes{1.0, 2.0}}; });
152 t.check_exception_thrown<std::logic_error>(
"Mismatched edge/node initialization", [](){
return graph_t{{{}, {}}, nodes{1.0}}; });
153 t.check_exception_thrown<std::logic_error>(
"Mismatched edge/node initialization", [](){
return graph_t{{{edge_t{1, 0}}, {edge_t{0, 0}}}, nodes{1.0}}; });
158 static transition_graph make_weighted_transition_graph(
regular_test& t)
161 using namespace undirected_embedded_graph;
163 auto trg{base_ops::make_transition_graph(t)};
165 check_initialization_exceptions(t);
168 trg.add_node(make_and_check(t, t.report(
""), {{}}, {1.0}));
171 trg.add_node(make_and_check(t, t.report(
""), {{{0, 1, 0.0}, {0, 0, 0.0}}}, {1.0}));
174 trg.add_node(make_and_check(t, t.report(
""), {{{0, 1, 1.0}, {0, 0, 1.0}}}, {0.0}));
177 trg.add_node(make_and_check(t, t.report(
""), {{{0, 1, 1.0}, {0, 0, 1.0}, {0, 3, 1.0}, {0, 2, 1.0}}}, {0.0}));
180 trg.add_node(make_and_check(t, t.report(
""), {{{0, 1, 0.0}, {0, 0, 0.0}, {0, 3, 1.0}, {0, 2, 1.0}}}, {0.0}));
183 trg.add_node(make_and_check(t, t.report(
""), {{{0, 1, 1.0}, {0, 0, 1.0}, {0, 3, 0.0}, {0, 2, 0.0}}}, {0.0}));
186 trg.add_node(make_and_check(t, t.report(
""), {{{0, 2, 1.0}, {0, 3, 0.0}, {0, 0, 1.0}, {0, 1, 0.0}}}, {0.0}));
189 trg.add_node(make_and_check(t, t.report(
""), {{{0, 2, 0.0}, {0, 3, 1.0}, {0, 0, 0.0}, {0, 1, 1.0}}}, {0.0}));
192 trg.add_node(make_and_check(t, t.report(
""), {{{0, 2, 1.0}, {0, 3, 1.0}, {0, 0, 1.0}, {0, 1, 1.0}}}, {0.0}));
195 trg.add_node(make_and_check(t, t.report(
""), {{}, {}}, {0.0, 1.0}));
198 trg.add_node(make_and_check(t, t.report(
""), {{}, {}}, {1.0, 0.0}));
201 trg.add_node(make_and_check(t, t.report(
""), {{{1, 0, 0.0}}, {{0, 0, 0.0}}}, {0.0, 1.0}));
204 trg.add_node(make_and_check(t, t.report(
""), {{{1, 0, 0.0}}, {{0, 0, 0.0}}}, {1.0, 0.0}));
207 trg.add_node(make_and_check(t, t.report(
""), {{{1, 0, 0.0}, {1, 1, 1.0}}, {{0, 0, 0.0}, {0, 1, 1.0}}}, {0.0, 0.0}));
210 trg.add_node(make_and_check(t, t.report(
""), {{{1, 0, 1.0}, {1, 1, 1.0}}, {{0, 0, 1.0}, {0, 1, 1.0}}}, {0.0, 0.0}));
213 trg.add_node(make_and_check(t, t.report(
""), {{{1, 1, 1.0}, {1, 0, 0.0}}, {{0, 1, 0.0}, {0, 0, 1.0}}}, {0.0, 0.0}));
216 trg.add_node(make_and_check(t, t.report(
""), {{{1, 1, 0.0}, {1, 0, 1.0}}, {{0, 1, 1.0}, {0, 0, 0.0}}}, {0.0, 0.0}));
219 trg.add_node(make_and_check(t, t.report(
""), {{{1, 0, 0.0}, {1, 1, 1.0}, {1, 2, 2.0}}, {{0, 0, 0.0}, {0, 1, 1.0}, {0, 2, 2.0}}}, {0.0, 0.0}));
222 trg.add_node(make_and_check(t, t.report(
""), {{{0, 1, 3.0}, {0, 0, 3.0}, {1, 0, 0.0}, {1, 1, 1.0}, {1, 2, 2.0}}, {{0, 2, 0.0}, {0, 3, 1.0}, {0, 4, 2.0}}}, {0.0, 0.0}));
227 graph_description::empty,
228 graph_description::empty,
230 [&t](graph_t g) -> graph_t {
231 t.check_exception_thrown<std::out_of_range>(
"Attempt to set a node weight which does not exist", [&g](){ g.set_node_weight(g.cbegin_node_weights(), 1.0); });
237 graph_description::empty,
238 graph_description::empty,
239 t.report(
"Attempt to mutate a node weight which does not exist"),
240 [&t](graph_t g) -> graph_t {
241 t.check_exception_thrown<std::out_of_range>(
"Attempt to mutate a node weight which does not exist", [&g](){ g.mutate_node_weight(g.cbegin_node_weights(), [](
double&){}); });
247 graph_description::empty,
248 weighted_graph_description::nodew,
249 t.report(
"Add weighted node"),
250 [](graph_t g) -> graph_t {
257 graph_description::empty,
258 weighted_graph_description::nodew,
259 t.report(
"Insert weighted node"),
260 [](graph_t g) -> graph_t {
261 g.insert_node(0, 1.0);
271 graph_description::node,
272 graph_description::node,
274 [&t](graph_t g) -> graph_t {
275 t.check_exception_thrown<std::out_of_range>(
"Attempt to set a node weight which does not exist", [&g](){ g.set_node_weight(g.cend_node_weights(), 1.0); });
281 graph_description::node,
282 graph_description::node,
283 t.report(
"Attempt to mutate a node weight which does not exist"),
284 [&t](graph_t g) -> graph_t {
285 t.check_exception_thrown<std::out_of_range>(
"Attempt to mutate a node weight which does not exist", [&g](){ g.mutate_node_weight(g.cend_node_weights(), [](
double&){}); });
291 graph_description::node,
292 weighted_graph_description::nodew,
293 t.report(
"Change node weight"),
294 [](graph_t g) -> graph_t {
295 g.set_node_weight(g.cbegin_node_weights(), 1.0);
301 graph_description::node,
302 weighted_graph_description::nodew,
303 t.report(
"Mutate node weight"),
304 [](graph_t g) -> graph_t {
305 g.mutate_node_weight(g.cbegin_node_weights(), [](
double& x) { x += 1.0; });
311 graph_description::node,
312 weighted_graph_description::nodew_node,
313 t.report(
"Insert weighted node"),
314 [](graph_t g) -> graph_t {
315 g.insert_node(0, 1.0);
321 graph_description::node,
322 weighted_graph_description::node_0w,
323 t.report(
"Join {0,0}"),
324 [](graph_t g) -> graph_t {
335 graph_description::node_0,
336 weighted_graph_description::node_0w,
337 t.report(
"Set edge weight"),
338 [](graph_t g) -> graph_t {
339 g.set_edge_weight(g.cbegin_edges(0), 1.0);
345 graph_description::node_0,
346 weighted_graph_description::node_0w,
347 t.report(
"Set edge weight via second insertion"),
348 [](graph_t g) -> graph_t {
349 g.set_edge_weight(++g.cbegin_edges(0), 1.0);
355 graph_description::node_0,
356 weighted_graph_description::node_0w,
357 t.report(
"Mutate edge weight"),
358 [](graph_t g) -> graph_t {
359 g.mutate_edge_weight(g.cbegin_edges(0), [](
double& x){ x += 1.0; });
365 graph_description::node_0,
366 weighted_graph_description::node_0w,
367 t.report(
"Mutate edge weight via second insertion"),
368 [](graph_t g) -> graph_t {
369 g.mutate_edge_weight(++g.cbegin_edges(0), [](
double& x){ x += 1.0; });
375 graph_description::node_0,
376 weighted_graph_description::node_0_0w,
377 t.report(
"Join {0,0}"),
378 [](graph_t g) -> graph_t {
385 graph_description::node_0,
386 weighted_graph_description::node_0w_0_interleaved,
387 t.report(
"Insert weighted join {0,0}"),
388 [](graph_t g) -> graph_t {
389 g.insert_join(g.cbegin_edges(0), 2, 1.0);
395 graph_description::node_0,
396 weighted_graph_description::node_0_0w_interleaved,
397 t.report(
"Insert weighted join {0,0}"),
398 [](graph_t g) -> graph_t {
399 g.insert_join(g.cbegin_edges(0)+1, 3, 1.0);
409 graph_description::node_0_0,
410 weighted_graph_description::node_0w_0,
411 t.report(
"Set edge weight via zeroth partial weight"),
412 [](graph_t g) -> graph_t {
413 g.set_edge_weight(g.cbegin_edges(0), 1.0);
419 graph_description::node_0_0,
420 weighted_graph_description::node_0w_0,
421 t.report(
"Set edge weight via first partial weight"),
422 [](graph_t g) -> graph_t {
423 g.set_edge_weight(g.cbegin_edges(0) + 1, 1.0);
429 graph_description::node_0_0,
430 weighted_graph_description::node_0_0w,
431 t.report(
"Set edge weight via second partial weight"),
432 [](graph_t g) -> graph_t {
433 g.set_edge_weight(g.cbegin_edges(0) + 2, 1.0);
439 graph_description::node_0_0,
440 weighted_graph_description::node_0_0w,
441 t.report(
"Set edge weight via third partial weight"),
442 [](graph_t g) -> graph_t {
443 g.set_edge_weight(g.cbegin_edges(0) + 3, 1.0);
449 graph_description::node_0_0,
450 weighted_graph_description::node_0w_0,
451 t.report(
"Mutate edge weight via zeroth partial weight"),
452 [](graph_t g) -> graph_t {
453 g.mutate_edge_weight(g.cbegin_edges(0), [](
double& x) { x += 1.0; });
459 graph_description::node_0_0,
460 weighted_graph_description::node_0w_0,
461 t.report(
"Mutate edge weight via first partial weight"),
462 [](graph_t g) -> graph_t {
463 g.mutate_edge_weight(g.cbegin_edges(0)+1, [](
double& x) { x += 1.0; });
469 graph_description::node_0_0,
470 weighted_graph_description::node_0_0w,
471 t.report(
"Mutate edge weight via second partial weight"),
472 [](graph_t g) -> graph_t {
473 g.mutate_edge_weight(g.cbegin_edges(0)+2, [](
double& x) { x += 1.0; });
479 graph_description::node_0_0,
480 weighted_graph_description::node_0_0w,
481 t.report(
"Mutate edge weight via third partial weight"),
482 [](graph_t g) -> graph_t {
483 g.mutate_edge_weight(g.cbegin_edges(0)+3, [](
double& x) { x += 1.0; });
493 graph_description::node_0_0_interleaved,
494 weighted_graph_description::node_0w_0_interleaved,
495 t.report(
"Set edge weight via zeroth partial weight"),
496 [](graph_t g) -> graph_t {
497 g.set_edge_weight(g.cbegin_edges(0), 1.0);
503 graph_description::node_0_0_interleaved,
504 weighted_graph_description::node_0_0w_interleaved,
505 t.report(
"Set edge weight via first partial weight"),
506 [](graph_t g) -> graph_t {
507 g.set_edge_weight(++g.cbegin_edges(0), 1.0);
513 graph_description::node_0_0_interleaved,
514 weighted_graph_description::node_0w_0_interleaved,
515 t.report(
"Set edge weight via second partial weight"),
516 [](graph_t g) -> graph_t {
517 g.set_edge_weight(g.cbegin_edges(0)+2, 1.0);
523 graph_description::node_0_0_interleaved,
524 weighted_graph_description::node_0_0w_interleaved,
525 t.report(
"Set edge weight via third partial weight"),
526 [](graph_t g) -> graph_t {
527 g.set_edge_weight(g.cbegin_edges(0)+3, 1.0);
533 graph_description::node_0_0_interleaved,
534 weighted_graph_description::node_0w_0_interleaved,
535 t.report(
"Muteate edge weight via zeroth partial weight"),
536 [](graph_t g) -> graph_t {
537 g.mutate_edge_weight(g.cbegin_edges(0), [](
double& x) { x += 1.0; });
543 graph_description::node_0_0_interleaved,
544 weighted_graph_description::node_0_0w_interleaved,
545 t.report(
"Mutate edge weight via first partial weight"),
546 [](graph_t g) -> graph_t {
547 g.mutate_edge_weight(++g.cbegin_edges(0), [](
double& x) { x += 1.0; });
553 graph_description::node_0_0_interleaved,
554 weighted_graph_description::node_0w_0_interleaved,
555 t.report(
"Mutate edge weight via second partial weight"),
556 [](graph_t g) -> graph_t {
557 g.mutate_edge_weight(g.cbegin_edges(0) + 2, [](
double& x) { x += 1.0; });
563 graph_description::node_0_0_interleaved,
564 weighted_graph_description::node_0_0w_interleaved,
565 t.report(
"Mutate edge weight via third partial weight"),
566 [](graph_t g) -> graph_t {
567 g.mutate_edge_weight(g.cbegin_edges(0) + 3, [](
double& x) { x += 1.0; });
577 graph_description::node_1_node_0,
578 weighted_graph_description::node_1w_1_node_0_0w,
579 t.report(
"Inserted braided join"),
580 [](graph_t g) -> graph_t {
581 g.insert_join(g.cbegin_edges(0), g.cbegin_edges(1)+1, 1.0);
587 graph_description::node_1_node_0,
588 weighted_graph_description::node_1_1w_node_0w_0,
589 t.report(
"Inserted braided join"),
590 [](graph_t g) -> graph_t {
591 g.insert_join(g.cbegin_edges(0) + 1, g.cbegin_edges(1), 1.0);
601 graph_description::node_1_1_node_0_0,
602 weighted_graph_description::node_1_1w_node_0_0w,
603 t.report(
"Set edge weight via node 0, first partial edge"),
604 [](graph_t g) -> graph_t {
605 g.set_edge_weight(++g.cbegin_edges(0), 1.0);
611 graph_description::node_1_1_node_0_0,
612 weighted_graph_description::node_1_1w_node_0_0w,
613 t.report(
"Set edge weight via node 1, first partial edge"),
614 [](graph_t g) -> graph_t {
615 g.set_edge_weight(++g.cbegin_edges(1), 1.0);
621 graph_description::node_1_1_node_0_0,
622 weighted_graph_description::node_1_1w_node_0_0w,
623 t.report(
"Mutate edge weight via node 0, first partial edge"),
624 [](graph_t g) -> graph_t {
625 g.mutate_edge_weight(++g.cbegin_edges(0), [](
double& x) { x += 1.0; });
631 graph_description::node_1_1_node_0_0,
632 weighted_graph_description::node_1_1w_node_0_0w,
633 t.report(
"Mutate edge weight via node 1, first partial edge"),
634 [](graph_t g) -> graph_t {
635 g.mutate_edge_weight(++g.cbegin_edges(1), [](
double& x) { x += 1.0; });
645 graph_description::node_1pos1_1pos0_node_0pos1_0pos0,
646 weighted_graph_description::node_1w_1_node_0_0w,
647 t.report(
"Set edge weight via node 0, zeroth partial edge"),
648 [](graph_t g) -> graph_t {
649 g.set_edge_weight(g.cbegin_edges(0), 1.0);
655 graph_description::node_1pos1_1pos0_node_0pos1_0pos0,
656 weighted_graph_description::node_1_1w_node_0w_0,
657 t.report(
"Set edge weight via node 0, first partial edge"),
658 [](graph_t g) -> graph_t {
659 g.set_edge_weight(g.cbegin_edges(0) + 1, 1.0);
665 graph_description::node_1pos1_1pos0_node_0pos1_0pos0,
666 weighted_graph_description::node_1_1w_node_0w_0,
667 t.report(
"Set edge weight via node 1, zeroth partial edge"),
668 [](graph_t g) -> graph_t {
669 g.set_edge_weight(g.cbegin_edges(1), 1.0);
675 graph_description::node_1pos1_1pos0_node_0pos1_0pos0,
676 weighted_graph_description::node_1w_1_node_0_0w,
677 t.report(
"Set edge weight via node 1, first partial edge"),
678 [](graph_t g) -> graph_t {
679 g.set_edge_weight(g.cbegin_edges(1) + 1, 1.0);
685 graph_description::node_1pos1_1pos0_node_0pos1_0pos0,
686 weighted_graph_description::node_1w_1_node_0_0w,
687 t.report(
"Mutate edge weight via node 0, zeroth partial edge"),
688 [](graph_t g) -> graph_t {
689 g.mutate_edge_weight(g.cbegin_edges(0), [](
double& x) { x += 1.0; });
695 graph_description::node_1pos1_1pos0_node_0pos1_0pos0,
696 weighted_graph_description::node_1_1w_node_0w_0,
697 t.report(
"Mutate edge weight via node 0, first partial edge"),
698 [](graph_t g) -> graph_t {
699 g.mutate_edge_weight(g.cbegin_edges(0) + 1, [](
double& x) { x += 1.0; });
705 graph_description::node_1pos1_1pos0_node_0pos1_0pos0,
706 weighted_graph_description::node_1_1w_node_0w_0,
707 t.report(
"Mutate edge weight via node 1, zeroth partial edge"),
708 [](graph_t g) -> graph_t {
709 g.mutate_edge_weight(g.cbegin_edges(1), [](
double& x) { x += 1.0; });
715 graph_description::node_1pos1_1pos0_node_0pos1_0pos0,
716 weighted_graph_description::node_1w_1_node_0_0w,
717 t.report(
"Mutate edge weight via node 1, first partial edge"),
718 [](graph_t g) -> graph_t {
719 g.mutate_edge_weight(g.cbegin_edges(1) + 1, [](
double& x) { x += 1.0; });
731 weighted_graph_description::node_0w,
732 weighted_graph_description::node_0_0w_interleaved,
733 t.report(
"Insert join {0,0}"),
734 [](graph_t g) -> graph_t {
735 g.insert_join(g.cbegin_edges(0), 2, 0.0);
741 weighted_graph_description::node_0w,
742 weighted_graph_description::node_0w_0_interleaved,
743 t.report(
"Insert join {0,0}"),
744 [](graph_t g) -> graph_t {
745 g.insert_join(g.cbegin_edges(0)+1, 3, 0.0);
755 weighted_graph_description::node_0_0w,
756 weighted_graph_description::node_0w,
757 t.report(
"Remove zeroth partial edge"),
758 [](graph_t g) -> graph_t {
759 g.erase_edge(g.cbegin_edges(0));
765 weighted_graph_description::node_0_0w,
766 weighted_graph_description::node_0w,
767 t.report(
"Remove first partial edge"),
768 [](graph_t g) -> graph_t {
769 g.erase_edge(++g.cbegin_edges(0));
775 weighted_graph_description::node_0_0w,
776 graph_description::node_0,
777 t.report(
"Remove second partial edge"),
778 [](graph_t g) -> graph_t {
779 g.erase_edge(g.cbegin_edges(0)+2);
785 weighted_graph_description::node_0_0w,
786 graph_description::node_0,
787 t.report(
"Remove third partial edge"),
788 [](graph_t g) -> graph_t {
789 g.erase_edge(g.cbegin_edges(0)+3);
799 weighted_graph_description::node_0w_0_interleaved,
800 graph_description::node_0_0_interleaved,
801 t.report(
"Set edge weight via zeroth partial weight"),
802 [](graph_t g) -> graph_t {
803 g.set_edge_weight(g.cbegin_edges(0), 0.0);
809 weighted_graph_description::node_0w_0_interleaved,
810 weighted_graph_description::node_0w_0w_interleaved,
811 t.report(
"Set edge weight via first partial weight"),
812 [](graph_t g) -> graph_t {
813 g.set_edge_weight(++g.cbegin_edges(0), 1.0);
819 weighted_graph_description::node_0w_0_interleaved,
820 graph_description::node_0_0_interleaved,
821 t.report(
"Set edge weight via second partial weight"),
822 [](graph_t g) -> graph_t {
823 g.set_edge_weight(g.cbegin_edges(0) + 2, 0.0);
829 weighted_graph_description::node_0w_0_interleaved,
830 weighted_graph_description::node_0w_0w_interleaved,
831 t.report(
"Set edge weight via third partial weight"),
832 [](graph_t g) -> graph_t {
833 g.set_edge_weight(g.cbegin_edges(0) + 3, 1.0);
839 weighted_graph_description::node_0w_0_interleaved,
840 graph_description::node_0_0_interleaved,
841 t.report(
"Muteate edge weight via zeroth partial weight"),
842 [](graph_t g) -> graph_t {
843 g.mutate_edge_weight(g.cbegin_edges(0), [](
double& x) { x -= 1.0; });
849 weighted_graph_description::node_0w_0_interleaved,
850 weighted_graph_description::node_0w_0w_interleaved,
851 t.report(
"Mutate edge weight via first partial weight"),
852 [](graph_t g) -> graph_t {
853 g.mutate_edge_weight(++g.cbegin_edges(0), [](
double& x) { x += 1.0; });
859 weighted_graph_description::node_0w_0_interleaved,
860 graph_description::node_0_0_interleaved,
861 t.report(
"Mutate edge weight via second partial weight"),
862 [](graph_t g) -> graph_t {
863 g.mutate_edge_weight(g.cbegin_edges(0) + 2, [](
double& x) { x -= 1.0; });
869 weighted_graph_description::node_0w_0_interleaved,
870 weighted_graph_description::node_0w_0w_interleaved,
871 t.report(
"Mutate edge weight via third partial weight"),
872 [](graph_t g) -> graph_t {
873 g.mutate_edge_weight(g.cbegin_edges(0) + 3, [](
double& x) { x += 1.0; });
883 weighted_graph_description::node_nodew,
884 weighted_graph_description::nodew_node,
885 t.report(
"Swap nodes"),
886 [](graph_t g) -> graph_t {
897 weighted_graph_description::nodew_node,
898 weighted_graph_description::node_nodew,
899 t.report(
"Swap nodes"),
900 [](graph_t g) -> graph_t {
911 weighted_graph_description::node_1_nodew_0,
912 weighted_graph_description::nodew_1_node_0,
913 t.report(
"Swap nodes"),
914 [](graph_t g) -> graph_t {
925 weighted_graph_description::nodew_1_node_0,
926 weighted_graph_description::node_1_nodew_0,
927 t.report(
"Swap nodes"),
928 [](graph_t g) -> graph_t {
939 weighted_graph_description::node_1_1w_node_0_0w,
940 weighted_graph_description::node_1w_1w_node_0w_0w,
941 t.report(
"Set edge weight {0, 1}"),
942 [](graph_t g) -> graph_t {
943 g.set_edge_weight(g.cbegin_edges(0), 1.0);
949 weighted_graph_description::node_1_1w_node_0_0w,
950 weighted_graph_description::node_1w_1w_node_0w_0w,
951 t.report(
"Set edge weight {1, 0}"),
952 [](graph_t g) -> graph_t {
953 g.set_edge_weight(g.cbegin_edges(1), 1.0);
963 weighted_graph_description::node_1w_1w_node_0w_0w,
964 weighted_graph_description::node_1_1w_node_0_0w,
965 t.report(
"Set edge weight {0, 1}"),
966 [](graph_t g) -> graph_t {
967 g.set_edge_weight(g.cbegin_edges(0), 0.0);
973 weighted_graph_description::node_1w_1w_node_0w_0w,
974 weighted_graph_description::node_1_1w_node_0_0w,
975 t.report(
"Set edge weight {1, 0}"),
976 [](graph_t g) -> graph_t {
977 g.set_edge_weight(g.cbegin_edges(1), 0.0);
983 weighted_graph_description::node_1w_1w_node_0w_0w,
984 weighted_graph_description::node_1_1w_node_0_0w,
985 t.report(
"Mutate edge weight {0, 1}"),
986 [](graph_t g) -> graph_t {
987 g.mutate_edge_weight(g.cbegin_edges(0), [](
double& x){ x -= 1.0; });
993 weighted_graph_description::node_1w_1w_node_0w_0w,
994 weighted_graph_description::node_1_1w_node_0_0w,
995 t.report(
"Mutate edge weight {1, 0}"),
996 [](graph_t g) -> graph_t {
997 g.mutate_edge_weight(g.cbegin_edges(1), [](
double& x){ x -= 1.0; });
1007 weighted_graph_description::node_1_1w_1x_node_0_0w_0x,
1008 weighted_graph_description::node_0y_1_1w_1x_node_0_0w_0x,
1009 t.report(
"Join {0,0} and sort"),
1010 [](graph_t g) -> graph_t {
1011 g.insert_join(g.cbegin_edges(0), 1, 3.0);
1021 weighted_graph_description::node_0y_1_1w_1x_node_0_0w_0x,
1022 weighted_graph_description::node_1_1w_1x_node_0_0w_0x,
1023 t.report(
"Remove zeroth partial edge"),
1024 [](graph_t g) -> graph_t {
1025 g.erase_edge(g.cbegin_edges(0));
1031 weighted_graph_description::node_0y_1_1w_1x_node_0_0w_0x,
1032 weighted_graph_description::node_1_1w_1x_node_0_0w_0x,
1033 t.report(
"Remove first partial edge"),
1034 [](graph_t g) -> graph_t {
1035 g.erase_edge(++g.cbegin_edges(0));
weighted_graph_description
Convention: the indices following 'node' - separated by underscores - give the target node of the ass...
Definition: DynamicUndirectedEmbeddedGraphWeightedTestingUtilities.hpp:18
Definition: DynamicGraph.hpp:303
Definition: DynamicGraph.hpp:473
class template from which all concrete tests should derive.
Definition: FreeTestCore.hpp:144
Exposes elementary check methods, with the option to plug in arbitrary Extenders to compose functiona...
Definition: FreeCheckers.hpp:708
Definition: DynamicUndirectedEmbeddedGraphTestingUtilities.hpp:215
Definition: DynamicUndirectedEmbeddedGraphWeightedTestingUtilities.hpp:111
Definition: DynamicGraphTestingUtilities.hpp:173
Definition: StateTransitionUtilities.hpp:77