Top Description Fields Constructors Methods
org.apache.commons.math3.optimization.linear

public Class SimplexSolver

extends AbstractLinearOptimizer
Class Inheritance
Annotations
@Deprecated
Imports
java.util.ArrayList, .List, org.apache.commons.math3.exception.MaxCountExceededException, org.apache.commons.math3.optimization.PointValuePair, org.apache.commons.math3.util.Precision

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

Modifier and TypeField and Description
private static final double
DEFAULT_EPSILON

Default amount of error to accept for algorithm convergence.

private static final int
DEFAULT_ULPS

Default amount of error to accept in floating point comparisons (as ulps).

private final double
epsilon

Amount of error to accept for algorithm convergence.

private final int
maxUlps

Amount of error to accept in floating point comparisons (as ulps).

Inherited from org.apache.commons.math3.optimization.linear.AbstractLinearOptimizer:
DEFAULT_MAX_ITERATIONS

Constructor Summary

AccessConstructor and Description
public
SimplexSolver()

Build a simplex solver with default settings.

public
SimplexSolver(final double
the amount of error to accept for algorithm convergence
epsilon
,
final int
amount of error to accept in floating point comparisons
maxUlps
)

Build a simplex solver with a specified accepted amount of error

Method Summary

Modifier and TypeMethod and Description
protected void
doIteration(final SimplexTableau
simple tableau for the problem
tableau
)
Deprecated as a consequence of SimplexTableau being deprecated.

Runs one iteration of the Simplex method on the given model.

public PointValuePair
doOptimize()

Implements abstract org.apache.commons.math3.optimization.linear.AbstractLinearOptimizer.doOptimize.

Deprecated as a consequence of PointValuePair being deprecated.

Perform the bulk of optimization algorithm.

private Integer

Returns:

column with the most negative coefficient
getPivotColumn
(SimplexTableau
simple tableau for the problem
tableau
)
Deprecated as a consequence of SimplexTableau being deprecated.

Returns the column with the most negative coefficient in the objective function row.

private Integer

Returns:

row with the minimum ratio
getPivotRow
(SimplexTableau
simple tableau for the problem
tableau
,
final int
the column to test the ratio of. See getPivotColumn(SimplexTableau)
col
)
Deprecated as a consequence of SimplexTableau being deprecated.

Returns the row with the minimum ratio as given by the minimum ratio test (MRT).

protected void
solvePhase1(final SimplexTableau
simple tableau for the problem
tableau
)
Deprecated as a consequence of SimplexTableau being deprecated.

Solves Phase 1 of the Simplex method.

Inherited from org.apache.commons.math3.optimization.linear.AbstractLinearOptimizer:
getConstraintsgetFunctiongetGoalTypegetIterationsgetMaxIterationsincrementIterationsCounteroptimizerestrictToNonNegativesetMaxIterations

Field Detail

DEFAULT_EPSILONback to summary
private static final double DEFAULT_EPSILON

Default amount of error to accept for algorithm convergence.

DEFAULT_ULPSback to summary
private static final int DEFAULT_ULPS

Default amount of error to accept in floating point comparisons (as ulps).

epsilonback to summary
private final double epsilon

Amount of error to accept for algorithm convergence.

maxUlpsback to summary
private final int maxUlps

Amount of error to accept in floating point comparisons (as ulps).

Constructor Detail

SimplexSolverback to summary
public SimplexSolver()

Build a simplex solver with default settings.

SimplexSolverback to summary
public SimplexSolver(final double epsilon, final int maxUlps)

Build a simplex solver with a specified accepted amount of error

Parameters
epsilon:double

the amount of error to accept for algorithm convergence

maxUlps:int

amount of error to accept in floating point comparisons

Method Detail

doIterationback to summary
protected void doIteration(final SimplexTableau tableau) throws MaxCountExceededException, UnboundedSolutionException

Deprecated

as a consequence of SimplexTableau being deprecated. See corresponding docs for further information.

Runs one iteration of the Simplex method on the given model.

Parameters
tableau:SimplexTableau

simple tableau for the problem

Exceptions
MaxCountExceededException:
if the maximal iteration count has been exceeded
UnboundedSolutionException:
if the model is found not to have a bounded solution
doOptimizeback to summary
public PointValuePair doOptimize() throws MaxCountExceededException, UnboundedSolutionException, NoFeasibleSolutionException

Implements abstract org.apache.commons.math3.optimization.linear.AbstractLinearOptimizer.doOptimize.

Doc from org.apache.commons.math3.optimization.linear.AbstractLinearOptimizer.doOptimize.

Deprecated

as a consequence of PointValuePair being deprecated. See corresponding docs for further information.

Perform the bulk of optimization algorithm.

Returns:PointValuePair

the point/value pair giving the optimal value for objective function

Annotations
@Override
getPivotColumnback to summary
private Integer getPivotColumn(SimplexTableau tableau)

Deprecated

as a consequence of SimplexTableau being deprecated. See corresponding docs for further information.

Returns the column with the most negative coefficient in the objective function row.

Parameters
tableau:SimplexTableau

simple tableau for the problem

Returns:Integer

column with the most negative coefficient

getPivotRowback to summary
private Integer getPivotRow(SimplexTableau tableau, final int col)

Deprecated

as a consequence of SimplexTableau being deprecated. See corresponding docs for further information.

Returns the row with the minimum ratio as given by the minimum ratio test (MRT).

Parameters
tableau:SimplexTableau

simple tableau for the problem

col:int

the column to test the ratio of. See getPivotColumn(SimplexTableau)

Returns:Integer

row with the minimum ratio

solvePhase1back to summary
protected void solvePhase1(final SimplexTableau tableau) throws MaxCountExceededException, UnboundedSolutionException, NoFeasibleSolutionException

Deprecated

as a consequence of SimplexTableau being deprecated. See corresponding docs for further information.

Solves Phase 1 of the Simplex method.

Parameters
tableau:SimplexTableau

simple tableau for the problem

Exceptions
MaxCountExceededException:
if the maximal iteration count has been exceeded
UnboundedSolutionException:
if the model is found not to have a bounded solution
NoFeasibleSolutionException:
if there is no feasible solution