ConicBundle
QPIterativeKKTHASolver.hxx
1 
2 #ifndef CONICBUNDLE_QPITERATIVEKKTHASOLVER_HXX
3 #define CONICBUNDLE_QPITERATIVEKKTHASOLVER_HXX
4 
14 #include "QPIterativeKKTSolver.hxx"
15 
16 namespace ConicBundle {
17 
21 
48 {
49 protected:
50 
51  //--- data describing the KKT system
52  //QPSolverProxObject* Hp; ///< points to the quadratic cost representation, may NOT be NULL afer init
53  //QPModelBlockObject* model; ///< points to the cutting model information, may be NULL
54  //const CH_Matrix_Classes::Sparsemat* A; ///< points to a possibly present constraint matrix, may be NULL
55  //const Indexmatrix* eq_indices; ///< if not NULL, these rows of A correspond to equations; needed for checking applicability of this Object
56 
57  // CH_Matrix_Classes::IterativeSolverObject* solver; ///< the iterative solution method to be used, may not be NULL, deleted on destruction or replacemnt
58  // QPKKTPrecondObject* precond; ///< a preconditioning routine compatible with this system AND the solver, may be NULL (no preconditioning); consistency cannot be checked here and must be guaranteed externally; deleted on destruction or replacement
59 
60  // CH_Matrix_Classes::Matrix KKTdiagx; ///< diagonal term to be added to the H-block due to bounds on the qudratic variables
61  // CH_Matrix_Classes::Matrix KKTdiagy; ///< diagonal term to be added to the A-block due to bounds on the constraints
62 
63  // CH_Matrix_Classes::Matrix sysrhs; ///< the right hand side of the system
64  // CH_Matrix_Classes::Matrix sol; ///< solution vector of the entire system
65  // CH_Matrix_Classes::Matrix solmod; ///< temporary solution part of the model variables
66  // CH_Matrix_Classes::Matrix solcstr; ///< temporary solution part of the model constraint variables
67 
68  // CH_Matrix_Classes::Matrix in_vecx; ///< temporary storage for x part of in_vec in ItSys_mult
69  // CH_Matrix_Classes::Matrix in_vecy; ///< temporary storage for y part of in_vec in ItSys_mult
70  // CH_Matrix_Classes::Matrix in_model; ///< temporary storage for model part of in_vec in ItSys_mult
71 
72 
73 public:
74  // reset data to empty but keep solver and preconditioner
75  //virtual void clear();
76 
79  QPIterativeKKTSolver(insolver,inprecond,cb,cbinc)
80  {}
81 
83  virtual ~QPIterativeKKTHASolver();
84 
85 
86  // returns 1 if this class is not applicable in the current data situation, otherwise it stores the data pointers and these need to stay valid throught the use of the other routines but are not deleted here
87  // virtual int QPinit_KKTdata(QPSolverProxObject* Hp, ///< may not be be NULL
88  // QPModelBlockObject* model, ///< may be NULL
89  // const CH_Matrix_Classes::Sparsemat* A, ///< may be NULL
90  // const CH_Matrix_Classes::Indexmatrix* eq_indices ///< if not NULL these rows of A correspond to equations
91  // );
92 
93  // set up the primal dual KKT system for being solved for predictor and corrector rhs in QPsolve_KKTsystem
94  // virtual int QPinit_KKTsystem(const CH_Matrix_Classes::Matrix& KKTdiagx,
95  // const CH_Matrix_Classes::Matrix& KKTdiagy,
96  // CH_Matrix_Classes::Real prec,
97  // QPSolverParameters* params);
98 
102  const CH_Matrix_Classes::Matrix& primalrhs,
103  const CH_Matrix_Classes::Matrix& dualrhs,
105  CH_Matrix_Classes::Real rhscorr,
107  QPSolverParameters* params);
108 
109  //returns the right hand side vector (dense)
110  //virtual const CH_Matrix_Classes::Matrix& ItSys_rhs()
111  //{return sysrhs;}
112 
114  virtual int ItSys_mult(const CH_Matrix_Classes::Matrix& in_vec,CH_Matrix_Classes::Matrix& out_vec);
115 
116  //returns M1^{-1}*vec; default: M1=I
117  //virtual int ItSys_precondM1(CH_Matrix_Classes::Matrix& vec)
118  //{return (precond?precond->precondM1(vec):0);}
119 
120  //returns M2^{-1}vec; default: M2=I
121  //virtual int ItSys_precondM2(CH_Matrix_Classes::Matrix& vec)
122  //{return (precond?precond->precondM2(vec):0);}
123 
126  {return KKTdiagx.rowdim()+KKTdiagy.rowdim();}
127  };
128 
129 
130 
131 
132 
134 
135 }
136 
137 #endif
138 
int Integer
all integer numbers in calculations and indexing are of this type
Definition: matop.hxx:40
parameters for steering the termination criteria and solution method of the solver ...
Definition: QPSolverParameters.hxx:26
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
virtual CH_Matrix_Classes::Integer QPget_system_size()
for evaluation purposes with iterative solvers, return the size of the system matrix ...
Definition: QPIterativeKKTHASolver.hxx:125
Header declaring the class ConicBundle::QPIterativeKKTSolver.
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
virtual int ItSys_mult(const CH_Matrix_Classes::Matrix &in_vec, CH_Matrix_Classes::Matrix &out_vec)
returns out_vec=(system matrix)*in_vec
CH_Matrix_Classes::Matrix KKTdiagx
diagonal term to be added to the H-block due to bounds on the qudratic variables
Definition: QPIterativeKKTSolver.hxx:63
Matrix class for real values of type Real
Definition: matrix.hxx:74
virtual ~QPIterativeKKTHASolver()
virtual destructor
Iterative solver for the full symmetric, in general indefinite primal dual KKT System within QPSolver...
Definition: QPIterativeKKTSolver.hxx:49
Iterative solver for the reduced symmetric, in general indefinite primal dual KKT System within QPSol...
Definition: QPIterativeKKTHASolver.hxx:47
Abstract Interface for preconditioners to be used with a QPIterativeKKTSolver and a CH_Matrix_Classes...
Definition: QPKKTPrecondObject.hxx:52
virtual int QPsolve_KKTsystem(CH_Matrix_Classes::Matrix &solx, CH_Matrix_Classes::Matrix &soly, const CH_Matrix_Classes::Matrix &primalrhs, const CH_Matrix_Classes::Matrix &dualrhs, CH_Matrix_Classes::Real rhsmu, CH_Matrix_Classes::Real rhscorr, CH_Matrix_Classes::Real prec, QPSolverParameters *params)
solve the KKTsystem to precision prec for the given right hand sides that have been computed for the ...
CH_Matrix_Classes::Matrix KKTdiagy
diagonal term to be added to the A-block due to bounds on the constraints
Definition: QPIterativeKKTSolver.hxx:64
QPIterativeKKTHASolver(CH_Matrix_Classes::IterativeSolverObject *insolver, QPKKTPrecondObject *inprecond=0, CBout *cb=0, int cbinc=-1)
default constructor
Definition: QPIterativeKKTHASolver.hxx:78
Abstract interface to iterative methods for solving Ax=b given by an IterativeSystemObject.
Definition: IterativeSystemObject.hxx:61