|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Comprehensive tests for Floyd-Warshall algorithm (latex_floyd.H) More...
#include <gtest/gtest.h>#include <sstream>#include <fstream>#include <limits>#include <cmath>#include <filesystem>#include <unistd.h>#include <tpl_graph.H>#include <tpl_sgraph.H>#include <tpl_agraph.H>#include <tpl_matgraph.H>#include <latex_floyd.H>#include <mat_path.H>Go to the source code of this file.
Classes | |
| struct | DistanceArc |
| Arc info type with required Distance_Type and constants. More... | |
| struct | IntDistanceArc |
| Integer distance arc type. More... | |
| class | FloydSimpleGraphTest |
| Test fixture with a simple weighted graph. More... | |
| class | FloydIntGraphTest |
| Test fixture with integer weights. More... | |
| struct | TestIndexFormatter< Mat > |
| Index formatter: takes matrix and index, returns string. More... | |
| struct | TestPathFormatter< Mat > |
| Path formatter: takes matrix, i, j indices, returns formatted entry. More... | |
| struct | TestDistFormatter< Mat > |
| Distance formatter: takes matrix, i, j indices, returns formatted entry. More... | |
| struct | MaxCompare |
| struct | MinPlus |
| class | ParallelArcsTest< GT > |
Typedefs | |
| using | ParallelArcsGraphs = Types< List_Digraph< Graph_Node< int >, Graph_Arc< IntDistanceArc > >, List_Graph< Graph_Node< int >, Graph_Arc< IntDistanceArc > >, List_SDigraph< Graph_Snode< int >, Graph_Sarc< IntDistanceArc > >, List_SGraph< Graph_Snode< int >, Graph_Sarc< IntDistanceArc > >, Array_Digraph< Graph_Anode< int >, Graph_Aarc< IntDistanceArc > >, Array_Graph< Graph_Anode< int >, Graph_Aarc< IntDistanceArc > > > |
Functions | |
| TEST_F (FloydSimpleGraphTest, DiagonalIsZero) | |
| TEST_F (FloydSimpleGraphTest, DirectEdgeDistance) | |
| TEST_F (FloydSimpleGraphTest, ShortestPathOverMultipleEdges) | |
| TEST_F (FloydSimpleGraphTest, ShortestPathToLastNode) | |
| TEST_F (FloydSimpleGraphTest, UnreachableNodesHaveInfinity) | |
| TEST_F (FloydIntGraphTest, SymmetricGraph) | |
| TEST_F (FloydIntGraphTest, ShortcutUsed) | |
| TEST_F (FloydSimpleGraphTest, PathReconstructionSameNode) | |
| TEST_F (FloydSimpleGraphTest, PathReconstructionDirectEdge) | |
| TEST_F (FloydSimpleGraphTest, PathReconstructionMultipleEdges) | |
| TEST_F (FloydIntGraphTest, LatexOutputContainsBeginFigure) | |
| TEST_F (FloydIntGraphTest, LatexOutputContainsMatrices) | |
| TEST_F (FloydIntGraphTest, LatexOutputHasCorrectNumberOfIterations) | |
| TEST (SingleNodeTest, FloydOnSingleNode) | |
| TEST (TwoNodeTest, FloydOnTwoNodes) | |
| TEST (DisconnectedGraphTest, FloydOnDisconnectedGraph) | |
| TEST (DisconnectedGraphTest, UnreachableStaysInfinityWithNegativeEdges) | |
| TEST (CompleteGraphTest, FloydOnCompleteGraph) | |
| TEST (CustomSemiringTest, MaxMinSemiring) | |
| TEST (StressTest, FloydOnLargerGraph) | |
| TEST_F (FloydIntGraphTest, PathMatrixPointsToNextHop) | |
| TEST_F (FloydSimpleGraphTest, DistanceMatrixTriangleInequality) | |
| TEST_F (FloydIntGraphTest, InitializationSetsEdgeWeightsCorrectly) | |
| TEST (NegativeWeightsTest, FloydWithNegativeWeights) | |
| TEST (DenseGraphTest, FloydOnDenseGraph) | |
| TYPED_TEST_SUITE (ParallelArcsTest, ParallelArcsGraphs) | |
| TYPED_TEST (ParallelArcsTest, TheLightestArcCounts) | |
| TYPED_TEST (ParallelArcsTest, TheLatexVariantCountsTheSameArcs) | |
| TYPED_TEST (ParallelArcsTest, InitializeDistTakesTheLightestArc) | |
| TYPED_TEST (ParallelArcsTest, LoopsDoNotCount) | |
| TEST (MatPathTest, FindMinPathThrowsWithoutAnArc) | |
| TEST (MatPathTest, FindMinPathWithArcsWithoutDistances) | |
| TEST (MatPathTest, FindMinPathTakesTheLightestByItsCompare) | |
Comprehensive tests for Floyd-Warshall algorithm (latex_floyd.H)
Tests cover:
Definition in file latex_floyd_test.cc.
| using ParallelArcsGraphs = Types<List_Digraph<Graph_Node<int>, Graph_Arc<IntDistanceArc> >, List_Graph<Graph_Node<int>, Graph_Arc<IntDistanceArc> >, List_SDigraph<Graph_Snode<int>, Graph_Sarc<IntDistanceArc> >, List_SGraph<Graph_Snode<int>, Graph_Sarc<IntDistanceArc> >, Array_Digraph<Graph_Anode<int>, Graph_Aarc<IntDistanceArc> >, Array_Graph<Graph_Anode<int>, Graph_Aarc<IntDistanceArc> >> |
Definition at line 973 of file latex_floyd_test.cc.
| TEST | ( | CompleteGraphTest | , |
| FloydOnCompleteGraph | |||
| ) |
Definition at line 632 of file latex_floyd_test.cc.
References Aleph::floyd_all_shortest_paths(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), N, and nodes.
| TEST | ( | CustomSemiringTest | , |
| MaxMinSemiring | |||
| ) |
Definition at line 680 of file latex_floyd_test.cc.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node().
| TEST | ( | DenseGraphTest | , |
| FloydOnDenseGraph | |||
| ) |
Definition at line 866 of file latex_floyd_test.cc.
References Aleph::floyd_all_shortest_paths(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), IntDistanceArc::Max_Distance, N, and nodes.
| TEST | ( | DisconnectedGraphTest | , |
| FloydOnDisconnectedGraph | |||
| ) |
Definition at line 554 of file latex_floyd_test.cc.
References Aleph::floyd_all_shortest_paths(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), and IntDistanceArc::Max_Distance.
| TEST | ( | DisconnectedGraphTest | , |
| UnreachableStaysInfinityWithNegativeEdges | |||
| ) |
Definition at line 593 of file latex_floyd_test.cc.
References Aleph::floyd_all_shortest_paths(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), and IntDistanceArc::Max_Distance.
| TEST | ( | MatPathTest | , |
| FindMinPathTakesTheLightestByItsCompare | |||
| ) |
Definition at line 1150 of file latex_floyd_test.cc.
References Aleph::find_min_path(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node().
| TEST | ( | MatPathTest | , |
| FindMinPathThrowsWithoutAnArc | |||
| ) |
Definition at line 1103 of file latex_floyd_test.cc.
References Aleph::find_min_path(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node().
| TEST | ( | MatPathTest | , |
| FindMinPathWithArcsWithoutDistances | |||
| ) |
Definition at line 1118 of file latex_floyd_test.cc.
References Aleph::find_min_path(), Aleph::Path< GT >::get_first_node(), Aleph::Path< GT >::get_last_node(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), r, and Aleph::Path< GT >::size().
| TEST | ( | NegativeWeightsTest | , |
| FloydWithNegativeWeights | |||
| ) |
Definition at line 830 of file latex_floyd_test.cc.
References Aleph::floyd_all_shortest_paths(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node().
| TEST | ( | SingleNodeTest | , |
| FloydOnSingleNode | |||
| ) |
Definition at line 511 of file latex_floyd_test.cc.
References Aleph::floyd_all_shortest_paths(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node().
| TEST | ( | StressTest | , |
| FloydOnLargerGraph | |||
| ) |
Definition at line 711 of file latex_floyd_test.cc.
References Aleph::floyd_all_shortest_paths(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), m, N, and nodes.
| TEST | ( | TwoNodeTest | , |
| FloydOnTwoNodes | |||
| ) |
Definition at line 527 of file latex_floyd_test.cc.
References Aleph::floyd_all_shortest_paths(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), and IntDistanceArc::Max_Distance.
| TEST_F | ( | FloydIntGraphTest | , |
| InitializationSetsEdgeWeightsCorrectly | |||
| ) |
Definition at line 801 of file latex_floyd_test.cc.
References Aleph::floyd_all_shortest_paths(), and IntDistanceArc::Max_Distance.
| TEST_F | ( | FloydIntGraphTest | , |
| LatexOutputContainsBeginFigure | |||
| ) |
Definition at line 428 of file latex_floyd_test.cc.
References Aleph::floyd_all_shortest_paths_latex(), and output.
| TEST_F | ( | FloydIntGraphTest | , |
| LatexOutputContainsMatrices | |||
| ) |
Definition at line 453 of file latex_floyd_test.cc.
References Aleph::floyd_all_shortest_paths_latex(), and output.
| TEST_F | ( | FloydIntGraphTest | , |
| LatexOutputHasCorrectNumberOfIterations | |||
| ) |
Definition at line 479 of file latex_floyd_test.cc.
References Aleph::floyd_all_shortest_paths_latex(), output, and Aleph::to_string().
| TEST_F | ( | FloydIntGraphTest | , |
| PathMatrixPointsToNextHop | |||
| ) |
Definition at line 752 of file latex_floyd_test.cc.
References Aleph::floyd_all_shortest_paths(), IntDistanceArc::Max_Distance, and Aleph::next().
| TEST_F | ( | FloydIntGraphTest | , |
| ShortcutUsed | |||
| ) |
Definition at line 315 of file latex_floyd_test.cc.
References Aleph::floyd_all_shortest_paths().
| TEST_F | ( | FloydIntGraphTest | , |
| SymmetricGraph | |||
| ) |
Definition at line 299 of file latex_floyd_test.cc.
References Aleph::floyd_all_shortest_paths().
| TEST_F | ( | FloydSimpleGraphTest | , |
| DiagonalIsZero | |||
| ) |
Definition at line 229 of file latex_floyd_test.cc.
References Aleph::floyd_all_shortest_paths().
| TEST_F | ( | FloydSimpleGraphTest | , |
| DirectEdgeDistance | |||
| ) |
Definition at line 242 of file latex_floyd_test.cc.
References Aleph::floyd_all_shortest_paths().
| TEST_F | ( | FloydSimpleGraphTest | , |
| DistanceMatrixTriangleInequality | |||
| ) |
Definition at line 775 of file latex_floyd_test.cc.
References Aleph::floyd_all_shortest_paths(), and k.
| TEST_F | ( | FloydSimpleGraphTest | , |
| PathReconstructionDirectEdge | |||
| ) |
Definition at line 354 of file latex_floyd_test.cc.
References Aleph::find_min_path(), Aleph::floyd_all_shortest_paths(), and Aleph::Path< GT >::size().
| TEST_F | ( | FloydSimpleGraphTest | , |
| PathReconstructionMultipleEdges | |||
| ) |
Definition at line 371 of file latex_floyd_test.cc.
References Aleph::find_min_path(), Aleph::floyd_all_shortest_paths(), and Aleph::Path< GT >::size().
| TEST_F | ( | FloydSimpleGraphTest | , |
| PathReconstructionSameNode | |||
| ) |
Definition at line 338 of file latex_floyd_test.cc.
References Aleph::find_min_path(), Aleph::floyd_all_shortest_paths(), and Aleph::Path< GT >::size().
| TEST_F | ( | FloydSimpleGraphTest | , |
| ShortestPathOverMultipleEdges | |||
| ) |
Definition at line 257 of file latex_floyd_test.cc.
References Aleph::floyd_all_shortest_paths().
| TEST_F | ( | FloydSimpleGraphTest | , |
| ShortestPathToLastNode | |||
| ) |
Definition at line 271 of file latex_floyd_test.cc.
References Aleph::floyd_all_shortest_paths().
| TEST_F | ( | FloydSimpleGraphTest | , |
| UnreachableNodesHaveInfinity | |||
| ) |
Definition at line 285 of file latex_floyd_test.cc.
References Aleph::floyd_all_shortest_paths().
| TYPED_TEST | ( | ParallelArcsTest | , |
| InitializeDistTakesTheLightestArc | |||
| ) |
Definition at line 1048 of file latex_floyd_test.cc.
References GraphCommon< GT, Node, Arc >::is_digraph(), and IntDistanceArc::Max_Distance.
| TYPED_TEST | ( | ParallelArcsTest | , |
| LoopsDoNotCount | |||
| ) |
| TYPED_TEST | ( | ParallelArcsTest | , |
| TheLatexVariantCountsTheSameArcs | |||
| ) |
Definition at line 1016 of file latex_floyd_test.cc.
References Aleph::floyd_all_shortest_paths(), Aleph::floyd_all_shortest_paths_latex(), and output.
| TYPED_TEST | ( | ParallelArcsTest | , |
| TheLightestArcCounts | |||
| ) |
Definition at line 983 of file latex_floyd_test.cc.
References Aleph::find_min_path(), Aleph::floyd_all_shortest_paths(), GraphCommon< GT, Node, Arc >::is_digraph(), IntDistanceArc::Max_Distance, and Aleph::Path< GT >::size().
| TYPED_TEST_SUITE | ( | ParallelArcsTest | , |
| ParallelArcsGraphs | |||
| ) |