public abstract class SequentialQuadraticProgrammingOptimizer extends ParameterOptimizer
ParameterOptimizers
that will optimize a cost function
by iteration towards a solution. In each iteration, the change of the variable values will be evaluated, applied to the previous
variable values and repeated in the next iteration.
An instance of a type derived from this will pass in values of Variables
(get
) into an
OptimizerMultivariableFunction
to optimize the CostFunction
(get
/ set
),
match the Equalities
(get
), and satisfy the
Inequalities
(get
).Modifier | Constructor and Description |
---|---|
protected |
SequentialQuadraticProgrammingOptimizer()
Initializes a new instance.
|
protected |
SequentialQuadraticProgrammingOptimizer(SequentialQuadraticProgrammingOptimizer existingInstance,
CopyContext context)
Initializes a new instance as a copy of an existing instance.
|
Modifier and Type | Method and Description |
---|---|
abstract MultivariableFunctionSolverStepResult<OptimizerMultivariableFunctionResults,OptimizerMultivariableFunctionDerivativeResults> |
computeNextStep(double[] variableValues,
Matrix hessian,
ParameterOptimizerIterationResults previousIterationResults,
ITrackCalculationProgress progressTracker)
Computes the next optimization step that this parameter optimizer should take.
|
abstract boolean |
convergenceCheck(OptimizerMultivariableFunctionResults currentResults,
OptimizerMultivariableFunctionResults previousResults)
Determines whether the optimizer converged or not.
|
boolean |
findSolution(int numberOfIterations,
boolean justFinalResult,
ITrackCalculationProgress progressTracker)
|
checkCostFunctionConvergence, checkEqualitySatisfaction, checkInequalitySatisfaction, checkVariableConvergence, clone, dispose, dispose, findSolution, findSolution, getCostFunction, getCurrentIteration, getEqualities, getFunction, getInequalities, getIsThreadSafe, getLastRunsResults, getMultithreaded, getVariables, reset, setCostFunction, setCurrentIteration, setFunction, setLastRunsResults, setMultithreaded
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close
protected SequentialQuadraticProgrammingOptimizer()
variable
to the
Variables
(get
) as well as set the Function
(get
/ set
).
Further, either the CostFunction
(get
/ set
) must be set or at least one
equality constraint
must be added to the
Equalities
(get
) to pose a well-defined optimization problem.protected SequentialQuadraticProgrammingOptimizer(@Nonnull SequentialQuadraticProgrammingOptimizer existingInstance, @Nonnull CopyContext context)
See ICloneWithContext.clone(CopyContext)
for more information about how to implement this constructor
in a derived class.
existingInstance
- The existing instance to copy.context
- A CopyContext
that controls the depth of the copy.ArgumentNullException
- Thrown when existingInstance
or context
is null
.public boolean findSolution(int numberOfIterations, boolean justFinalResult, ITrackCalculationProgress progressTracker)
findSolution
in class ParameterOptimizer
numberOfIterations
- The number of iterations that may be performed while
attempting to find a solution.justFinalResult
- Tells this method to only include the final results, or
the results of each iteration.progressTracker
- An optional progress tracker.LastRunsResults
(get
/ set
)
for the results.public abstract boolean convergenceCheck(OptimizerMultivariableFunctionResults currentResults, OptimizerMultivariableFunctionResults previousResults)
currentResults
- The current results that are used to check if the equality constraints match
their desired values within tolerance and the inequality constraints are satisfied.
These are also used in combination with the previous results to check changes in the independent variables and
the cost function. Use of these results in custom convergence checks is also permitted.previousResults
- The previous results that are used in combination with the current results
to check changes in the independent variables and the cost function. Use of these results in custom
convergence checks is also permitted.true
if the convergence check passes; false
if the convergence
check fails.public abstract MultivariableFunctionSolverStepResult<OptimizerMultivariableFunctionResults,OptimizerMultivariableFunctionDerivativeResults> computeNextStep(double[] variableValues, @Nonnull Matrix hessian, @Nullable ParameterOptimizerIterationResults previousIterationResults, @Nullable ITrackCalculationProgress progressTracker)
variableValues
- The current values of the variables.hessian
- An approximation of the second derivative
matrix of the Lagrangian.previousIterationResults
- The results of the previous iteration
that are used to compute the next step.progressTracker
- An optional progress tracker.