#include <rdFSQP.h>
Public Member Functions | |
| virtual | ~rdFSQP () |
| Destructor. | |
| rdFSQP (rdOptimizationTarget *aTarget) | |
| Construct an rdFSQP instance based on an optimization target. | |
| rdOptimizationTarget * | setTarget (rdOptimizationTarget *aTarget) |
| Set the optimization target. | |
| rdOptimizationTarget * | getTarget () |
| Get the current optimization target. | |
| void | setMode (int aMode) |
| Set the mode of fsqp. | |
| int | getMode () |
| Get the mode of fsqp. | |
| void | setPrintLevel (int aLevel) |
| Set the print level. | |
| int | getPrintLevel () |
| Get the print level. | |
| void | setMaxIterations (int aMaxIter) |
| Set the maximum number of iterations. | |
| int | getMaxIterations () |
| Get the maximum number of iterations. | |
| void | setInfinity (double aInfinity) |
| Set the value considered to be infinity. | |
| double | getInfinity () |
| Set the value considered to be infinity. | |
| void | setConvergenceCriterion (double aEPS) |
| Set the convergence criterion. | |
| double | getConvergenceCriterion () |
| Get the convergence criterion. | |
| void | setNonlinearEqualityConstraintTolerance (double aEPSEQN) |
| Set the tolerance allowed in meeting nonlinear equality constraints. | |
| double | getNonlinearEqualityConstraintTolerance () |
| Get the tolerance allowed in meeting nonlinear equality constraints. | |
| void | setLowerBound (double aLower) |
| Set a lower bound on the controls. | |
| void | setLowerBound (int aIndex, double aLower) |
| Set the lower bound for a specified control. | |
| void | setLowerBound (double aLower[]) |
| Set lower bounds on the controls. | |
| double * | getLowerBound () |
| Get lower bounds on the controls. | |
| void | setUpperBound (double aUpper) |
| Set a upper bound on the controls. | |
| void | setUpperBound (int aIndex, double aUpper) |
| Set the upper bound for a specified control. | |
| void | setUpperBound (double aUpper[]) |
| Set upper bounds on the controls. | |
| double * | getUpperBound () |
| Get upper bounds on the controls. | |
| int | computeOptimalControls (const double *xstart, double *x) |
| Compute a set of optimal controls, given the input controls (xin) and the current state of the optimization target. | |
Static Public Member Functions | |
| int | CentralDifferences (rdOptimizationTarget *aTarget, double *dx, double *x, double *dpdx, double *dcdx) |
| Compute derivatives of performance and constraints with respect to the controls by central differences. | |
| int | CentralDifferences (rdOptimizationTarget *aTarget, double *dx, double *x, double *dpdx) |
| Compute derivatives of performance with respect to the controls by central differences. | |
| int | CentralDifferencesConstraint (rdOptimizationTarget *aTarget, double *dx, double *x, int ic, double *dcdx) |
| Compute derivatives of a constraint with respect to the controls by central differences. | |
| void | pFunc (int nparam, int j, double *x, double *pj, void *cd) |
| Compute the performance criterion. | |
| void | cFunc (int nparam, int j, double *x, double *cj, void *cd) |
| Compute the constraints. | |
| void | dpdxFunc (int nparam, int j, double *x, double *dpdx, void(*dummy)(int, int, double *, double *, void *), void *cd) |
| Compute the derivatives of the performance criterion. | |
| void | dcdxFunc (int nparam, int j, double *x, double *dcdx, void(*dummy)(int, int, double *, double *, void *), void *cd) |
| Compute the gradient of the constraints. | |
Private Member Functions | |
| void | setNull () |
| Set NULL values for the member variables. | |
Private Attributes | |
| rdOptimizationTarget * | _target |
| int | _mode |
| Mode. | |
| int | _printLevel |
| Print level. | |
| int | _maxIter |
| Maximum number of iterations. | |
| int | _inform |
| Variable that contains information about the status of an optimization. | |
| double | _infinity |
| Value used for infinity or a very large number. | |
| double | _eps |
| Convergence criterion. | |
| double | _epseqn |
| Convergence criterion for nonlinear equality constraints. | |
| double | _udelta |
| I don't know. | |
| int | _ncsrl |
| int | _ncsrn |
| int | _nfsr |
| int * | _mesh |
| double * | _bl |
| Lower bounds on controls. | |
| double * | _bu |
| Upper bounds on controls. | |
| double * | _x |
| Controls. | |
| double * | _p |
| Array of performance criteria. | |
| double * | _c |
| Array of constraints. | |
| double * | _lambda |
| Lagrange multipliers for constraints. | |
The core algorithm is called fsqp, "Fast Sequential Quadratic Programming".
|
||||||||||||||||||||
|
Compute derivatives of performance with respect to the controls by central differences. Note that the gradient array should be allocated as dpdx[nx].
|
|
||||||||||||||||||||||||
|
Compute derivatives of performance and constraints with respect to the controls by central differences. Note that the gradient arrays should be allocated as dpdx[nx] and dcdx[nc][nx].
|
|
||||||||||||||||||||||||
|
Compute derivatives of a constraint with respect to the controls by central differences.
|
|
||||||||||||
|
Compute a set of optimal controls, given the input controls (xin) and the current state of the optimization target. Whether or not the optimization terminates normally, the latest value of the controls are copied to xout. It is safe to use the same pointer for xin and xout. However, in all cases the calling routine must allocate enough space for xin and xout.
|
|
|
Get lower bounds on the controls. Note that the address is returned and not a copy;
|
|
|
Get the current optimization target.
|
|
|
Get upper bounds on the controls. Note that the address is returned and not a copy;
|
|
|
Set lower bounds on the controls.
|
|
||||||||||||
|
Set the lower bound for a specified control.
|
|
|
Set a lower bound on the controls.
|
|
|
Set the optimization target. It is permissible to change the target at any time. Calling this method, however, will destroy any information about the lower and upper bounds for the controls. The upper and lower bounds therefore need to be set again.
|
|
|
Set upper bounds on the controls.
|
|
||||||||||||
|
Set the upper bound for a specified control.
|
|
|
Set a upper bound on the controls.
|
1.3