ConicBundle
ConeModel.hxx
Go to the documentation of this file.
1 
2 
3 #ifndef CONICBUNDLE_CONEMODEL_HXX
4 #define CONICBUNDLE_CONEMODEL_HXX
5 
13 #include "SumBlockModel.hxx"
14 
15 namespace ConicBundle {
16 
20 
52 class ConeModel: public SumBlockModel
53 {
54 protected:
55 
56 
57  //----------------------------------------------------------------------
60 
61 
65  CH_Matrix_Classes::Real nullstep_bound,
66  CH_Matrix_Classes::Real relprec)=0;
67 
72  CH_Matrix_Classes::Real relprec)=0;
73 
86  virtual int update_local_model(ModelUpdate model_update,
88  const CH_Matrix_Classes::Matrix& center_y,
91  CH_Matrix_Classes::Real model_maxviol,
92  BundleProxObject& H)=0;
93 
94 
96  virtual int switch_to_local( const MinorantBundle& sumbundle_model,
97  const CH_Matrix_Classes::Matrix& sumbundle_coeff)=0;
98 
100  virtual int get_aggregate_and_coefficient(MinorantPointer& sumbundle_aggr,
101  CH_Matrix_Classes::Real& aggr_coeff)=0;
102 
104  virtual int start_local_augmodel(QPModelDataPointer& qpblockp,
106  const CH_Matrix_Classes::Matrix& cand_y,
107  const CH_Matrix_Classes::Indexmatrix* needed_indexsubset)=0;
108 
111  const CH_Matrix_Classes::Matrix& iny)=0;
112 
114  virtual int make_local_aggregate(CH_Matrix_Classes::Real& new_function_factor,
115  bool keep_penalty_fixed)=0;
116 
118  virtual int local_adjust_multiplier(CH_Matrix_Classes::Real& new_function_factor)=0;
119 
121  virtual bool candidate_available()=0;
122  //e.g. { return (data.cand_ub_mid==data.modification_id)&&(data.cand_Ritzvec.coldim()>0); }
123 
126 
129 
130 
132 
133 
134 
135 
136 public:
137 
139  virtual void clear();
140 
141  // set_variable_metric_selection //as in SumBlockData
142 
144  ConeModel(CBout* cb=0,int incr=-1);
145 
147  virtual ~ConeModel();
148 
149 
150  //----------------------------------------------------------------------
153 
154 
159  const CH_Matrix_Classes::Matrix& y,
160  CH_Matrix_Classes::Real nullstep_bound,
161  CH_Matrix_Classes::Real relprec);
162 
166  const CH_Matrix_Classes::Matrix& y,
167  CH_Matrix_Classes::Real relprec);
168 
169  //get_model_aggregate(three parameters) //as in SumBlockModel
170 
172  int update_model(ModelUpdate model_update,
173  CH_Matrix_Classes::Integer center_id,
174  const CH_Matrix_Classes::Matrix& center_y,
176  const CH_Matrix_Classes::Matrix& cand_y,
177  CH_Matrix_Classes::Real model_maxviol,
178  BundleProxObject& H);
179 
180  //synchronize_ids //as in SumBlockModel
181 
182  //center_modified //as in SumBlockModel
183 
185  int recompute_center(CH_Matrix_Classes::Integer& new_center_fid,
186  CH_Matrix_Classes::Real& new_center_ub,
187  CH_Matrix_Classes::Integer center_id,
188  const CH_Matrix_Classes::Matrix& y,
189  bool accept_only_higher_values=false,
190  CH_Matrix_Classes::Real relprec=-1.);
191 
192 
193 
196  {return get_data()->model_aggregate_modified(old_model_aggregate_id);}
197 
200  const CH_Matrix_Classes::Matrix& y);
201 
202  // apply_modification // as in SumBlockModel
203 
205  int check_center_validity_by_candidate(bool& cand_minorant_is_below,
206  CH_Matrix_Classes::Integer center_id,
207  const CH_Matrix_Classes::Matrix& center_y);
208 
210 
211  //----------------------------------------------------------------------
214 
215  // get_oracle_object() still abstract
216 
217  // start_augmodel see SumBlockModel::start_augmodel
218 
220  int make_model_aggregate(bool& penalty_parameter_increased,
221  bool keep_penalty_fixed);
222 
223  //get_model_aggregate(... aft=0) //as in SumBlockModel
224 
227  const CH_Matrix_Classes::Matrix& y);
228 
231  const AffineFunctionTransformation* aft=0);
232 
234  int get_center_minorant(MinorantPointer& minorant,
235  const AffineFunctionTransformation* aft=0);
236 
238  int adjust_multiplier(bool& values_may_have_changed);
239 
242  SumBundleHandler* bh=0,
244 
246  virtual int start_sumaugmodel(QPModelDataPointer& blockp,
248  const CH_Matrix_Classes::Matrix& cand_y,
249  const CH_Matrix_Classes::Indexmatrix* indices=0,
250  SumBundleHandler* bh=0,
253 
254 
256  virtual int update_model(ModelUpdate model_update,
257  CH_Matrix_Classes::Integer center_id,
258  const CH_Matrix_Classes::Matrix& center_y,
260  const CH_Matrix_Classes::Matrix& cand_y,
261  CH_Matrix_Classes::Real model_maxviol,
262  BundleProxObject& H,
263  CH_Matrix_Classes::Real& model_deviation,
264  CH_Matrix_Classes::Real& model_curvature);
265 
266 
267  // SumBlockModel::get_data is still abstract
268 
270 
271  //----------------------------------------------------------------------
274 
275 
276  // SumBlockModel::get_approximate_primal is still abstract
277 
278  // SumBlockModel::get_center_primal is still abstract
279 
280  // SumBlockModel::get_candidate_primal is still abstract
281 
282  // SumBlockModel::call_primal_extender is still asbtract
283 
284  // SumBlockModel::set_bundle_parameters is still abstract
285 
286  // SumBlockModel::get_bundle_parameters is still abstract
287 
288  // see SumBlockModel::clear_model
289  void clear_model(bool discard_minorants_only);
290 
292  void clear_aggregates();
293 
295 
296 
298 
299  //get_QPcoeff_time() // as in SumBlockModel
300 
301  //get_QPsolve_time() // as in SumBlockModel
302 
303  //get_evalaugmodel_time() // as in SumBlockModel
304 
305  //get_evalmodel_time() // as in SumBlockModel
306 
307  //get_updatemodel_time() // as in SumBlockModel
308 
309  //get_eval_time() // as in SumBlockModel
310 
311  //set_out() // as in SumBlockModel
312 
313  //set_cbout() // calls set_out in SumBlockModel
314 
315 
316 
317 };
318 
320 
321 }
322 
323 #endif
324 
int Integer
all integer numbers in calculations and indexing are of this type
Definition: matop.hxx:40
ConeModel(CBout *cb=0, int incr=-1)
construct a model for the MatrixFunctionOracle pointed to by fo
Header declaring the class ConicBundle::SumBlockModel.
abstract interface that allows to use different -norms with a positive definite matrix in the proxi...
Definition: BundleProxObject.hxx:88
virtual int evaluate_local_model(CH_Matrix_Classes::Real &lb, CH_Matrix_Classes::Integer y_id, const CH_Matrix_Classes::Matrix &y, CH_Matrix_Classes::Real relprec)=0
see SumBlockModel::eval_model() but ignore function_factor and function_task, this is set by ConeMode...
virtual int update_local_model(ModelUpdate model_update, CH_Matrix_Classes::Integer center_id, const CH_Matrix_Classes::Matrix &center_y, CH_Matrix_Classes::Integer y_id, const CH_Matrix_Classes::Matrix &y, CH_Matrix_Classes::Real model_maxviol, BundleProxObject &H)=0
see BundleModel::update_model() for the general setting;
virtual int start_local_augmodel(QPModelDataPointer &qpblockp, CH_Matrix_Classes::Integer cand_id, const CH_Matrix_Classes::Matrix &cand_y, const CH_Matrix_Classes::Indexmatrix *needed_indexsubset)=0
see SumBlockModel::start_augmodel(); the local QP block is exclusively organized here; the routine is...
abstract interface extending BundleModel so that any such model can be used alone or within SumModel ...
Definition: SumBlockModel.hxx:102
double Real
all real numbers in calculations are of this type
Definition: matop.hxx:50
virtual bool candidate_available()=0
returns true if candidate information (always the results of the most recent function evaulation) is ...
abstract interface for automatically generating and retrieving the qp blocks with the model data that...
Definition: QPModelDataObject.hxx:298
virtual int get_aggregate_and_coefficient(MinorantPointer &sumbundle_aggr, CH_Matrix_Classes::Real &aggr_coeff)=0
the sumbundle is initialized (not necessarily switched on) and needs to know the normalized aggregate...
the SumBundle/part is maybe maintained but currently not in use anywhere
Definition: SumBundle.hxx:197
virtual int local_adjust_multiplier(CH_Matrix_Classes::Real &new_function_factor)=0
see SumBlockModel::adjust_multiplier(); the routine is only called for adaptive penalty functions and...
int check_center_validity_by_candidate(bool &cand_minorant_is_below, CH_Matrix_Classes::Integer center_id, const CH_Matrix_Classes::Matrix &center_y)
see BundleModel::check_center_validity_by_candidate
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)
see BundleModel::eval_function
Matrix class for integral values of type Integer
Definition: indexmat.hxx:195
virtual ~ConeModel()
calls clear() and deletes the bundle parameters
virtual int evaluate_oracle(CH_Matrix_Classes::Integer y_id, const CH_Matrix_Classes::Matrix &y, CH_Matrix_Classes::Real nullstep_bound, CH_Matrix_Classes::Real relprec)=0
see SumBlockModel::eval_function() but ignore ub_fid and ub with function_factor and function_task...
CH_Matrix_Classes::Real lb_function(CH_Matrix_Classes::Integer y_id, const CH_Matrix_Classes::Matrix &y)
see SumBlockModel::lb_function
virtual int provide_local_aggregate(CH_Matrix_Classes::Integer y_id, const CH_Matrix_Classes::Matrix &iny)=0
see SumBlockModel::provide_model_aggregate(), only called if local model is active ...
int recompute_center(CH_Matrix_Classes::Integer &new_center_fid, CH_Matrix_Classes::Real &new_center_ub, CH_Matrix_Classes::Integer center_id, const CH_Matrix_Classes::Matrix &y, bool accept_only_higher_values=false, CH_Matrix_Classes::Real relprec=-1.)
see BundleModel::recompute_center
Mode
specifies for different parts of the sumbundle whether it is active and who is responsible for handli...
Definition: SumBundle.hxx:194
conic bundle method solver for sum of convex functions. See the ConicBundle_Manual for a quick introd...
Definition: CBSolver.hxx:22
base class for uniform use of WARNINGS and ERRORS (at some point in time)
Definition: CBout.hxx:30
int adjust_multiplier(bool &values_may_have_changed)
see SumBlockModel::adjust_multiplier()
virtual MinorantPointer & provide_cand_minorant()=0
if it cannot be provided it returns a minorant with valid()==false
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
int provide_model_aggregate(CH_Matrix_Classes::Integer y_id, const CH_Matrix_Classes::Matrix &y)
see BundleModel::provide_model_aggregate
int get_center_minorant(MinorantPointer &minorant, const AffineFunctionTransformation *aft=0)
see SumBlockModel::get_center_minorant()
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)
see BundleModel::update_model
virtual bool model_aggregate_modified(CH_Matrix_Classes::Integer model_aggregate_id)
check whether aggregate is available and has the same id
void clear_aggregates()
see SumBlockModel::clear_aggregates
void clear_model(bool discard_minorants_only)
modifications of this specific problem were such that old subgradient data and function values have t...
virtual int make_local_aggregate(CH_Matrix_Classes::Real &new_function_factor, bool keep_penalty_fixed)=0
see SumBlockModel::make_model_aggregate for the general rationale; the routine is only called...
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)
see BundleModel::eval_model
Matrix class for real values of type Real
Definition: matrix.hxx:74
virtual int start_sumaugmodel(QPModelDataPointer &blockp, CH_Matrix_Classes::Integer cand_id, const CH_Matrix_Classes::Matrix &cand_y, const CH_Matrix_Classes::Indexmatrix *indices=0, SumBundleHandler *bh=0, SumBundle::Mode mode=SumBundle::inactive, AffineFunctionTransformation *aft=0)
see BundleModel::start_augmodel() for the first four parameters; for the others see sumbundle_contrib...
routines for updating and handling SumBundle components, possibly by cooperating over several recursi...
Definition: SumBundleHandler.hxx:42
std::vector< MinorantPointer > MinorantBundle
a bundle is a vector with MinorantPointer entries
Definition: MinorantPointer.hxx:24
virtual void clear()
resets all data to initial status of this class, also the bundle parameters
virtual MinorantPointer & provide_center_minorant()=0
if it cannot be provided it returns a minorant with valid()==false
bool model_aggregate_modified(CH_Matrix_Classes::Integer old_model_aggregate_id)
see BundleModel::model_aggregate_modified
Definition: ConeModel.hxx:195
int make_model_aggregate(bool &penalty_parameter_increased, bool keep_penalty_fixed)
see SumBlockModel::make_model_aggregate
virtual int switch_to_local(const MinorantBundle &sumbundle_model, const CH_Matrix_Classes::Matrix &sumbundle_coeff)=0
the local model has to take over after sumbundle was active; current_model holds the final model and ...
virtual BundleData * get_data()=0
returns the essential information on the bundle date for continuing from the same point lateron...
provides a general abstract base class for conic cutting models with SumBundle capabilities (as a der...
Definition: ConeModel.hxx:52
transform a function f(z) to fun_coeff*f(arg_offset+arg_trafo*y)+linear_cost*y+fun_offset (scales the...
Definition: AffineFunctionTransformation.hxx:68
int get_function_minorant(MinorantPointer &minorant, const AffineFunctionTransformation *aft=0)
see SumBlockModel::get_function_minorant()
int sumbundle_mode(SumBundle::Mode &mode, SumBundleHandler *bh=0, AffineFunctionTransformation *aft=0)
see SumBlockModel::sumbundle_mode
points to MinorantUseData that may be shared by many and allows computations with Minorants ...
Definition: MinorantPointer.hxx:34