ConicBundle
QPSolverParameters.hxx
Go to the documentation of this file.
1 
2 #ifndef CONICBUNDLE_QPSOLVERPARAMETERS_HXX
3 #define CONICBUNDLE_QPSOLVERPARAMETERS_HXX
4 
14 #include "QPKKTSolverObject.hxx"
15 
16 namespace ConicBundle {
17 
18 
22 
26 class QPSolverParameters: public virtual QPSolverParametersObject, public virtual CBout
27 {
28 private:
29  //--- preset termination parameters
32 
33  //--- selecting system and system solver
35 
36  //--- adaptive termination parameters set by the code
44 
46 
51 
52  bool use_socqp;
53 
55  QPSolverParameters(const QPSolverParameters& /*params*/);
56 
59 
60 public:
62  QPSolverParameters(CBout* cb=0,int incr=-1);
63  virtual ~QPSolverParameters(){delete KKTsolver;}
65 
95  bool QPget_use_socqp() const {return use_socqp;}
96 
97 
100  {min_objective_relprec=(eps>0)?eps:min_objective_relprec; return (eps<=0);}
103  {objective_gap_eps=(eps>0)?eps:objective_gap_eps; return (eps<=0);}
106  {primal_infeasibility_eps=(eps>0)?eps:primal_infeasibility_eps; return (eps<=0);}
109  {dual_infeasibility_eps=(eps>0)?eps:dual_infeasibility_eps; return (eps<=0);}
112  {if (lb>ub) return 1;lower_bound=lb;upper_bound=ub;return 0;}
115  {lower_bound_gap_eps=(eps>0)?eps:lower_bound_gap_eps; return (eps<=0);}
118  {upper_bound_gap_eps=(eps>0)?eps:upper_bound_gap_eps; return (eps<=0);}
121  {maxiter=mi;return 0;}
122 
125  {delete KKTsolver; KKTsolver=in_KKTsolver;return 0;}
126 
129  {use_predictor_corrector=upc; return 0;}
130 
133  {use_neighborhood=nbh; return 0;}
134 
137  {
139  nbh_ub=CH_Matrix_Classes::max(nbh_lb,nbhub);
140  return 0;
141  }
142 
144  int QPset_use_socqp(bool s)
145  {use_socqp=s; return 0;}
146 
148  int QPset_allow_UQPSolver(bool allow)
149  {allow_unconstrained=allow; return 0;}
152  {return allow_unconstrained;}
153 };
154 
155 
156 
157 
158 
160 
161 }
162 
163 #endif
164 
int Integer
all integer numbers in calculations and indexing are of this type
Definition: matop.hxx:40
int QPset_use_socqp(bool s)
if set to true (default: false), the quadratic term is modelled via a second order cone approach ...
Definition: QPSolverParameters.hxx:144
parameters for steering the termination criteria and solution method of the solver ...
Definition: QPSolverParameters.hxx:26
CH_Matrix_Classes::Real QPget_min_objective_relprec() const
get this variable value
Definition: QPSolverParameters.hxx:67
int QPset_maxiter(CH_Matrix_Classes::Integer mi)
set this variable value
Definition: QPSolverParameters.hxx:120
double Real
all real numbers in calculations are of this type
Definition: matop.hxx:50
QPSolverParameters(const QPSolverParameters &)
blocked copy constructor
CH_Matrix_Classes::Real primal_infeasibility_eps
absolute precision for primal feasibility (groundset)
Definition: QPSolverParameters.hxx:38
int QPset_upper_bound_gap_eps(CH_Matrix_Classes::Real eps)
set this variable value
Definition: QPSolverParameters.hxx:117
bool use_socqp
default false, set to true if the quadratic part should be modelled via a second order cone ...
Definition: QPSolverParameters.hxx:52
CH_Matrix_Classes::Real lower_bound_gap_eps
relative size requirement of objective gap to primal value minus lower_bound
Definition: QPSolverParameters.hxx:42
CH_Matrix_Classes::Real objective_gap_eps
relative precision for gap between lower and upper objective values
Definition: QPSolverParameters.hxx:37
CH_Matrix_Classes::Real QPget_nbh_lb() const
get this variable value
Definition: QPSolverParameters.hxx:93
QPKKTSolverObject * KKTsolver
provides the routine described in QPKKTSolverObject, see also Internal QP Solver for linearly constra...
Definition: QPSolverParameters.hxx:45
int QPset_allow_UQPSolver(bool allow)
set to true/false if switching to the unconstrained solver is allowed or not
Definition: QPSolverParameters.hxx:148
const Real eps_Real
machine epsilon for type Real
Definition: matop.hxx:59
int QPset_lower_bound_gap_eps(CH_Matrix_Classes::Real eps)
set this variable value
Definition: QPSolverParameters.hxx:114
QPKKTSolverObject * QPget_KKTsolver()
get this variable value
Definition: QPSolverParameters.hxx:85
int QPset_use_neighborhood(bool nbh)
if set to true (default: false), the lines search is carried out with respect to the neighborhood pol...
Definition: QPSolverParameters.hxx:132
CH_Matrix_Classes::Integer maxiter
maxium iteration number, negative means no bound
Definition: QPSolverParameters.hxx:31
CH_Matrix_Classes::Real nbh_ub
curve searches try to stay inside the neighborhood to this value
Definition: QPSolverParameters.hxx:49
bool QPallow_UQPSolver()
set to true/false if switching to the unconstrained solver is allowed or not
Definition: QPSolverParameters.hxx:151
CH_Matrix_Classes::Real nbh_lb
the barrier parameter reduction aims for this value and below this value a predictor step is allowed ...
Definition: QPSolverParameters.hxx:50
CH_Matrix_Classes::Integer QPget_maxiter() const
get this variable value
Definition: QPSolverParameters.hxx:83
CH_Matrix_Classes::Real QPget_objective_gap_eps() const
get this variable value
Definition: QPSolverParameters.hxx:69
in order to pass parameters to a customized QPSolverObject, derive the parameters from this object; n...
Definition: QPSolverObject.hxx:46
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
CH_Matrix_Classes::Real min_objective_relprec
minimum relative precision in objective
Definition: QPSolverParameters.hxx:30
CH_Matrix_Classes::Real upper_bound
optimal primal objective should not exceed that
Definition: QPSolverParameters.hxx:41
QPSolverParameters & operator=(const QPSolverParameters &)
blocked assignment operator
CH_Matrix_Classes::Real lower_bound
optimal dual objective value should exceed that
Definition: QPSolverParameters.hxx:40
bool allow_unconstrained
allow switching to the internal UQPSolver if applicable
Definition: QPSolverParameters.hxx:34
Header declaring the class ConicBundle::QPKKTSolverObject.
CH_Matrix_Classes::Real QPget_lower_bound_gap_eps() const
get this variable value
Definition: QPSolverParameters.hxx:79
CH_Matrix_Classes::Real QPget_lower_bound() const
get this variable value
Definition: QPSolverParameters.hxx:75
bool use_neighborhood
default false, set to true if the line search should ensure staying in the neighborhood ...
Definition: QPSolverParameters.hxx:48
bool use_predictor_corrector
default true, set to false if just one solve per KKT system is desired
Definition: QPSolverParameters.hxx:47
CH_Matrix_Classes::Real QPget_primal_infeasibility_eps() const
get this variable value
Definition: QPSolverParameters.hxx:71
CH_Matrix_Classes::Real QPget_upper_bound() const
get this variable value
Definition: QPSolverParameters.hxx:77
virtual ~QPSolverParameters()
virtual destructor
Definition: QPSolverParameters.hxx:64
int QPset_KKTsolver(QPKKTSolverObject *in_KKTsolver)
delete previous solver and replace by the new one (should not be zero when calling the solver) ...
Definition: QPSolverParameters.hxx:124
int QPset_dual_infeasibility_eps(CH_Matrix_Classes::Real eps)
set this variable value
Definition: QPSolverParameters.hxx:108
int QPset_min_objective_relprec(CH_Matrix_Classes::Real eps)
set this variable value
Definition: QPSolverParameters.hxx:99
CH_Matrix_Classes::Real QPget_upper_bound_gap_eps() const
get this variable value
Definition: QPSolverParameters.hxx:81
bool QPget_use_socqp() const
get this variable value
Definition: QPSolverParameters.hxx:95
double max(double a, double b)
maximum value of two double variables
Definition: mymath.hxx:43
int QPset_lower_and_upper_bounds(CH_Matrix_Classes::Real lb, CH_Matrix_Classes::Real ub)
set this variable value
Definition: QPSolverParameters.hxx:111
int QPset_nbh_bounds(CH_Matrix_Classes::Real nbhlb, CH_Matrix_Classes::Real nbhub)
set the upper bound on the neighborhood that should be ensured in curve searches; ensures eps_Real<=n...
Definition: QPSolverParameters.hxx:136
CH_Matrix_Classes::Real dual_infeasibility_eps
absolute precision for dual feasibility
Definition: QPSolverParameters.hxx:39
bool QPget_use_neighborhood() const
get this variable value
Definition: QPSolverParameters.hxx:89
int QPset_objective_gap_eps(CH_Matrix_Classes::Real eps)
set this variable value
Definition: QPSolverParameters.hxx:102
CH_Matrix_Classes::Real upper_bound_gap_eps
relative size requirement of objective gap to upper_bound - dual value
Definition: QPSolverParameters.hxx:43
CH_Matrix_Classes::Real QPget_nbh_ub() const
get this variable value
Definition: QPSolverParameters.hxx:91
int QPset_use_predictor_corrector(bool upc)
if set to true (=default), a predictor corrector approach is used for solving the KKT system (solve f...
Definition: QPSolverParameters.hxx:128
abstract class for setting up and solving the primal dual KKT System within QPSolverBasicStructures ...
Definition: QPKKTSolverObject.hxx:101
CH_Matrix_Classes::Real QPget_dual_infeasibility_eps() const
get this variable value
Definition: QPSolverParameters.hxx:73
bool QPget_use_predictor_corrector() const
get this variable value
Definition: QPSolverParameters.hxx:87
int QPset_primal_infeasibility_eps(CH_Matrix_Classes::Real eps)
set this variable value
Definition: QPSolverParameters.hxx:105