ConicBundle
NNCIPBundleBlock.hxx
Go to the documentation of this file.
1 
2 
3 #ifndef CONICBUNDLE_NNCIPBUNDLEBLOCK_HXX
4 #define CONICBUNDLE_NNCIPBUNDLEBLOCK_HXX
5 
14 #include "NNCIPBlock.hxx"
15 
16 namespace ConicBundle {
17 
22 
29 {
30 private:
34 
37 
40  CH_Matrix_Classes::Real trace_bound,
41  bool cautious) const;
42 
43 public:
46 
48  NNCIPBundleBlock(CH_Matrix_Classes::Integer dim=0, CBout* cb=0,int cbinc=-1);
49 
52 
55 
57  virtual int copy_from(InteriorPointBundleBlock*);
58 
61  {return bundle_dim;}
62 
65 
68 
71 
73  virtual int add_trace(CH_Matrix_Classes::Matrix& vec,
75  CH_Matrix_Classes::Integer startindex);
76 
79  CH_Matrix_Classes::Integer startindex);
80 
81  // after the bundle subproblem is solved, this retrieves the local linear solution vector; if nncx_activity is set, the values between zero and one indicate the guess on the coefficients activity level
82  // virtual int get_nncx(CH_Matrix_Classes::Matrix& nncx,
83  // CH_Matrix_Classes::Matrix* nncx_activity=0) const;
84 
91  int Btrans,
92  int Atrans,
93  CH_Matrix_Classes::Integer startindex_model,
94  MinorantBundle& globalbundle,
95  CH_Matrix_Classes::Integer startindex_bundle);
96 
103  int Atrans,
104  int Btrans,
105  CH_Matrix_Classes::Integer startindex_model,
106  MinorantBundle& globalbundle,
107  CH_Matrix_Classes::Integer startindex_bundle);
108 
111  add_BDBt(const CH_Matrix_Classes::Matrix& diagvec,
113  bool minus,
114  CH_Matrix_Classes::Integer startindex,
116  CH_Matrix_Classes::Integer startindex_model,
117  MinorantBundle& globalbundle,
118  CH_Matrix_Classes::Integer startindex_bundle);
119 
123  CH_Matrix_Classes::Integer startindex_model,
124  MinorantBundle& global_bundle,
125  CH_Matrix_Classes::Integer startindex_bundle);
126 
130  MinorantBundle& global_bundle,
131  CH_Matrix_Classes::Integer startindex_bundle);
132 
134  virtual int get_sysviol_model(CH_Matrix_Classes::Matrix& sysviol_model,
135  CH_Matrix_Classes::Integer startindex_model,
136  const CH_Matrix_Classes::Matrix& dy,
137  const CH_Matrix_Classes::Real deltatrdual,
138  MinorantBundle& global_bundle,
139  CH_Matrix_Classes::Integer startindex_bundle);
140 
142  virtual int set_bundle_z(const CH_Matrix_Classes::Matrix& y,
143  MinorantBundle& global_bundle,
144  CH_Matrix_Classes::Integer startindex_bundle,
145  CH_Matrix_Classes::Real& add_center_value);
146 
148  virtual int add_trace_to_diff_model(CH_Matrix_Classes::Real trace_dual);
149 
152 
154  virtual int do_bundle_step(CH_Matrix_Classes::Real alpha,
155  const CH_Matrix_Classes::Matrix& y,
156  MinorantBundle& globalbundle,
157  CH_Matrix_Classes::Integer startindex_bundle,
158  CH_Matrix_Classes::Real tracedual,
159  CH_Matrix_Classes::Real trace_rhs);
160 
162  virtual int set_modelrhs(CH_Matrix_Classes::Matrix& globalrhs,
164  CH_Matrix_Classes::Real rhscorr,
165  CH_Matrix_Classes::Integer startindex_model);
166 
168  virtual int add_BtinvsysB(CH_Matrix_Classes::Symmatrix& globalsys,
169  const MinorantBundle& bundle,
170  CH_Matrix_Classes::Integer startindex_bundle) ;
171 
195  MinorantBundle& globalbundle,
196  CH_Matrix_Classes::Integer startindex_bundle,
197  CH_Matrix_Classes::Matrix& trafotrace,
198  CH_Matrix_Classes::Integer startindex_trace);
199 
200 
225  CH_Matrix_Classes::Matrix& ipBtrvec,
226  MinorantBundle& globalbundle,
227  CH_Matrix_Classes::Integer startindex_bundle,
228  const CH_Matrix_Classes::Matrix& trafotrace,
229  CH_Matrix_Classes::Integer startindex_trace);
230 
231 
249  virtual int add_pcsubspace(CH_Matrix_Classes::Matrix& lowrank,
250  CH_Matrix_Classes::Matrix& sigma_guess,
251  const CH_Matrix_Classes::Matrix& Diag_inv,
253  CH_Matrix_Classes::Real diaginvval,
254  CH_Matrix_Classes::Matrix & minus_trmult,
255  CH_Matrix_Classes::Real schur_trace,
256  MinorantBundle& globalbundle,
257  CH_Matrix_Classes::Integer startindex_bundle);
258 
259 
262  CH_Matrix_Classes::Matrix& subspace,
263  CH_Matrix_Classes::Integer startindex_subsspace,
264  MinorantBundle& globalbundle,
265  CH_Matrix_Classes::Integer startindex_bundle);
266 
268  virtual int add_BtinvsysB_times(const CH_Matrix_Classes::Matrix& in_vec,
269  CH_Matrix_Classes::Matrix& out_vec,
270  CH_Matrix_Classes::Real zeta_inval,
271  CH_Matrix_Classes::Real* zeta_outval,
272  MinorantBundle& globalbundle,
273  CH_Matrix_Classes::Integer startindex_bundle);
274 
276  virtual int set_dx_xizsolvestep(const CH_Matrix_Classes::Matrix& step_y,
277  const CH_Matrix_Classes::Real step_trdual,
278  MinorantBundle& globalbundle,
279  CH_Matrix_Classes::Integer startindex_bundle);
280 
281 
283  virtual int get_nncx(CH_Matrix_Classes::Matrix& nncx,
284  CH_Matrix_Classes::Matrix* nncx_activity,
285  CH_Matrix_Classes::Real trace_rhs,
286  bool cautious) const;
287 
288 };
289 
290 
292 
293 }
294 
295 #endif
296 
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)
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 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)
move to (x+alpha*dx, z+alpha*dz), update diff_model and possibly reduce the model size if some part i...
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)
append to lowrank "large" columns that should serve well for generating a low rank projection of the ...
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)
out_vec+=BtinvsysB*in_vec
virtual int set_xizinvsqrt_trace(CH_Matrix_Classes::Matrix &vec, CH_Matrix_Classes::Integer startindex)
set the trace premultiplied by sqrt(inv(xiz)) in vec[startindex+0,...,startindex+dim_bundle()-1] ...
double Real
all real numbers in calculations are of this type
Definition: matop.hxx:50
CH_Matrix_Classes::Matrix sqrBnorms
if rowdim>0 it holds the squared norm of each subgradient in the same sequence as in B ...
Definition: NNCIPBundleBlock.hxx:33
virtual CH_Matrix_Classes::Integer dim_bundle() const
returns the number of consecutive bundle elements this cone makes use of
Definition: NNCIPBundleBlock.hxx:60
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)
provides basic information for low rank preconditioning (in the extreme case solving) for the case of...
Matrix class for integral values of type Integer
Definition: indexmat.hxx:195
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)
add bundle*sqrt(inv(xiz))*subspace to glob_lowrank with bundle(:,si_bundle+1:si_bundle+dim_bundle()-1...
Header declaring the class ConicBundle::NNCIPBlock.
NNCIPBundleBlock(CH_Matrix_Classes::Integer dim=0, CBout *cb=0, int cbinc=-1)
default constructor, allows to intialize the dimension
CH_Matrix_Classes::Matrix Boffset
columnvector of bundle offsets
Definition: NNCIPBundleBlock.hxx:32
virtual int add_trace(CH_Matrix_Classes::Matrix &vec, CH_Matrix_Classes::Real alpha, CH_Matrix_Classes::Integer startindex)
add alpha*trace_vec to vec starting at startindex
Matrix class of symmetric matrices with real values of type Real
Definition: symmat.hxx:43
virtual CH_Matrix_Classes::Real evaluate_trace_dx()
return the change in "trace" value caused by the current step
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)
set the model violation for the current system solution for the precomputed rhs on basis of the y and...
conic bundle method solver for sum of convex functions. See the ConicBundle_Manual for a quick introd...
Definition: CBSolver.hxx:22
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)
If mu is not zero, always add the centering term for this mu as well;.
base class for uniform use of WARNINGS and ERRORS (at some point in time)
Definition: CBout.hxx:30
virtual CH_Matrix_Classes::Real dualviol_2normsqr()
return the squared Euclidean norm of the dual model violation
virtual CH_Matrix_Classes::Real evaluate_trace_z()
return the "trace" value of the current point
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 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)
add the main diagonal block tranpose(projection)*diagvec*projection to bigS starting at startindex ...
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)
get the current matrix for the coupling matrix Bt in the first row of blocks
Matrix class for real values of type Real
Definition: matrix.hxx:74
int find_inactive_indices(CH_Matrix_Classes::Indexmatrix &inactive, CH_Matrix_Classes::Real trace_bound, bool cautious) const
returns in inactive, in increasing order, the indices considered inactive (small in comparison to tra...
interface for the interior point variable vector and routines specific to the primal dual complementa...
Definition: NNCIPBlock.hxx:26
interior point variables and routines specific to primal dual complementarity conditions of a nonnega...
Definition: NNCIPBundleBlock.hxx:28
CH_Matrix_Classes::Matrix Bt
matrix representation of bundle
Definition: NNCIPBundleBlock.hxx:31
CH_Matrix_Classes::Indexmatrix map_to_old
this is currently not in use but was used for experiments with eliminating some coordinates on the fl...
Definition: NNCIPBundleBlock.hxx:36
std::vector< MinorantPointer > MinorantBundle
a bundle is a vector with MinorantPointer entries
Definition: MinorantPointer.hxx:24
void clear(CH_Matrix_Classes::Integer dim=0)
reset all point information to zero for dimension dim, the rest to zero
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)
C=beta*C+alpha*B*A where B and A may be transposed; carry out the model part of this beginning at sta...
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)
add diag(Bt*sqrt(invsys)*(I-lambda*trvec*trvec&#39;)*sqrt(invsys)*B) to diagonal
virtual int copy_from(InteriorPointBundleBlock *)
copies to content of the argument to this; to work *this must be a clone of the argument; sofar this ...
virtual int add_trace_to_diff_model(CH_Matrix_Classes::Real trace_dual)
add trace_dual*trace to diff_model for the right hand side (negative of current model violation) ...
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)
set z to the slack of the bundle and return a value>=0 that needs to be added to make it feasible ...
abstract interface for interior point routines specific to primal dual complementarity conditions of ...
Definition: InteriorPointBundleBlock.hxx:31
Header declaring the class ConicBundle::InteriorPointBundleBlock.
virtual int add_BtinvsysB(CH_Matrix_Classes::Symmatrix &globalsys, const MinorantBundle &bundle, CH_Matrix_Classes::Integer startindex_bundle)
add the "scaled" minorant outer products to globalsys, where the correct minroants start at the given...
virtual int add_modelx_aggregate(CH_Matrix_Classes::Real &val, CH_Matrix_Classes::Matrix &vec, MinorantBundle &global_bundle, CH_Matrix_Classes::Integer startindex_bundle)
adds opB transposed times modelx (without constant affine term) to the arguments
virtual int get_nncx(CH_Matrix_Classes::Matrix &nncx, CH_Matrix_Classes::Matrix *nncx_activity, CH_Matrix_Classes::Real trace_rhs, bool cautious) const
after the bundle subproblem is solved, this retrieves the local linear solution vector; if nncx_activ...
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)
compute dx (and then dz) given step_y and step_trdual on basis of the last rhs computed for the model...
virtual CH_Matrix_Classes::Real evaluate_trace_x()
return the "trace" value of the current point
virtual InteriorPointBundleBlock * clone()
returns a clone