Class SimplexSolver
java.lang.Object
org.apache.commons.math3.optimization.linear.AbstractLinearOptimizer
org.apache.commons.math3.optimization.linear.SimplexSolver
- All Implemented Interfaces:
LinearOptimizer
Deprecated.
As of 3.1 (to be removed in 4.0).
Solves a linear problem using the Two-Phase Simplex Method.
- Since:
- 2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final double
Deprecated.Default amount of error to accept for algorithm convergence.private static final int
Deprecated.Default amount of error to accept in floating point comparisons (as ulps).private final double
Deprecated.Amount of error to accept for algorithm convergence.private final int
Deprecated.Amount of error to accept in floating point comparisons (as ulps).Fields inherited from class org.apache.commons.math3.optimization.linear.AbstractLinearOptimizer
DEFAULT_MAX_ITERATIONS
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Build a simplex solver with default settings.SimplexSolver
(double epsilon, int maxUlps) Deprecated.Build a simplex solver with a specified accepted amount of error -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doIteration
(SimplexTableau tableau) Deprecated.Runs one iteration of the Simplex method on the given model.Deprecated.Perform the bulk of optimization algorithm.private Integer
getPivotColumn
(SimplexTableau tableau) Deprecated.Returns the column with the most negative coefficient in the objective function row.private Integer
getPivotRow
(SimplexTableau tableau, int col) Deprecated.Returns the row with the minimum ratio as given by the minimum ratio test (MRT).protected void
solvePhase1
(SimplexTableau tableau) Deprecated.Solves Phase 1 of the Simplex method.Methods inherited from class org.apache.commons.math3.optimization.linear.AbstractLinearOptimizer
getConstraints, getFunction, getGoalType, getIterations, getMaxIterations, incrementIterationsCounter, optimize, restrictToNonNegative, setMaxIterations
-
Field Details
-
DEFAULT_EPSILON
private static final double DEFAULT_EPSILONDeprecated.Default amount of error to accept for algorithm convergence.- See Also:
-
DEFAULT_ULPS
private static final int DEFAULT_ULPSDeprecated.Default amount of error to accept in floating point comparisons (as ulps).- See Also:
-
epsilon
private final double epsilonDeprecated.Amount of error to accept for algorithm convergence. -
maxUlps
private final int maxUlpsDeprecated.Amount of error to accept in floating point comparisons (as ulps).
-
-
Constructor Details
-
SimplexSolver
public SimplexSolver()Deprecated.Build a simplex solver with default settings. -
SimplexSolver
public SimplexSolver(double epsilon, int maxUlps) Deprecated.Build a simplex solver with a specified accepted amount of error- Parameters:
epsilon
- the amount of error to accept for algorithm convergencemaxUlps
- amount of error to accept in floating point comparisons
-
-
Method Details
-
getPivotColumn
Deprecated.Returns the column with the most negative coefficient in the objective function row.- Parameters:
tableau
- simple tableau for the problem- Returns:
- column with the most negative coefficient
-
getPivotRow
Deprecated.Returns the row with the minimum ratio as given by the minimum ratio test (MRT).- Parameters:
tableau
- simple tableau for the problemcol
- the column to test the ratio of. SeegetPivotColumn(SimplexTableau)
- Returns:
- row with the minimum ratio
-
doIteration
protected void doIteration(SimplexTableau tableau) throws MaxCountExceededException, UnboundedSolutionException Deprecated.Runs one iteration of the Simplex method on the given model.- Parameters:
tableau
- simple tableau for the problem- Throws:
MaxCountExceededException
- if the maximal iteration count has been exceededUnboundedSolutionException
- if the model is found not to have a bounded solution
-
solvePhase1
protected void solvePhase1(SimplexTableau tableau) throws MaxCountExceededException, UnboundedSolutionException, NoFeasibleSolutionException Deprecated.Solves Phase 1 of the Simplex method.- Parameters:
tableau
- simple tableau for the problem- Throws:
MaxCountExceededException
- if the maximal iteration count has been exceededUnboundedSolutionException
- if the model is found not to have a bounded solutionNoFeasibleSolutionException
- if there is no feasible solution
-
doOptimize
public PointValuePair doOptimize() throws MaxCountExceededException, UnboundedSolutionException, NoFeasibleSolutionExceptionDeprecated.Perform the bulk of optimization algorithm.- Specified by:
doOptimize
in classAbstractLinearOptimizer
- Returns:
- the point/value pair giving the optimal value for objective function
- Throws:
MaxCountExceededException
UnboundedSolutionException
NoFeasibleSolutionException
-