ConicBundle
|
unconstrained QP solver combining the properties of a QPModelDataPointer and QPSolverObject More...
#include <UQPSolver.hxx>
Public Member Functions | |
void | clear () |
reset to "empty/no" model | |
void | set_defaults () |
reset parameters to default values | |
UQPSolver (CBout *cb=0, int cbinc=-1) | |
default constructor | |
~UQPSolver () | |
destructor | |
void | init_size (CH_Matrix_Classes::Integer maxdim) |
reserve memory for this size | |
const CH_Matrix_Classes::Symmatrix & | get_Q (void) const |
returns the quadratic cost matrix | |
const CH_Matrix_Classes::Matrix & | get_c (void) const |
returns the linear cost vector | |
CH_Matrix_Classes::Real | get_offset (void) const |
returns the constant cost offset value | |
void | set_termbounds (CH_Matrix_Classes::Real lb, CH_Matrix_Classes::Real ub) |
sets the termination lower and upper bounds | |
void | set_termeps (CH_Matrix_Classes::Real te) |
sets the termination precision | |
void | set_maxiter (CH_Matrix_Classes::Integer mi) |
sets the upper bound on the number of interior point iterations (<0 means no bound) | |
CH_Matrix_Classes::Integer | get_iter () const |
return the number of iterations of the last solve | |
CH_Matrix_Classes::Integer | get_status () const |
return the status of the last solve | |
CH_Matrix_Classes::Real | get_termeps () const |
return the termination precision | |
CH_Matrix_Classes::Integer | get_maxiter () const |
return the upper bound on interior point interations | |
CH_Matrix_Classes::Real | get_primalval () const |
return the primal objective value (lower bound) of the last solve | |
CH_Matrix_Classes::Real | get_dualval () const |
return the dual objective value (upper bound) of the last solve | |
const CH_Matrix_Classes::Matrix & | get_x () |
return the joint model vector (primal solution) produced by the last solve | |
const CH_Matrix_Classes::Matrix & | get_y () |
return the joint dual vector (dual solution) produced by the last solve | |
int | solve (const CH_Matrix_Classes::Symmatrix &Q, const CH_Matrix_Classes::Matrix &c, CH_Matrix_Classes::Real offset) |
solve the QP for this cost function from scratch | |
int | resolve () |
resolve the QP for the same cost function as last time with slightly modified feasible set | |
int | update (const CH_Matrix_Classes::Symmatrix &dQ, const CH_Matrix_Classes::Matrix &dc, CH_Matrix_Classes::Real doffset) |
resolve the QP for the same feasible set but update the cost terms by the given argumetns first | |
std::ostream & | print_statistics (std::ostream &out) const |
output some statistical information on performance | |
std::ostream & | save (std::ostream &out) const |
save the current settings and values | |
std::istream & | restore (std::istream &in) |
restore the settings and values | |
void | QPclear () |
calls clear(), i.e. reinitialize completely | |
int | QPset_parameters (QPSolverParametersObject *) |
does nothing here | |
int | apply_modification (const GroundsetModification &) |
does nothing here (unconstrained case) | |
bool | QPsupports_yfixing () |
no difficulty if the BundleProxObject does it | |
virtual bool | QPsupports_updates () |
return true iff the code supports QPupdate(), i.e., it supports external updates of the groundset aggregate in order to model constraints not included explicitly in the QP's model | |
CH_Matrix_Classes::Real | QPget_lower_bound () |
return the lower bound on the objective value of the bundle subproblem | |
int | QPsolve (const CH_Matrix_Classes::Matrix ¢er_y, CH_Matrix_Classes::Real lower_bound, CH_Matrix_Classes::Real upper_bound, CH_Matrix_Classes::Real relprec, QPSolverProxObject *Hp, const MinorantPointer &gs_aggr, CH_Matrix_Classes::Indexmatrix *yfixed) |
see QPSolverObject::QPsolve() and Internal QP Solver for unconstrained groundsets | |
int | QPupdate (const CH_Matrix_Classes::Matrix ¢er_y, CH_Matrix_Classes::Real lower_bound, CH_Matrix_Classes::Real upper_bound, CH_Matrix_Classes::Real relprec, QPSolverProxObject *Hp, const MinorantPointer &gs_aggr, CH_Matrix_Classes::Indexmatrix *yfixed, const MinorantPointer &delta_gs_subg, const CH_Matrix_Classes::Indexmatrix &delta_index) |
see QPSolverObject::QPupdate() and Internal QP Solver for unconstrained groundsets | |
int | QPresolve (CH_Matrix_Classes::Real lower_bound, CH_Matrix_Classes::Real upper_bound, CH_Matrix_Classes::Real relprec) |
see QPSolverObject::QPresolve() and Internal QP Solver for unconstrained groundsets | |
int | QPget_solution (CH_Matrix_Classes::Real &augval_lb, CH_Matrix_Classes::Real &augval_ub, CH_Matrix_Classes::Matrix &new_point, CH_Matrix_Classes::Real &gsaggr_offset, CH_Matrix_Classes::Matrix &gsaggr_gradient) |
the unconstrained solver can only provide this information if the references to the input data of QPsolve() and QPudate() are still available and unchanged, otherwise the behavior is undefined and will hopefully return 1 if not valid | |
bool | QPprefer_UQPSolver (QPSolverProxObject *) const |
as this IS the internal UQPSolver, the answer doesn't matter, but the solver would certainly say yes | |
bool | QPconstrained () const |
it is always unconstrained | |
virtual GroundsetModification * | QPstart_modification () |
returns 0 because no modifications are applicable | |
int | QPapply_modification (const GroundsetModification &) |
no modifications need to be carried out here as there is no data to be modified, so any modification succeeds | |
bool | QPis_feasible (const CH_Matrix_Classes::Matrix &, CH_Matrix_Classes::Real=1e-10) |
for the unconstrained solver any point is feasible, because it cannot even check the dimension of the design space | |
virtual int | QPensure_feasibility (CH_Matrix_Classes::Matrix &, bool &ychanged, QPSolverProxObject *, CH_Matrix_Classes::Real=1e-10) |
for the unconstrained solver any point is feasible, because it cannot even check the dimension of the design space, so any y is left unchanged | |
bool | QPboxconstrained (const CH_Matrix_Classes::Matrix *&lb, const CH_Matrix_Classes::Matrix *&ub, const CH_Matrix_Classes::Indexmatrix *&lbind, const CH_Matrix_Classes::Indexmatrix *&ubind) const |
the unconstrained solver does not have this inforamion and does not know about it, so it returns NULL pointers and false | |
std::ostream & | QPprint_statistics (std::ostream &out, int=0) |
outputs some statistical data about solver performance | |
Public Member Functions inherited from ConicBundle::UQPModelPointer | |
UQPModelPointer (CBout *cb=0, int cbinc=-1) | |
default constructor | |
virtual | ~UQPModelPointer () |
virtual destructor | |
void | clear_model_data_ptr () |
set the pointer to NULL | |
int | set_model_data (QPModelDataObject *inbp) |
store the pointer to the object if it matches the required type for the QP solver, otherwise return a nonzero value as error; this is used in the models to return the local qp model data | |
QPSumModelDataObject * | generate_summodel_data (BundleModel *bmp=0) |
returns a new QPSumModelDataObject, that has to be deleted by the caller. The argument is optional and allows to potentially generate different blocks for different derived BundleModel objects; this is used in SumModel to collect the models of the various oracles that are summed over | |
QPConeModelDataObject * | generate_conemodel_data (BundleModel *bmp=0) |
returns a new QPConeModelDataObject suitable for the default conic BundleModel implementations; it has to be deleted by the caller. The argument is optional and allows to potentially generate specialized objects for special BundleModel objects | |
QPModelDataObject * | get_model_data_ptr () const |
returns the pointer value | |
Public Member Functions inherited from ConicBundle::QPModelDataPointer | |
QPModelDataPointer (CBout *cb=0, int cbinc=-1) | |
default constructor | |
virtual | ~QPModelDataPointer () |
virtual destructor | |
Public Member Functions inherited from ConicBundle::CBout | |
virtual void | set_out (std::ostream *out=0, int print_level=1) |
Specifies the output level (out==NULL: no output at all, out!=NULL and level=0: errors and warnings, level>0 increasingly detailed information) More... | |
virtual void | set_cbout (const CBout *cb, int incr=-1) |
Specifies the output level relative to the given CBout class. More... | |
void | clear_cbout () |
reset to default settings (out=0,print_level=1) | |
CBout (const CBout *cb=0, int incr=-1) | |
calls set_cbout | |
CBout (std::ostream *outp, int pl=1) | |
initialize correspondingly | |
CBout (const CBout &cb, int incr=0) | |
copy constructor | |
virtual bool | cb_out (int pl=-1) const |
Returns true if out!=0 and (pl<print_level), pl<0 should be used for WARNINGS and ERRORS only, pl==0 for usual output. | |
std::ostream & | get_out () const |
If cb_out() returned true, this returns the output stream, but it will abort if called with out==0. | |
std::ostream * | get_out_ptr () const |
returns the pointer to the output stream | |
int | get_print_level () const |
returns the print_level | |
virtual int | mfile_data (std::ostream &out) const |
writes problem data to the given outstream | |
Public Member Functions inherited from ConicBundle::QPSolverObject | |
QPSolverObject (CBout *cb=0, int cbinc=-1) | |
default constructor | |
virtual | ~QPSolverObject () |
virtual destructor | |
Private Member Functions | |
void | select_new_mu (const CH_Matrix_Classes::Matrix &dx, const CH_Matrix_Classes::Matrix &dy, const CH_Matrix_Classes::Matrix &rhs_residual) |
chooses the next value of the barrier parameter | |
int | predcorr_step (CH_Matrix_Classes::Real &alpha) |
carry out a predictor corrector step | |
int | iterate () |
calls predcorr_step interatively until termination | |
Private Attributes | |
BundleProxObject * | Hp |
the current/latest prox term, mainly needed for computing the QP cost matrices and possibly for delivering the solution later in QPget_solution | |
const CH_Matrix_Classes::Matrix * | center_yp |
the current/latest center point, mainly needed for computint the QP cost matrices and possibly reconstructing the solution later in QPget_solution | |
MinorantPointer | gs_aggr |
the current/latest groundset aggeregate, mainly needed for computing the QP cost matrices and possibly reconstructing the solution later in QPget_solution | |
CH_Matrix_Classes::Symmatrix | Q |
quadratic cost matrix (positive definite) | |
CH_Matrix_Classes::Matrix | c |
linear cost matrix | |
CH_Matrix_Classes::Real | offset |
constant added to objective | |
CH_Matrix_Classes::Matrix | A |
a (full) blockmatrix mainly for the trace constraints, it is collected by calling model_block | |
CH_Matrix_Classes::Matrix | b |
right hand side to A, it is collected by calling model_block | |
CH_Matrix_Classes::Real | lowerbound |
lower bound on the final objective value | |
CH_Matrix_Classes::Real | upperbound |
upper bound on the final objective value | |
CH_Matrix_Classes::Real | termeps |
termination precision | |
CH_Matrix_Classes::Integer | maxiter |
upper limit on the number of interior poitn iterations (none if <0) | |
CH_Matrix_Classes::Matrix | x |
current model x as one joint vector | |
CH_Matrix_Classes::Matrix | y |
current dual variable to constraints | |
CH_Matrix_Classes::Matrix | dx |
step for x | |
CH_Matrix_Classes::Matrix | dy |
step for y | |
CH_Matrix_Classes::Real | primalval |
primal objective value | |
CH_Matrix_Classes::Real | dualval |
dual objective value | |
CH_Matrix_Classes::Real | mu |
barrier parameter | |
CH_Matrix_Classes::Matrix | Qx |
holds Q*x for current x | |
CH_Matrix_Classes::Matrix | rhs |
right hand side of the KKT system | |
bool | run_starting_point |
in restarting go back to the starting point | |
CH_Matrix_Classes::Integer | iter |
counts number o iterations | |
CH_Matrix_Classes::Integer | status |
termination status of last call to solve or update | |
CH_Matrix_Classes::Symmatrix | Qplus |
L*L^T factorization of Q+blockdiag. | |
CH_Matrix_Classes::Matrix | LinvAt |
=L^-1*A^T | |
CH_Matrix_Classes::Symmatrix | sysdy |
system matrix for dy | |
CH_Matrix_Classes::Matrix | rd |
dual slack rd=c-Qx-At*y (=-z if feasible) | |
CH_Matrix_Classes::Matrix | xcorr |
correction value for x | |
CH_Matrix_Classes::Matrix | tmpvec |
temporary vector for reducing reallocations | |
CH_Matrix_Classes::Matrix | tmpxvec |
temporary vector for reducing reallocations | |
CH_Matrix_Classes::Matrix | tmpyvec |
temporary vector for reducing reallocations | |
CH_Matrix_Classes::Integer | sum_iter |
sum over all interior point iterations | |
CH_Matrix_Classes::Integer | sum_choliter |
sum over Cholesky facotrizations | |
CH_Tools::Clock | clock |
for timing | |
CH_Tools::Microseconds | sum_choltime |
sum of time spent in Cholesky | |
CH_Tools::Microseconds | QPcoeff_time |
time spent in computing the QP coefficients | |
CH_Tools::Microseconds | QPsolve_time |
time spent in solving the QP | |
Additional Inherited Members | |
Protected Attributes inherited from ConicBundle::UQPModelPointer | |
UQPModelBlock * | model_block |
stores a pointer to the current starting block giving access to the cutting model(s) [it does not own or delete this object] | |
unconstrained QP solver combining the properties of a QPModelDataPointer and QPSolverObject
For solving the bundle subproblem the standard entry point is QPsolve() (see Internal QP Solver for unconstrained groundsets for QPupdate() or QPresolve()). The cutting model is given by an internal UQPModelBlock obtained via being passed to the BundleModel as a QPModelDataPointer. The BundleProxObject provides the routines for computing the quadratic cost terms for eliminated design variables, so this solver is blind to the structure of the Groundset.
After obtaining the quadratic cost function from the BundleProxObject, the solver calls solve() (or update() or resove()) which intializes the variables also of UQPModelBlock, determines the starting point and calls iterate(). This routine then computes for the current point the primal and dual violations, the opimality gap, etc. As long as the termination criterion (steered by upper and lower bounds and termination precision) is not met, it computes predictor corrector steps by calling predcorr_step(). The latter sets up and solves a primal dual KKT system in cooperation with the routines of the UQPModelBlock (with underlying implementations in UQPConeModelBlock and UQPSumModelBlock) and intermediate/susbsequent calls to UQPModelBlock.line_search() and select_new_mu() for determining the next step sizes and barrier parameter.