ConicBundle
UQPModelBlockObject.hxx
Go to the documentation of this file.
1 
2 
3 #ifndef CONICBUNDLE_UQPMODELBLOCKOBJECT_HXX
4 #define CONICBUNDLE_UQPMODELBLOCKOBJECT_HXX
5 
13 #include "symmat.hxx"
14 
15 namespace ConicBundle {
16 
21 
71 {
72 private:
73  //the Block has to memorize and update its local x,y,z variables
74  //(and all additional ones that are not visible to the outside)
75  //in particular it is assumed to keep a copy of the current variables
76  //after the calls to the following functions:
77  // starting_x, starting_yz, restart_x, restart_yz, set_point
78 
79 public:
80 
82  virtual ~UQPModelBlockObject();
83 
85  virtual CH_Matrix_Classes::Integer xdim() const =0;
86 
88  virtual CH_Matrix_Classes::Integer ydim() const =0;
89 
91  virtual int set_qp_xstart(CH_Matrix_Classes::Integer x_start_index)=0;
92 
94  virtual int set_qp_ystart(CH_Matrix_Classes::Integer y_start_index)=0;
95 
97  virtual int starting_x(CH_Matrix_Classes::Matrix& qp_x)=0;
98 
100  virtual int starting_y(CH_Matrix_Classes::Matrix& qp_y,
101  const CH_Matrix_Classes::Matrix& qp_Qx,
102  const CH_Matrix_Classes::Matrix& qp_c)=0;
103 
106 
109 
111  virtual int get_Ab(CH_Matrix_Classes::Matrix& qp_A,CH_Matrix_Classes::Matrix &qp_b) const=0;
112 
124  virtual int restart_x(CH_Matrix_Classes::Matrix& qp_x,
125  const CH_Matrix_Classes::Matrix& qp_c,
126  const CH_Matrix_Classes::Matrix& qp_dc)=0;
127 
136  virtual int restart_y(CH_Matrix_Classes::Matrix& qp_y,
137  const CH_Matrix_Classes::Matrix& qp_Qx,
138  const CH_Matrix_Classes::Matrix& qp_c,
139  const CH_Matrix_Classes::Matrix& qp_dc)=0;
140 
142  virtual int add_xinv_kron_z(CH_Matrix_Classes::Symmatrix& barQ)=0;
143 
157 
168  virtual int suggest_mu(CH_Matrix_Classes::Real& ip_xz,
171  const CH_Matrix_Classes::Matrix& qp_dx,
172  const CH_Matrix_Classes::Matrix& qp_dy,
173  const CH_Matrix_Classes::Matrix& rhs_residual)=0;
174 
189  virtual int get_corr(CH_Matrix_Classes::Matrix& xcorr,
192 
207  virtual int line_search(CH_Matrix_Classes::Real& alpha,
208  const CH_Matrix_Classes::Matrix& qp_dx,
209  const CH_Matrix_Classes::Matrix& qp_dy,
210  const CH_Matrix_Classes::Matrix& rhs_residual)=0;
211 
213  virtual int set_point(const CH_Matrix_Classes::Matrix& qp_x,
214  const CH_Matrix_Classes::Matrix& qp_y,
215  CH_Matrix_Classes::Real alpha)=0;
216 
217 
218  //---------------- for debugging purposes
219 
222 
224  virtual CH_Matrix_Classes::Matrix& subtract_z(CH_Matrix_Classes::Matrix& dual_residual,bool with_step=false) const=0;
225 
226 };
227 
228 
230 
231 
232 }
233 
234 #endif
235 
int Integer
all integer numbers in calculations and indexing are of this type
Definition: matop.hxx:40
double Real
all real numbers in calculations are of this type
Definition: matop.hxx:50
virtual 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)=0
perform a line search for the block variables
virtual int set_qp_ystart(CH_Matrix_Classes::Integer y_start_index)=0
the indices of the local variables correspond to the indices of the qp variables y starting with this...
virtual int add_xinv_kron_z(CH_Matrix_Classes::Symmatrix &barQ)=0
add the system term corresponding to (xinv kron z) (that arises from solving the linearized perturbed...
virtual int restart_x(CH_Matrix_Classes::Matrix &qp_x, const CH_Matrix_Classes::Matrix &qp_c, const CH_Matrix_Classes::Matrix &qp_dc)=0
it is assumed that the problem was solved already once and is now resolved for a new linear cost term...
virtual int add_local_sys(CH_Matrix_Classes::Symmatrix &sysdy, CH_Matrix_Classes::Matrix &rhs)=0
add the local system informatoin
virtual ~UQPModelBlockObject()
virtual destructor
virtual CH_Matrix_Classes::Real get_local_dualcost() const =0
returns the current local dual cost contribution
virtual int set_qp_xstart(CH_Matrix_Classes::Integer x_start_index)=0
the indices of the local variables correspond to the indices of the qp variables x and z starting wit...
Matrix class of symmetric matrices with real values of type Real
Definition: symmat.hxx:43
Header declaring the class CH_Matrix_Classes::Symmatrix for symmetric matrices with Real elements...
virtual 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)=0
this is called after restart_x (see there)
virtual int starting_x(CH_Matrix_Classes::Matrix &qp_x)=0
generate a strictly feasible primal starting point, store it in the qpx_range of x; returns 0 on succ...
conic bundle method solver for sum of convex functions. See the ConicBundle_Manual for a quick introd...
Definition: CBSolver.hxx:22
abstract interface for model blocks in the unconstrained UQPSolver
Definition: UQPModelBlockObject.hxx:70
virtual int starting_y(CH_Matrix_Classes::Matrix &qp_y, const CH_Matrix_Classes::Matrix &qp_Qx, const CH_Matrix_Classes::Matrix &qp_c)=0
generate a strictly feasible dual starting point, store it in the qpy_range of y, x is fixed already ...
virtual int get_corr(CH_Matrix_Classes::Matrix &xcorr, CH_Matrix_Classes::Matrix &rhs, CH_Matrix_Classes::Real mu)=0
supply the information for the corrector
virtual int get_Ab(CH_Matrix_Classes::Matrix &qp_A, CH_Matrix_Classes::Matrix &qp_b) const =0
store the local coefficients of matrices A and b in the positions corresponding to qpy_range (rows) a...
virtual CH_Matrix_Classes::Integer xdim() const =0
dimension of externally visible primal variables
Matrix class for real values of type Real
Definition: matrix.hxx:74
virtual CH_Matrix_Classes::Matrix & add_Bs(CH_Matrix_Classes::Matrix &qp_vec) const =0
add the local product of matrices B and s in the positions corresponding to qpy_range (rows) and retu...
virtual int set_point(const CH_Matrix_Classes::Matrix &qp_x, const CH_Matrix_Classes::Matrix &qp_y, CH_Matrix_Classes::Real alpha)=0
x,y,z is the new point and has to be stored, alpha is the step size used in the step, it is passed so thatthe block can take the same step for internal variables if needed.
virtual CH_Matrix_Classes::Integer ydim() const =0
dimension of externally visible dual variables
virtual CH_Matrix_Classes::Matrix & subtract_z(CH_Matrix_Classes::Matrix &dual_residual, bool with_step=false) const =0
add the contributions of the dual slacks and return dual_residual returns 0 on success, 1 on failure
virtual 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)=0
supply the information for the choice of the next barrier parameter value
virtual CH_Matrix_Classes::Real get_local_primalcost() const =0
returns the current local primal cost contribution <d,s>