3 #ifndef CONICBUNDLE_BUNDLETERMINATOR_HXX 4 #define CONICBUNDLE_BUNDLETERMINATOR_HXX 80 friend class NBundleSolver;
134 terminated|=2*(clockp->
time()>=timelimit);
139 if (modelfailslimit>=0)
141 if (augvalfailslimit>=0)
145 if (oraclefailslimit>=0)
148 if ((aggregate_dnormsqr>0)&&(sb->
get_aggr_dnormsqr()>aggregate_dnormsqr))
return terminated;
160 recomplimit=100;qpfailslimit=100;modelfailslimit=100;
161 augvalfailslimit=10;oraclefailslimit=10;objevallimit=-1;
162 aggregate_dnormsqr=-1.;
171 { set_defaults(); clear(); }
178 {
if (teps>0.) termeps=teps;}
187 {clockp=cp;timelimit=tl;}
223 o<<
"termination status: "<<terminated;
224 if (terminated==0) { o<<
" (not terminated)"<<std::endl;
return;}
225 if (terminated & 1){ o<<
", relative precision criterion satisfied"; }
226 if (terminated & 2){ o<<
", timelimit exceeded"; }
227 if (terminated & 4){ o<<
", function reevaluation limit exceeded";}
228 if (terminated & 8){ o<<
", limit of QP failures exceeded";}
229 if (terminated & 16){ o<<
", limit of model failures exceeded";}
230 if (terminated & 32){ o<<
", limit of augmented model failures exceeded";}
231 if (terminated & 64){ o<<
", limit of calls to evaluation oracle exceeded";}
232 if (terminated & 128){ o<<
", limit of failed oracle calls exceeded";}
237 virtual std::ostream&
save(std::ostream& o)
const 240 o<<termeps<<
"\n"<<timelimit<<
"\n"<<recomplimit<<
"\n"<<qpfailslimit<<
"\n"<<modelfailslimit<<
"\n"<<augvalfailslimit<<
"\n"<<objevallimit<<
"\n"<<oraclefailslimit<<
"\n"<<aggregate_dnormsqr<<
"\n"<<terminated<<
"\n";
245 virtual std::istream&
restore(std::istream& in)
252 in>>augvalfailslimit;
254 in>>oraclefailslimit;
255 in>>aggregate_dnormsqr;
virtual CH_Tools::Microseconds get_timelimit() const
returns the timelimit value
Definition: BundleTerminator.hxx:189
int Integer
all integer numbers in calculations and indexing are of this type
Definition: matop.hxx:40
virtual void set_termeps(CH_Matrix_Classes::Real teps)
set the termination precision (>0!)
Definition: BundleTerminator.hxx:177
virtual std::ostream & save(std::ostream &o) const
output current parameter settings
Definition: BundleTerminator.hxx:237
Header declaring the classes CH_Matrix_Classes::Realrange and CH_Matrix_Classes::Matrix having Real e...
CH_Matrix_Classes::Real aggregate_dnormsqr
if the value is positive, do not terminate due to sufficient precision as long as the squared dual no...
Definition: BundleTerminator.hxx:86
virtual CH_Matrix_Classes::Integer get_sumaugvalfails() const =0
returns the number of times, the augmented model value could not be increased over all descent and nu...
virtual CH_Matrix_Classes::Integer get_objevallimit() const
returns the current value of this parameter
Definition: BundleTerminator.hxx:209
virtual int get_terminated() const
return the termination code returned in the last call to check_termination()
Definition: BundleTerminator.hxx:216
double Real
all real numbers in calculations are of this type
Definition: matop.hxx:50
CH_Matrix_Classes::Integer objevallimit
upper limit on number returned in BundleTerminatorData::get_cntobjeval, <0 if no limit ...
Definition: BundleTerminator.hxx:106
virtual void set_aggr_dnormsqr(CH_Matrix_Classes::Real sg)
set an upper bound for the dual norm squared of the aggregate at termination (or <=0 if no such bound...
Definition: BundleTerminator.hxx:182
virtual CH_Matrix_Classes::Real get_term_corr() const =0
returns a correction factor for the termination criterion if the quadratic term is big (the proximal ...
virtual CH_Matrix_Classes::Real get_aggr_dnormsqr() const
returns the current bound for the dual norm squared of the aggregate
Definition: BundleTerminator.hxx:184
CH_Tools::Microseconds timelimit
if clockp is not Null then this gives the upper time limit in Microseconds
Definition: BundleTerminator.hxx:91
BundleTerminator(const CBout *cb=0, int incr=-1)
calls set_defaults() and clear()
Definition: BundleTerminator.hxx:170
virtual void set_timelimit(const CH_Tools::Clock *cp, CH_Tools::Microseconds tl)
set cp==0 for no timelimit, otherwise specify clock and microseconds
Definition: BundleTerminator.hxx:186
virtual CH_Matrix_Classes::Integer get_qpfailslimit() const
returns the current value of this parameter
Definition: BundleTerminator.hxx:197
virtual void set_recomplimit(CH_Matrix_Classes::Integer rl)
set upper bound on the value returned by BundleTerminatorData::get_sumrecomp, <0 if no limit ...
Definition: BundleTerminator.hxx:191
virtual void set_modelfailslimit(CH_Matrix_Classes::Integer ml)
set upper bound on the value returned by BundleTerminatorData::get_summodelfails, <0 if no limit ...
Definition: BundleTerminator.hxx:199
virtual CH_Matrix_Classes::Real get_center_objval() const =0
returns the upper bound on the function value in the current center of stability
virtual CH_Matrix_Classes::Integer get_oraclefailslimit() const
returns the current value of this parameter
Definition: BundleTerminator.hxx:213
virtual void print_status(std::ostream &o) const
output an explanation string for the current termination code
Definition: BundleTerminator.hxx:221
virtual void clear()
resets terminated
Definition: BundleTerminator.hxx:166
CH_Matrix_Classes::Integer recomplimit
upper limit on number returned in BundleTerminatorData::get_sumrecomp, <0 if no limit ...
Definition: BundleTerminator.hxx:94
conic bundle method solver for sum of convex functions. See the ConicBundle_Manual for a quick introd...
Definition: CBSolver.hxx:22
virtual CH_Matrix_Classes::Integer get_suminnerit() const =0
returns the number of descent and null steps
base class for uniform use of WARNINGS and ERRORS (at some point in time)
Definition: CBout.hxx:30
virtual CH_Matrix_Classes::Integer get_sumqpfails() const =0
returns the number of times, the call to a quadratic subproblem failed
virtual CH_Matrix_Classes::Integer get_summodelfails() const =0
returns the number of failed callls to model evaluations
virtual CH_Matrix_Classes::Integer get_recomplimit() const
returns the current value of this parameter
Definition: BundleTerminator.hxx:193
virtual CH_Matrix_Classes::Integer get_augvalfails() const =0
returns the number of times, the augmented model value could not be increased since the last descent ...
This is the internal bundle solver managing descent/null steps with inner updates for approximating t...
Definition: BundleSolver.hxx:103
Header declaring the classes ConicBundle::CBSolver, ConicBundle::FunctionOracle and ConicBundle::Prim...
virtual void set_oraclefailslimit(CH_Matrix_Classes::Integer ol)
set upper bound on the value returned by BundleTerminatorData::get_sumoraclefails, <0 if no limit
Definition: BundleTerminator.hxx:211
virtual CH_Matrix_Classes::Integer get_sumrecomp() const =0
returns the number of reevalutions in center points (if their function value violates the most recent...
Header declaring the output class CBout.
virtual CH_Matrix_Classes::Real get_termeps() const
returns the current termination precision
Definition: BundleTerminator.hxx:180
CH_Matrix_Classes::Integer qpfailslimit
upper limit on number returned in BundleTerminatorData::get_sumqpfails, <0 if no limit ...
Definition: BundleTerminator.hxx:97
const CH_Tools::Clock * clockp
if a computation time criterion is set, this pointer is also set and points at the clock to be used ...
Definition: BundleTerminator.hxx:89
virtual CH_Matrix_Classes::Integer get_modelfailslimit() const
returns the current value of this parameter
Definition: BundleTerminator.hxx:201
CH_Matrix_Classes::Integer augvalfailslimit
upper limit on number returned in BundleTerminatorData::get_sumaugvalfails, <0 if no limit ...
Definition: BundleTerminator.hxx:103
basic class implementing termination criteria for BundleSolver, may also serve as base class for othe...
Definition: BundleTerminator.hxx:77
virtual CH_Matrix_Classes::Real get_modelval() const =0
returns the model value in the current candidate
virtual void set_augvalfailslimit(CH_Matrix_Classes::Integer al)
set upper bound on the value returned by BundleTerminatorData::get_sumaugvalfails(), <0 if no limit
Definition: BundleTerminator.hxx:203
virtual void set_qpfailslimit(CH_Matrix_Classes::Integer ql)
set upper bound on the value returned by BundleTerminatorData::get_sumqpfails, <0 if no limit ...
Definition: BundleTerminator.hxx:195
virtual CH_Matrix_Classes::Integer get_augvalfailslimit() const
returns the current value of this parameter
Definition: BundleTerminator.hxx:205
virtual CH_Matrix_Classes::Integer get_sumoraclefails() const =0
returns the number of times, the oracle returend some error code over all descent and null steps ...
virtual CH_Matrix_Classes::Real get_aggr_dnormsqr() const =0
returns the norm of the aggregate subgradient squared (for the norm dual to quadratic augmented term)...
abstract interface for BundleTerminator providing the data needed for deciding on termination ...
Definition: BundleTerminator.hxx:29
virtual void set_objevallimit(CH_Matrix_Classes::Integer ol)
set upper bound on the value returned by BundleTerminatorData::get_cntobjeval, <0 if no limit ...
Definition: BundleTerminator.hxx:207
virtual int check_termination(BundleTerminatorData *sb)
computes and returns a termination code for the BundleTerminationData passed to this ...
Definition: BundleTerminator.hxx:130
virtual CH_Matrix_Classes::Integer get_cntobjeval() const =0
returns the number of calls to the oracle, i.e., to BundleProblem::eval_function() ...
CH_Matrix_Classes::Integer modelfailslimit
upper limit on number returned in BundleTerminatorData::get_summodelfails, <0 if no limit ...
Definition: BundleTerminator.hxx:100
virtual CH_Matrix_Classes::Real get_cand_objval() const =0
returns the upper bound on the function value in the current candidate
int terminated
result of last call to check_termination
Definition: BundleTerminator.hxx:112
virtual void set_defaults()
sets the default parameter values
Definition: BundleTerminator.hxx:157
CH_Matrix_Classes::Real termeps
termination precision
Definition: BundleTerminator.hxx:84
double abs(double d)
absolute value of a double
Definition: mymath.hxx:25
Header declaring and (inline) implementing the classes CH_Tools::Microseconds and CH_Tools::Clock as ...
virtual void clear_terminated()
reset the termination code to zero (this does not remove the reason for the termination; for this...
Definition: BundleTerminator.hxx:218
virtual std::istream & restore(std::istream &in)
input new parameter settings, the clock must be set in addition!
Definition: BundleTerminator.hxx:245
virtual CH_Matrix_Classes::Integer get_oraclefails() const =0
returns the number of times, the oracle returend some error code since the last descent step ...
CH_Matrix_Classes::Integer oraclefailslimit
upper limit on number returned in BundleTerminatorData::get_sumoraclefails, <0 if no limit ...
Definition: BundleTerminator.hxx:109