#include <ConstrainedOptPack_QPSolverRelaxed.hpp>
Inheritance diagram for ConstrainedOptPack::QPSolverRelaxed:
Public Types | |
| enum | EOutputLevel |
Enumeration for the amount of output to create from solve_qp(). More... | |
| enum | ERunTests |
| Enumeration for if to run internal tests or not. More... | |
Initializers | |
| void | infinite_bound (const value_type &infinite_bound) |
| Set the scalar that will be used to identigy infinite bounds. | |
| QPSolverRelaxed () | |
| | |
| virtual | ~QPSolverRelaxed () |
| | |
Interface methods with default implementations | |
| virtual QPSolverStats::ESolutionType | solve_qp (std::ostream *out, EOutputLevel olevel, ERunTests test_what, const Vector &g, const MatrixSymOp &G, value_type etaL, const Vector &dL, const Vector &dU, const MatrixOp &E, BLAS_Cpp::Transp trans_E, const Vector &b, const Vector &eL, const Vector &eU, const MatrixOp &F, BLAS_Cpp::Transp trans_F, const Vector &f, value_type *obj_d, value_type *eta, VectorMutable *d, VectorMutable *nu, VectorMutable *mu, VectorMutable *Ed, VectorMutable *lambda, VectorMutable *Fd) |
| Solve the QP. | |
| virtual QPSolverStats::ESolutionType | solve_qp (std::ostream *out, EOutputLevel olevel, ERunTests test_what, const Vector &g, const MatrixSymOp &G, value_type etaL, const Vector &dL, const Vector &dU, const MatrixOp &E, BLAS_Cpp::Transp trans_E, const Vector &b, const Vector &eL, const Vector &eU, value_type *obj_d, value_type *eta, VectorMutable *d, VectorMutable *nu, VectorMutable *mu, VectorMutable *Ed) |
| Solve the QP without general equality constrants. | |
| virtual QPSolverStats::ESolutionType | solve_qp (std::ostream *out, EOutputLevel olevel, ERunTests test_what, const Vector &g, const MatrixSymOp &G, value_type etaL, const Vector &dL, const Vector &dU, const MatrixOp &F, BLAS_Cpp::Transp trans_F, const Vector &f, value_type *obj_d, value_type *eta, VectorMutable *d, VectorMutable *nu, VectorMutable *lambda, VectorMutable *Fd) |
| Solve the QP without general inequality constrants. | |
| virtual QPSolverStats::ESolutionType | solve_qp (std::ostream *out, EOutputLevel olevel, ERunTests test_what, const Vector &g, const MatrixSymOp &G, const Vector &dL, const Vector &dU, value_type *obj_d, VectorMutable *d, VectorMutable *nu) |
| Solve the QP without general equality or inequality constrants (no relaxation needed). | |
| virtual QPSolverStats::ESolutionType | solve_qp (std::ostream *out, EOutputLevel olevel, ERunTests test_what, const Vector &g, const MatrixSymOp &G, value_type etaL, const Vector *dL, const Vector *dU, const MatrixOp *E, BLAS_Cpp::Transp trans_E, const Vector *b, const Vector *eL, const Vector *eU, const MatrixOp *F, BLAS_Cpp::Transp trans_F, const Vector *f, value_type *obj_d, value_type *eta, VectorMutable *d, VectorMutable *nu, VectorMutable *mu, VectorMutable *Ed, VectorMutable *lambda, VectorMutable *Fd) |
| This is a more flexible function where the client can set different constraints to be included. | |
| virtual QPSolverStats | get_qp_stats () const =0 |
| Get the statistics of the last QP solved. | |
| virtual void | release_memory ()=0 |
| Release any memory that is being used. | |
Static utility functions | |
| void | validate_input (const value_type infinite_bound, const Vector &g, const MatrixSymOp &G, value_type etaL, const Vector *dL, const Vector *dU, const MatrixOp *E, BLAS_Cpp::Transp trans_E, const Vector *b, const Vector *eL, const Vector *eU, const MatrixOp *F, BLAS_Cpp::Transp trans_F, const Vector *f, const value_type *obj_d, const value_type *eta, const Vector *d, const Vector *nu, const Vector *mu, const Vector *Ed, const Vector *lambda, const Vector *Fd) |
This is a (static) function that is used as a utility to validate the input arguments to solve_qp(). | |
| void | print_qp_input (const value_type infinite_bound, std::ostream *out, EOutputLevel olevel, const Vector &g, const MatrixSymOp &G, value_type etaL, const Vector *dL, const Vector *dU, const MatrixOp *E, BLAS_Cpp::Transp trans_E, const Vector *b, const Vector *eL, const Vector *eU, const MatrixOp *F, BLAS_Cpp::Transp trans_F, const Vector *f, value_type *eta, VectorMutable *d, VectorMutable *nu, VectorMutable *mu, VectorMutable *lambda) |
| Utility (static) function for printing the input input/output arguments before the QP solver is run. The QP solver subclasses can call this function. | |
| void | print_qp_output (const value_type infinite_bound, std::ostream *out, EOutputLevel olevel, const value_type *obj_d, const value_type *eta, const Vector *d, const Vector *nu, const Vector *mu, const Vector *Ed, const Vector *lambda, const Vector *Fd) |
| Utility (static) function for printing the output input/output arguments after the QP solver is run. The QP solver subclasses can call this function. | |
Pure virtual methods that must be overridden by subclass | |
| virtual QPSolverStats::ESolutionType | imp_solve_qp (std::ostream *out, EOutputLevel olevel, ERunTests test_what, const Vector &g, const MatrixSymOp &G, value_type etaL, const Vector *dL, const Vector *dU, const MatrixOp *E, BLAS_Cpp::Transp trans_E, const Vector *b, const Vector *eL, const Vector *eU, const MatrixOp *F, BLAS_Cpp::Transp trans_F, const Vector *f, value_type *obj_d, value_type *eta, VectorMutable *d, VectorMutable *nu, VectorMutable *mu, VectorMutable *Ed, VectorMutable *lambda, VectorMutable *Fd)=0 |
| Subclasses are to override this to implement the QP algorithm. | |
The formulation for the QP being solved is:
(1.1) min g'*d + 1/2*d'*G*d + M(eta)
d <: R^n
s.t.
(1.2) etaL <= eta
(1.3) dL <= d <= dU
(1.4) eL <= op(E)*d - b*eta <= eU
(1.5) op(F)*d + (1 - eta) * f = 0
eta = 1, d = 0 guaranteed if dL <= 0 <= dU and eL <= b <= eU). If the function M(eta) in the objective is large enough, then the constraint etaL <= eta will be active if a feasible region exists. The form of the function M(eta) is not specified by this interface but is defined as appropriate for each individual QP solver method and implementation.The Lagrangian for the QP in (1) is:
L = g' * d + 1/2 * d' * G * d + M(eta)
+ kappa * (etaL - eta)
+ nuL' * (dL - d)
+ nuU' * (d - dU)
+ muL' * (eL - op(E)*d - b*eta)
+ muU' * (op(E)*d - b*eta - eU)
+ lambda' * (op(F)*d + (1 - eta) * f)
Linear dependence of gradients:
(2) d(L)/d(d) = g + G*d - nuL + nuU + op(E)'*(- muL + muU) + op(F)'*lambda
= g + G*d + nu + op(E)'*mu + op(F)'*lambda = 0
where: nu = nuU - nuL, mu = muU - muL
(3) d(L)/d(eta) = d(M)/d(eta) - kappa - b'*mu - f'*lambda = 0
Feasibility:
(4.1) etaL <= eta
(4.2) dL <= d <= dU
(4.3) eL <= op(E)*d - b*eta <= eU
(4.4) op(F)*d + (1 - eta) * f = 0
Complementarity:
(5.1) nu(i) * (dL - d)(i) = 0, if nu(i) <= 0, i = 1...n
(5.2) nu(i) * (d - dU)(i) = 0, if nu(i) >= 0, i = 1...n
(5.3) mu(j) * (eL - op(E)*d + b*eta)(j) = 0, if mu(j) <= 0, j = 1...m_in
(5.4) mu(j) * (op(E)*d - b*eta - eU)(j) = 0, if mu(j) >= 0, j = 1...m_in
Nonnegativity of Lagrange Multipliers for Inequality Constraints:
(6.1) nu(i) <= 0 if (dL - d)(i) = 0, i = 1...n
(6.2) nu(i) >= 0 if (d - dU)(i) = 0, i = 1...n
(6.3) mu(j) <= 0 if (eL - op(E)*d - b*eta)(j) = 0, j = 1...m_in
(6.4) mu(j) >= 0 if (op(E)*d - b*eta - eU)(j) = 0, j = 1...m_in
d and eta are determined as well as the lagrange multipliers for the constriants: nu : dL <= d <= dU mu : eL <= op(E)*d - b*eta <= eU lambda : op(F)*d + (1 - eta) * f = 0
kappa for the constraint etaL <= eta is not returned since if this constraint is not active, then kappa == 0 and all of the multiplier estimates will be off because of the arbitrarily large value of d(M)/d(eta) in the optimality condition (3).
Definition at line 119 of file ConstrainedOptPack_QPSolverRelaxed.hpp.
|
|
Enumeration for the amount of output to create from
Definition at line 142 of file ConstrainedOptPack_QPSolverRelaxed.hpp. |
|
|
Enumeration for if to run internal tests or not.
Definition at line 153 of file ConstrainedOptPack_QPSolverRelaxed.hpp. |
|
|
Definition at line 46 of file ConstrainedOptPack_QPSolverRelaxed.cpp. |
|
|
Definition at line 167 of file ConstrainedOptPack_QPSolverRelaxed.hpp. |
|
|
Set the scalar that will be used to identigy infinite bounds.
Reimplemented in ConstrainedOptPack::QPSolverRelaxedQPKWIK. Definition at line 161 of file ConstrainedOptPack_QPSolverRelaxed.hpp. |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Solve the QP.
Unbounded, Infeasible or InvalidInput may be thrown. If the QP is illconditioned other exeptions may be thrown by this function or perhaps warning messages may be printed to *out and a value other than OPTIMAL_SOLUTION may be returned.
After this function returns,
Note, the variable bounds can be removed by passing in
By default this function calls the function Definition at line 51 of file ConstrainedOptPack_QPSolverRelaxed.cpp. |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Solve the QP without general equality constrants.
By default this function calls Definition at line 72 of file ConstrainedOptPack_QPSolverRelaxed.cpp. |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Solve the QP without general inequality constrants.
By default this function calls Definition at line 91 of file ConstrainedOptPack_QPSolverRelaxed.cpp. |
|
||||||||||||||||||||||||||||||||||||||||||||
|
Solve the QP without general equality or inequality constrants (no relaxation needed).
By default this function calls Definition at line 110 of file ConstrainedOptPack_QPSolverRelaxed.cpp. |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This is a more flexible function where the client can set different constraints to be included.
The default implementation of this function validates the compatibily of the input objects and that the proper sets of constraints are set by calling Definition at line 128 of file ConstrainedOptPack_QPSolverRelaxed.cpp. |
|
|
Get the statistics of the last QP solved.
solution: Returns the type of solution found. See
num_iter: Gives the number of QP iterations on output. Implemented in ConstrainedOptPack::QPSolverRelaxedQPKWIK, ConstrainedOptPack::QPSolverRelaxedQPOPTSOL, and ConstrainedOptPack::QPSolverRelaxedQPSchur. |
|
|
Release any memory that is being used.
Implemented in ConstrainedOptPack::QPSolverRelaxedQPKWIK, ConstrainedOptPack::QPSolverRelaxedQPOPTSOL, and ConstrainedOptPack::QPSolverRelaxedQPSchur. |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This is a (static) function that is used as a utility to validate the input arguments to The input arguments are validated as follows.
If the variable bounds are excluded then:
If the general inequality constraints are excluded then:
If the equality constraints are excluded then:
If the equality and inequality constraints are excluded then: If any errors are found an std::invalid_argument exception will be thrown. Definition at line 163 of file ConstrainedOptPack_QPSolverRelaxed.cpp. |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Utility (static) function for printing the input input/output arguments before the QP solver is run. The QP solver subclasses can call this function.
Definition at line 262 of file ConstrainedOptPack_QPSolverRelaxed.cpp. |
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
Utility (static) function for printing the output input/output arguments after the QP solver is run. The QP solver subclasses can call this function.
Definition at line 357 of file ConstrainedOptPack_QPSolverRelaxed.cpp. |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subclasses are to override this to implement the QP algorithm.
Called by default implementations of Implemented in ConstrainedOptPack::QPSolverRelaxedQPKWIK, ConstrainedOptPack::QPSolverRelaxedQPOPTSOL, and ConstrainedOptPack::QPSolverRelaxedQPSchur. |
1.3.9.1