ConicBundle
UQPSumModelBlock.hxx
Go to the documentation of this file.
1 
2 
3 #ifndef CONICBUNDLE_UQPSUMMODELBLOCK_HXX
4 #define CONICBUNDLE_UQPSUMMODELBLOCK_HXX
5 
14 #include "UQPModelBlock.hxx"
15 
16 namespace ConicBundle {
17 
22 
37 {
38 private:
40  std::vector<UQPModelBlock*> blocks;
41 
46 
47 
48 public:
50  void clear()
51  {blocks.clear();xstart=0;xend=0;ystart=0;yend=0;UQPModelBlock::clear();}
52 
54  UQPSumModelBlock(CBout* cb=0,int incr=-1):QPSumModelDataObject(cb,incr),UQPModelBlock(cb,incr){clear();}
55 
58 
60  int append(QPModelDataObject* inblock);
61 
62  //----------- UQPModelBlock routines
63 
66 
69 
71  int set_qp_xstart(CH_Matrix_Classes::Integer x_start_index);
72 
74  int set_qp_ystart(CH_Matrix_Classes::Integer y_start_index);
75 
78 
81  const CH_Matrix_Classes::Matrix& qp_Qx,
82  const CH_Matrix_Classes::Matrix& qp_c);
83 
86 
89 
92 
95 
96 
99  const CH_Matrix_Classes::Matrix& qp_Qx,
100  const CH_Matrix_Classes::Matrix& qp_c,
101  const CH_Matrix_Classes::Matrix& qp_dc);
102 
105 
106 
109 
114  const CH_Matrix_Classes::Matrix& qp_dx,
115  const CH_Matrix_Classes::Matrix& qp_dy,
116  const CH_Matrix_Classes::Matrix& rhs_residual);
117 
118 
123 
124 
127  const CH_Matrix_Classes::Matrix& qp_dx,
128  const CH_Matrix_Classes::Matrix& qp_dy,
129  const CH_Matrix_Classes::Matrix& rhs_residual);
130 
131 
133  int set_point(const CH_Matrix_Classes::Matrix& qp_x,
134  const CH_Matrix_Classes::Matrix& qp_y,
136 
139  CH_Matrix_Classes::Matrix& gradient);
140 
142  void set_out(std::ostream* o=0,int pril=1);
143 
145  void set_cbout(const CBout* cb,int incr=-1);
146 
147  //---------------- for debugging purposes
148 
151 
153  CH_Matrix_Classes::Matrix& subtract_z(CH_Matrix_Classes::Matrix& dual_residual,bool with_step=false) const;
154 
155 };
156 
158 
159 }
160 
161 #endif
162 
int Integer
all integer numbers in calculations and indexing are of this type
Definition: matop.hxx:40
int starting_y(CH_Matrix_Classes::Matrix &qp_y, const CH_Matrix_Classes::Matrix &qp_Qx, const CH_Matrix_Classes::Matrix &qp_c)
get the starting y information of all subblocks
UQPSumModelBlock(CBout *cb=0, int incr=-1)
default constructor
Definition: UQPSumModelBlock.hxx:54
~UQPSumModelBlock()
virtual destructor
double Real
all real numbers in calculations are of this type
Definition: matop.hxx:50
void set_cbout(const CBout *cb, int incr=-1)
do this for all subblocks
int set_qp_xstart(CH_Matrix_Classes::Integer x_start_index)
set the starting index of x also for all subblocks
int get_Ab(CH_Matrix_Classes::Matrix &qp_A, CH_Matrix_Classes::Matrix &qp_b) const
get the A matrix of all subblocks and store it consistently
CH_Matrix_Classes::Integer xstart
starting index of the x variables subsumed here within the globale vector x
Definition: UQPSumModelBlock.hxx:42
CH_Matrix_Classes::Integer xend
ending index of local x
Definition: UQPSumModelBlock.hxx:43
abstract interface declaring the uniform outer appearance of general cutting models produced by the v...
Definition: QPModelDataObject.hxx:44
CH_Matrix_Classes::Integer ystart
starting index of the y variables subsumed here within the globale vector y
Definition: UQPSumModelBlock.hxx:44
Matrix class of symmetric matrices with real values of type Real
Definition: symmat.hxx:43
CH_Matrix_Classes::Real get_local_primalcost() const
get joint primalcost of all subblocks
CH_Matrix_Classes::Integer yend
ending index of local y
Definition: UQPSumModelBlock.hxx:45
CH_Matrix_Classes::Integer ydim() const
sum of all ydim of the sublocks
int add_xinv_kron_z(CH_Matrix_Classes::Symmatrix &barQ)
add this for all subblocks
CH_Matrix_Classes::Integer xdim() const
sum of all xdim of the sublocks
int restart_y(CH_Matrix_Classes::Matrix &qp_y, const CH_Matrix_Classes::Matrix &qp_Qx, const CH_Matrix_Classes::Matrix &qp_c, const CH_Matrix_Classes::Matrix &qp_dc)
get a good restarting y of all subblocks for this change in costs
int line_search(CH_Matrix_Classes::Real &alpha, const CH_Matrix_Classes::Matrix &qp_dx, const CH_Matrix_Classes::Matrix &qp_dy, const CH_Matrix_Classes::Matrix &rhs_residual)
get/do this from/for all subblocks
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
CH_Matrix_Classes::Matrix & add_Bs(CH_Matrix_Classes::Matrix &qp_vec) const
do this for all subblocks
int add_local_sys(CH_Matrix_Classes::Symmatrix &sysdy, CH_Matrix_Classes::Matrix &rhs)
add this for all subblocks
int starting_x(CH_Matrix_Classes::Matrix &qp_x)
get the starting x of all subblocks
CH_Matrix_Classes::Matrix & subtract_z(CH_Matrix_Classes::Matrix &dual_residual, bool with_step=false) const
do this for all subblocks
int set_point(const CH_Matrix_Classes::Matrix &qp_x, const CH_Matrix_Classes::Matrix &qp_y, CH_Matrix_Classes::Real alpha)
do this for all subblocks
void set_out(std::ostream *o=0, int pril=1)
do this for all subblocks
int get_corr(CH_Matrix_Classes::Matrix &xcorr, CH_Matrix_Classes::Matrix &rhs, CH_Matrix_Classes::Real mu)
get this from all subblocks
void clear()
reset to "empty/no" model
Definition: UQPSumModelBlock.hxx:50
combines and provides basic functionalities of QPModelDataObject and UQPModelBlockObject, but is still abstract
Definition: UQPModelBlock.hxx:42
Matrix class for real values of type Real
Definition: matrix.hxx:74
std::vector< UQPModelBlock * > blocks
the container pointing to the UQPModelBlock instances comprised in the sum
Definition: UQPSumModelBlock.hxx:40
int set_qp_ystart(CH_Matrix_Classes::Integer y_start_index)
set the starting index of y also for all subblocks
int suggest_mu(CH_Matrix_Classes::Real &ip_xz, CH_Matrix_Classes::Integer &mu_dim, CH_Matrix_Classes::Real &sigma, const CH_Matrix_Classes::Matrix &qp_dx, const CH_Matrix_Classes::Matrix &qp_dy, const CH_Matrix_Classes::Matrix &rhs_residual)
get this from all subblocks
abstract interface extension of QPModelDataObject for use in SumModel where several blocks are concat...
Definition: QPModelDataObject.hxx:105
void clear()
reset to "empty/no" model information
Definition: UQPModelBlock.hxx:54
CH_Matrix_Classes::Real get_local_dualcost() const
get joint dualcost of all subblocks
int restart_x(CH_Matrix_Classes::Matrix &qp_x, const CH_Matrix_Classes::Matrix &qp_c, const CH_Matrix_Classes::Matrix &qp_dc)
get a good restarting x of all subblocks for this change in costs
int append(QPModelDataObject *inblock)
add another model at the end of the list
Header declaring the classes ConicBundle::UQPModelBlock, ConicBundle::UQPModelPointer.
int add_modelx_aggregate(CH_Matrix_Classes::Real &offset, CH_Matrix_Classes::Matrix &gradient)
do this for all subblocks
implements a (virtual) cutting model being built of a (possibly recursive) sum of UQPModelBlock cutti...
Definition: UQPSumModelBlock.hxx:36