ConicBundle
InteriorPointBundleBlock.hxx
Go to the documentation of this file.
1 
2 
3 #ifndef CONICBUNDLE_INTERIORPOINTBUNDLEBLOCK_HXX
4 #define CONICBUNDLE_INTERIORPOINTBUNDLEBLOCK_HXX
5 
13 #include "InteriorPointBlock.hxx"
14 #include "MinorantPointer.hxx"
15 #include "QPModelDataObject.hxx"
16 
17 namespace ConicBundle {
18 
23 
32 {
33 protected:
36 
37 public:
39  InteriorPointBundleBlock(CBout* cb=0,int cbinc=-1):CBout(cb,cbinc){bundle_dim=0;}
40 
42  virtual ~InteriorPointBundleBlock();
43 
45  virtual InteriorPointBundleBlock* clone()=0;
46 
48  virtual int copy_from(InteriorPointBundleBlock*)=0;
49 
50  //virtual CH_Matrix_Classes::Integer get_vecdim() const =0;
51 
53  virtual void set_oracle_data(QPModelOracleDataObject* /*oracle_data*/)
54  {}
55 
57  virtual CH_Matrix_Classes::Integer dim_bundle() const=0;
58 
61 
64 
67 
69  virtual int add_trace(CH_Matrix_Classes::Matrix& vec,
71  CH_Matrix_Classes::Integer startindex) =0;
72 
75  CH_Matrix_Classes::Integer startindex) =0;
76 
77  // set x to value*"one" to x, or if add==true, add value*"one" to x
78  //virtual int center_x(CH_Matrix_Classes::Real val,bool add=false)=0;
79 
80  // set z to value*"one" to z, or if add==true, add value*"one" to z
81  //virtual int center_z(CH_Matrix_Classes::Real val,bool add=false)=0;
82 
83  // set x to the values of vec[startindex+0,+1 ...,+(vecdim-1)] and return in add_center_value a value>=0 that needs to be added to make it feasible
84  //virtual int set_x(const CH_Matrix_Classes::Matrix& vec,
85  // CH_Matrix_Classes::Integer startindex,
86  // CH_Matrix_Classes::Real& add_center_value)=0;
87 
88  // set z to the values of vec[startindex+0,+1 ...,+(vecdim-1)] and return a value>=0 that needs to be added to make it feasible
89  //virtual int set_z(const CH_Matrix_Classes::Matrix& vec,
90  // CH_Matrix_Classes::Integer startindex,
91  // CH_Matrix_Classes::Real& add_center_value)=0;
92 
93  // on vec[startindex+0,+1 ...,+(vecdim-1)] put or add a * x into vec for a real number a
94  //virtual int vecgetsax(CH_Matrix_Classes::Matrix& vec,
95  // CH_Matrix_Classes::Integer startindex,
96  // CH_Matrix_Classes::Real a=1.,
97  // bool add=false)=0;
98 
99  // on vec[startindex+0,+1 ...,+(vecdim-1)] put or add a * z into vec for a real number a
100  //virtual int vecgetsaz(CH_Matrix_Classes::Matrix& vec,
101  // CH_Matrix_Classes::Integer startindex,
102  // CH_Matrix_Classes::Real a=1.,
103  // bool add=false)=0;
104 
105  // add dimensions of the primal-dual pairs to mudim and add the inner products of the primal-dual pairs of the current point to current_ip and those of the next point obtained by the given stepsize with the latest computed step to step_ip
106  //virtual int get_mu_info(CH_Matrix_Classes::Integer& inmudim,
107  // CH_Matrix_Classes::Real& current_ip,
108  // CH_Matrix_Classes::Real& step_ip,
109  // CH_Matrix_Classes::Real stepsize) const =0;
110 
111  // if necessary, reduce alpha to the biggest value so that feasibility is maintained with this step size
112  //virtual int linesearch(CH_Matrix_Classes::Real& alpha) const=0;
113 
114  // compute the complementarity_rhs=rhsmu*xi-rhscorr*xi*dx*dz (wihtout "-z") for mu=rhsmu and for corrector for factor rhscorr>0., store this and add it to rhs;
115  //virtual int add_muxinv(CH_Matrix_Classes::Matrix& rhs,
116  // CH_Matrix_Classes::Integer startindex,
117  // CH_Matrix_Classes::Real rhsmu,
118  // CH_Matrix_Classes::Real rhscorr,
119  // bool minus=false)=0;
120 
122  //virtual int set_dx(const CH_Matrix_Classes::Matrix& rhs,CH_Matrix_Classes::Integer startindex)=0;
123 
124  // compute dx=sysinv*rhs and at the same time dz (=-rhs-z +complentarity_rhs); may only be called after add_muxinv was called for the most recent point; this may only be called after add_muxinv() was called for this point
125  //virtual int set_dx_xizsolverhs(const CH_Matrix_Classes::Matrix& rhs,
126  // CH_Matrix_Classes::Integer startindex)=0;
127 
128  // compute sysinv*rhs into rhs, possibly with a negative sign
129  //virtual int apply_xizinv(CH_Matrix_Classes::Matrix& rhs,
130  // CH_Matrix_Classes::Integer startindex,
131  // bool minus=false)=0;
132 
133  // compute sys*rhs into rhs, possibly with a negative sign
134  //virtual int apply_xiz(CH_Matrix_Classes::Matrix& rhs,
135  // CH_Matrix_Classes::Integer startindex,
136  // bool minus=false)=0;
137 
138  // move to (x+alpha*dx, z+alpha*dz)
139  //virtual int do_step(CH_Matrix_Classes::Real alpha)=0;
140  //
141 
142  // add the Schur complement to a big system matrix
143  //virtual int add_AxizinvAt(const CH_Matrix_Classes::Matrix& A,
144  // CH_Matrix_Classes::Symmatrix& globalsys,
145  // bool minus=false)=0;
146 
147  //add (or subract if minus==true) the system matrix to a big system matrix starting at startindex
148  //virtual int add_xiz(CH_Matrix_Classes::Symmatrix& globalsys,
149  // CH_Matrix_Classes::Integer startindex,
150  // bool minus=false)=0;
151 
158  int Btrans,
159  int Atrans,
160  CH_Matrix_Classes::Integer startindex_model,
161  MinorantBundle& globalbundle,
162  CH_Matrix_Classes::Integer startindex_bundle)=0;
163 
170  int Atrans,
171  int Btrans,
172  CH_Matrix_Classes::Integer startindex_model,
173  MinorantBundle& globalbundle,
174  CH_Matrix_Classes::Integer startindex_bundle)=0;
175 
178  add_BDBt(const CH_Matrix_Classes::Matrix& diagvec,
180  bool minus,
181  CH_Matrix_Classes::Integer startindex,
183  CH_Matrix_Classes::Integer startindex_model,
184  MinorantBundle& globalbundle,
185  CH_Matrix_Classes::Integer startindex_bundle)=0;
186 
190  CH_Matrix_Classes::Integer startindex_model,
191  MinorantBundle& global_bundle,
192  CH_Matrix_Classes::Integer startindex_bundle)=0;
193 
197  MinorantBundle& global_bundle,
198  CH_Matrix_Classes::Integer startindex_bundle)=0;
199 
201  virtual int get_sysviol_model(CH_Matrix_Classes::Matrix& sysviol_model,
202  CH_Matrix_Classes::Integer startindex_model,
203  const CH_Matrix_Classes::Matrix& dy,
204  const CH_Matrix_Classes::Real deltatrdual,
205  MinorantBundle& global_bundle,
206  CH_Matrix_Classes::Integer startindex_bundle)=0;
207 
209  virtual int set_bundle_z(const CH_Matrix_Classes::Matrix& y,
210  MinorantBundle& global_bundle,
211  CH_Matrix_Classes::Integer startindex_bundle,
212  CH_Matrix_Classes::Real& add_center_value)=0;
213 
215  virtual int add_trace_to_diff_model(CH_Matrix_Classes::Real trace_dual)=0;
216 
219 
221  virtual int do_bundle_step(CH_Matrix_Classes::Real alpha,
222  const CH_Matrix_Classes::Matrix& y,
223  MinorantBundle& globalbundle,
224  CH_Matrix_Classes::Integer startindex_bundle,
225  CH_Matrix_Classes::Real tracedual,
226  CH_Matrix_Classes::Real trace_rhs)=0;
227 
229  virtual int set_modelrhs(CH_Matrix_Classes::Matrix& globalrhs,
231  CH_Matrix_Classes::Real rhscorr,
232  CH_Matrix_Classes::Integer startindex_model)=0;
233 
235  virtual int add_BtinvsysB(CH_Matrix_Classes::Symmatrix& globalsys,
236  const MinorantBundle& bundle,
237  CH_Matrix_Classes::Integer startindex_bundle) =0;
238 
261  virtual int Schur_transform_bundle(CH_Matrix_Classes::Matrix& glob_lowrank,
262  MinorantBundle& globalbundle,
263  CH_Matrix_Classes::Integer startindex_bundle,
264  CH_Matrix_Classes::Matrix& trafotrace,
265  CH_Matrix_Classes::Integer startindex_trace)=0;
266 
267 
292  CH_Matrix_Classes::Matrix& ipBtrvec,
293  MinorantBundle& globalbundle,
294  CH_Matrix_Classes::Integer startindex_bundle,
295  const CH_Matrix_Classes::Matrix& trafotrace,
296  CH_Matrix_Classes::Integer startindex_trace)=0;
297 
298 
299 
317  virtual int add_pcsubspace(CH_Matrix_Classes::Matrix& lowrank,
318  CH_Matrix_Classes::Matrix& sigma_guess,
319  const CH_Matrix_Classes::Matrix& Diag_inv,
321  CH_Matrix_Classes::Real diaginvval,
322  CH_Matrix_Classes::Matrix & minus_trmult,
323  CH_Matrix_Classes::Real schur_trace,
324  MinorantBundle& globalbundle,
325  CH_Matrix_Classes::Integer startindex_bundle) =0;
326 
329  CH_Matrix_Classes::Matrix& subspace,
330  CH_Matrix_Classes::Integer startindex_subsspace,
331  MinorantBundle& globalbundle,
332  CH_Matrix_Classes::Integer startindex_bundle) =0;
333 
334 
336  virtual int add_BtinvsysB_times(const CH_Matrix_Classes::Matrix& in_vec,
337  CH_Matrix_Classes::Matrix& out_vec,
338  CH_Matrix_Classes::Real zeta_inval,
339  CH_Matrix_Classes::Real* zeta_outval,
340  MinorantBundle& globalbundle,
341  CH_Matrix_Classes::Integer startindex_bundle)=0;
342 
344  virtual int set_dx_xizsolvestep(const CH_Matrix_Classes::Matrix& step_y,
345  const CH_Matrix_Classes::Real step_trdual,
346  MinorantBundle& globalbundle,
347  CH_Matrix_Classes::Integer startindex_bundle)=0;
348 
349 
350  //---------------------- mainly for testing
351 
352  // return the vector form of x
353  //virtual int get_vecx(CH_Matrix_Classes::Matrix& vecx,CH_Matrix_Classes::Integer startindex)=0;
354 
355  // return the vector form of z
356  //virtual int get_vecz(CH_Matrix_Classes::Matrix& vecz,CH_Matrix_Classes::Integer startindex)=0;
357 
358  // return the vector form of dx, 1 if not available
359  //virtual int get_vecdx(CH_Matrix_Classes::Matrix& vecdx,CH_Matrix_Classes::Integer startindex)=0;
360 
361  // return the vector form of dz, 1 if not available
362  // virtual int get_vecdz(CH_Matrix_Classes::Matrix& vecdz,CH_Matrix_Classes::Integer startindex)=0;
363 
364 
365 };
366 
367 
368 
369 
371 
372 }
373 
374 #endif
375 
int Integer
all integer numbers in calculations and indexing are of this type
Definition: matop.hxx:40
virtual CH_Matrix_Classes::Matrix & times_B(const CH_Matrix_Classes::Matrix &A, CH_Matrix_Classes::Matrix &C, CH_Matrix_Classes::Real alpha, CH_Matrix_Classes::Real beta, int Atrans, int Btrans, CH_Matrix_Classes::Integer startindex_model, MinorantBundle &globalbundle, CH_Matrix_Classes::Integer startindex_bundle)=0
C=beta*C+alpha*A*B where A and B may be transposed; carry out the model part of this beginning at sta...
virtual int add_trace(CH_Matrix_Classes::Matrix &vec, CH_Matrix_Classes::Real alpha, CH_Matrix_Classes::Integer startindex)=0
add alpha*trace_vec to vec starting at startindex
virtual int set_dx_xizsolvestep(const CH_Matrix_Classes::Matrix &step_y, const CH_Matrix_Classes::Real step_trdual, MinorantBundle &globalbundle, CH_Matrix_Classes::Integer startindex_bundle)=0
compute dx (and then dz) given step_y and step_trdual on basis of the last rhs computed for the model...
double Real
all real numbers in calculations are of this type
Definition: matop.hxx:50
virtual CH_Matrix_Classes::Real dualviol_2normsqr()=0
return the squared Euclidean norm of the dual model violation
virtual int add_BtinvsysB_times(const CH_Matrix_Classes::Matrix &in_vec, CH_Matrix_Classes::Matrix &out_vec, CH_Matrix_Classes::Real zeta_inval, CH_Matrix_Classes::Real *zeta_outval, MinorantBundle &globalbundle, CH_Matrix_Classes::Integer startindex_bundle)=0
out_vec+=BtinvsysB*in_vec
virtual CH_Matrix_Classes::Matrix & B_times(const CH_Matrix_Classes::Matrix &A, CH_Matrix_Classes::Matrix &C, CH_Matrix_Classes::Real alpha, CH_Matrix_Classes::Real beta, int Btrans, int Atrans, CH_Matrix_Classes::Integer startindex_model, MinorantBundle &globalbundle, CH_Matrix_Classes::Integer startindex_bundle)=0
extract dx from rhs at startindex and compute at the same time dz (=-sys dx-z +complentarity_rhs); th...
virtual CH_Matrix_Classes::Real evaluate_trace_x()=0
return the "trace" value of the current point
Header declaring the class ConicBundle::InteriorPointBlock.
virtual int add_BtinvsysB(CH_Matrix_Classes::Symmatrix &globalsys, const MinorantBundle &bundle, CH_Matrix_Classes::Integer startindex_bundle)=0
add the "scaled" minorant outer products to globalsys, where the correct minroants start at the given...
abstract base class for passing additional oracle information to the QP
Definition: QPModelDataObject.hxx:134
virtual CH_Matrix_Classes::Real evaluate_trace_dx()=0
return the change in "trace" value caused by the current step
virtual int set_bundle_z(const CH_Matrix_Classes::Matrix &y, MinorantBundle &global_bundle, CH_Matrix_Classes::Integer startindex_bundle, CH_Matrix_Classes::Real &add_center_value)=0
set z to the slack of the bundle and return a value>=0 that needs to be added to make it feasible ...
virtual CH_Matrix_Classes::Integer dim_bundle() const =0
returns the number of consecutive bundle elements this cone makes use of
abstract interface for interior point vector/matrix variables and routines specific to primal dual co...
Definition: InteriorPointBlock.hxx:30
Matrix class of symmetric matrices with real values of type Real
Definition: symmat.hxx:43
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 Schur_transform_bundle(CH_Matrix_Classes::Matrix &glob_lowrank, MinorantBundle &globalbundle, CH_Matrix_Classes::Integer startindex_bundle, CH_Matrix_Classes::Matrix &trafotrace, CH_Matrix_Classes::Integer startindex_trace)=0
provides basic information for low rank preconditioning (in the extreme case solving) for the case of...
InteriorPointBundleBlock(CBout *cb=0, int cbinc=-1)
default constructor
Definition: InteriorPointBundleBlock.hxx:39
virtual int add_modelx_aggregate(CH_Matrix_Classes::Real &val, CH_Matrix_Classes::Matrix &vec, MinorantBundle &global_bundle, CH_Matrix_Classes::Integer startindex_bundle)=0
adds opB transposed times modelx (without constant affine term) to the arguments
virtual int add_pcsubspace(CH_Matrix_Classes::Matrix &lowrank, CH_Matrix_Classes::Matrix &sigma_guess, const CH_Matrix_Classes::Matrix &Diag_inv, CH_Matrix_Classes::Real minval, CH_Matrix_Classes::Real diaginvval, CH_Matrix_Classes::Matrix &minus_trmult, CH_Matrix_Classes::Real schur_trace, MinorantBundle &globalbundle, CH_Matrix_Classes::Integer startindex_bundle)=0
append to lowrank "large" columns that should serve well for generating a low rank projection of the ...
virtual ~InteriorPointBundleBlock()
virtual destructor
virtual void set_oracle_data(QPModelOracleDataObject *)
allows to pass on additional information about the oracle if required
Definition: InteriorPointBundleBlock.hxx:53
CH_Matrix_Classes::Integer bundle_dim
dimension of the bundle (in case of subspace projections this may differ from vecdim ...
Definition: InteriorPointBundleBlock.hxx:34
virtual int set_xizinvsqrt_trace(CH_Matrix_Classes::Matrix &vec, CH_Matrix_Classes::Integer startindex)=0
set the trace premultiplied by sqrt(inv(xiz)) in vec[startindex+0,...,startindex+dim_bundle()-1] ...
virtual CH_Matrix_Classes::Matrix & get_Bt(CH_Matrix_Classes::Matrix &Bt, CH_Matrix_Classes::Integer startindex_model, MinorantBundle &global_bundle, CH_Matrix_Classes::Integer startindex_bundle)=0
get the current matrix for the coupling matrix Bt in the first row of blocks
CH_Matrix_Classes::Matrix diff_model
negative evaluation of minorants in current point
Definition: InteriorPointBundleBlock.hxx:35
Header declaring the class ConicBundle::QPModelDataObject, ConicBundle::QPSumModelDataObject, ConicBundle::QPConeModelDataObject, ConicBundle::QPModelDataPointer.
virtual int get_sysviol_model(CH_Matrix_Classes::Matrix &sysviol_model, CH_Matrix_Classes::Integer startindex_model, const CH_Matrix_Classes::Matrix &dy, const CH_Matrix_Classes::Real deltatrdual, MinorantBundle &global_bundle, CH_Matrix_Classes::Integer startindex_bundle)=0
set the model violation for the current system solution for the precomputed rhs on basis of the y and...
virtual CH_Matrix_Classes::Real evaluate_trace_z()=0
return the "trace" value of the current point
Matrix class for real values of type Real
Definition: matrix.hxx:74
virtual int add_trace_to_diff_model(CH_Matrix_Classes::Real trace_dual)=0
add trace_dual*trace to diff_model for the right hand side (negative of current model violation) ...
std::vector< MinorantPointer > MinorantBundle
a bundle is a vector with MinorantPointer entries
Definition: MinorantPointer.hxx:24
virtual int set_modelrhs(CH_Matrix_Classes::Matrix &globalrhs, CH_Matrix_Classes::Real rhsmu, CH_Matrix_Classes::Real rhscorr, CH_Matrix_Classes::Integer startindex_model)=0
If mu is not zero, always add the centering term for this mu as well;.
abstract interface for interior point routines specific to primal dual complementarity conditions of ...
Definition: InteriorPointBundleBlock.hxx:31
Header declaring the class ConicBundle::MinorantPointer.
virtual int add_bundle_xizinv_diagonal(CH_Matrix_Classes::Matrix &diagonal, CH_Matrix_Classes::Matrix &ipBtrvec, MinorantBundle &globalbundle, CH_Matrix_Classes::Integer startindex_bundle, const CH_Matrix_Classes::Matrix &trafotrace, CH_Matrix_Classes::Integer startindex_trace)=0
add diag(Bt*sqrt(invsys)*(I-lambda*trvec*trvec&#39;)*sqrt(invsys)*B) to diagonal
virtual int add_bundle_xizinvsqrt_projection(CH_Matrix_Classes::Matrix &glob_lowrank, CH_Matrix_Classes::Matrix &subspace, CH_Matrix_Classes::Integer startindex_subsspace, MinorantBundle &globalbundle, CH_Matrix_Classes::Integer startindex_bundle)=0
add bundle*sqrt(inv(xiz))*subspace to glob_lowrank with bundle(:,si_bundle+1:si_bundle+dim_bundle()-1...
virtual InteriorPointBundleBlock * clone()=0
returns a clone; sofar this is only needed for comparative testing
virtual CH_Matrix_Classes::Symmatrix & add_BDBt(const CH_Matrix_Classes::Matrix &diagvec, CH_Matrix_Classes::Symmatrix &bigS, bool minus, CH_Matrix_Classes::Integer startindex, CH_Matrix_Classes::Matrix &Bt, CH_Matrix_Classes::Integer startindex_model, MinorantBundle &globalbundle, CH_Matrix_Classes::Integer startindex_bundle)=0
add the main diagonal block tranpose(projection)*diagvec*projection to bigS starting at startindex ...
virtual int copy_from(InteriorPointBundleBlock *)=0
copies to content of the argument to this; to work *this must be a clone of the argument; sofar this ...
virtual int do_bundle_step(CH_Matrix_Classes::Real alpha, const CH_Matrix_Classes::Matrix &y, MinorantBundle &globalbundle, CH_Matrix_Classes::Integer startindex_bundle, CH_Matrix_Classes::Real tracedual, CH_Matrix_Classes::Real trace_rhs)=0
move to (x+alpha*dx, z+alpha*dz), update diff_model and possibly reduce the model size if some part i...