ConicBundle
QPModelDataObject.hxx
Go to the documentation of this file.
1 
2 #ifndef CONICBUNDLE_QPMODELDATAOBJECT_HXX
3 #define CONICBUNDLE_QPMODELDATAOBJECT_HXX
4 
5 
13 #include "MinorantPointer.hxx"
15 
16 namespace ConicBundle {
17 
18 
19 
20 
40 
44  class QPModelDataObject: public virtual CBout
45 {
46 public:
48  virtual void clear()=0;
50  QPModelDataObject(CBout *cb=0,int cbinc=-1):CBout(cb,cbinc){}
52  virtual ~QPModelDataObject();
53 
55  virtual const MinorantPointer& get_constant_minorant() const =0;
56 
58  virtual const MinorantBundle& get_bundle() const =0;
59 
62 
64  virtual MinorantBundle& get_bundle() =0;
65 
85  virtual int push_aft(const AffineFunctionTransformation* inaft,
86  const CH_Matrix_Classes::Indexmatrix* global_indices,
87  const CH_Matrix_Classes::Indexmatrix* local_indices,
88  std::map<MinorantPointer,MinorantPointer>* precomputed=0)=0;
89 
91  virtual int pop_aft()=0;
92 
95  CH_Matrix_Classes::Matrix& gradient)=0;
96 
97 
98 
99 };
100 
101 
102 
106 {
107 public:
109  QPSumModelDataObject(CBout* cb=0,int cbinc=-1):QPModelDataObject(cb,cbinc)
110  {}
111 
113  virtual ~QPSumModelDataObject();
114 
116  virtual int append(QPModelDataObject* inblock)=0;
117 };
118 
135 {
136 public:
138  virtual ~QPModelOracleDataObject();
139 
140 };
141 
145 {
146 public:
148  QPConeModelDataObject(CBout* cb=0,int cbinc=-1):QPModelDataObject(cb,cbinc)
149  {}
150 
152  virtual ~QPConeModelDataObject();
153 
235  virtual int init(const MinorantPointer& constant_minorant,
236  const MinorantBundle& bundle,
238  const CH_Matrix_Classes::Indexmatrix& socdim,
239  const CH_Matrix_Classes::Indexmatrix& pscdim,
240  const CH_Matrix_Classes::Matrix& box_lb,
241  const CH_Matrix_Classes::Matrix& box_ub,
242  CH_Matrix_Classes::Real rhs_trace,
243  FunctionTask ft,
244  QPModelOracleDataObject* oracle_data=0,
245  bool scale_box=true)=0;
246 
248  virtual int adjust_trace(CH_Matrix_Classes::Real next_rhs_trace) =0;
249 
251  virtual CH_Matrix_Classes::Real evaluate_trace() const =0;
252 
254  virtual int get_nncx(CH_Matrix_Classes::Matrix& nncx,
255  CH_Matrix_Classes::Matrix* nncx_activity=0,
256  bool cautious=false) =0;
257 
259  virtual int get_socx(CH_Matrix_Classes::Integer i,
261  CH_Matrix_Classes::Real* socx_activity=0,
262  bool cautious=false) =0;
263 
265  virtual int get_pscx(CH_Matrix_Classes::Integer i,
266  CH_Matrix_Classes::Matrix& pscx_eigs,
267  CH_Matrix_Classes::Matrix& pscx_vecs,
268  CH_Matrix_Classes::Real& pscx_growthrate,
269  CH_Matrix_Classes::Matrix& pscx_primalgrowth,
270  CH_Matrix_Classes::Matrix& pscx_dualgrowth) =0;
271 
273  virtual int get_boxx(CH_Matrix_Classes::Matrix& x,
274  CH_Matrix_Classes::Matrix* x_activity=0,
275  bool cautious=false) =0;
276 
278  virtual CH_Matrix_Classes::Real tracedual(CH_Matrix_Classes::Real* prec=0) const =0;
279 
280 };
281 
282 
283 class BundleModel;
284 
298  class QPModelDataPointer: public virtual CBout
299 {
300 public:
302  QPModelDataPointer(CBout* cb=0,int cbinc=-1):CBout(cb,cbinc)
303  {}
304 
306  virtual ~QPModelDataPointer();
307 
309  virtual void clear_model_data_ptr()=0;
310 
312  virtual int set_model_data(QPModelDataObject*)=0;
313 
315  virtual QPSumModelDataObject* generate_summodel_data(BundleModel* bmp=0) =0;
316 
318  virtual QPConeModelDataObject* generate_conemodel_data(BundleModel* bmp=0) =0;
319 
321  virtual QPModelDataObject* get_model_data_ptr() const =0;
322 };
323 
324 
326 
327 }
328 
329 #endif
330 
int Integer
all integer numbers in calculations and indexing are of this type
Definition: matop.hxx:40
virtual void clear()=0
clear
virtual int add_modelx_aggregate(CH_Matrix_Classes::Real &offset, CH_Matrix_Classes::Matrix &gradient)=0
this routine is added here mainly to allow for comperative testing; for the current value of x it add...
QPConeModelDataObject(CBout *cb=0, int cbinc=-1)
default constructor
Definition: QPModelDataObject.hxx:148
virtual const MinorantBundle & get_bundle() const =0
gives reading access to the (possibly transformed) bundle minorants of the cutting model ...
double Real
all real numbers in calculations are of this type
Definition: matop.hxx:50
abstract interface for automatically generating and retrieving the qp blocks with the model data that...
Definition: QPModelDataObject.hxx:298
QPModelDataPointer(CBout *cb=0, int cbinc=-1)
default constructor
Definition: QPModelDataObject.hxx:302
Matrix class for integral values of type Integer
Definition: indexmat.hxx:195
abstract base class for passing additional oracle information to the QP
Definition: QPModelDataObject.hxx:134
abstract interface extension of QPModelDataObject to allow uniform generation of tuned quadratic solv...
Definition: QPModelDataObject.hxx:144
abstract interface declaring the uniform outer appearance of general cutting models produced by the v...
Definition: QPModelDataObject.hxx:44
virtual int push_aft(const AffineFunctionTransformation *inaft, const CH_Matrix_Classes::Indexmatrix *global_indices, const CH_Matrix_Classes::Indexmatrix *local_indices, std::map< MinorantPointer, MinorantPointer > *precomputed=0)=0
applies the AffineFunctionTransformation to constant_minorant and bundle, where (if given) only the g...
virtual const MinorantPointer & get_constant_minorant() const =0
gives reading access to a constant offset minorant
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
virtual int pop_aft()=0
undo the top push_aft this
Matrix class for real values of type Real
Definition: matrix.hxx:74
QPSumModelDataObject(CBout *cb=0, int cbinc=-1)
default constructor
Definition: QPModelDataObject.hxx:109
abstract interface for BundleSolver giving access to all objective function specific bundle routines ...
Definition: BundleModel.hxx:140
FunctionTask
Each function represented by a FunctionModel is equipped with a function_factor (it defaults to 1...
Definition: CBSolver.hxx:221
std::vector< MinorantPointer > MinorantBundle
a bundle is a vector with MinorantPointer entries
Definition: MinorantPointer.hxx:24
QPModelDataObject(CBout *cb=0, int cbinc=-1)
default constructor
Definition: QPModelDataObject.hxx:50
abstract interface extension of QPModelDataObject for use in SumModel where several blocks are concat...
Definition: QPModelDataObject.hxx:105
virtual ~QPModelDataObject()
virtual destructor
Header declaring the class ConicBundle::MinorantPointer.
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
points to MinorantUseData that may be shared by many and allows computations with Minorants ...
Definition: MinorantPointer.hxx:34
Header declaring the classes ConicBundle::AffineFunctionTransformation.