ConicBundle
|
abstract interface for a QPSolver More...
#include <QPSolverObject.hxx>
Public Member Functions | |
virtual void | QPclear ()=0 |
clear | |
QPSolverObject (CBout *cb=0, int cbinc=-1) | |
default constructor | |
virtual | ~QPSolverObject () |
virtual destructor | |
virtual int | QPset_parameters (QPSolverParametersObject *params)=0 |
the parameter object passed here will be owned and deleted by *this | |
virtual bool | QPsupports_yfixing ()=0 |
in the case of box constraints it may be worth to fix some variables to their upper or lower bounds; return true if the QPsolver supports this in QPSolve More... | |
virtual bool | QPsupports_updates ()=0 |
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 | |
virtual 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)=0 |
solve for the data described by Hp and QPModelDataPointer for the center of stability center_y terminating when the relative precision relprec of the objective value with respect to lower_bound and upper_bound is reached More... | |
virtual 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_aggr, const CH_Matrix_Classes::Indexmatrix &delta_index)=0 |
resolve after a call to QPsolve for a modified groundset minorant, whose changes are described in delta_gs_subg for the indices in delta_index More... | |
virtual int | QPresolve (CH_Matrix_Classes::Real lower_bound, CH_Matrix_Classes::Real upper_bound, CH_Matrix_Classes::Real relprec)=0 |
if in the model description some trace/penalty values were adapted, this may require resolving without any other change in information More... | |
virtual 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 &gs_aggr_offset, CH_Matrix_Classes::Matrix &gs_aggr_gradient)=0 |
returns 0 and the solution to the last solving call if the data is available, otherwise it returns 1 | |
virtual CH_Matrix_Classes::Real | QPget_lower_bound ()=0 |
returns the last lower bound used for termination | |
virtual GroundsetModification * | QPstart_modification ()=0 |
return a new modification object on the heap that is initialized for modification of *this, return 0 if no modifications applicable | |
virtual int | QPapply_modification (const GroundsetModification &mdf)=0 |
apply the modification, return 0 if successful and 1 if unsuccessful | |
virtual bool | QPis_feasible (const CH_Matrix_Classes::Matrix &y, CH_Matrix_Classes::Real relprec=1e-10)=0 |
check whether the point y is feasible with respect to the constraints describing the groundset of the QP for y | |
virtual int | QPensure_feasibility (CH_Matrix_Classes::Matrix &y, bool &ychanged, QPSolverProxObject *Hp, CH_Matrix_Classes::Real relprec=1e-10)=0 |
makes y feasible if it is not feasible for the groundset of the QP, see Groundset::ensure_feasibility() | |
virtual bool | QPprefer_UQPSolver (QPSolverProxObject *) const =0 |
returns true if, for the current constraints and the requested ProxObject, it might be better to use the internal unconstrained QP solver (which can deal with box constraints by a work-around) | |
virtual bool | QPconstrained () const =0 |
returns false if the feasible set is the entire space (unconstrained optimization), true otherwise. | |
virtual 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 =0 |
returns true if and only if there exist box constraints and these are the only constraints; if there are box constraints (and maybe others), the pointers return the reference to them (full dimensional dense vectors lb und ub; lbind and ubind are index vectors giving only the indices i of entries lb(i)>-infty and ub(i)<infty respectively sorted by increasing index values); if the corresponding objects do not exist, the value returned is null | |
virtual std::ostream & | QPprint_statistics (std::ostream &out, int printlevel=0)=0 |
allows to output some implementation dependent statistics on run time behaviour | |
Public Member Functions inherited from ConicBundle::QPModelDataPointer | |
QPModelDataPointer (CBout *cb=0, int cbinc=-1) | |
default constructor | |
virtual | ~QPModelDataPointer () |
virtual destructor | |
virtual void | clear_model_data_ptr ()=0 |
set the pointer to NULL | |
virtual int | set_model_data (QPModelDataObject *)=0 |
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 | |
virtual QPSumModelDataObject * | generate_summodel_data (BundleModel *bmp=0)=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 | |
virtual QPConeModelDataObject * | generate_conemodel_data (BundleModel *bmp=0)=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 | |
virtual QPModelDataObject * | get_model_data_ptr () const =0 |
returns the pointer value | |
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 | |
abstract interface for a QPSolver
In QPsolve() and QPupdate() the QPSolverProxObject gives access to the quadratic term of the cost function, maybe in several different ways, e.g. by a routine computing the cost terms explicitly or as a matrix times vector interface or as a low rank description with diagonal; the object pointed to just provides information but is neither owned nor deleted by this
|
pure virtual |
if in the model description some trace/penalty values were adapted, this may require resolving without any other change in information
Implemented in ConicBundle::UQPSolver, and ConicBundle::QPSolver.
|
pure virtual |
solve for the data described by Hp and QPModelDataPointer for the center of stability center_y terminating when the relative precision relprec of the objective value with respect to lower_bound and upper_bound is reached
The main termination criterion (besides sufficient feasibility) is that the lower bound on the objective value is above lower_bound (most of the time this is the most recent augmented model value and this should make sure that there is some increase in the augemented value) and that it is sufficiently close to the current upper bound with relative precision relprec*(current_upper_bound-lower_bound) It should never exceed upper_bound (relprec is mostly a pretty large number for a relative precision); in practice it may happen that for high precision requirements it is not possible to get strictly above lower_bound, which indicates the limit of achievable numerical precision is reached.
The groundset aggregated gs_aggr is typically only required when using an unconstrained QP solver, if simple groundset constraints are modelled in a Gauss-Seidel fashion. If QP solvers model all groundset constraints explicitly this can be ignored. Otherwise the groundset aggregate is updated each time to be the best groundset minorant for keeping the candidate inside the feasible set for the current model aggregate.
The parameter yfixed holds a nonzero value in each index where the center_y value should no longer be changed by the qp solver. This simply requires some precprocessing which eliminates the corresponding variables but this need not be implemented if QPsupports_yfixing() returns false, then the parameter may simply be ignored. yfixed(i) has value
Implemented in ConicBundle::UQPSolver, and ConicBundle::QPSolver.
|
pure virtual |
in the case of box constraints it may be worth to fix some variables to their upper or lower bounds; return true if the QPsolver supports this in QPSolve
Implemented in ConicBundle::UQPSolver, and ConicBundle::QPSolver.
|
pure virtual |
resolve after a call to QPsolve for a modified groundset minorant, whose changes are described in delta_gs_subg for the indices in delta_index
The routine is only called if the solution of QPsolve does not produce a feasible candidate by itself and the candidate has to be made feasible by adapting the groundset aggregate gs_aggr in a suitable way. This never happens if a QP solver includes all groundset constraints explitictly. Currently it may happen in ConicBundle when the unconstrained QP solver is used together with box constraints. If it happens, delta_gs_aggr gives the change from the previous groundset aggregate to the new groundset aggregate as well as a list of indices in delta_index on which coordinates changed. This information should help to efficiently update the QP cost function without the need to fully form in particular the quadratic cost matrix.
yfixed has the same meaning as for QPsolve
Implemented in ConicBundle::UQPSolver, and ConicBundle::QPSolver.