OptimizationResult

class OptimizationResult(*args)

Optimization result.

Returned by optimization solvers, see OptimizationAlgorithm.

Available constructors:

OptimizationResult(optimalPoint, optimalValue, evaluationNumber, absoluteError, relativeError, residualError, constraintError)

Parameters
optimalPointsequence of float

Optimal point.

optimalValuesequence of float

Value at optimal point.

evaluationNumberint

Number of evaluations.

absoluteErrorfloat

Parameters for this solver.

relativeErrorfloat

Relative error.

residualErrorfloat

Residual error.

constraintErrorfloat

Constraint error.

problemOptimizationProblem

Associated problem.

Attributes
thisown

The membership flag

Methods

drawErrorHistory()

Draw the convergence criteria history.

drawOptimalValueHistory()

Draw the optimal value history.

getAbsoluteError()

Accessor to the absolute error.

getAbsoluteErrorHistory()

Accessor to the evolution of the absolute error.

getClassName()

Accessor to the object’s name.

getConstraintError()

Accessor to the constraint error.

getConstraintErrorHistory()

Accessor to the evolution of the constraint error.

getEvaluationNumber()

Accessor to the number of evaluations.

getId()

Accessor to the object’s id.

getInputSample()

Accessor to the input sample.

getIterationNumber()

Accessor to the number of iterations.

getLagrangeMultipliers()

Accessor to the Lagrange multipliers.

getName()

Accessor to the object’s name.

getOptimalPoint()

Accessor to the optimal point.

getOptimalValue()

Accessor to the optimal value.

getOutputSample()

Accessor to the output sample.

getProblem()

Accessor to the underlying optimization problem.

getRelativeError()

Accessor to the relative error.

getRelativeErrorHistory()

Accessor to the evolution of the relative error.

getResidualError()

Accessor to the residual error.

getResidualErrorHistory()

Accessor to the evolution of the residual error.

getShadowedId()

Accessor to the object’s shadowed id.

getVisibility()

Accessor to the object’s visibility state.

hasName()

Test if the object is named.

hasVisibleName()

Test if the object has a distinguishable name.

setEvaluationNumber(evaluationNumber)

Accessor to the number of evaluation.

setIterationNumber(iterationNumber)

Accessor to the number of iterations.

setLagrangeMultipliers(lagrangeMultipliers)

Accessor to the Lagrange multipliers.

setName(name)

Accessor to the object’s name.

setOptimalPoint(optimalPoint)

Accessor to the optimal point.

setOptimalValue(optimalValue)

Accessor to the optimal value.

setProblem(problem)

Accessor to the underlying optimization problem.

setShadowedId(id)

Accessor to the object’s shadowed id.

setVisibility(visible)

Accessor to the object’s visibility state.

store

__init__(*args)

Initialize self. See help(type(self)) for accurate signature.

drawErrorHistory()

Draw the convergence criteria history.

Returns
graphGraph

Convergence criteria history graph

drawOptimalValueHistory()

Draw the optimal value history.

Returns
graphGraph

Optimal value history graph

getAbsoluteError()

Accessor to the absolute error.

Returns
absoluteErrorfloat

Absolute error, defined by \epsilon^a_n=\|\vect{x}_{n+1}-\vect{x}_n\|_{\infty} where \vect{x}_{n+1} and \vect{x}_n are two consecutive approximations of the optimum.

getAbsoluteErrorHistory()

Accessor to the evolution of the absolute error.

Returns
absoluteErrorHistorySample

Value of the absolute error at each function evaluation.

getClassName()

Accessor to the object’s name.

Returns
class_namestr

The object class name (object.__class__.__name__).

getConstraintError()

Accessor to the constraint error.

Returns
constraintErrorfloat

Constraint error, defined by \gamma_n=\|g(\vect{x}_n)\|_{\infty} where \vect{x}_n is the current approximation of the optimum and g is the function that gathers all the equality and inequality constraints (violated values only).

getConstraintErrorHistory()

Accessor to the evolution of the constraint error.

Returns
constraintErrorHistorySample

Value of the constraint error at each function evaluation.

getEvaluationNumber()

Accessor to the number of evaluations.

Returns
evaluationNumberint

Number of evaluations.

getId()

Accessor to the object’s id.

Returns
idint

Internal unique identifier.

getInputSample()

Accessor to the input sample.

Returns
inputSampleSample

Input points used by the solver

getIterationNumber()

Accessor to the number of iterations.

Returns
iterationNumberint

Number of iterations.

getLagrangeMultipliers()

Accessor to the Lagrange multipliers.

Returns
multipliersPoint

Lagrange multipliers.

Notes

See OptimizationAlgorithm for the details on how the multipliers are defined and stored in the result.

getName()

Accessor to the object’s name.

Returns
namestr

The name of the object.

getOptimalPoint()

Accessor to the optimal point.

Returns
optimalPointPoint

Optimal point

getOptimalValue()

Accessor to the optimal value.

Returns
optimalValuePoint

Value at the optimal point

getOutputSample()

Accessor to the output sample.

Returns
outputSampleSample

Output points used by the solver

getProblem()

Accessor to the underlying optimization problem.

Returns
problemOptimizationProblem

Problem corresponding to the result

getRelativeError()

Accessor to the relative error.

Returns
relativeErrorfloat

Relative error, defined by \epsilon^r_n=\epsilon^a_n/\|\vect{x}_{n+1}\|_{\infty} if \|\vect{x}_{n+1}\|_{\infty}\neq 0, else \epsilon^r_n=-1.

getRelativeErrorHistory()

Accessor to the evolution of the relative error.

Returns
relativeErrorHistorySample

Value of the relative error at each function evaluation.

getResidualError()

Accessor to the residual error.

Returns
residualErrorfloat

Relative error, defined by \epsilon^r_n=\frac{\|f(\vect{x}_{n+1})-f(\vect{x}_{n})\|}{\|f(\vect{x}_{n+1})\|} if \|f(\vect{x}_{n+1})\|\neq 0, else \epsilon^r_n=-1.

getResidualErrorHistory()

Accessor to the evolution of the residual error.

Returns
residualErrorHistorySample

Value of the residual error at each function evaluation.

getShadowedId()

Accessor to the object’s shadowed id.

Returns
idint

Internal unique identifier.

getVisibility()

Accessor to the object’s visibility state.

Returns
visiblebool

Visibility flag.

hasName()

Test if the object is named.

Returns
hasNamebool

True if the name is not empty.

hasVisibleName()

Test if the object has a distinguishable name.

Returns
hasVisibleNamebool

True if the name is not empty and not the default one.

setEvaluationNumber(evaluationNumber)

Accessor to the number of evaluation.

Parameters
evaluationNumberint

Number of evaluations.

setIterationNumber(iterationNumber)

Accessor to the number of iterations.

Parameters
iterationNumberint

Number of iterations.

setLagrangeMultipliers(lagrangeMultipliers)

Accessor to the Lagrange multipliers.

Parameters
multipliersPoint

Lagrange multipliers.

Notes

See OptimizationAlgorithm for the details on how the multipliers are defined and stored in the result.

setName(name)

Accessor to the object’s name.

Parameters
namestr

The name of the object.

setOptimalPoint(optimalPoint)

Accessor to the optimal point.

Parameters
optimalPointPoint

Optimal point

setOptimalValue(optimalValue)

Accessor to the optimal value.

Parameters
optimalValuePoint

Value at the optimal point

setProblem(problem)

Accessor to the underlying optimization problem.

Parameters
problemOptimizationProblem

Problem corresponding to the result

setShadowedId(id)

Accessor to the object’s shadowed id.

Parameters
idint

Internal unique identifier.

setVisibility(visible)

Accessor to the object’s visibility state.

Parameters
visiblebool

Visibility flag.

thisown

The membership flag