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

public abstract Class LinearOptimizer

extends MultivariateOptimizer
Class Inheritance
Known Direct Subclasses
org.apache.commons.math3.optim.linear.SimplexSolver
Imports
java.util.Collection, .Collections, org.apache.commons.math3.exception.TooManyIterationsException, org.apache.commons.math3.optim.OptimizationData, .PointValuePair, org.apache.commons.math3.optim.nonlinear.scalar.MultivariateOptimizer

Base class for implementing linear optimizers.
Since
3.1

Field Summary

Modifier and TypeField and Description
private LinearObjectiveFunction
private Collection<LinearConstraint>
linearConstraints

Linear constraints.

private boolean
nonNegative

Whether to restrict the variables to non-negative values.

Constructor Summary

AccessConstructor and Description
protected
LinearOptimizer()

Simple constructor with default settings.

Method Summary

Modifier and TypeMethod and Description
protected Collection<LinearConstraint>

Returns:

the optimization type.
getConstraints
()

protected LinearObjectiveFunction

Returns:

the optimization type.
getFunction
()

protected boolean

Returns:

true if the variables are restricted to non-negative values.
isRestrictedToNonNegative
()

public PointValuePair

Returns:

a point/value pair that satisfies the convergence criteria.
optimize
(OptimizationData...
Optimization data. In addition to those documented in MultivariateOptimizer, this method will register the following data:
optData
)

Overrides org.apache.commons.math3.optim.nonlinear.scalar.MultivariateOptimizer.optimize.

Stores data and performs the optimization.

protected void
parseOptimizationData(OptimizationData...
Optimization data. The following data will be looked for:
optData
)

Overrides org.apache.commons.math3.optim.nonlinear.scalar.MultivariateOptimizer.parseOptimizationData.

Scans the list of (required and optional) optimization data that characterize the problem.

Inherited from org.apache.commons.math3.optim.nonlinear.scalar.MultivariateOptimizer:
computeObjectiveValuegetGoalType

Field Detail

functionback to summary
private LinearObjectiveFunction function

Hides org.apache.commons.math3.optim.nonlinear.scalar.MultivariateOptimizer.function.

Linear objective function.

linearConstraintsback to summary
private Collection<LinearConstraint> linearConstraints

Linear constraints.

nonNegativeback to summary
private boolean nonNegative

Whether to restrict the variables to non-negative values.

Constructor Detail

LinearOptimizerback to summary
protected LinearOptimizer()

Simple constructor with default settings.

Method Detail

getConstraintsback to summary
protected Collection<LinearConstraint> getConstraints()
Returns:Collection<LinearConstraint>

the optimization type.

getFunctionback to summary
protected LinearObjectiveFunction getFunction()
Returns:LinearObjectiveFunction

the optimization type.

isRestrictedToNonNegativeback to summary
protected boolean isRestrictedToNonNegative()
Returns:boolean

true if the variables are restricted to non-negative values.

optimizeback to summary
public PointValuePair optimize(OptimizationData... optData) throws TooManyIterationsException

Overrides org.apache.commons.math3.optim.nonlinear.scalar.MultivariateOptimizer.optimize.

Doc from org.apache.commons.math3.optim.nonlinear.scalar.MultivariateOptimizer.optimize.

Stores data and performs the optimization.

The list of parameters is open-ended so that sub-classes can extend it with arguments specific to their concrete implementations.

When the method is called multiple times, instance data is overwritten only when actually present in the list of arguments: when not specified, data set in a previous call is retained (and thus is optional in subsequent calls).

Important Note

Subclasses must override parseOptimizationData(OptimizationData[]) if they need to register their own options; but then, they must also call super.parseOptimizationData(optData) within that method.

Parameters
optData:OptimizationData[]

Optimization data. In addition to those documented in MultivariateOptimizer, this method will register the following data:

Returns:PointValuePair

a point/value pair that satisfies the convergence criteria.

Annotations
@Override
Exceptions
TooManyIterationsException:
if the maximal number of iterations is exceeded.
parseOptimizationDataback to summary
protected void parseOptimizationData(OptimizationData... optData)

Overrides org.apache.commons.math3.optim.nonlinear.scalar.MultivariateOptimizer.parseOptimizationData.

Scans the list of (required and optional) optimization data that characterize the problem.

Parameters
optData:OptimizationData[]

Optimization data. The following data will be looked for:

Annotations
@Override