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

Tests for Simplex. More...

#include <gtest/gtest.h>
#include <Simplex.H>
#include <cmath>
Include dependency graph for Simplex_test.cc:

Go to the source code of this file.

Classes

class  SimplexTest
 
class  RevisedSimplexTest
 
class  NonStandardConstraintsTest
 
class  MinimizationTest
 

Functions

 TEST_F (SimplexTest, ConstructorBasic)
 
 TEST_F (SimplexTest, ConstructorZeroVariablesThrows)
 
 TEST_F (SimplexTest, ConstructorSingleVariable)
 
 TEST_F (SimplexTest, ConstructorLargeNumber)
 
 TEST_F (SimplexTest, SetObjectiveCoefficient)
 
 TEST_F (SimplexTest, SetObjectiveCoefficientOutOfRangeThrows)
 
 TEST_F (SimplexTest, GetObjectiveCoefficientOutOfRangeThrows)
 
 TEST_F (SimplexTest, SetObjectiveFunctionFromArray)
 
 TEST_F (SimplexTest, SetObjectiveFunctionFromDynArray)
 
 TEST_F (SimplexTest, GetObjectiveFunctionPointer)
 
 TEST_F (SimplexTest, AddRestrictionFromArray)
 
 TEST_F (SimplexTest, AddMultipleRestrictions)
 
 TEST_F (SimplexTest, AddEmptyRestriction)
 
 TEST_F (SimplexTest, ModifyRestrictionAfterAdd)
 
 TEST_F (SimplexTest, GetRestrictionOutOfRangeThrows)
 
 TEST_F (SimplexTest, GetRestrictionCoef)
 
 TEST_F (SimplexTest, PutRestrictionCoef)
 
 TEST_F (SimplexTest, AddRestrictionFromDynArray)
 
 TEST_F (SimplexTest, SolveWithoutRestrictionThrows)
 
 TEST_F (SimplexTest, SolveWithoutPrepareThrows)
 
 TEST_F (SimplexTest, SolveTwiceThrows)
 
 TEST_F (SimplexTest, SimpleMaximization)
 
 TEST_F (SimplexTest, ThreeVariableProblem)
 
 TEST_F (SimplexTest, ProductMixProblem)
 
 TEST_F (SimplexTest, DietProblem)
 
 TEST_F (SimplexTest, TransportationVariant)
 
 TEST_F (SimplexTest, SingleVariableSingleConstraint)
 
 TEST_F (SimplexTest, ZeroObjectiveCoefficient)
 
 TEST_F (SimplexTest, TightConstraints)
 
 TEST_F (SimplexTest, RedundantConstraint)
 
 TEST_F (SimplexTest, FractionalSolution)
 
 TEST_F (SimplexTest, FloatType)
 
 TEST_F (SimplexTest, StateTransitions)
 
 TEST_F (SimplexTest, VerifySolutionTrue)
 
 TEST_F (SimplexTest, GetNumVars)
 
 TEST_F (SimplexTest, GetNumRestrictions)
 
 TEST_F (SimplexTest, MediumSizeProblem)
 
 TEST_F (SimplexTest, SmallCoefficients)
 
 TEST_F (SimplexTest, LargeCoefficients)
 
 TEST_F (SimplexTest, MinimizationModeAPI)
 
 TEST_F (SimplexTest, EqualityConstraintSimulated)
 
 TEST_F (SimplexTest, ConstraintTypesAPI)
 
 TEST_F (SimplexTest, StatisticsTracking)
 
 TEST_F (SimplexTest, BlandRuleEnabled)
 
 TEST_F (SimplexTest, SensitivityAnalysisObjective)
 
 TEST_F (SimplexTest, ShadowPrices)
 
 TEST_F (SimplexTest, ReducedCosts)
 
 TEST_F (SimplexTest, DualSimplexReoptimize)
 
 TEST_F (SimplexTest, LargeDegenerateProblem)
 
 TEST_F (SimplexTest, SetMinimizeMaximize)
 
 TEST_F (SimplexTest, IsBasicVariable)
 
 TEST_F (RevisedSimplexTest, BasicConstructor)
 
 TEST_F (RevisedSimplexTest, SimpleMaximization)
 
 TEST_F (RevisedSimplexTest, ThreeVariables)
 
 TEST_F (RevisedSimplexTest, CompareWithStandardSimplex)
 
 TEST_F (RevisedSimplexTest, MediumSizeProblem)
 
 TEST_F (RevisedSimplexTest, StatisticsTracking)
 
 TEST_F (RevisedSimplexTest, PerformanceBenchmark)
 
 TEST_F (NonStandardConstraintsTest, GreaterThanOrEqualConstraints)
 
 TEST_F (NonStandardConstraintsTest, EqualityConstraints)
 
 TEST_F (NonStandardConstraintsTest, MixedConstraintTypes)
 
 TEST_F (NonStandardConstraintsTest, MultipleEqualityConstraints)
 
 TEST_F (NonStandardConstraintsTest, InfeasibleWithGEConstraints)
 
 TEST_F (MinimizationTest, BasicMinimization)
 
 TEST_F (MinimizationTest, DietProblem)
 
 TEST_F (MinimizationTest, TransportationCostMinimization)
 
 TEST_F (MinimizationTest, SetMinimizeMethod)
 
 TEST_F (MinimizationTest, MinimizationWithEquality)
 
 TEST_F (MinimizationTest, CompareMinimizeVsNegatedMaximize)
 
int main (int argc, char **argv)
 

Detailed Description

Tests for Simplex.

Comprehensive test suite for Simplex.H.

Tests all aspects of the Simplex linear programming solver including:

  • Constructor and initialization
  • Objective function setup
  • Constraint management
  • Solution algorithm
  • Edge cases and error handling
  • Classic linear programming problems

Definition in file Simplex_test.cc.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 1883 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [1/69]

TEST_F ( MinimizationTest  ,
BasicMinimization   
)

Definition at line 1661 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [2/69]

TEST_F ( MinimizationTest  ,
CompareMinimizeVsNegatedMaximize   
)

Definition at line 1844 of file Simplex_test.cc.

References Aleph::maps(), Aleph::max_value(), and Aleph::min_value().

◆ TEST_F() [3/69]

TEST_F ( MinimizationTest  ,
DietProblem   
)

Definition at line 1697 of file Simplex_test.cc.

References EPSILON, Aleph::maps(), and y.

◆ TEST_F() [4/69]

TEST_F ( MinimizationTest  ,
MinimizationWithEquality   
)

Definition at line 1804 of file Simplex_test.cc.

References EPSILON, Aleph::maps(), and y.

◆ TEST_F() [5/69]

TEST_F ( MinimizationTest  ,
SetMinimizeMethod   
)

Definition at line 1774 of file Simplex_test.cc.

References EPSILON, Aleph::maps(), and y.

◆ TEST_F() [6/69]

TEST_F ( MinimizationTest  ,
TransportationCostMinimization   
)

Definition at line 1734 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [7/69]

TEST_F ( NonStandardConstraintsTest  ,
EqualityConstraints   
)

Definition at line 1451 of file Simplex_test.cc.

References Aleph::maps(), and Aleph::sum().

◆ TEST_F() [8/69]

TEST_F ( NonStandardConstraintsTest  ,
GreaterThanOrEqualConstraints   
)

Definition at line 1410 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [9/69]

TEST_F ( NonStandardConstraintsTest  ,
InfeasibleWithGEConstraints   
)

Definition at line 1582 of file Simplex_test.cc.

References EPSILON, Aleph::maps(), and y.

◆ TEST_F() [10/69]

TEST_F ( NonStandardConstraintsTest  ,
MixedConstraintTypes   
)

Definition at line 1495 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [11/69]

TEST_F ( NonStandardConstraintsTest  ,
MultipleEqualityConstraints   
)

Definition at line 1538 of file Simplex_test.cc.

References Aleph::maps(), and y.

◆ TEST_F() [12/69]

TEST_F ( RevisedSimplexTest  ,
BasicConstructor   
)

Definition at line 1170 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [13/69]

TEST_F ( RevisedSimplexTest  ,
CompareWithStandardSimplex   
)

Definition at line 1237 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [14/69]

TEST_F ( RevisedSimplexTest  ,
MediumSizeProblem   
)

Definition at line 1278 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [15/69]

TEST_F ( RevisedSimplexTest  ,
PerformanceBenchmark   
)

Definition at line 1325 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [16/69]

TEST_F ( RevisedSimplexTest  ,
SimpleMaximization   
)

Definition at line 1179 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [17/69]

TEST_F ( RevisedSimplexTest  ,
StatisticsTracking   
)

Definition at line 1304 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [18/69]

TEST_F ( RevisedSimplexTest  ,
ThreeVariables   
)

Definition at line 1209 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [19/69]

TEST_F ( SimplexTest  ,
AddEmptyRestriction   
)

Definition at line 199 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [20/69]

TEST_F ( SimplexTest  ,
AddMultipleRestrictions   
)

Definition at line 185 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [21/69]

TEST_F ( SimplexTest  ,
AddRestrictionFromArray   
)

Definition at line 175 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [22/69]

TEST_F ( SimplexTest  ,
AddRestrictionFromDynArray   
)

Definition at line 262 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [23/69]

TEST_F ( SimplexTest  ,
BlandRuleEnabled   
)

Definition at line 955 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [24/69]

TEST_F ( SimplexTest  ,
ConstraintTypesAPI   
)

Definition at line 905 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [25/69]

TEST_F ( SimplexTest  ,
ConstructorBasic   
)

Definition at line 76 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [26/69]

TEST_F ( SimplexTest  ,
ConstructorLargeNumber   
)

Definition at line 96 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [27/69]

TEST_F ( SimplexTest  ,
ConstructorSingleVariable   
)

Definition at line 90 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [28/69]

TEST_F ( SimplexTest  ,
ConstructorZeroVariablesThrows   
)

Definition at line 85 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [29/69]

TEST_F ( SimplexTest  ,
DietProblem   
)

Definition at line 421 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [30/69]

TEST_F ( SimplexTest  ,
DualSimplexReoptimize   
)

Definition at line 1049 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [31/69]

TEST_F ( SimplexTest  ,
EqualityConstraintSimulated   
)

Definition at line 870 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [32/69]

TEST_F ( SimplexTest  ,
FloatType   
)

Definition at line 644 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [33/69]

TEST_F ( SimplexTest  ,
FractionalSolution   
)

Definition at line 604 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [34/69]

TEST_F ( SimplexTest  ,
GetNumRestrictions   
)

Definition at line 723 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [35/69]

TEST_F ( SimplexTest  ,
GetNumVars   
)

Definition at line 717 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [36/69]

TEST_F ( SimplexTest  ,
GetObjectiveCoefficientOutOfRangeThrows   
)

Definition at line 127 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [37/69]

TEST_F ( SimplexTest  ,
GetObjectiveFunctionPointer   
)

Definition at line 161 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [38/69]

TEST_F ( SimplexTest  ,
GetRestrictionCoef   
)

Definition at line 239 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [39/69]

TEST_F ( SimplexTest  ,
GetRestrictionOutOfRangeThrows   
)

Definition at line 229 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [40/69]

TEST_F ( SimplexTest  ,
IsBasicVariable   
)

Definition at line 1135 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [41/69]

TEST_F ( SimplexTest  ,
LargeCoefficients   
)

Definition at line 798 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [42/69]

TEST_F ( SimplexTest  ,
LargeDegenerateProblem   
)

Definition at line 1079 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [43/69]

TEST_F ( SimplexTest  ,
MediumSizeProblem   
)

Definition at line 741 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [44/69]

TEST_F ( SimplexTest  ,
MinimizationModeAPI   
)

Definition at line 826 of file Simplex_test.cc.

References Aleph::maps(), Aleph::max_value(), and Aleph::min_value().

◆ TEST_F() [45/69]

TEST_F ( SimplexTest  ,
ModifyRestrictionAfterAdd   
)

Definition at line 214 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [46/69]

TEST_F ( SimplexTest  ,
ProductMixProblem   
)

Definition at line 388 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [47/69]

TEST_F ( SimplexTest  ,
PutRestrictionCoef   
)

Definition at line 250 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [48/69]

TEST_F ( SimplexTest  ,
ReducedCosts   
)

Definition at line 1029 of file Simplex_test.cc.

References Aleph::maps(), and Aleph::HTList::size().

◆ TEST_F() [49/69]

TEST_F ( SimplexTest  ,
RedundantConstraint   
)

Definition at line 573 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [50/69]

TEST_F ( SimplexTest  ,
SensitivityAnalysisObjective   
)

Definition at line 986 of file Simplex_test.cc.

References Aleph::maps(), and Aleph::range().

◆ TEST_F() [51/69]

TEST_F ( SimplexTest  ,
SetMinimizeMaximize   
)

Definition at line 1122 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [52/69]

TEST_F ( SimplexTest  ,
SetObjectiveCoefficient   
)

Definition at line 106 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [53/69]

TEST_F ( SimplexTest  ,
SetObjectiveCoefficientOutOfRangeThrows   
)

Definition at line 119 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [54/69]

TEST_F ( SimplexTest  ,
SetObjectiveFunctionFromArray   
)

Definition at line 134 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [55/69]

TEST_F ( SimplexTest  ,
SetObjectiveFunctionFromDynArray   
)

Definition at line 146 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [56/69]

TEST_F ( SimplexTest  ,
ShadowPrices   
)

Definition at line 1008 of file Simplex_test.cc.

References Aleph::maps(), and Aleph::HTList::size().

◆ TEST_F() [57/69]

TEST_F ( SimplexTest  ,
SimpleMaximization   
)

Definition at line 319 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [58/69]

TEST_F ( SimplexTest  ,
SingleVariableSingleConstraint   
)

Definition at line 489 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [59/69]

TEST_F ( SimplexTest  ,
SmallCoefficients   
)

Definition at line 775 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [60/69]

TEST_F ( SimplexTest  ,
SolveTwiceThrows   
)

Definition at line 301 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [61/69]

TEST_F ( SimplexTest  ,
SolveWithoutPrepareThrows   
)

Definition at line 290 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [62/69]

TEST_F ( SimplexTest  ,
SolveWithoutRestrictionThrows   
)

Definition at line 281 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [63/69]

TEST_F ( SimplexTest  ,
StateTransitions   
)

Definition at line 670 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [64/69]

TEST_F ( SimplexTest  ,
StatisticsTracking   
)

Definition at line 934 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [65/69]

TEST_F ( SimplexTest  ,
ThreeVariableProblem   
)

Definition at line 354 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [66/69]

TEST_F ( SimplexTest  ,
TightConstraints   
)

Definition at line 540 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [67/69]

TEST_F ( SimplexTest  ,
TransportationVariant   
)

Definition at line 451 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [68/69]

TEST_F ( SimplexTest  ,
VerifySolutionTrue   
)

Definition at line 694 of file Simplex_test.cc.

References Aleph::maps().

◆ TEST_F() [69/69]

TEST_F ( SimplexTest  ,
ZeroObjectiveCoefficient   
)

Definition at line 512 of file Simplex_test.cc.

References Aleph::maps().