ConicBundle
BundleModel.hxx
Go to the documentation of this file.
1 
2 
3 #ifndef CONICBUNDLE_BUNDLEMODEL_HXX
4 #define CONICBUNDLE_BUNDLEMODEL_HXX
5 
6 
15 #include "QPModelDataObject.hxx"
16 #include "BundleProxObject.hxx"
19 
20 namespace ConicBundle {
21 
67 
141 {
142 
143 public:
144 
145  BundleModel(CBout* cb=0,int cbinc=-1);
146  virtual ~BundleModel();
147 
149  enum ModelUpdate {
153  };
154 
155 
192  virtual int eval_function(CH_Matrix_Classes::Integer& ub_fid,
195  const CH_Matrix_Classes::Matrix& y,
196  CH_Matrix_Classes::Real nullstep_bound,
197  CH_Matrix_Classes::Real relprec) =0;
198 
199 
229  virtual int eval_model(CH_Matrix_Classes::Real& lb,
231  const CH_Matrix_Classes::Matrix& y,
232  CH_Matrix_Classes::Real relprec)=0;
233 
234 
235 
236 
269  virtual int start_augmodel(QPModelDataPointer& blockp,
271  const CH_Matrix_Classes::Matrix& cand_y,
272  const CH_Matrix_Classes::Indexmatrix* indices=0)=0;
273 
274 
308  virtual int make_model_aggregate(bool& penalty_parameter_increased,bool keep_penalty_fixed)=0;
309 
310 
342  virtual int get_model_aggregate(CH_Matrix_Classes::Integer& model_aggregate_id,
343  MinorantPointer& model_aggregate) =0;
344 
345 
410  virtual int update_model(ModelUpdate model_update,
411  CH_Matrix_Classes::Integer center_id,
412  const CH_Matrix_Classes::Matrix& center_y,
414  const CH_Matrix_Classes::Matrix& cand_y,
415  CH_Matrix_Classes::Real model_maxviol,
416  BundleProxObject& H) =0;
417 
418 
490  virtual int synchronize_ids(CH_Matrix_Classes::Integer& new_center_ub_fid,
491  CH_Matrix_Classes::Integer new_center_id,
492  CH_Matrix_Classes::Integer old_center_id,
493  CH_Matrix_Classes::Integer& new_cand_ub_fid,
494  CH_Matrix_Classes::Integer new_cand_id,
495  CH_Matrix_Classes::Integer old_cand_id,
496  CH_Matrix_Classes::Integer& new_aggregate_id)=0;
497 
533  virtual bool center_modified(CH_Matrix_Classes::Integer& function_modification_id,
534  CH_Matrix_Classes::Integer center_id)=0;
535 
536 
595  virtual int recompute_center(CH_Matrix_Classes::Integer& new_center_ub_fid,
596  CH_Matrix_Classes::Real& new_center_ub,
597  CH_Matrix_Classes::Integer center_id,
598  const CH_Matrix_Classes::Matrix& center_y,
599  bool accept_only_higher_values=false,
600  CH_Matrix_Classes::Real relprec=-1.)=0;
601 
602 
605  virtual bool model_aggregate_modified(CH_Matrix_Classes::Integer old_model_aggregate_id)=0;
606 
607 
608 
620  const CH_Matrix_Classes::Matrix& y)=0;
621 
622 
623 
657  virtual int apply_modification(bool& no_changes,
658  const GroundsetModification& gsmdf,
659  const FunObjModMap& funmdfmap,
660  CH_Matrix_Classes::Integer new_center_id,
661  const CH_Matrix_Classes::Matrix& new_center,
662  CH_Matrix_Classes::Integer old_center_id,
663  const CH_Matrix_Classes::Matrix& old_center)=0;
664 
665 
680  virtual int check_center_validity_by_candidate(bool& cand_minorant_is_below,
681  CH_Matrix_Classes::Integer center_id,
682  const CH_Matrix_Classes::Matrix& center_y)=0;
683 
686  virtual int get_function_minorant(CH_Matrix_Classes::Integer& function_modification_id,MinorantPointer& minorant) =0;
687 
690  virtual int get_center_minorant(CH_Matrix_Classes::Integer& function_modification_id,MinorantPointer& minorant) =0;
691 
692 
698  virtual BundleModel* transform() {return this;}
699 
702  {return transform();}
703 
704 };
705 
706 
707 
709 
710 }
711 
712 #endif
713 
int Integer
all integer numbers in calculations and indexing are of this type
Definition: matop.hxx:40
VariableMetricModel * variable_metric_transform()
replaces variable_metric_transform by transform
Definition: BundleModel.hxx:701
abstract interface that allows to use different -norms with a positive definite matrix in the proxi...
Definition: BundleProxObject.hxx:88
virtual int get_function_minorant(CH_Matrix_Classes::Integer &function_modification_id, MinorantPointer &minorant)=0
returns the minorant corresponding to the subgradient inequality returned by the last function evalua...
double Real
all real numbers in calculations are of this type
Definition: matop.hxx:50
virtual bool center_modified(CH_Matrix_Classes::Integer &function_modification_id, CH_Matrix_Classes::Integer center_id)=0
returns true if the evaluation data for the known function_modification_id and for the identifier cen...
abstract interface for automatically generating and retrieving the qp blocks with the model data that...
Definition: QPModelDataObject.hxx:298
virtual int get_center_minorant(CH_Matrix_Classes::Integer &function_modification_id, MinorantPointer &minorant)=0
returns the minorant corresponding to the subgradient inequality returned by the function evaluation ...
virtual ~BundleModel()
virtual destructor
Matrix class for integral values of type Integer
Definition: indexmat.hxx:195
the latest function evaluation and its subgradient resulted in a null step, preserve the aggregate! ...
Definition: BundleModel.hxx:152
virtual BundleModel * transform()
Overload this in order apply transformations in between.
Definition: BundleModel.hxx:698
the latest function evaluation and its subgradient give rise to a descent step, preserving the aggreg...
Definition: BundleModel.hxx:151
Header declaring the class ConicBundle::BundleProxObject.
virtual int update_model(ModelUpdate model_update, CH_Matrix_Classes::Integer center_id, const CH_Matrix_Classes::Matrix &center_y, CH_Matrix_Classes::Integer cand_id, const CH_Matrix_Classes::Matrix &cand_y, CH_Matrix_Classes::Real model_maxviol, BundleProxObject &H)=0
generate the next cutting model and store the center information in the case of a descent step ...
conic bundle method solver for sum of convex functions. See the ConicBundle_Manual for a quick introd...
Definition: CBSolver.hxx:22
virtual int eval_model(CH_Matrix_Classes::Real &lb, CH_Matrix_Classes::Integer y_id, const CH_Matrix_Classes::Matrix &y, CH_Matrix_Classes::Real relprec)=0
evaluate the current cutting model in the given point
base class for uniform use of WARNINGS and ERRORS (at some point in time)
Definition: CBout.hxx:30
ModelUpdate
for informing update_model() at what stage it is called to update the bundle so that the amount of in...
Definition: BundleModel.hxx:149
declares the interface that a BundelModel needs to provide for contributing to VariableMetric informa...
Definition: VariableMetric.hxx:111
Header declaring the classes ConicBundle::FunctionObjectModification and ConicBundle::FunObjModMap.
virtual int eval_function(CH_Matrix_Classes::Integer &ub_fid, CH_Matrix_Classes::Real &ub, CH_Matrix_Classes::Integer y_id, const CH_Matrix_Classes::Matrix &y, CH_Matrix_Classes::Real nullstep_bound, CH_Matrix_Classes::Real relprec)=0
evaluates the objective function in y and returns an upper bound in ub within relative precision relp...
virtual int apply_modification(bool &no_changes, const GroundsetModification &gsmdf, const FunObjModMap &funmdfmap, CH_Matrix_Classes::Integer new_center_id, const CH_Matrix_Classes::Matrix &new_center, CH_Matrix_Classes::Integer old_center_id, const CH_Matrix_Classes::Matrix &old_center)=0
passes on modification information about function and ground set changes
virtual int recompute_center(CH_Matrix_Classes::Integer &new_center_ub_fid, CH_Matrix_Classes::Real &new_center_ub, CH_Matrix_Classes::Integer center_id, const CH_Matrix_Classes::Matrix &center_y, bool accept_only_higher_values=false, CH_Matrix_Classes::Real relprec=-1.)=0
after modifications of the problem the center information may have to be recomputed partially or comp...
Header declaring the class ConicBundle::QPModelDataObject, ConicBundle::QPSumModelDataObject, ConicBundle::QPConeModelDataObject, ConicBundle::QPModelDataPointer.
Matrix class for real values of type Real
Definition: matrix.hxx:74
Header declaring the class ConicBundle::GroundsetModification.
std::map< const FunctionObject *, FunctionObjectModification > FunObjModMap
In order to pass on problem modifications, FunObjModMap allows to specify a FunctionObjectModificatio...
Definition: FunctionObjectModification.hxx:104
abstract interface for BundleSolver giving access to all objective function specific bundle routines ...
Definition: BundleModel.hxx:140
BundleModel(CBout *cb=0, int cbinc=-1)
constructor (cb allows to set output options)
virtual int check_center_validity_by_candidate(bool &cand_minorant_is_below, CH_Matrix_Classes::Integer center_id, const CH_Matrix_Classes::Matrix &center_y)=0
consistency check for oracle computations: test if the subgradient inequality arising out of the last...
virtual bool model_aggregate_modified(CH_Matrix_Classes::Integer old_model_aggregate_id)=0
returns true if the data about the aggregate minorant has changed w.r.t. old_model_aggregate_id. In this case call provide_model_aggregate and then add_model_aggregate to update the model_aggregate
virtual int make_model_aggregate(bool &penalty_parameter_increased, bool keep_penalty_fixed)=0
after the common QP is solved, this call asks to form the new aggregate from the solution. If keep_penalty_fixed==false the model may decide to increase some internal penalty parameter, has then to report this in penalty_parameter_increased but need not form the aggregate.
Collects modifications for the unconstrained Groundset for appending, deleting or reassigning variabl...
Definition: GroundsetModification.hxx:32
virtual int get_model_aggregate(CH_Matrix_Classes::Integer &model_aggregate_id, MinorantPointer &model_aggregate)=0
returns the model aggregate if available.
virtual int start_augmodel(QPModelDataPointer &blockp, CH_Matrix_Classes::Integer cand_id, const CH_Matrix_Classes::Matrix &cand_y, const CH_Matrix_Classes::Indexmatrix *indices=0)=0
the returned blockp points to a description of the variables and constraints generating the cutting m...
virtual int synchronize_ids(CH_Matrix_Classes::Integer &new_center_ub_fid, CH_Matrix_Classes::Integer new_center_id, CH_Matrix_Classes::Integer old_center_id, CH_Matrix_Classes::Integer &new_cand_ub_fid, CH_Matrix_Classes::Integer new_cand_id, CH_Matrix_Classes::Integer old_cand_id, CH_Matrix_Classes::Integer &new_aggregate_id)=0
reset all id counters and references to zero and center_id and cand_id to the given values if consist...
points to MinorantUseData that may be shared by many and allows computations with Minorants ...
Definition: MinorantPointer.hxx:34
the latest function evaluation and its subgradient arise from an extra evaluation of the function ...
Definition: BundleModel.hxx:150
virtual int provide_model_aggregate(CH_Matrix_Classes::Integer y_id, const CH_Matrix_Classes::Matrix &y)=0
makes sure that the model_aggregate returned by add_model_aggregate is actually a minorant contained ...