3 #ifndef CONICBUNDLE_UQPCONEMODELBLOCK_HXX 4 #define CONICBUNDLE_UQPCONEMODELBLOCK_HXX 75 std::vector<CH_Matrix_Classes::Symmatrix>
Xp;
76 std::vector<CH_Matrix_Classes::Symmatrix>
Zp;
77 std::vector<CH_Matrix_Classes::Symmatrix>
Xinv;
114 std::vector<CH_Matrix_Classes::Symmatrix>
old_Xp;
115 std::vector<CH_Matrix_Classes::Symmatrix>
old_Zp;
179 bool scale_box=
true);
193 bool cautious=
false);
199 bool cautious=
false);
212 bool cautious=
false);
290 {qp_xstart=x_start_index;
return 0;}
294 {qp_ystart=y_start_index;
return 0;}
355 {
return (less_or_equal? s*scost:0.);}
int Integer
all integer numbers in calculations and indexing are of this type
Definition: matop.hxx:40
std::vector< CH_Matrix_Classes::Symmatrix > Xinv
inverses of local primal psd variables X
Definition: UQPConeModelBlock.hxx:77
std::vector< CH_Matrix_Classes::Symmatrix > Xp
local primal psd variables X
Definition: UQPConeModelBlock.hxx:75
int inner_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 &dz, const CH_Matrix_Classes::Matrix &duz, CH_Matrix_Classes::Real box_ds, CH_Matrix_Classes::Real ds)
perform a line search for the given direction and return a feasible step length
std::vector< MinorantBundle > bundle
the minorants forming the cutting model; how to combine them is described in derived classes ...
Definition: UQPModelBlock.hxx:49
CH_Matrix_Classes::Real get_local_dualcost() const
returns the current local dual cost contribution
CH_Matrix_Classes::Real get_trace()
get the right hand side of the trace constraint
Definition: UQPConeModelBlock.hxx:188
int set_qp_ystart(CH_Matrix_Classes::Integer y_start_index)
the indices of the local variables correspond to the indices of the qp variables y starting with this...
Definition: UQPConeModelBlock.hxx:293
int compute_local_directions(const CH_Matrix_Classes::Matrix &qp_dx, const CH_Matrix_Classes::Matrix &qp_dy, const CH_Matrix_Classes::Matrix &rhs_resid, CH_Matrix_Classes::Matrix &dz, CH_Matrix_Classes::Matrix &duz, CH_Matrix_Classes::Real &box_ds, CH_Matrix_Classes::Real &ds)
given the steps of the global part, compute the step of the local part
void clear()
reinitialize to "empty/no" model
CH_Matrix_Classes::Matrix z
joint local dual slack variables as a vector, z=(vecz',svec(Z1)',svec(Z2)',...,svec(Zk)',boxlz)'
Definition: UQPConeModelBlock.hxx:56
int set_qp_xstart(CH_Matrix_Classes::Integer x_start_index)
the indices of the local variables correspond to the indices of the qp variables x and z starting wit...
Definition: UQPConeModelBlock.hxx:289
bool box_scaleub
if true, the scaling is upper bounded by b
Definition: UQPConeModelBlock.hxx:84
CH_Matrix_Classes::Matrix dz
step for z
Definition: UQPConeModelBlock.hxx:126
CH_Matrix_Classes::Real current_mu
current value of the barrier parameter
Definition: UQPConeModelBlock.hxx:106
Integer rowdim() const
returns the row dimension
Definition: matrix.hxx:215
CH_Matrix_Classes::Matrix lb
box lower bounds
Definition: UQPConeModelBlock.hxx:81
double Real
all real numbers in calculations are of this type
Definition: matop.hxx:50
CH_Matrix_Classes::Real last_alpha
most recent value of step size alpha
Definition: UQPConeModelBlock.hxx:116
int get_boxx(CH_Matrix_Classes::Matrix &, CH_Matrix_Classes::Matrix *=0, bool cautious=false)
get the box part of modelx (and a guess, which of the bounds are active, in {0.,1.})
int get_Ab(CH_Matrix_Classes::Matrix &qp_A, CH_Matrix_Classes::Matrix &qp_b) const
store the local coefficients of matrices A and b in the positions corresponding to qpy_range (rows) a...
CH_Matrix_Classes::Real old_s
previous value of s
Definition: UQPConeModelBlock.hxx:113
~UQPConeModelBlock()
destructor
Definition: UQPConeModelBlock.hxx:162
CH_Matrix_Classes::Matrix old_uz
previous value of uz
Definition: UQPConeModelBlock.hxx:110
CH_Matrix_Classes::Matrix & add_Bs(CH_Matrix_Classes::Matrix &qp_vec) const
add the local product of matrices B and s in the positions corresponding to qpy_range (rows) and retu...
int get_old_socx(CH_Matrix_Classes::Integer i, CH_Matrix_Classes::Matrix &vecx)
get the previous primal second order cone point to cone i (of the solution)
Definition: UQPConeModelBlock.hxx:244
int add_local_sys(CH_Matrix_Classes::Symmatrix &sysdy, CH_Matrix_Classes::Matrix &rhs)
add the local system informatoin
CH_Matrix_Classes::Integer ydim() const
dimension of externally visible dual variables
Definition: UQPConeModelBlock.hxx:286
int add_modelx_aggregate(CH_Matrix_Classes::Real &offset, CH_Matrix_Classes::Matrix &gradient)
adds opB transposed times modelx (with offsets but without constant affine term) to the arguments ...
std::vector< MinorantPointer > constant_minorant
constant offset minorant (fixed affine function to be added to the model)
Definition: UQPModelBlock.hxx:47
CH_Matrix_Classes::Symmatrix dX
temporary variable to reduce reallocations
Definition: UQPConeModelBlock.hxx:135
CH_Matrix_Classes::Matrix old_z
previous value of z
Definition: UQPConeModelBlock.hxx:109
CH_Matrix_Classes::Real scost
cost of primal slack if ineqquality
Definition: UQPConeModelBlock.hxx:67
Symmatrix & init(const Symmatrix &A, double d=1.)
initialize to *this=A*d
Definition: symmat.hxx:753
Matrix class for integral values of type Integer
Definition: indexmat.hxx:195
int get_nncz(CH_Matrix_Classes::Matrix &vecz)
get the current dual non negative cone point (of the solution)
Definition: UQPConeModelBlock.hxx:223
CH_Matrix_Classes::Integer xdim() const
dimension of externally visible primal variables
Definition: UQPConeModelBlock.hxx:283
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
abstract base class for passing additional oracle information to the QP
Definition: QPModelDataObject.hxx:134
CH_Matrix_Classes::Matrix zcorr
value used in corrector of z
Definition: UQPConeModelBlock.hxx:119
CH_Matrix_Classes::Real get_old_s(void)
get the previous slack value of the trace constraint
Definition: UQPConeModelBlock.hxx:256
CH_Matrix_Classes::Matrix dx
step for x
Definition: UQPConeModelBlock.hxx:124
int get_socx(CH_Matrix_Classes::Integer i, CH_Matrix_Classes::Matrix &socx, CH_Matrix_Classes::Real *socx_activity, bool cautious=false)
get the SOC part of modelx (and a guess whether the entire cone is active
UQPConeModelBlock(CBout *cb=0, int cbinc=-1)
default constructor
Definition: UQPConeModelBlock.hxx:159
int get_X(CH_Matrix_Classes::Integer i, CH_Matrix_Classes::Symmatrix &X)
get the current primal positive semidefinite cone point to cone i (of the solution) ...
Definition: UQPConeModelBlock.hxx:228
CH_Matrix_Classes::Real old_mu
previous value of the barrier parameter
Definition: UQPConeModelBlock.hxx:107
CH_Matrix_Classes::Real get_s(void)
get the current slack value of the trace constraint
Definition: UQPConeModelBlock.hxx:234
CH_Matrix_Classes::Real get_y(void)
get the current dual value of the trace constraint
Definition: UQPConeModelBlock.hxx:232
CH_Matrix_Classes::Matrix mult_G(const CH_Matrix_Classes::Matrix &x, CH_Matrix_Classes::Real gamma, const CH_Matrix_Classes::Matrix &v) const
used for second order cone computations
abstract interface extension of QPModelDataObject to allow uniform generation of tuned quadratic solv...
Definition: QPModelDataObject.hxx:144
CH_Matrix_Classes::Matrix uzcorr
value used in corrector of uz
Definition: UQPConeModelBlock.hxx:120
int get_socz(CH_Matrix_Classes::Integer i, CH_Matrix_Classes::Matrix &vecz)
get the current dual second order cone point to cone i (of the solution)
Definition: UQPConeModelBlock.hxx:225
CH_Matrix_Classes::Real get_old_y(void)
get the previous dual value of the trace constraint
Definition: UQPConeModelBlock.hxx:254
Real * get_store()
returns the current address of the internal value array; use cautiously, do not use delete! ...
Definition: matrix.hxx:326
Matrix class of symmetric matrices with real values of type Real
Definition: symmat.hxx:43
CH_Matrix_Classes::Real dy
step for y
Definition: UQPConeModelBlock.hxx:125
CH_Matrix_Classes::Real scorr
value used in corrector of s
Definition: UQPConeModelBlock.hxx:122
CH_Matrix_Classes::Integer nnc_dim
dimension of leading linear part
Definition: UQPConeModelBlock.hxx:70
conic bundle method solver for sum of convex functions. See the ConicBundle_Manual for a quick introd...
Definition: CBSolver.hxx:22
CH_Matrix_Classes::Integer qp_ystart
the index of the local y in qp_y
Definition: UQPConeModelBlock.hxx:99
CH_Matrix_Classes::Real y
dual variable for A
Definition: UQPConeModelBlock.hxx:68
CH_Matrix_Classes::Matrix duz
step for uz
Definition: UQPConeModelBlock.hxx:127
base class for uniform use of WARNINGS and ERRORS (at some point in time)
Definition: CBout.hxx:30
CH_Matrix_Classes::Real ds
step for s
Definition: UQPConeModelBlock.hxx:129
CH_Matrix_Classes::Integer box_start
the index of box_x in qp_x
Definition: UQPConeModelBlock.hxx:95
CH_Matrix_Classes::Real get_old_mu(void)
get the previous barrier parameter
Definition: UQPConeModelBlock.hxx:258
int adjust_trace(CH_Matrix_Classes::Real b)
change the right hand side of the trace constraint to b
int set_point(const CH_Matrix_Classes::Matrix &qp_x, const CH_Matrix_Classes::Matrix &qp_y, CH_Matrix_Classes::Real alpha)
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.
std::vector< CH_Matrix_Classes::Symmatrix > old_Xp
previous value of Xp
Definition: UQPConeModelBlock.hxx:114
CH_Matrix_Classes::Real box_uz
dual variable for upper bound on box_s
Definition: UQPConeModelBlock.hxx:90
std::vector< CH_Matrix_Classes::Symmatrix > old_Zp
previous value of Zp
Definition: UQPConeModelBlock.hxx:115
int restart_x(CH_Matrix_Classes::Matrix &qp_x, const CH_Matrix_Classes::Matrix &qp_c, const CH_Matrix_Classes::Matrix &qp_dc)
it is assumed that the problem was solved already once and is now resolved for a new linear cost term...
int get_old_socz(CH_Matrix_Classes::Integer i, CH_Matrix_Classes::Matrix &vecz)
get the previous dual second order cone point to cone i (of the solution)
Definition: UQPConeModelBlock.hxx:247
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)
perform a line search for the block variables
CH_Matrix_Classes::Real restart_factor
after a cost update, how far to go back into the interior
Definition: UQPConeModelBlock.hxx:102
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)
this is called after restart_x (see there)
CH_Matrix_Classes::Matrix tmpsvec
temporary variable to reduce reallocations
Definition: UQPConeModelBlock.hxx:133
int get_nncx(CH_Matrix_Classes::Matrix &nncx, CH_Matrix_Classes::Matrix *nncx_activity=0, bool cautious=false)
get the linear part of modelx (and a guess, which of them are active, in {0.,1.}) ...
CH_Matrix_Classes::Symmatrix tmpsymmat
temporary variable to reduce reallocations
Definition: UQPConeModelBlock.hxx:134
combines and provides basic functionalities of QPModelDataObject and UQPModelBlockObject, but is still abstract
Definition: UQPModelBlock.hxx:42
CH_Matrix_Classes::Real box_duz
step for box_uz
Definition: UQPConeModelBlock.hxx:128
CH_Matrix_Classes::Matrix mult_Ginv(const CH_Matrix_Classes::Matrix &x, CH_Matrix_Classes::Real gamma, const CH_Matrix_Classes::Matrix &v) const
used for second order cone computations
int less_or_equal
if !=0, then Ax <= b
Definition: UQPConeModelBlock.hxx:65
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)
supply the information for the choice of the next barrier parameter value
CH_Matrix_Classes::Real get_last_alpha()
get the most recent step size
Definition: UQPConeModelBlock.hxx:260
CH_Matrix_Classes::Real old_box_uz
previous value of box_uz
Definition: UQPConeModelBlock.hxx:111
Matrix class for real values of type Real
Definition: matrix.hxx:74
CH_Matrix_Classes::Real get_mu(void)
get the current barrier parameter
Definition: UQPConeModelBlock.hxx:236
CH_Matrix_Classes::Matrix mult_Arwinv(const CH_Matrix_Classes::Matrix &x, const CH_Matrix_Classes::Matrix &v) const
used for second order cone computations
CH_Matrix_Classes::Matrix uz
box dual variable for upper bounds(if box_scaleub)
Definition: UQPConeModelBlock.hxx:88
int get_old_nncx(CH_Matrix_Classes::Matrix &vecx)
get the previous primal non negative cone point (of the solution)
Definition: UQPConeModelBlock.hxx:240
CH_Matrix_Classes::Matrix & subtract_z(CH_Matrix_Classes::Matrix &dual_residual, bool with_step=false) const
add the contributions of the dual slacks and return dual_residual returns 0 on success, 1 on failure
implements a UQPModelBlock for conic cutting models in UQPSolver
Definition: UQPConeModelBlock.hxx:49
CH_Matrix_Classes::Matrix x
joint local primal variables as a vector, x=(vecx',svec(X1)',svec(X2)',...,svec(Xk)',boxx)'
Definition: UQPConeModelBlock.hxx:53
FunctionTask
Each function represented by a FunctionModel is equipped with a function_factor (it defaults to 1...
Definition: CBSolver.hxx:221
std::vector< MinorantPointer > MinorantBundle
a bundle is a vector with MinorantPointer entries
Definition: MinorantPointer.hxx:24
CH_Matrix_Classes::Indexmatrix soc_start
first element of i-th SOC variable in x
Definition: UQPConeModelBlock.hxx:73
int get_old_Z(CH_Matrix_Classes::Integer i, CH_Matrix_Classes::Symmatrix &Z)
get the previous dual positive semidefinite cone point to cone i (of the solution) ...
Definition: UQPConeModelBlock.hxx:252
CH_Matrix_Classes::Matrix mult_Arw(const CH_Matrix_Classes::Matrix &x, const CH_Matrix_Classes::Matrix &v) const
used for second order cone computations
int get_corr(CH_Matrix_Classes::Matrix &xcorr, CH_Matrix_Classes::Matrix &rhs, CH_Matrix_Classes::Real mu)
supply the information for the corrector
int init(const MinorantPointer &constant_minorant, const MinorantBundle &bundle, CH_Matrix_Classes::Integer nnc_dim, const CH_Matrix_Classes::Indexmatrix &soc_dim, const CH_Matrix_Classes::Indexmatrix &sdp_dim, const CH_Matrix_Classes::Matrix &box_lb, const CH_Matrix_Classes::Matrix &box_ub, CH_Matrix_Classes::Real b, FunctionTask ft, QPModelOracleDataObject *oracle_data=0, bool scale_box=true)
sets up the model with bundle information and how to combine it, see QPConeModelDataObject::init() fo...
CH_Matrix_Classes::Integer box_dim
the size of lb + scaling (if so)
Definition: UQPConeModelBlock.hxx:93
CH_Matrix_Classes::Matrix ub
box upper bounds
Definition: UQPConeModelBlock.hxx:82
CH_Matrix_Classes::Matrix old_x
previous value of x
Definition: UQPConeModelBlock.hxx:108
CH_Matrix_Classes::Real old_y
previous value of y
Definition: UQPConeModelBlock.hxx:112
int add_xinv_kron_z(CH_Matrix_Classes::Symmatrix &barQ)
add the system term corresponding to (xinv kron z) (that arises from solving the linearized perturbed...
bool box_scaling
true if box takes part in scaling
Definition: UQPConeModelBlock.hxx:83
int starting_y(CH_Matrix_Classes::Matrix &qp_y, const CH_Matrix_Classes::Matrix &qp_Qx, const CH_Matrix_Classes::Matrix &qp_c)
generate a strictly feasible dual starting point, store it in the qpy_range of y, x is fixed already ...
CH_Matrix_Classes::Real box_uzcorr
value used in corrector of box_uz
Definition: UQPConeModelBlock.hxx:121
CH_Matrix_Classes::Real b
the trace right hand side
Definition: UQPConeModelBlock.hxx:62
CH_Matrix_Classes::Matrix A
here, A is only a row vector (the trace), A=(ones(vecz)', svec(I1)',....,svec(Ik)') ...
Definition: UQPConeModelBlock.hxx:59
int get_pscx(CH_Matrix_Classes::Integer i, CH_Matrix_Classes::Matrix &pscx_eigs, CH_Matrix_Classes::Matrix &pscx_vecs, CH_Matrix_Classes::Real &pscx_growthrate, CH_Matrix_Classes::Matrix &pscx_primalgrowth, CH_Matrix_Classes::Matrix &pscx_dualgrowth)
get the PSC part of modelx (and a guess on the rank of the active part)
CH_Matrix_Classes::Real evaluate_trace() const
evaluate the left hand side of the trace constraint for modelx
int starting_x(CH_Matrix_Classes::Matrix &qp_x)
generate a strictly feasible primal starting point, store it in the qpx_range of x; returns 0 on succ...
int get_Z(CH_Matrix_Classes::Integer i, CH_Matrix_Classes::Symmatrix &Z)
get the current dual positive semidefinite cone point to cone i (of the solution) ...
Definition: UQPConeModelBlock.hxx:230
int get_old_X(CH_Matrix_Classes::Integer i, CH_Matrix_Classes::Symmatrix &X)
get the previous primal positive semidefinite cone point to cone i (of the solution) ...
Definition: UQPConeModelBlock.hxx:250
CH_Matrix_Classes::Matrix tmpvec
temporary variable to reduce reallocations
Definition: UQPConeModelBlock.hxx:132
CH_Matrix_Classes::Integer qp_xstart
the first index of the local x in qp_x
Definition: UQPConeModelBlock.hxx:98
std::vector< CH_Matrix_Classes::Symmatrix > Zp
local dual slack psd variables Z
Definition: UQPConeModelBlock.hxx:76
points to MinorantUseData that may be shared by many and allows computations with Minorants ...
Definition: MinorantPointer.hxx:34
Header declaring the classes ConicBundle::UQPModelBlock, ConicBundle::UQPModelPointer.
int get_old_nncz(CH_Matrix_Classes::Matrix &vecz)
get the previous dual non negative cone point (of the solution)
Definition: UQPConeModelBlock.hxx:242
CH_Matrix_Classes::Real get_local_primalcost() const
returns the current local primal cost contribution <d,s>
Definition: UQPConeModelBlock.hxx:354
CH_Matrix_Classes::Integer mu_dim
= vecx.dim + sum of the matrix orders [ + 1]
Definition: UQPConeModelBlock.hxx:101
CH_Matrix_Classes::Indexmatrix soc_dim
dimensions of second order cone variables
Definition: UQPConeModelBlock.hxx:72
CH_Matrix_Classes::Real tracedual(CH_Matrix_Classes::Real *prec=0) const
return the value of the dual variable to the trace consrat == support function value ...
CH_Matrix_Classes::Real s
primal slack variable if inequality
Definition: UQPConeModelBlock.hxx:66