Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
tpl_mincost_test.cc File Reference
#include <array>
#include <string>
#include <limits>
#include <utility>
#include <vector>
#include <gtest/gtest.h>
#include <tpl_mincost.H>
#include <tpl_netcost.H>
Include dependency graph for tpl_mincost_test.cc:

Go to the source code of this file.

Functions

 TEST (SSPTest, SimplePath)
 
 TEST (SSPTest, DiamondNetwork)
 
 TEST (SSPTest, CrossNetwork)
 
 TEST (SSPTest, ParallelPaths)
 
 TEST (SSPTest, LargeCosts)
 
 TEST (SSPTest, SingleArc)
 
 TEST (SSPTest, ZeroCapacity)
 
 TEST (SSPTest, FunctorInterface)
 
 TEST (SSPTest, CompareWithCycleCanceling)
 
 TEST (AlgorithmComparisonTest, SSP_vs_CycleCanceling_Diamond)
 
 TEST (AlgorithmComparisonTest, SSP_vs_CycleCanceling_CrossNetwork)
 
 TEST (PerformanceTest, SSP_vs_CycleCanceling_OnLargerNetwork)
 
 TEST (AssignmentTest, Basic3x3)
 
 TEST (AssignmentTest, Single1x1)
 
 TEST (AssignmentTest, Empty)
 
 TEST (AssignmentTest, Larger5x5)
 
 TEST (TransportationTest, Balanced)
 
 TEST (TransportationTest, Imbalanced)
 
 TEST (TransportationTest, Larger3x4)
 
 TEST (TransportationTest, NotSquareKeepsRowsColumnsAndCost)
 
 TEST (NegCycleTest, RejectsNegativeCycle)
 
 TEST (NegCycleTest, AcceptsNonNegativeCostNetwork)
 
 TEST (NegCycleTest, RejectsANegativeCycleApartFromTheSource)
 
 TEST (SSPTest, ASourceThatIsTheSinkEnds)
 
TestNet build_tenths_network (const std::vector< std::array< int, 4 > > &spec, int n)
 
 TEST (SSPTest, DecimalCostsEnd)
 
 TEST (SSPTest, ASecondRunOfDecimalCostsFindsNoNegativeCycle)
 
 TEST (SSPTest, RunsOnTheCheapestFlowOfTheNetworkSimplex)
 
 TEST (SSPTest, DecimalCapacitiesStayWithinTheArcs)
 
 TEST (SSPTest, RefusesACycleOfCost1e7)
 
 TEST (SSPTest, RefusesAnInfiniteMaximumFlow)
 
 TEST (SSPTest, ReturnsTheResiduesOfItsPaths)
 
 TEST (SSPTest, ZeroDemandNodesHandledGracefully)
 
 TEST (AssignmentValidationTest, NonSquareMatrixThrows)
 
 TEST (AssignmentValidationTest, EmptyMatrixReturnsFeasible)
 
 TEST (TransportationValidationTest, MismatchedRowsThrows)
 
 TEST (TransportationValidationTest, MismatchedColumnsThrows)
 
 TEST (TransportationValidationTest, NegativeSupplyThrows)
 
 TEST (TransportationValidationTest, NegativeDemandThrows)
 
 TEST (TransportationValidationTest, EmptySuppliesNonemptyDemandsInfeasible)
 
 TEST (TransportationValidationTest, EmptySuppliesZeroDemandFeasible)
 
 TEST (TransportationValidationTest, BothEmptyFeasible)
 
int main (int argc, char **argv)
 

Function Documentation

◆ build_tenths_network()

TestNet build_tenths_network ( const std::vector< std::array< int, 4 > > &  spec,
int  n 
)

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 905 of file tpl_mincost_test.cc.

◆ TEST() [1/41]

TEST ( AlgorithmComparisonTest  ,
SSP_vs_CycleCanceling_CrossNetwork   
)

◆ TEST() [2/41]

TEST ( AlgorithmComparisonTest  ,
SSP_vs_CycleCanceling_Diamond   
)

◆ TEST() [3/41]

TEST ( AssignmentTest  ,
Basic3x3   
)

Definition at line 369 of file tpl_mincost_test.cc.

References Aleph::solve_assignment().

◆ TEST() [4/41]

TEST ( AssignmentTest  ,
Empty   
)

Definition at line 395 of file tpl_mincost_test.cc.

References Aleph::solve_assignment().

◆ TEST() [5/41]

TEST ( AssignmentTest  ,
Larger5x5   
)

Definition at line 405 of file tpl_mincost_test.cc.

References Aleph::solve_assignment().

◆ TEST() [6/41]

TEST ( AssignmentTest  ,
Single1x1   
)

Definition at line 384 of file tpl_mincost_test.cc.

References Aleph::solve_assignment().

◆ TEST() [7/41]

TEST ( AssignmentValidationTest  ,
EmptyMatrixReturnsFeasible   
)

Definition at line 831 of file tpl_mincost_test.cc.

References Aleph::solve_assignment().

◆ TEST() [8/41]

TEST ( AssignmentValidationTest  ,
NonSquareMatrixThrows   
)

Definition at line 825 of file tpl_mincost_test.cc.

References Aleph::solve_assignment().

◆ TEST() [9/41]

TEST ( NegCycleTest  ,
AcceptsNonNegativeCostNetwork   
)

◆ TEST() [10/41]

TEST ( NegCycleTest  ,
RejectsANegativeCycleApartFromTheSource   
)

◆ TEST() [11/41]

TEST ( NegCycleTest  ,
RejectsNegativeCycle   
)

◆ TEST() [12/41]

◆ TEST() [13/41]

TEST ( SSPTest  ,
ASecondRunOfDecimalCostsFindsNoNegativeCycle   
)

◆ TEST() [14/41]

TEST ( SSPTest  ,
ASourceThatIsTheSinkEnds   
)

◆ TEST() [15/41]

TEST ( SSPTest  ,
CompareWithCycleCanceling   
)

◆ TEST() [16/41]

TEST ( SSPTest  ,
CrossNetwork   
)

◆ TEST() [17/41]

◆ TEST() [18/41]

TEST ( SSPTest  ,
DecimalCostsEnd   
)

◆ TEST() [19/41]

TEST ( SSPTest  ,
DiamondNetwork   
)

◆ TEST() [20/41]

TEST ( SSPTest  ,
FunctorInterface   
)

Definition at line 207 of file tpl_mincost_test.cc.

◆ TEST() [21/41]

◆ TEST() [22/41]

TEST ( SSPTest  ,
ParallelPaths   
)

◆ TEST() [23/41]

TEST ( SSPTest  ,
RefusesACycleOfCost1e7   
)

◆ TEST() [24/41]

TEST ( SSPTest  ,
RefusesAnInfiniteMaximumFlow   
)

◆ TEST() [25/41]

◆ TEST() [26/41]

◆ TEST() [27/41]

TEST ( SSPTest  ,
SimplePath   
)

◆ TEST() [28/41]

◆ TEST() [29/41]

◆ TEST() [30/41]

TEST ( SSPTest  ,
ZeroDemandNodesHandledGracefully   
)

Definition at line 808 of file tpl_mincost_test.cc.

References Aleph::solve_transportation().

◆ TEST() [31/41]

TEST ( TransportationTest  ,
Balanced   
)

Definition at line 427 of file tpl_mincost_test.cc.

References Aleph::solve_transportation().

◆ TEST() [32/41]

TEST ( TransportationTest  ,
Imbalanced   
)

Definition at line 442 of file tpl_mincost_test.cc.

References Aleph::solve_transportation().

◆ TEST() [33/41]

TEST ( TransportationTest  ,
Larger3x4   
)

Definition at line 457 of file tpl_mincost_test.cc.

References Aleph::solve_transportation().

◆ TEST() [34/41]

TEST ( TransportationTest  ,
NotSquareKeepsRowsColumnsAndCost   
)

Definition at line 486 of file tpl_mincost_test.cc.

References row, and Aleph::solve_transportation().

◆ TEST() [35/41]

TEST ( TransportationValidationTest  ,
BothEmptyFeasible   
)

Definition at line 896 of file tpl_mincost_test.cc.

References Aleph::solve_transportation().

◆ TEST() [36/41]

TEST ( TransportationValidationTest  ,
EmptySuppliesNonemptyDemandsInfeasible   
)

Definition at line 876 of file tpl_mincost_test.cc.

References Aleph::solve_transportation().

◆ TEST() [37/41]

TEST ( TransportationValidationTest  ,
EmptySuppliesZeroDemandFeasible   
)

Definition at line 886 of file tpl_mincost_test.cc.

References Aleph::solve_transportation().

◆ TEST() [38/41]

TEST ( TransportationValidationTest  ,
MismatchedColumnsThrows   
)

Definition at line 849 of file tpl_mincost_test.cc.

References Aleph::solve_transportation().

◆ TEST() [39/41]

TEST ( TransportationValidationTest  ,
MismatchedRowsThrows   
)

Definition at line 840 of file tpl_mincost_test.cc.

References Aleph::solve_transportation().

◆ TEST() [40/41]

TEST ( TransportationValidationTest  ,
NegativeDemandThrows   
)

Definition at line 866 of file tpl_mincost_test.cc.

References Aleph::solve_transportation().

◆ TEST() [41/41]

TEST ( TransportationValidationTest  ,
NegativeSupplyThrows   
)

Definition at line 858 of file tpl_mincost_test.cc.

References Aleph::solve_transportation().