The main PSQP class to use.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | nres | = | 0 |
number of restarts. |
|
| integer, | public | :: | ndec | = | 0 |
number of matrix decomposition. |
|
| integer, | public | :: | nrem | = | 0 |
number of constraint deletions. |
|
| integer, | public | :: | nadd | = | 0 |
number of constraint additions. |
|
| integer, | public | :: | nit | = | 0 |
number of iterations. |
|
| integer, | public | :: | nfv | = | 0 |
number of function evaluations. |
|
| integer, | public | :: | nfg | = | 0 |
number of gradient evaluations. |
|
| integer, | public | :: | nfh | = | 0 |
number of hessian evaluations. |
|
| integer, | private | :: | mtyp | = | 0 | ||
| integer, | private | :: | mode | = | 0 | ||
| integer, | private | :: | mes1 | = | 0 | ||
| integer, | private | :: | mes2 | = | 0 | ||
| real(kind=wp), | private | :: | rl | = | 0.0_wp | ||
| real(kind=wp), | private | :: | fl | = | 0.0_wp | ||
| real(kind=wp), | private | :: | ru | = | 0.0_wp | ||
| real(kind=wp), | private | :: | fu | = | 0.0_wp | ||
| real(kind=wp), | private | :: | ri | = | 0.0_wp | ||
| real(kind=wp), | private | :: | fi | = | 0.0_wp | ||
| procedure(obj_func), | private, | pointer | :: | obj | => | null() |
objective function |
| procedure(dobj_func), | private, | pointer | :: | dobj | => | null() |
gradient of the objective function |
| procedure(con_func), | private, | pointer | :: | con | => | null() |
constraint function |
| procedure(dcon_func), | private, | pointer | :: | dcon | => | null() |
gradient of the constraint function |
| procedure(report_f), | private, | pointer | :: | report | => | null() |
iteration report function |
easy to use subroutine for general nonlinear programming problems.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(psqp_class), | intent(inout) | :: | me | |||
| integer, | intent(in) | :: | nf |
number of variables |
||
| integer, | intent(in) | :: | nb |
choice of simple bounds. |
||
| integer, | intent(in) | :: | nc |
number of general nonlinear constraints. |
||
| real(kind=wp), | intent(inout), | dimension(nf) | :: | x |
x(nf) vector of variables. |
|
| integer, | intent(in), | dimension(nf) | :: | bound_type |
ix(nf) vector containing types of bounds. |
|
| real(kind=wp), | intent(in), | dimension(nf) | :: | xl |
xl(nf) vector containing lower bounds for variables. |
|
| real(kind=wp), | intent(in), | dimension(nf) | :: | xu |
xu(nf) vector containing upper bounds for variables. |
|
| real(kind=wp), | intent(out), | dimension(nc+1) | :: | cf |
cf(nc+1) vector containing values of the constraint functions. |
|
| integer, | intent(in), | dimension(nc) | :: | constraint_type |
ic(nc) vector containing types of constraints: |
|
| real(kind=wp), | intent(in), | dimension(nc) | :: | cl |
cl(nc) vector containing lower bounds for constraint functions. |
|
| real(kind=wp), | intent(in), | dimension(nc) | :: | cu |
cu(nc) vector containing upper bounds for constraint functions. |
|
| integer, | intent(in), | dimension(6) | :: | ipar |
integer paremeters: |
|
| real(kind=wp), | intent(in), | dimension(5) | :: | rpar |
real parameters: |
|
| real(kind=wp), | intent(out) | :: | f |
value of the objective function. |
||
| real(kind=wp), | intent(out) | :: | gmax |
maximum partial derivative of the lagrangian function. |
||
| real(kind=wp), | intent(out) | :: | cmax |
maximum constraint violation. |
||
| integer, | intent(in) | :: | iprnt |
print specification: |
||
| integer, | intent(out) | :: | iterm |
variable that indicates the cause of termination. |
||
| procedure(obj_func) | :: | obj |
computation of the value of the objective function |
|||
| procedure(dobj_func) | :: | dobj |
computation of the gradient of the objective function |
|||
| procedure(con_func) | :: | con |
computation of the value of the constraint function |
|||
| procedure(dcon_func) | :: | dcon |
computation of the gradient of the constraint function |
|||
| procedure(report_f), | optional | :: | report |
iteration report function. Note: this is independent of |
recursive quadratic programming method with the bfgs variable metric update for general nonlinear programming problems.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(psqp_class), | intent(inout) | :: | me | |||
| integer | :: | nf |
number of variables. |
|||
| integer | :: | nb |
choice of simple bounds. |
|||
| integer | :: | nc |
number of linear constraints. |
|||
| real(kind=wp) | :: | x(*) |
x(nf) vector of variables. |
|||
| integer, | intent(inout) | :: | ix(*) |
ix(nf) vector containing types of bounds. |
||
| real(kind=wp) | :: | xl(*) |
xl(nf) vector containing lower bounds for variables. |
|||
| real(kind=wp) | :: | xu(*) |
xu(nf) vector containing upper bounds for variables. |
|||
| real(kind=wp) | :: | cf(*) |
cf(nc+1) vector containing values of the constraint functions. |
|||
| integer, | intent(inout) | :: | ic(*) |
ic(nc) vector containing types of constraints. |
||
| real(kind=wp) | :: | cl(*) |
cl(nc) vector containing lower bounds for constraint functions. |
|||
| real(kind=wp) | :: | cu(*) |
cu(nc) vector containing upper bounds for constraint functions. |
|||
| real(kind=wp) | :: | cg(*) |
cg(nf*nc) matrix whose columns are normals of the linear constraints. |
|||
| real(kind=wp) | :: | cfo(*) |
cfo(nc) vector containing saved values of the constraint functions. |
|||
| real(kind=wp) | :: | cfd(*) |
cfd(nc) vector containing increments of the constraint functions. |
|||
| real(kind=wp) | :: | gc(*) |
gc(nf) gradient of the selected constraint function. |
|||
| integer | :: | ica(*) |
ica(nf) vector containing indices of active constraints. |
|||
| real(kind=wp) | :: | cr(*) |
cr(nf*(nf+1)/2) triangular decomposition of kernel of the orthogonal projection. |
|||
| real(kind=wp) | :: | cz(*) |
cz(nf) vector of lagrange multipliers. |
|||
| real(kind=wp) | :: | cp(*) | ||||
| real(kind=wp) | :: | gf(*) |
gf(nf) gradient of the model function. |
|||
| real(kind=wp) | :: | g(*) |
g(nf) gradient of the objective function. |
|||
| real(kind=wp) | :: | h(*) |
h(nf*(nf+1)/2) triangular decomposition or inversion of the hessian matrix approximation. |
|||
| real(kind=wp) | :: | s(*) |
s(nf) direction vector. |
|||
| real(kind=wp) | :: | xo(*) |
xo(nf) vectors of variables difference. |
|||
| real(kind=wp) | :: | go(*) |
go(nf) gradients difference. |
|||
| real(kind=wp) | :: | xmax |
maximum stepsize. |
|||
| real(kind=wp) | :: | tolx |
tolerance for change of variables. |
|||
| real(kind=wp) | :: | tolc |
tolerance for constraint violations. |
|||
| real(kind=wp) | :: | tolg |
tolerance for the gradient of the lagrangian function. |
|||
| real(kind=wp) | :: | rpf |
penalty coefficient. |
|||
| real(kind=wp) | :: | cmax |
maximum constraint violation. |
|||
| real(kind=wp) | :: | gmax |
maximum partial derivative of the lagrangian function. |
|||
| real(kind=wp) | :: | f |
value of the objective function. |
|||
| integer | :: | mit |
maximum number of iterations. |
|||
| integer | :: | mfv |
maximum number of function evaluations. |
|||
| integer | :: | met |
variable metric update used. |
|||
| integer | :: | mec |
correction if the negative curvature occurs. |
|||
| integer | :: | iprnt |
print specification. |
|||
| integer | :: | iterm |
variable that indicates the cause of termination. |
computation of the value and the gradient of the objective function.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(psqp_class), | intent(inout) | :: | me | |||
| integer, | intent(in) | :: | nf |
number of variables. |
||
| real(kind=wp), | intent(in) | :: | x(nf) |
x(nf) vector of variables. |
||
| real(kind=wp), | intent(out) | :: | gf(nf) |
gf(nf) gradient of the model function. |
||
| real(kind=wp), | intent(out) | :: | g(nf) |
g(nf) gradient of the objective function. |
||
| real(kind=wp), | intent(out) | :: | ff |
value of the model function. |
||
| real(kind=wp), | intent(out) | :: | f |
value of the objective function. |
||
| integer, | intent(in) | :: | kd |
degree of required derivatives. |
||
| integer, | intent(inout) | :: | ld |
degree of previously computed derivatives. |
||
| integer, | intent(in) | :: | iext |
type of extremum. |
dual range space quadratic programming method.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(psqp_class), | intent(inout) | :: | me | |||
| integer | :: | nf |
number of variables. |
|||
| integer | :: | nc |
number of linear constraints. |
|||
| real(kind=wp) | :: | x(*) |
x(nf) vector of variables. |
|||
| integer | :: | ix(*) |
ix(nf) vector containing types of bounds. |
|||
| real(kind=wp) | :: | xl(*) |
xl(nf) vector containing lower bounds for variables. |
|||
| real(kind=wp) | :: | xu(*) |
xu(nf) vector containing upper bounds for variables. |
|||
| real(kind=wp) | :: | cf(*) |
cf(nf) vector containing values of the constraint functions. |
|||
| real(kind=wp) | :: | cfd(*) |
cfd(nc) vector containing increments of the constraint functions. |
|||
| integer | :: | ic(*) |
ic(nc) vector containing types of constraints. |
|||
| integer | :: | ica(*) |
ica(nf) vector containing indices of active constraints. |
|||
| real(kind=wp) | :: | cl(*) |
cl(nc) vector containing lower bounds for constraint functions. |
|||
| real(kind=wp) | :: | cu(*) |
cu(nc) vector containing upper bounds for constraint functions. |
|||
| real(kind=wp) | :: | cg(*) |
cg(nf*nc) matrix whose columns are normals of the linear constraints. |
|||
| real(kind=wp) | :: | cr(*) |
cr(nf*(nf+1)/2) triangular decomposition of kernel of the orthogonal projection. |
|||
| real(kind=wp) | :: | cz(*) |
cz(nf) vector of lagrange multipliers. |
|||
| real(kind=wp) | :: | g(*) |
g(nf) gradient of the lagrangian function. |
|||
| real(kind=wp) | :: | go(*) |
go(nf) saved gradient of the objective function. |
|||
| real(kind=wp) | :: | h(*) |
h(nf*(nf+1)/2) triangular decomposition or inversion of the hessian matrix approximation. |
|||
| real(kind=wp) | :: | s(*) |
s(nf) direction vector. |
|||
| integer | :: | mfp |
type of feasible point. |
|||
| integer | :: | kbf |
specification of simple bounds. |
|||
| integer | :: | kbc |
specification of linear constraints. |
|||
| integer | :: | idecf |
decomposition indicator. |
|||
| real(kind=wp) | :: | eta2 |
tolerance for positive definiteness of the hessian matrix. |
|||
| real(kind=wp) | :: | eta9 |
maximum for real numbers. |
|||
| real(kind=wp) | :: | eps7 |
tolerance for linear independence of constraints. |
|||
| real(kind=wp) | :: | eps9 |
tolerance for activity of constraints. |
|||
| real(kind=wp) | :: | umax |
maximum absolute value of a negative lagrange multiplier. |
|||
| real(kind=wp) | :: | gmax |
maximum absolute value of a partial derivative. |
|||
| integer | :: | n |
dimension of the manifold defined by active constraints. |
|||
| integer | :: | iterq |
type of feasible point. |
operations after constraint deletion.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(psqp_class), | intent(inout) | :: | me | |||
| integer | :: | nf |
declared number of variables. |
|||
| integer | :: | nc |
number of constraints. |
|||
| integer | :: | ix(*) |
ix(nf) vector containing types of bounds. |
|||
| integer | :: | ia(*) |
ia(na) vector containing types of deviations. |
|||
| integer | :: | iaa(*) |
iaa(nf+1) vector containing indices of active functions. |
|||
| real(kind=wp) | :: | ar(*) |
ar((nf+1)*(nf+2)/2) triangular decomposition of kernel of the orthogonal projection. |
|||
| integer | :: | ic(*) |
ic(nc) vector containing types of constraints. |
|||
| real(kind=wp) | :: | s(*) |
s(nf+1) auxiliary vector. |
|||
| integer | :: | n |
actual number of variables. |
|||
| integer | :: | iold |
index of the old active constraint. |
|||
| integer | :: | krem |
auxiliary variable. |
|||
| integer | :: | ier |
error indicator. |
computation of the value and the gradient of the constraint function.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(psqp_class), | intent(inout) | :: | me | |||
| integer | :: | nf |
number of variables. |
|||
| integer | :: | nc |
number of constraints. |
|||
| real(kind=wp) | :: | x(nf) |
x(nf) vector of variables. |
|||
| real(kind=wp) | :: | fc |
value of the selected constraint function. |
|||
| real(kind=wp) | :: | cf(*) |
cf(nc) vector containing values of constraint functions. |
|||
| real(kind=wp) | :: | cl(*) |
cl(nc) vector containing lower bounds for constraint functions. |
|||
| real(kind=wp) | :: | cu(*) |
cu(nc) vector containing upper bounds for constraint functions. |
|||
| integer | :: | ic(*) |
ic(nc) vector containing types of constraints. |
|||
| real(kind=wp) | :: | gc(nf) |
gc(nf) gradient of the selected constraint function. |
|||
| real(kind=wp) | :: | cg(*) |
cg(nf*nc) matrix whose columns are gradients of constraint functions. |
|||
| real(kind=wp) | :: | cmax |
maximum constraint violation. |
|||
| integer | :: | kd |
degree of required derivatives. |
|||
| integer | :: | ld |
degree of previously computed derivatives. |
extended line search without directional derivatives.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(psqp_class), | intent(inout) | :: | me | |||
| real(kind=wp) | :: | r |
value of the stepsize parameter. |
|||
| real(kind=wp) | :: | ro |
initial value of the stepsize parameter. |
|||
| real(kind=wp) | :: | rp |
previous value of the stepsize parameter. |
|||
| real(kind=wp) | :: | f |
value of the objective function. |
|||
| real(kind=wp) | :: | fo |
initial value of the objective function. |
|||
| real(kind=wp) | :: | fp |
previous value of the objective function. |
|||
| real(kind=wp) | :: | po |
initial value of the directional derivative. |
|||
| real(kind=wp) | :: | pp |
previous value of the directional derivative. |
|||
| real(kind=wp) | :: | fmin |
lower bound for value of the objective function. |
|||
| real(kind=wp) | :: | fmax |
upper bound for value of the objective function. |
|||
| real(kind=wp) | :: | rmin |
minimum value of the stepsize parameter |
|||
| real(kind=wp) | :: | rmax |
maximum value of the stepsize parameter |
|||
| real(kind=wp) | :: | tols |
termination tolerance for line search (in test on the change of the function value). |
|||
| integer | :: | kd |
degree of required dervatives. |
|||
| integer | :: | ld |
degree of previously computed derivatives. |
|||
| integer | :: | nit |
actual number of iterations. |
|||
| integer | :: | kit |
number of the iteration after last restart. |
|||
| integer | :: | nred |
actual number of extrapolations or interpolations. |
|||
| integer | :: | mred |
maximum number of extrapolations or interpolations. |
|||
| integer | :: | maxst |
maximum stepsize indicator. maxst=0 or maxst=1 if maximum stepsize was not or was reached. |
|||
| integer | :: | iest |
lower bound specification. iest=0 or iest=1 if lower bound is not or is given. |
|||
| integer | :: | inits |
choice of the initial stepsize. |
|||
| integer | :: | iters |
termination indicator. |
|||
| integer | :: | kters |
termination selection. |
|||
| integer | :: | mes |
method selection. |
|||
| integer | :: | isys |
control parameter. |
type, public :: psqp_class !! The main PSQP class to use. private ! these were formerly in the `stat` common block: integer, public :: nres = 0 !! number of restarts. integer, public :: ndec = 0 !! number of matrix decomposition. integer, public :: nrem = 0 !! number of constraint deletions. integer, public :: nadd = 0 !! number of constraint additions. integer, public :: nit = 0 !! number of iterations. integer, public :: nfv = 0 !! number of function evaluations. integer, public :: nfg = 0 !! number of gradient evaluations. integer, public :: nfh = 0 !! number of hessian evaluations. ! formerly saved variables in extended_line_search: integer :: mtyp = 0 integer :: mode = 0 integer :: mes1 = 0 integer :: mes2 = 0 real(wp) :: rl = 0.0_wp real(wp) :: fl = 0.0_wp real(wp) :: ru = 0.0_wp real(wp) :: fu = 0.0_wp real(wp) :: ri = 0.0_wp real(wp) :: fi = 0.0_wp procedure(obj_func), pointer :: obj => null() !! objective function procedure(dobj_func), pointer :: dobj => null() !! gradient of the objective function procedure(con_func), pointer :: con => null() !! constraint function procedure(dcon_func), pointer :: dcon => null() !! gradient of the constraint function procedure(report_f),pointer :: report => null() !! iteration report function contains private procedure, public :: psqpn procedure, public :: psqp procedure :: compute_obj_and_dobj procedure :: dual_range_space_quad_prog procedure :: ops_after_constr_deletion procedure :: compute_con_and_dcon procedure :: extended_line_search end type psqp_class