3 #ifndef CONICBUNDLE_BOXIPBUNDLEBLOCK_HXX 4 #define CONICBUNDLE_BOXIPBUNDLEBLOCK_HXX 113 bool use_scaling=
false,
115 CBout* cb=0,
int cbinc=-1);
223 vecx(startindex+vecdim)=
s;
232 vecz(startindex+vecdim)=lt-(scalub>0.?
ut:0.);
243 vecdx(startindex+vecdim)=
ds;
256 vecdz(startindex+vecdim)=dlt-(scalub>0.?
dut:0.);
478 bool cautious)
const;
virtual int add_trace(CH_Matrix_Classes::Matrix &vec, CH_Matrix_Classes::Real alpha, CH_Matrix_Classes::Integer startindex)
add alpha*trace_vec to vec starting at startindex
int Integer
all integer numbers in calculations and indexing are of this type
Definition: matop.hxx:40
void mat_xmey(Integer len, Val *x, const Val *y)
Set x[i]=-y[i] for len elements of the arrays x and y.
Definition: matop.hxx:174
CH_Matrix_Classes::Matrix oldlz
point before lz
Definition: BoxIPBundleBlock.hxx:73
virtual int add_AxizinvAt(const CH_Matrix_Classes::Matrix &A, CH_Matrix_Classes::Symmatrix &globalsys, bool minus=false, bool Atrans=false)
add the Schur complement to a big system matrix
CH_Matrix_Classes::Matrix uz
"dual" point uz for upper bound >=0
Definition: BoxIPBundleBlock.hxx:38
CH_Matrix_Classes::Real compl_utrhs
rhs usd in solving the complementartiy line for t
Definition: BoxIPBundleBlock.hxx:62
virtual int get_vecdx(CH_Matrix_Classes::Matrix &vecdx, CH_Matrix_Classes::Integer startindex)
return the vector form of dx, 1 if not available
Definition: BoxIPBundleBlock.hxx:237
int Schur_transform_bundle(CH_Matrix_Classes::Matrix &glob_lowrank, MinorantBundle &globalbundle, CH_Matrix_Classes::Integer startindex_bundle, CH_Matrix_Classes::Matrix &trafotrace, CH_Matrix_Classes::Integer startindex_trace)
provides basic information for low rank preconditioning (in the extreme case solving) for the case of...
CH_Matrix_Classes::Matrix Boffset
columnvector of bundle offsets
Definition: BoxIPBundleBlock.hxx:79
CH_Matrix_Classes::Real compl_ltrhs
rhs usd in solving the complementartiy line for t
Definition: BoxIPBundleBlock.hxx:61
virtual int add_BtinvsysB(CH_Matrix_Classes::Symmatrix &globalsys, const MinorantBundle &bundle, CH_Matrix_Classes::Integer startindex_bundle)
add the "scaled" minorant outer products to globalsys, where the correct minroants start at the given...
CH_Matrix_Classes::Real ut
"dual" to scaling size <= scalval;
Definition: BoxIPBundleBlock.hxx:45
virtual int set_x(const CH_Matrix_Classes::Matrix &vec, CH_Matrix_Classes::Integer startindex, CH_Matrix_Classes::Real &add_center_value)
the base description "set x to the values of vec[startindex+0,+1 ...,+(vecdim-1)] and return in add_c...
double Real
all real numbers in calculations are of this type
Definition: matop.hxx:50
virtual int get_vecz(CH_Matrix_Classes::Matrix &vecz, CH_Matrix_Classes::Integer startindex)
return the vector form of z
Definition: BoxIPBundleBlock.hxx:227
CH_Matrix_Classes::Matrix lz
"dual" point lz for lower bound >=0
Definition: BoxIPBundleBlock.hxx:37
CH_Matrix_Classes::Matrix sqrBnorms
if rowdim>0 it holds the squared norm of each subgradient in the same sequence as in B ...
Definition: BoxIPBundleBlock.hxx:80
CH_Matrix_Classes::Real oldlt
point before lt
Definition: BoxIPBundleBlock.hxx:75
virtual int apply_xiz(CH_Matrix_Classes::Matrix &rhs, CH_Matrix_Classes::Integer startindex, bool minus=false)
compute sys*rhs into rhs, possibly with a negative sign
bool use_scaling
whether scaling is to used or s=1. throughout
Definition: BoxIPBundleBlock.hxx:33
virtual int set_dx_xizsolverhs(const CH_Matrix_Classes::Matrix &rhs, CH_Matrix_Classes::Integer startindex)
compute dx=sysinv*rhs and at the same time dz (=-rhs -z +complentarity_rhs);
virtual int add_modelx_aggregate(CH_Matrix_Classes::Real &val, CH_Matrix_Classes::Matrix &vec, MinorantBundle &global_bundle, CH_Matrix_Classes::Integer startindex_bundle)
adds opB transposed times modelx (without constant affine term) to the arguments
Matrix class for integral values of type Integer
Definition: indexmat.hxx:195
void dim(Integer &_nr, Integer &_nc) const
returns the number of rows in _nr and the number of columns in _nc
Definition: matrix.hxx:209
CH_Matrix_Classes::Real mu
in a step mu gets the value of last_rhs_mu
Definition: BoxIPBundleBlock.hxx:66
CH_Matrix_Classes::Real oldut
point before ut
Definition: BoxIPBundleBlock.hxx:76
virtual int linesearch(CH_Matrix_Classes::Real &alpha) const
if necessary, reduce alpha to the biggest value so that feasibility is maintained with this step size...
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
add dimensions of the primal-dual pairs to mudim and add the "trace" (the inner product with center) ...
int given_dx_compute_dz(void)
does what is says
virtual InteriorPointBundleBlock * clone()
returns a clone
virtual int add_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, CH_Matrix_Classes::Matrix &minus_trmult, CH_Matrix_Classes::Real schur_trace, MinorantBundle &globalbundle, CH_Matrix_Classes::Integer startindex_bundle)
append to lowrank "large" columns that should serve well for generating a low rank projection of the ...
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)
C=beta*C+alpha*B*A where B and A may be transposed; carry out the model part of this beginning at sta...
virtual int set_dx(const CH_Matrix_Classes::Matrix &rhs, CH_Matrix_Classes::Integer startindex)
extract dx from rhs at startindex and compute at the same time dz (=-sys dx-z +complentarity_rhs); ...
CH_Matrix_Classes::Matrix lb
lower bounds of the box, lb < ub
Definition: BoxIPBundleBlock.hxx:31
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 hats
[ut/(scalub-s)]+lt/s+sum(lb(i)^2*lz(i)/(x(i)-s*lb) + ub(i)^2*uz(i)/(s*ub-x(i)))
Definition: BoxIPBundleBlock.hxx:53
virtual int set_dx_xizsolvestep(const CH_Matrix_Classes::Matrix &step_y, const CH_Matrix_Classes::Real step_trdual, MinorantBundle &globalbundle, CH_Matrix_Classes::Integer startindex_bundle)
compute dx (and then dz) given step_y and step_trdual on basis of the last rhs computed for the model...
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)
C=beta*C+alpha*A*B where A and B may be transposed; carry out the model part of this beginning at sta...
virtual int vecgetsax(CH_Matrix_Classes::Matrix &vec, CH_Matrix_Classes::Integer startindex, CH_Matrix_Classes::Real a=1., bool add=false)
on vec[startindex+0,+1 ...,+(vecdim-1)] put or add a * x into vec for a real number a ...
conic bundle method solver for sum of convex functions. See the ConicBundle_Manual for a quick introd...
Definition: CBSolver.hxx:22
CH_Matrix_Classes::Real s
"primal" scaling size >=0
Definition: BoxIPBundleBlock.hxx:43
CH_Matrix_Classes::Real sys_srhs
rhs of s in the system with uz,lz,t eliminated
Definition: BoxIPBundleBlock.hxx:63
virtual int add_xiz(CH_Matrix_Classes::Symmatrix &globalsys, CH_Matrix_Classes::Integer startindex, bool minus=false)
add (or subract if minus==true) the system matrix to a big system matrix starting at startindex ...
CH_Matrix_Classes::Real lt
"dual" to scaling size >= 0
Definition: BoxIPBundleBlock.hxx:44
CH_Matrix_Classes::Matrix olduz
point before uz
Definition: BoxIPBundleBlock.hxx:74
base class for uniform use of WARNINGS and ERRORS (at some point in time)
Definition: CBout.hxx:30
QPBundleBlock interface for the interior point routines specific to the primal dual complementarity c...
Definition: BoxIPBundleBlock.hxx:26
CH_Matrix_Classes::Real old_mu
in a step old_mu gets the value of mu before this gets last_rhs_mu
Definition: BoxIPBundleBlock.hxx:67
CH_Matrix_Classes::Real dlt
current step for lt (for s>=0
Definition: BoxIPBundleBlock.hxx:47
CH_Matrix_Classes::Matrix x
"primal" point x, lb*s<= x <= ub*s
Definition: BoxIPBundleBlock.hxx:36
virtual int add_BtinvsysB_times(const CH_Matrix_Classes::Matrix &in_vec, CH_Matrix_Classes::Matrix &out_vec, CH_Matrix_Classes::Real zeta_inval, CH_Matrix_Classes::Real *zeta_outval, MinorantBundle &globalbundle, CH_Matrix_Classes::Integer startindex_bundle)
out_vec+=BtinvsysB*in_vec
virtual int add_muxinv(CH_Matrix_Classes::Matrix &rhs, CH_Matrix_Classes::Integer startindex, CH_Matrix_Classes::Real rhsmu, CH_Matrix_Classes::Real rhscorr, bool minus=false)
compute the complementarity_rhs=rhsmu*xi-rhscorr*xi*dx*dz (wihtout "-z") for mu=rhsmu and for correct...
virtual int set_xizinvsqrt_trace(CH_Matrix_Classes::Matrix &vec, CH_Matrix_Classes::Integer startindex)
set the trace premultiplied by sqrt(inv(xiz)) in vec[startindex+0,...,startindex+dim_bundle()-1] ...
CH_Matrix_Classes::Real last_alpha
last alpha used in do_step()
Definition: BoxIPBundleBlock.hxx:69
virtual int center_x(CH_Matrix_Classes::Real val, bool add=false)
set x to value*"one" to x, or if add==true, add value*"one" to x
virtual int do_step(CH_Matrix_Classes::Real alpha)
move to (x+alpha*dx, z+alpha*dz)
CH_Matrix_Classes::Matrix tmpmat
temporary matrix to avoid reallocatoins
Definition: BoxIPBundleBlock.hxx:83
int add_bundle_xizinvsqrt_projection(CH_Matrix_Classes::Matrix &glob_lowrank, CH_Matrix_Classes::Matrix &subspace, CH_Matrix_Classes::Integer startindex_subsspace, MinorantBundle &globalbundle, CH_Matrix_Classes::Integer startindex_bundle)
add bundle*sqrt(inv(xiz))*subspace to glob_lowrank with bundle(:,si_bundle+1:si_bundle+dim_bundle()-1...
virtual int get_vecx(CH_Matrix_Classes::Matrix &vecx, CH_Matrix_Classes::Integer startindex)
return the vector form of x
Definition: BoxIPBundleBlock.hxx:219
virtual int get_sysviol_model(CH_Matrix_Classes::Matrix &sysviol_model, CH_Matrix_Classes::Integer startindex_model, const CH_Matrix_Classes::Matrix &dy, const CH_Matrix_Classes::Real deltatrdual, MinorantBundle &global_bundle, CH_Matrix_Classes::Integer startindex_bundle)
set the model violation for the current system solution for the precomputed rhs on basis of the y and...
CH_Matrix_Classes::Matrix compl_lrhs
rhs used in solving the complementarity line for lb
Definition: BoxIPBundleBlock.hxx:59
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)
add the main diagonal block tranpose(projection)*diagvec*projection to bigS starting at startindex ...
virtual int set_modelrhs(CH_Matrix_Classes::Matrix &globalrhs, CH_Matrix_Classes::Real rhsmu, CH_Matrix_Classes::Real rhscorr, CH_Matrix_Classes::Integer startindex_model)
If mu is not zero, always add the centering term for this mu as well;.
CH_Matrix_Classes::Integer bundle_dim
dimension of the bundle (in case of subspace projections this may differ from vecdim ...
Definition: InteriorPointBundleBlock.hxx:34
CH_Matrix_Classes::Matrix hatb
(lb(i)*lz(i)/(x(i)-s*lb) + ub(i)*uz(i)/(s*ub-x(i))
Definition: BoxIPBundleBlock.hxx:54
virtual int vecgetsaz(CH_Matrix_Classes::Matrix &vec, CH_Matrix_Classes::Integer startindex, CH_Matrix_Classes::Real a=1., bool add=false)
on vec[startindex+0,+1 ...,+(vecdim-1)] put or add a * z into vec for a real number a ...
CH_Matrix_Classes::Real Chols
sqrt(hats-Cholb'*Cholb)
Definition: BoxIPBundleBlock.hxx:56
void mat_xey(Integer len, Val *x, const Val *y)
Copy an array of length len to destination x from source y.
Definition: matop.hxx:117
virtual int add_bundle_xizinv_diagonal(CH_Matrix_Classes::Matrix &diagonal, CH_Matrix_Classes::Matrix &ipBtrvec, MinorantBundle &globalbundle, CH_Matrix_Classes::Integer startindex_bundle, const CH_Matrix_Classes::Matrix &trafotrace, CH_Matrix_Classes::Integer startindex_trace)
add diag(Bt*sqrt(invsys)*(I-lambda*trvec*trvec')*sqrt(invsys)*B) to diagonal
virtual int center_z(CH_Matrix_Classes::Real val, bool add=false)
set z to value*"one" to z, or if add==true, add value*"one" to z
virtual int set_z(const CH_Matrix_Classes::Matrix &vec, CH_Matrix_Classes::Integer startindex, CH_Matrix_Classes::Real &add_center_value)
set z to the values of vec[startindex+0,+1 ...,+(vecdim-1)] and add sufficient center to make z feasi...
virtual CH_Matrix_Classes::Integer dim_bundle() const
returns the number of consecutive bundle elements this cone makes use of
Definition: BoxIPBundleBlock.hxx:260
CH_Matrix_Classes::Matrix Bt
matrix representation of bundle
Definition: BoxIPBundleBlock.hxx:78
CH_Matrix_Classes::Matrix ub
upper bounds of the box, lb < ub
Definition: BoxIPBundleBlock.hxx:32
Matrix class for real values of type Real
Definition: matrix.hxx:74
virtual int add_trace_to_diff_model(CH_Matrix_Classes::Real trace_dual)
add trace_dual*trace to diff_model for the right hand side (negative of current model violation) ...
virtual CH_Matrix_Classes::Real evaluate_trace_z()
return the "trace" value of the current point
CH_Matrix_Classes::Matrix oldx
point before x
Definition: BoxIPBundleBlock.hxx:71
virtual int set_bundle_z(const CH_Matrix_Classes::Matrix &y, MinorantBundle &global_bundle, CH_Matrix_Classes::Integer startindex_bundle, CH_Matrix_Classes::Real &add_center_value)
set z to the slack of the bundle and return a value>=0 that needs to be added to make it feasible ...
CH_Matrix_Classes::Matrix uxinv
1./(s*ub-x(i))
Definition: BoxIPBundleBlock.hxx:52
CH_Matrix_Classes::Matrix lxinv
1./(x(i)-s*lb)
Definition: BoxIPBundleBlock.hxx:51
CH_Matrix_Classes::Matrix sqrt_xiz
xiz.^{.5}
Definition: BoxIPBundleBlock.hxx:55
CH_Matrix_Classes::Matrix duz
current step for uz
Definition: BoxIPBundleBlock.hxx:41
virtual int do_bundle_step(CH_Matrix_Classes::Real alpha, const CH_Matrix_Classes::Matrix &y, MinorantBundle &globalbundle, CH_Matrix_Classes::Integer startindex_bundle, CH_Matrix_Classes::Real tracedual, CH_Matrix_Classes::Real trace_rhs)
move to (x+alpha*dx, z+alpha*dz), update diff_model and possibly reduce the model size if some part i...
int get_boxx(CH_Matrix_Classes::Matrix &linx, CH_Matrix_Classes::Matrix *linx_activity, CH_Matrix_Classes::Real trace_rhs, bool cautious) const
after the bundle subproblem is solved, this retrieves the local linear solution vector; if linx_activ...
int find_inactive_indices(CH_Matrix_Classes::Indexmatrix &inactive, CH_Matrix_Classes::Real trace_bound, bool cautious) const
returns in inactive, in increasing order, the indices considered inactive (small in comparison to tra...
CH_Matrix_Classes::Real last_rhs_mu
the last mu used in rhs computations
Definition: BoxIPBundleBlock.hxx:65
std::vector< MinorantPointer > MinorantBundle
a bundle is a vector with MinorantPointer entries
Definition: MinorantPointer.hxx:24
virtual CH_Matrix_Classes::Real evaluate_trace_x()
return the "trace" value of the current point
CH_Matrix_Classes::Matrix compl_urhs
rhs used in solving the complementarity line for ub
Definition: BoxIPBundleBlock.hxx:60
CH_Matrix_Classes::Matrix Cholinvb
xiz.^{-1}.*hatb/Chols
Definition: BoxIPBundleBlock.hxx:57
virtual CH_Matrix_Classes::Real dualviol_2normsqr()
return the squared Euclidean norm of the dual model violation
CH_Matrix_Classes::Matrix dlz
current step for lz
Definition: BoxIPBundleBlock.hxx:40
CH_Matrix_Classes::Matrix xiz
lz(i)/(x(i)-s*lb) + uz(i)/(s*ub-x(i))
Definition: BoxIPBundleBlock.hxx:50
bool test_myself_call
if true, this is already called by a routine for checking a result, so don't produce infinite test lo...
Definition: BoxIPBundleBlock.hxx:87
CH_Matrix_Classes::Matrix dx
current step for x
Definition: BoxIPBundleBlock.hxx:39
void clear(const CH_Matrix_Classes::Matrix &lb, const CH_Matrix_Classes::Matrix &ub, bool use_scaling, CH_Matrix_Classes::Real scalub)
reset all point information to zero for dimension dim, the rest to zero
virtual CH_Matrix_Classes::Integer get_vecdim() const
returns the length of the varialbe vector
CH_Matrix_Classes::Real constraints_cost()
returns the dual cost of the box constraints
Definition: BoxIPBundleBlock.hxx:481
abstract interface for interior point routines specific to primal dual complementarity conditions of ...
Definition: InteriorPointBundleBlock.hxx:31
int compute_NTscaling(void)
computes the step information for the complementarity parts
void point_changed()
clear variables that are no longer valid for the current point
CH_Matrix_Classes::Indexmatrix map_to_old
currently not in use (used in failed attempt to eliminate some inactive variables on the fly) ...
Definition: BoxIPBundleBlock.hxx:85
Header declaring the class ConicBundle::InteriorPointBundleBlock.
CH_Matrix_Classes::Real ds
current step for s
Definition: BoxIPBundleBlock.hxx:46
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)
get the current matrix for the coupling matrix Bt in the first row of blocks
virtual int get_vecdz(CH_Matrix_Classes::Matrix &vecdz, CH_Matrix_Classes::Integer startindex)
return the vector form of dz, 1 if not available
Definition: BoxIPBundleBlock.hxx:249
BoxIPBundleBlock(const CH_Matrix_Classes::Matrix &lb, const CH_Matrix_Classes::Matrix &ub, bool use_scaling=false, CH_Matrix_Classes::Real scalub=-1., CBout *cb=0, int cbinc=-1)
if use_scaling is true, then if scalub>0 it gives the maximum scaling value allowed, while a negative value just requires nonnegative scalings. If use_scaling is false and scalub>0. then work with (lb*scalub) and (ub*scalub);
virtual int copy_from(InteriorPointBundleBlock *)
copies to content of the argument to this; to work *this must be a clone of the argument; sofar this ...
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
for limiting the stepsize with respect to the neighborhood this information about norms and inner pro...
CH_Matrix_Classes::Matrix tmpvec
temporary vector to avoid reallocations
Definition: BoxIPBundleBlock.hxx:82
CH_Matrix_Classes::Real scalub
>0 only if use_scaling==true, and if so then enforce s <= scalub
Definition: BoxIPBundleBlock.hxx:34
virtual CH_Matrix_Classes::Real evaluate_trace_dx()
return the change in "trace" value caused by the current step
CH_Matrix_Classes::Integer scalvecdim
size of the model vector with scaling
Definition: BoxIPBundleBlock.hxx:30
CH_Matrix_Classes::Real olds
point before s
Definition: BoxIPBundleBlock.hxx:72
Real ip(const Matrix &A, const Matrix &B)
returns the usual inner product of A and B, i.e., the sum of A(i,j)*B(i,j) over all i...
Definition: matrix.hxx:1165
CH_Matrix_Classes::Integer vecdim
size of the model vector
Definition: BoxIPBundleBlock.hxx:29
CH_Matrix_Classes::Real dut
current step for ut (for s<=scaval)
Definition: BoxIPBundleBlock.hxx:48
virtual int apply_xizinv(CH_Matrix_Classes::Matrix &rhs, CH_Matrix_Classes::Integer startindex, bool minus=false)
compute sysinv*rhs into rhs, possibly with a negative sign