2 #ifndef CONICBUNDLE_QPMODELBLOCK_HXX 3 #define CONICBUNDLE_QPMODELBLOCK_HXX 70 modeldcstr.
init(0,0,0.);
71 sysviol_model.
init(0,0,0.);
72 sysviol_constraints.
init(0,0,0.);
79 { constant_minorant.clear(); bundle.clear();modelx_aggregate.
clear();
97 {
return constant_minorant.back(); }
101 {
return bundle.back();}
105 {
return constant_minorant.back(); }
109 {
return bundle.back();}
115 std::map<MinorantPointer,MinorantPointer>* precomputed=0);
269 bool append_globtransp_times_mat_to_subspace,
357 std::ostream&
out)=0;
416 bool append_globtransp_times_mat_to_subspace=
false);
465 { model_block=
dynamic_cast<QPModelBlock*
>(inbp);
return (model_block==0);}
int Integer
all integer numbers in calculations and indexing are of this type
Definition: matop.hxx:40
QPModelPointer(CBout *cb=0, int cbinc=-1)
default constructor
Definition: QPModelBlock.hxx:454
QPModelBlock * model_block
stores a pointer to the current starting block giving access to the cutting model(s) [it does not own...
Definition: QPModelBlock.hxx:451
void clear_model_data_ptr()
set the pointer to NULL
Definition: QPModelBlock.hxx:459
virtual int get_modeldcstr(CH_Matrix_Classes::Matrix &modeldcstr, CH_Matrix_Classes::Integer startindex_constraints)=0
set the local modeldx value in modeldx beginning with startindex (initialize it, do not add) ...
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
virtual CH_Matrix_Classes::Matrix & get_dx()
get the vector formed by all delta model x variables
CH_Matrix_Classes::Matrix modeldcstr
only for testing
Definition: QPModelBlock.hxx:58
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
Matrix class for integral values of type Integer
Definition: indexmat.hxx:195
Matrix & init(const Matrix &A, Real d=1., int atrans=0)
initialize to *this=A*d where A may be transposed
Definition: matrix.hxx:1035
virtual CH_Matrix_Classes::Matrix & get_dcstr()
get the vector formed by all delta model x variables
virtual int reset_starting_point(const CH_Matrix_Classes::Matrix &y, CH_Matrix_Classes::Real mu, MinorantBundle &global_bundle, CH_Matrix_Classes::Integer startindex_bundle)=0
reset the starting point for the current y
combines and provides basic functionalities of QPModelDataObject and QPModelBlockObject, but is still abstract
Definition: QPModelBlock.hxx:47
virtual CH_Matrix_Classes::Matrix & get_x()
get the vector formed by all model x variables
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
abstract interface extension of QPModelDataObject to allow uniform generation of tuned quadratic solv...
Definition: QPModelDataObject.hxx:144
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)
applies the AffineFunctionTransformation to constant_minorant and bundle, where (if given) only the g...
virtual MinorantPointer & get_constant_minorant()
gives access to a constant offset minorant
Definition: QPModelBlock.hxx:104
virtual int get_sysviol_model(CH_Matrix_Classes::Matrix &modelvec, CH_Matrix_Classes::Integer startindex_model, const CH_Matrix_Classes::Matrix &dy, MinorantBundle &global_bundle, CH_Matrix_Classes::Integer startindex_bundle)=0
set the model violation for the current system solution
virtual MinorantBundle & get_bundle()
gives access to the bundle minorants of the cutting model
Definition: QPModelBlock.hxx:108
abstract interface declaring the uniform outer appearance of general cutting models produced by the v...
Definition: QPModelDataObject.hxx:44
virtual QPModelBlockObject * clone()=0
return a cloned object on the heap
CH_Matrix_Classes::Matrix modeldx
only for testing
Definition: QPModelBlock.hxx:57
CH_Matrix_Classes::Matrix sysviol_constraints
only for testing
Definition: QPModelBlock.hxx:60
Matrix class of symmetric matrices with real values of type Real
Definition: symmat.hxx:43
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 get_modelx(CH_Matrix_Classes::Matrix &modelx, CH_Matrix_Classes::Integer startindex_model)=0
set the local modelx value in modelx beginning with startindex (initialize it, do not add) ...
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 prepare_BCSchur_JLprecond(CH_Matrix_Classes::Matrix &glob_lowrank, CH_Matrix_Classes::Matrix &subspace, bool append_globtransp_times_mat_to_subspace, MinorantBundle &globalbundle, CH_Matrix_Classes::Integer startindex_bundle)=0
compute the preconditioning low-rank representation of the Schur complementd blocks belonging to bund...
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, CH_Matrix_Classes::Integer startindex_constraints, MinorantBundle &globalbundle, CH_Matrix_Classes::Integer startindex_bundle)=0
add the contributions to glob_rhs of the Schur complemented model block, and return local_rhs of the ...
CH_Matrix_Classes::Matrix Bt
if the matrix of the bundle information has to be formed at least once, it is then stored here for la...
Definition: QPModelBlock.hxx:56
virtual int do_step(CH_Matrix_Classes::Real alpha, const CH_Matrix_Classes::Matrix &y, MinorantBundle &global_bundle, CH_Matrix_Classes::Integer startindex_bundle)=0
move in the last computed step direction by a step of length alpha and compute and store the violatio...
MinorantPointer modelx_aggregate
if asked to form the aggregate for the current modlex, it is also stored here for later use ...
Definition: QPModelBlock.hxx:62
virtual int get_modeldx(CH_Matrix_Classes::Matrix &modeldx, CH_Matrix_Classes::Integer startindex_model)=0
set the local modeldx value in modeldx beginning with startindex (initialize it, do not add) ...
virtual ~QPModelBlock()
virtual destructor
Header declaring the classes ConicBundle::QPModelBlockObject.
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
C=beta*C+alpha*B*A where B and A may be transposed; carry out the model part of this beginning at sta...
virtual CH_Matrix_Classes::Real globalx_cost(const CH_Matrix_Classes::Matrix &globalx)
returns the value of constant offset plus global linear cost term for the current globalx ...
Header declaring the class ConicBundle::QPModelDataObject, ConicBundle::QPSumModelDataObject, ConicBundle::QPConeModelDataObject, ConicBundle::QPModelDataPointer.
virtual void recursive_delete_and_clear()=0
usually the objects of the recursive block structure and not deleted in a clear. If needed...
Matrix class for real values of type Real
Definition: matrix.hxx:74
std::ostream * out
not output at all if out==0, otherwise use this output stream
Definition: CBout.hxx:33
abstract interface for BundleSolver giving access to all objective function specific bundle routines ...
Definition: BundleModel.hxx:140
std::vector< MinorantPointer > MinorantBundle
a bundle is a vector with MinorantPointer entries
Definition: MinorantPointer.hxx:24
virtual int solve_constrsys(const CH_Matrix_Classes::Symmatrix &ABchol, const CH_Matrix_Classes::Matrix &LinvABrhs, CH_Matrix_Classes::Matrix &LinvABsol, CH_Matrix_Classes::Integer startindex_model, CH_Matrix_Classes::Matrix &Crhs_and_sol, 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 int pop_aft()
undo the last push_aft
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 B and B may be transposed; carry out the model part of this beginning at sta...
virtual int computed_Schur_step(const CH_Matrix_Classes::Matrix &xstep, const CH_Matrix_Classes::Matrix &local_step, CH_Matrix_Classes::Integer startindex_model, MinorantBundle &globalbundle, CH_Matrix_Classes::Integer startindex_bundle)=0
informs the model about the step computed
abstract interface for model blocks in the constrained QPSolver
Definition: QPModelBlockObject.hxx:89
virtual const MinorantPointer & get_constant_minorant() const
gives reading access to a constant offset minorant
Definition: QPModelBlock.hxx:96
QPModelBlock(CBout *cb=0, int cbinc=-1)
default constructor
Definition: QPModelBlock.hxx:83
virtual void modelx_changed()
whenever modelx is (going to be) changed, the information collected for the oblivious modelx is reset...
Definition: QPModelBlock.hxx:65
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, 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 ...
void clear()
reset to uninitialized state (no model)
Definition: QPModelBlock.hxx:78
virtual void display_model_values(const CH_Matrix_Classes::Matrix &y, MinorantBundle &global_bundle, CH_Matrix_Classes::Integer startindex_bundle, std::ostream &out)=0
for test outputs
abstract interface extension of QPModelDataObject for use in SumModel where several blocks are concat...
Definition: QPModelDataObject.hxx:105
int set_model_data(QPModelDataObject *inbp)
store the pointer to the object if it matches the required type for the QP solver, otherwise return a nonzero value as error; this is used in the models to return the local qp model data
Definition: QPModelBlock.hxx:464
virtual CH_Matrix_Classes::Matrix & get_sysviol_constraints()
get the constraint violation for the current system solution
virtual int compute_step(const CH_Matrix_Classes::Matrix &ystep, MinorantBundle &global_bundle, CH_Matrix_Classes::Integer startindex_bundle)=0
compute the step in the model space given the step in the design space
Implementation of the QPModelDataPointer Interface for BundelModel for generating the correct type of...
Definition: QPModelBlock.hxx:448
virtual CH_Matrix_Classes::Integer dim_bundle()
returns bundle.size() of the model (may differ from dim_model in case of fixing some subspace to zero...
Definition: QPModelBlock.hxx:121
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, MinorantBundle &bundle, CH_Matrix_Classes::Integer startindex_bundle)=0
If mu is not zero, always add the centering term for this mu as well, if append is false...
std::vector< MinorantBundle > bundle
the minorants forming the cutting model(s); how to combine them within the model(s) comprised in *thi...
Definition: QPModelBlock.hxx:53
virtual const MinorantBundle & get_bundle() const
gives reading access to the bundle minorants of the cutting model
Definition: QPModelBlock.hxx:100
CH_Matrix_Classes::Matrix sysviol_model
only for testing
Definition: QPModelBlock.hxx:59
virtual int add_BtinvsysB(CH_Matrix_Classes::Symmatrix &globalsys, MinorantBundle &bundle, CH_Matrix_Classes::Integer startindex_bundle)=0
add the "scaled" minorant outer products to globalsys, where the correct minorants start at the given...
virtual int add_Schur_mult(const CH_Matrix_Classes::Matrix &in_vec, CH_Matrix_Classes::Matrix &out_vec, const CH_Matrix_Classes::Matrix *in_cvec, CH_Matrix_Classes::Matrix *out_cvec, CH_Matrix_Classes::Integer startindex_constraints, MinorantBundle &globalbundle, CH_Matrix_Classes::Integer startindex_bundle)=0
multiply in_vec with the local contribution to the global main block and add it to out_vec; the other...
points to MinorantUseData that may be shared by many and allows computations with Minorants ...
Definition: MinorantPointer.hxx:34
void clear()
afterwards the pointer is empty (calls delete_data())
Definition: MinorantPointer.hxx:86
virtual int computed_step(const CH_Matrix_Classes::Matrix &modelxstep, CH_Matrix_Classes::Integer startindex_model, const CH_Matrix_Classes::Matrix &modelconstrstep, CH_Matrix_Classes::Integer startindex_constr)=0
store this computed step locally and compute the missing local dual step information ...
std::vector< MinorantPointer > constant_minorant
constant offset minorant (fixed affine function to be added to the model); each aft creates a new one...
Definition: QPModelBlock.hxx:51
virtual int add_BCSchur_diagonal(CH_Matrix_Classes::Matrix &diagonal, MinorantBundle &globalbundle, CH_Matrix_Classes::Integer startindex_bundle)=0
add the diagonal of the Schur complemented blocks belonging to bundle and local constraints (used for...
CH_Matrix_Classes::Matrix modelx
the current vector of model variables of all models comprised in *this
Definition: QPModelBlock.hxx:55
virtual int add_Bt_modelx(CH_Matrix_Classes::Real &val, CH_Matrix_Classes::Matrix &vec)
adds opB transposed times modelx and constant affine term to the arguments
Definition: QPModelBlock.hxx:307
QPModelDataObject * get_model_data_ptr() const
returns the pointer value
Definition: QPModelBlock.hxx:474