2 #ifndef CONICBUNDLE_QPKKTSOLVERCOMPARISON_HXX 3 #define CONICBUNDLE_QPKKTSOLVERCOMPARISON_HXX 48 preptime=predtime=corrtime=0;
49 prepnmult=prednmult=corrnmult=0;
52 Hviol=Aviol=Bviol=Cviol=sysviol=0.;
86 std::vector<QPKKT_SolverStats>
sdata;
125 prepsecs(i,ind)+=sdata[unsigned(i)].preptime;
126 predsecs(i,ind)+=sdata[unsigned(i)].predtime;
127 corrsecs(i,ind)=sdata[unsigned(i)].corrtime;
128 predcalls(i,ind)=sdata[unsigned(i)].prednmult;
129 corrcalls(i,ind)=sdata[unsigned(i)].corrnmult;
130 cond(i,ind)=sdata[unsigned(i)].cond;
131 pccols(i,ind)=sdata[unsigned(i)].rank;
132 sysviol(i,ind)=sdata[unsigned(i)].sysviol;
147 prepsecs(i,ind)+=sdata[unsigned(i)].preptime;
148 predsecs(i,ind)+=sdata[unsigned(i)].predtime;
149 corrsecs(i,ind)+=sdata[unsigned(i)].corrtime;
150 predcalls(i,ind)+=sdata[unsigned(i)].prednmult;
151 corrcalls(i,ind)+=sdata[unsigned(i)].corrnmult;
194 {Qdim=Vdim=Arowdim=Aeqdim=Bdim=Cdim=0; }
204 for (
unsigned int i=0;i<kktdata.size();i++)
205 if ((lbmu<=kktdata[i].mu)&&(kktdata[i].mu<ubmu))
225 for (
unsigned int i=0;i<kktdata.size();i++){
226 if ((lbmu<=kktdata[i].mu)&&(kktdata[i].mu<ubmu)){
227 kktdata[i].append_col(mu,prepsecs,predsecs,corrsecs,predcalls,corrcalls,cond,pccols,sysviol);
240 dims(0,startcol+i)=Qdim;
241 dims(1,startcol+i)=Vdim;
242 dims(2,startcol+i)=Arowdim;
243 dims(3,startcol+i)=Aeqdim;
244 dims(4,startcol+i)=Bdim;
245 dims(5,startcol+i)=Cdim;
283 assert(inittime.size()==unsigned(prepsecs.
rowdim()));
285 for(
unsigned int i=0;i<inittime.size();i++)
291 for (
unsigned int i=0;i<kktdata.size();i++){
292 kktdata[i].add_col(prepsecs,predsecs,corrsecs,predcalls,corrcalls);
333 std::vector<QPModelBlockObject*>
model;
355 virtual void clear();
Integer coldim() const
returns the column dimension
Definition: indexmat.hxx:324
int Integer
all integer numbers in calculations and indexing are of this type
Definition: matop.hxx:40
std::vector< QPKKT_ProbStats > & get_probdata()
returns the stored statistical data
Definition: QPKKTSolverComparison.hxx:404
CH_Tools::Clock clock
for taking the time
Definition: QPKKTSolverComparison.hxx:343
std::vector< QPKKT_SolverStats > sdata
one entry per solver
Definition: QPKKTSolverComparison.hxx:86
parameters for steering the termination criteria and solution method of the solver ...
Definition: QPSolverParameters.hxx:26
QPSolverProxObject * testHp
the proximal term/quadratic cost matrix; this points to external object
Definition: QPKKTSolverComparison.hxx:335
CH_Matrix_Classes::Matrix testdualrhs
stores the input rhs for the H block
Definition: QPKKTSolverComparison.hxx:341
const CH_Matrix_Classes::Sparsemat * testA
the constraint matrix; this points to external object
Definition: QPKKTSolverComparison.hxx:336
Integer rowdim() const
returns the row dimension
Definition: matrix.hxx:215
double Real
all real numbers in calculations are of this type
Definition: matop.hxx:50
CH_Matrix_Classes::Real sysviol
norm of the residual of the entire KKT system
Definition: QPKKTSolverComparison.hxx:43
CH_Tools::Microseconds corrtime
time spent in solving the corrector
Definition: QPKKTSolverComparison.hxx:33
CH_Matrix_Classes::Integer Arowdim
rowdim of the constraints
Definition: QPKKTSolverComparison.hxx:185
CH_Matrix_Classes::Real Bviol
norm of the residual for the B block
Definition: QPKKTSolverComparison.hxx:41
CH_Matrix_Classes::Matrix insoly
stores the input solution of the A block (e.g. of predictor)
Definition: QPKKTSolverComparison.hxx:346
std::vector< QPKKTSolverObject * > solver
solvers add via add_solver()
Definition: QPKKTSolverComparison.hxx:330
Matrix class for integral values of type Integer
Definition: indexmat.hxx:195
~QPKKT_SolverStats()
destructor
Definition: QPKKTSolverComparison.hxx:56
CH_Matrix_Classes::Integer Qdim
the order of the H block (the quadratic/proximal term)
Definition: QPKKTSolverComparison.hxx:183
Matrix & concat_right(const Matrix &A, int Atrans=0)
concats matrix A (or its tranpose) to the right of *this, A or *this may be the 0x0 matrix initally...
CH_Matrix_Classes::Real cond
estimate of the condition number
Definition: QPKKTSolverComparison.hxx:37
Used for collecting statics in QPKKTSolverComparison: For each bundle subproblem there is a block QPK...
Definition: QPKKTSolverComparison.hxx:81
~QPKKT_ProbStats()
destructor
Definition: QPKKTSolverComparison.hxx:197
CH_Matrix_Classes::Real Cviol
norm of the residual for the C block
Definition: QPKKTSolverComparison.hxx:42
std::vector< std::string > & get_solvernames()
returns the names of the solvers
Definition: QPKKTSolverComparison.hxx:400
CH_Matrix_Classes::Integer rank
the rank used in the preconditioner
Definition: QPKKTSolverComparison.hxx:38
std::vector< CH_Tools::Microseconds > inittime
time spent in initializing the solver for a subproblem
Definition: QPKKTSolverComparison.hxx:189
std::vector< QPKKT_KKTStats > kktdata
one entry per KKT system
Definition: QPKKTSolverComparison.hxx:190
std::vector< QPModelBlockObject * > model
a seperate clone of the model for each solver in order to avoid side effects
Definition: QPKKTSolverComparison.hxx:333
CH_Matrix_Classes::Integer Bdim
number of vectors in the bundle
Definition: QPKKTSolverComparison.hxx:187
Used for collecting statics in QPKKTSolverComparison: For each bundle subproblem there is a block QPK...
Definition: QPKKTSolverComparison.hxx:180
Indexmatrix & enlarge_right(Integer addnc)
enlarge the matrix by addnc>=0 columns without intializaton of the new columns, returns *this (marked...
conic bundle method solver for sum of convex functions. See the ConicBundle_Manual for a quick introd...
Definition: CBSolver.hxx:22
int append_col(CH_Matrix_Classes::Matrix &muvals, CH_Matrix_Classes::Matrix &prepsecs, CH_Matrix_Classes::Matrix &predsecs, CH_Matrix_Classes::Matrix &corrsecs, CH_Matrix_Classes::Indexmatrix &predcalls, CH_Matrix_Classes::Indexmatrix &corrcalls, CH_Matrix_Classes::Matrix &cond, CH_Matrix_Classes::Indexmatrix &pccols, CH_Matrix_Classes::Matrix &sysviol)
appends the statsitics data of this KKT system as the last column of the repsective matrices ...
Definition: QPKKTSolverComparison.hxx:96
CH_Matrix_Classes::Real testHfactor
stores a factor for testHp, usually ==1. unless a second order cone variant is used ...
Definition: QPKKTSolverComparison.hxx:339
int get_prob_stats(CH_Matrix_Classes::Indexmatrix &dims, CH_Matrix_Classes::Indexmatrix &iterations, CH_Matrix_Classes::Matrix &lastmu, CH_Matrix_Classes::Matrix &prepsecs, CH_Matrix_Classes::Matrix &predsecs, CH_Matrix_Classes::Matrix &corrsecs, CH_Matrix_Classes::Indexmatrix &predcalls, CH_Matrix_Classes::Indexmatrix &corrcalls)
collects the cummulative values for each quadratic (bundle) subproblem. For each problem a new column...
Definition: QPKKTSolverComparison.hxx:251
base class for uniform use of WARNINGS and ERRORS (at some point in time)
Definition: CBout.hxx:30
CH_Matrix_Classes::Integer corrnmult
matrix multiplications in solving the correcotr
Definition: QPKKTSolverComparison.hxx:36
CH_Matrix_Classes::Matrix testKKTdiagy
stores the input diagonal for the A block
Definition: QPKKTSolverComparison.hxx:338
Used for collecting statics in QPKKTSolverComparison: For each bundle subproblem there is a block QPK...
Definition: QPKKTSolverComparison.hxx:28
Indexmatrix & concat_right(const Indexmatrix &A)
concats matrix A to the right of *this, A or *this may be the 0x0 matrix initally, returns *this
QPKKT_ProbStats()
constructor
Definition: QPKKTSolverComparison.hxx:193
friend std::istream & operator>>(std::ostream &in, QPKKT_SolverStats &s)
(file-)input
CH_Matrix_Classes::Integer cnt_mu_cols(CH_Matrix_Classes::Real lbmu, CH_Matrix_Classes::Real ubmu)
for collecting the statistics for an interval of barrier parameter values, this first determines the ...
Definition: QPKKTSolverComparison.hxx:200
Matrix & enlarge_right(Integer addnc)
enlarge the matrix by addnc>=0 columns without intializaton of the new columns, returns *this (marked...
CH_Matrix_Classes::Matrix testprimalrhs
stores the input rhs for the A block
Definition: QPKKTSolverComparison.hxx:340
Header declaring the class ConicBundle::QPKKTSolverObject.
friend std::ostream & operator<<(std::ostream &out, const QPKKT_SolverStats &s)
(file-)output
QPKKT_KKTStats()
constructor
Definition: QPKKTSolverComparison.hxx:89
Indexmatrix & init(const Indexmatrix &A, Integer d=1)
initialize to *this=A*d
int add_col(CH_Matrix_Classes::Matrix &prepsecs, CH_Matrix_Classes::Matrix &predsecs, CH_Matrix_Classes::Matrix &corrsecs, CH_Matrix_Classes::Indexmatrix &predcalls, CH_Matrix_Classes::Indexmatrix &corrcalls)
adds the respecitve values of the solvers to last column. It is used for collecting cummlative data f...
Definition: QPKKTSolverComparison.hxx:138
QPKKT_SolverStats()
constructor
Definition: QPKKTSolverComparison.hxx:46
CH_Matrix_Classes::Integer prepnmult
matrix multiplications in setting up the system
Definition: QPKKTSolverComparison.hxx:34
Integer coldim() const
returns the column dimension
Definition: matrix.hxx:218
Matrix class for real values of type Real
Definition: matrix.hxx:74
int get_mu_stats(CH_Matrix_Classes::Real lbmu, CH_Matrix_Classes::Real ubmu, CH_Matrix_Classes::Indexmatrix &dims, CH_Matrix_Classes::Matrix &mu, CH_Matrix_Classes::Matrix &prepsecs, CH_Matrix_Classes::Matrix &predsecs, CH_Matrix_Classes::Matrix &corrsecs, CH_Matrix_Classes::Indexmatrix &predcalls, CH_Matrix_Classes::Indexmatrix &corrcalls, CH_Matrix_Classes::Matrix &cond, CH_Matrix_Classes::Indexmatrix &pccols, CH_Matrix_Classes::Matrix &sysviol)
collects the statistics for an interval of barrier parameter values by appending a column for each KK...
Definition: QPKKTSolverComparison.hxx:211
CH_Matrix_Classes::Real Hviol
norm of the residual for the H block
Definition: QPKKTSolverComparison.hxx:39
~QPKKT_KKTStats()
destructor
Definition: QPKKTSolverComparison.hxx:93
CH_Matrix_Classes::Matrix outsoly
stores the output solution of the A block (first solver)
Definition: QPKKTSolverComparison.hxx:348
CH_Matrix_Classes::Matrix testKKTdiagx
stores the input diagonal for the H block
Definition: QPKKTSolverComparison.hxx:337
CH_Matrix_Classes::Integer prednmult
matrix multiplications in solving the predictor
Definition: QPKKTSolverComparison.hxx:35
Matrix class of sparse matrices with real values of type Real
Definition: sparsmat.hxx:74
abstract interface for model blocks in the constrained QPSolver
Definition: QPModelBlockObject.hxx:89
CH_Tools::Microseconds preptime
time spent in setting up the system
Definition: QPKKTSolverComparison.hxx:31
CH_Matrix_Classes::Real mu
this is the (minimal) mu>0 value used in the calls
Definition: QPKKTSolverComparison.hxx:85
This is a pseudosolver designed for producing comparative statistics on the performance of mainly ite...
Definition: QPKKTSolverComparison.hxx:327
Integer rowdim() const
returns the row dimension
Definition: indexmat.hxx:321
CH_Matrix_Classes::Matrix insolx
stores the input solution of the H block (e.g. of predictor)
Definition: QPKKTSolverComparison.hxx:345
std::vector< std::string > solvername
name of the solver for output
Definition: QPKKTSolverComparison.hxx:331
std::vector< QPKKT_ProbStats > probdata
for each bundle subproblem there is a block QPKKT_ProbStats (stored here), which holds for each KKT s...
Definition: QPKKTSolverComparison.hxx:332
CH_Matrix_Classes::Integer Aeqdim
with this number of equations
Definition: QPKKTSolverComparison.hxx:186
Header declaring and (inline) implementing the classes CH_Tools::Microseconds and CH_Tools::Clock as ...
CH_Matrix_Classes::Matrix outsolx
stores the output solution of the H block (first solver)
Definition: QPKKTSolverComparison.hxx:347
CH_Tools::Microseconds predtime
time spent in solving the predictor
Definition: QPKKTSolverComparison.hxx:32
CH_Matrix_Classes::Integer Cdim
number of constraints in the model
Definition: QPKKTSolverComparison.hxx:188
abstract class for setting up and solving the primal dual KKT System within QPSolverBasicStructures ...
Definition: QPKKTSolverObject.hxx:101
CH_Matrix_Classes::Real prec
this is the (minimal) precision requirement in the calls
Definition: QPKKTSolverComparison.hxx:84
CH_Matrix_Classes::Integer Vdim
the low-rank rank of the H matrix
Definition: QPKKTSolverComparison.hxx:184
CH_Matrix_Classes::Real Aviol
norm of the residual for the A block
Definition: QPKKTSolverComparison.hxx:40
in order to pass a ConicBundle::BundleProxObject, see Quadratic Proximal Terms, to a custzomized QPSo...
Definition: QPSolverObject.hxx:55