Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
latex_floyd_test.cc File Reference

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>
Include dependency graph for latex_floyd_test.cc:

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)
 

Detailed Description

Comprehensive tests for Floyd-Warshall algorithm (latex_floyd.H)

Tests cover:

Definition in file latex_floyd_test.cc.

Typedef Documentation

◆ ParallelArcsGraphs

Function Documentation

◆ TEST() [1/12]

◆ TEST() [2/12]

TEST ( CustomSemiringTest  ,
MaxMinSemiring   
)

◆ TEST() [3/12]

◆ TEST() [4/12]

◆ TEST() [5/12]

◆ TEST() [6/12]

TEST ( MatPathTest  ,
FindMinPathTakesTheLightestByItsCompare   
)

◆ TEST() [7/12]

TEST ( MatPathTest  ,
FindMinPathThrowsWithoutAnArc   
)

◆ TEST() [8/12]

◆ TEST() [9/12]

TEST ( NegativeWeightsTest  ,
FloydWithNegativeWeights   
)

◆ TEST() [10/12]

TEST ( SingleNodeTest  ,
FloydOnSingleNode   
)

◆ TEST() [11/12]

◆ TEST() [12/12]

◆ TEST_F() [1/16]

TEST_F ( FloydIntGraphTest  ,
InitializationSetsEdgeWeightsCorrectly   
)

◆ TEST_F() [2/16]

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() [3/16]

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() [4/16]

TEST_F ( FloydIntGraphTest  ,
LatexOutputHasCorrectNumberOfIterations   
)

◆ TEST_F() [5/16]

TEST_F ( FloydIntGraphTest  ,
PathMatrixPointsToNextHop   
)

◆ TEST_F() [6/16]

TEST_F ( FloydIntGraphTest  ,
ShortcutUsed   
)

Definition at line 315 of file latex_floyd_test.cc.

References Aleph::floyd_all_shortest_paths().

◆ TEST_F() [7/16]

TEST_F ( FloydIntGraphTest  ,
SymmetricGraph   
)

Definition at line 299 of file latex_floyd_test.cc.

References Aleph::floyd_all_shortest_paths().

◆ TEST_F() [8/16]

TEST_F ( FloydSimpleGraphTest  ,
DiagonalIsZero   
)

Definition at line 229 of file latex_floyd_test.cc.

References Aleph::floyd_all_shortest_paths().

◆ TEST_F() [9/16]

TEST_F ( FloydSimpleGraphTest  ,
DirectEdgeDistance   
)

Definition at line 242 of file latex_floyd_test.cc.

References Aleph::floyd_all_shortest_paths().

◆ TEST_F() [10/16]

TEST_F ( FloydSimpleGraphTest  ,
DistanceMatrixTriangleInequality   
)

Definition at line 775 of file latex_floyd_test.cc.

References Aleph::floyd_all_shortest_paths(), and k.

◆ TEST_F() [11/16]

TEST_F ( FloydSimpleGraphTest  ,
PathReconstructionDirectEdge   
)

◆ TEST_F() [12/16]

TEST_F ( FloydSimpleGraphTest  ,
PathReconstructionMultipleEdges   
)

◆ TEST_F() [13/16]

TEST_F ( FloydSimpleGraphTest  ,
PathReconstructionSameNode   
)

◆ TEST_F() [14/16]

TEST_F ( FloydSimpleGraphTest  ,
ShortestPathOverMultipleEdges   
)

Definition at line 257 of file latex_floyd_test.cc.

References Aleph::floyd_all_shortest_paths().

◆ TEST_F() [15/16]

TEST_F ( FloydSimpleGraphTest  ,
ShortestPathToLastNode   
)

Definition at line 271 of file latex_floyd_test.cc.

References Aleph::floyd_all_shortest_paths().

◆ TEST_F() [16/16]

TEST_F ( FloydSimpleGraphTest  ,
UnreachableNodesHaveInfinity   
)

Definition at line 285 of file latex_floyd_test.cc.

References Aleph::floyd_all_shortest_paths().

◆ TYPED_TEST() [1/4]

TYPED_TEST ( ParallelArcsTest  ,
InitializeDistTakesTheLightestArc   
)

◆ TYPED_TEST() [2/4]

◆ TYPED_TEST() [3/4]

TYPED_TEST ( ParallelArcsTest  ,
TheLatexVariantCountsTheSameArcs   
)

◆ TYPED_TEST() [4/4]

◆ TYPED_TEST_SUITE()

TYPED_TEST_SUITE ( ParallelArcsTest  ,
ParallelArcsGraphs   
)