ConicBundle
QPModelBlockObject.hxx
Go to the documentation of this file.
1 
2 #ifndef CONICBUNDLE_QPMODELBLOCKOBJECT_HXX
3 #define CONICBUNDLE_QPMODELBLOCKOBJECT_HXX
4 
13 #include "symmat.hxx"
14 
15 namespace ConicBundle {
16 
17 
22 
90 {
91 public:
92 
93  virtual ~QPModelBlockObject();
94 
96  virtual QPModelBlockObject* clone()=0;
97 
99  virtual void recursive_delete_and_clear()=0;
100 
103 
106 
109 
112 
115 
117  virtual int add_Bt_modelx(CH_Matrix_Classes::Real& val,
119 
120 
121 
125  CH_Matrix_Classes::Real alpha=1.,
126  CH_Matrix_Classes::Real beta=0.,
127  int Btrans=0,
128  int Atrans=0) =0;
129 
133  CH_Matrix_Classes::Real alpha=1.,
134  CH_Matrix_Classes::Real beta=0.,
135  int Atrans=0,
136  int Btrans=0) =0;
137 
141  bool minus=false,
142  CH_Matrix_Classes::Integer startindex=0) =0;
143 
146  CH_Matrix_Classes::Integer start_col=0)=0;
147 
148 
151 
154 
157 
159  virtual int get_mu_info(CH_Matrix_Classes::Integer& mudim,
161  CH_Matrix_Classes::Real& tr_xdzpdxz,
162  CH_Matrix_Classes::Real& tr_dxdz,
163  CH_Matrix_Classes::Real& min_xz,
164  CH_Matrix_Classes::Real& max_xz) const=0;
165 
167  virtual int get_nbh_info(CH_Matrix_Classes::Integer mudim,
169  CH_Matrix_Classes::Real tr_xdzpdxz,
170  CH_Matrix_Classes::Real tr_dxdz,
171  CH_Matrix_Classes::Real nbh_ubnd,
173  CH_Matrix_Classes::Real& max_nbh,
174  CH_Matrix_Classes::Real& nrmsqr_xz,
175  CH_Matrix_Classes::Real& nrmsqr_xdzpdxz,
176  CH_Matrix_Classes::Real& nrmsqr_dxdz,
177  CH_Matrix_Classes::Real& ip_xz_xdzpdxz,
178  CH_Matrix_Classes::Real& ip_xz_dxdz,
179  CH_Matrix_Classes::Real& ip_dxdz_xdzpdxz) const=0;
180 
182  virtual int linesearch(CH_Matrix_Classes::Real& alpha) const=0;
183 
185  virtual int compute_step(const CH_Matrix_Classes::Matrix& ystep) =0;
186 
188  virtual int computed_step(const CH_Matrix_Classes::Matrix& modelxstep,
189  const CH_Matrix_Classes::Matrix& modelconstrstep) =0;
190 
192  virtual int do_step(CH_Matrix_Classes::Real alpha,
193  const CH_Matrix_Classes::Matrix& nexty) =0;
194 
195 
200  virtual int add_localrhs(CH_Matrix_Classes::Matrix& globalrhs,
202  CH_Matrix_Classes::Real rhscorr,
203  CH_Matrix_Classes::Integer startindex_model,
204  CH_Matrix_Classes::Integer startindex_constraints,
205  bool append) =0;
206 
207 
210  virtual int add_BtinvsysB(CH_Matrix_Classes::Symmatrix& globalsys) =0;
211 
214  virtual int add_localsys(CH_Matrix_Classes::Symmatrix& globalsys,
215  CH_Matrix_Classes::Integer startindex_model,
216  CH_Matrix_Classes::Integer startindex_constraints)=0;
217 
220  virtual int solve_constrsys(const CH_Matrix_Classes::Symmatrix& ABchol,
221  CH_Matrix_Classes::Matrix& ABCrhs_and_sol,
222  CH_Matrix_Classes::Integer startindex_model,
223  CH_Matrix_Classes::Integer startindex_constraints)=0;
224 
226  virtual int localsys_mult(const CH_Matrix_Classes::Matrix& in_vec,
227  CH_Matrix_Classes::Matrix& out_vec,
228  CH_Matrix_Classes::Integer startindex_model,
229  CH_Matrix_Classes::Integer startindex_constraints)=0;
230 
231 
234  virtual int add_BCSchur_diagonal(CH_Matrix_Classes::Matrix& diagonal)=0;
235 
236 
243  CH_Matrix_Classes::Matrix& sigma_guess,
244  const CH_Matrix_Classes::Matrix& Diag_inv,
246  CH_Matrix_Classes::Real diaginvval=-1.)=0;
247 
250  virtual int prepare_BCSchur_JLprecond(CH_Matrix_Classes::Matrix& glob_lowrank,
251  CH_Matrix_Classes::Matrix& subspace,
252  bool append_globtransp_times_mat_to_subspace=false)=0;
253 
255  virtual int add_Schur_rhs(CH_Matrix_Classes::Matrix& glob_rhs,
256  CH_Matrix_Classes::Matrix* local_rhs,
258  CH_Matrix_Classes::Real rhscorr)=0;
259 
261  virtual int add_Schur_mult(const CH_Matrix_Classes::Matrix& in_Qvec,
262  CH_Matrix_Classes::Matrix& out_Qvec,
263  const CH_Matrix_Classes::Matrix* in_Cvec=0,
264  CH_Matrix_Classes::Matrix* out_Cvec=0)=0;
265 
267  virtual int computed_Schur_step(const CH_Matrix_Classes::Matrix& xstep,
268  const CH_Matrix_Classes::Matrix& local_step)=0;
269 
270  //----------- mainly for testing the correctness of the system solution
271 
273  virtual CH_Matrix_Classes::Matrix& get_x()=0;
275  virtual CH_Matrix_Classes::Matrix& get_dx()=0;
282 
283 
285  virtual void display_model_values(const CH_Matrix_Classes::Matrix& y,std::ostream& out)=0;
286 
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 QPModelBlockObject * clone()=0
return a cloned object on the heap; sofar this is only needed for some comparative evaluations ...
virtual CH_Matrix_Classes::Integer dim_constraints()=0
returns the dimension of the system describing the model set (may contain further constraints) ...
double Real
all real numbers in calculations are of this type
Definition: matop.hxx:50
virtual int computed_Schur_step(const CH_Matrix_Classes::Matrix &xstep, const CH_Matrix_Classes::Matrix &local_step)=0
use the computed step information to also compute the steps of the complemented parts ...
virtual int add_Bt_modelx(CH_Matrix_Classes::Real &val, CH_Matrix_Classes::Matrix &vec)=0
adds opB transposed times modelx and constant affine term to the arguments
virtual int reset_starting_point(const CH_Matrix_Classes::Matrix &firsty, CH_Matrix_Classes::Real mu)=0
initialize the model variables to a strictly feasible "central" starting point; this is the first cal...
virtual CH_Matrix_Classes::Matrix & times_B(const CH_Matrix_Classes::Matrix &A, CH_Matrix_Classes::Matrix &C, CH_Matrix_Classes::Real alpha=1., CH_Matrix_Classes::Real beta=0., int Atrans=0, int Btrans=0)=0
computes and returns C=alpha*A*B+beta*C where A and B may be transposed; C needs to have the correct ...
virtual CH_Matrix_Classes::Real dualviol_2normsqr()=0
Euclidean norm of constraint violation on the dual model side for the current point transmitted in th...
virtual int get_mu_info(CH_Matrix_Classes::Integer &mudim, CH_Matrix_Classes::Real &tr_xz, CH_Matrix_Classes::Real &tr_xdzpdxz, CH_Matrix_Classes::Real &tr_dxdz, CH_Matrix_Classes::Real &min_xz, CH_Matrix_Classes::Real &max_xz) const =0
add dimensions of the primal-dual pairs to mudim and add the "trace" (the inner product with center) ...
virtual int localsys_mult(const CH_Matrix_Classes::Matrix &in_vec, CH_Matrix_Classes::Matrix &out_vec, CH_Matrix_Classes::Integer startindex_model, CH_Matrix_Classes::Integer startindex_constraints)=0
multiply the local system diagonal block consisting of the model and local contraints rows and column...
virtual CH_Matrix_Classes::Real constraints_cost()=0
returns the dual upper bound to the model value (the trace weighted sum of the dual trace variables) ...
virtual int propose_BCSchur_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=-1.)=0
append to lowrank "large" columns that should serve well for generating a low rank projection of the ...
virtual CH_Matrix_Classes::Real primalviol_2normsqr()=0
Euclidean norm of constraint violation of modelx.
virtual int add_BtinvsysB(CH_Matrix_Classes::Symmatrix &globalsys)=0
add the Schur complement of the local system Matrix to the global one so that, if minus == false the ...
virtual CH_Matrix_Classes::Integer dim_model()=0
returns the dimension of the model set
virtual CH_Matrix_Classes::Matrix & get_Bt(CH_Matrix_Classes::Matrix &Bt, CH_Matrix_Classes::Integer start_col=0)=0
get the current matrix for the coupling matrix Bt in the first row; Bt needs to have the correct size...
Matrix class of symmetric matrices with real values of type Real
Definition: symmat.hxx:43
virtual int add_BCSchur_diagonal(CH_Matrix_Classes::Matrix &diagonal)=0
add the diagonal of the Schur complemented blocks belonging to bundle and local constraints (used for...
Header declaring the class CH_Matrix_Classes::Symmatrix for symmetric matrices with Real elements...
conic bundle method solver for sum of convex functions. See the ConicBundle_Manual for a quick introd...
Definition: CBSolver.hxx:22
virtual int prepare_BCSchur_JLprecond(CH_Matrix_Classes::Matrix &glob_lowrank, CH_Matrix_Classes::Matrix &subspace, bool append_globtransp_times_mat_to_subspace=false)=0
compute the preconditioning low-rank representation of the Schur complemented blocks belonging to bun...
virtual int recursive_copy_data_of(QPModelBlockObject *)=0
sofar this is only needed for some comparative evaluations; to work *this must be a clone of the the ...
virtual int linesearch(CH_Matrix_Classes::Real &alpha) const =0
if necessary, reduce alpha to the biggest value so that feasibility is maintained with this step size...
virtual CH_Matrix_Classes::Matrix & get_dx()=0
get the vector formed by all delta model x variables
virtual void display_model_values(const CH_Matrix_Classes::Matrix &y, std::ostream &out)=0
output the model values in a readable format for testing
virtual int solve_constrsys(const CH_Matrix_Classes::Symmatrix &ABchol, CH_Matrix_Classes::Matrix &ABCrhs_and_sol, CH_Matrix_Classes::Integer startindex_model, CH_Matrix_Classes::Integer startindex_constraints)=0
given the Cholesky factorization LL' of minus the blocks A and B (contraints on design variables and ...
virtual CH_Matrix_Classes::Real globalx_cost(const CH_Matrix_Classes::Matrix &globalx)=0
returns the value of constant offset plus global linear cost term for the current globalx ...
virtual int do_step(CH_Matrix_Classes::Real alpha, const CH_Matrix_Classes::Matrix &nexty)=0
move in the last computed step direction by a step of length alpha
virtual CH_Matrix_Classes::Matrix & get_sysviol_model(const CH_Matrix_Classes::Matrix &dy)=0
get the model violation for the current system solution with this dy
Matrix class for real values of type Real
Definition: matrix.hxx:74
virtual int add_localrhs(CH_Matrix_Classes::Matrix &globalrhs, CH_Matrix_Classes::Real rhsmu, CH_Matrix_Classes::Real rhscorr, CH_Matrix_Classes::Integer startindex_model, CH_Matrix_Classes::Integer startindex_constraints, bool append)=0
compute the right hand sides for the rows correpsonding to the local model and contraints and add the...
virtual CH_Matrix_Classes::Matrix & B_times(const CH_Matrix_Classes::Matrix &A, CH_Matrix_Classes::Matrix &C, CH_Matrix_Classes::Real alpha=1., CH_Matrix_Classes::Real beta=0., int Btrans=0, int Atrans=0)=0
computes and returns C=alpha*B*A+beta*C where B and A may be transposed; C needs to have the correct ...
virtual CH_Matrix_Classes::Symmatrix & add_BDBt(const CH_Matrix_Classes::Matrix &diagvec, CH_Matrix_Classes::Symmatrix &S, bool minus=false, CH_Matrix_Classes::Integer startindex=0)=0
add B*Diag(diagvec)*Bt to C in the principal block starting at startindex
virtual int add_localsys(CH_Matrix_Classes::Symmatrix &globalsys, CH_Matrix_Classes::Integer startindex_model, CH_Matrix_Classes::Integer startindex_constraints)=0
add the local system Matrix to the global one so that the positive definite complementarity block of ...
virtual int get_nbh_info(CH_Matrix_Classes::Integer mudim, CH_Matrix_Classes::Real tr_xz, CH_Matrix_Classes::Real tr_xdzpdxz, CH_Matrix_Classes::Real tr_dxdz, CH_Matrix_Classes::Real nbh_ubnd, CH_Matrix_Classes::Real &alpha, CH_Matrix_Classes::Real &max_nbh, CH_Matrix_Classes::Real &nrmsqr_xz, CH_Matrix_Classes::Real &nrmsqr_xdzpdxz, CH_Matrix_Classes::Real &nrmsqr_dxdz, CH_Matrix_Classes::Real &ip_xz_xdzpdxz, CH_Matrix_Classes::Real &ip_xz_dxdz, CH_Matrix_Classes::Real &ip_dxdz_xdzpdxz) const =0
for limiting the stepsize with respect to the neighborhood this information about norms and inner pro...
virtual int add_Schur_mult(const CH_Matrix_Classes::Matrix &in_Qvec, CH_Matrix_Classes::Matrix &out_Qvec, const CH_Matrix_Classes::Matrix *in_Cvec=0, CH_Matrix_Classes::Matrix *out_Cvec=0)=0
multiply in_Qvec and in_Cvec with the local Schur complement contribution to the main block and the l...
virtual CH_Matrix_Classes::Matrix & get_x()=0
get the vector formed by all model x variables
abstract interface for model blocks in the constrained QPSolver
Definition: QPModelBlockObject.hxx:89
virtual CH_Matrix_Classes::Matrix & get_dcstr()=0
get the vector formed by all delta dual constraint variables
virtual CH_Matrix_Classes::Matrix & get_sysviol_constraints()=0
get the constraint violation for the current system solution
virtual int computed_step(const CH_Matrix_Classes::Matrix &modelxstep, const CH_Matrix_Classes::Matrix &modelconstrstep)=0
store the computed step and compute the missing dual step information
virtual int add_Schur_rhs(CH_Matrix_Classes::Matrix &glob_rhs, CH_Matrix_Classes::Matrix *local_rhs, CH_Matrix_Classes::Real rhsmu, CH_Matrix_Classes::Real rhscorr)=0
add the contributions to glob_diagonal and glob_rhs of the Schur complemented parts, and return local_rhs, local_globblock, local_diagblock of the non complemented parts
virtual int compute_step(const CH_Matrix_Classes::Matrix &ystep)=0
compute the step in the model space given the step in the design space
virtual void recursive_delete_and_clear()=0
sofar this is only needed for some comparative evaluations; usually the objects of the recursive bloc...