44#ifndef ROL_CONSTRAINTSTATUSTEST_H
45#define ROL_CONSTRAINTSTATUSTEST_H
72 gtol_ = parlist.sublist(
"Status Test").get(
"Gradient Tolerance", em6);
73 ctol_ = parlist.sublist(
"Status Test").get(
"Constraint Tolerance", em6);
74 stol_ = parlist.sublist(
"Status Test").get(
"Step Tolerance", em6*gtol_);
75 max_iter_ = parlist.sublist(
"Status Test").get(
"Iteration Limit", 100);
79 gtol_(gtol), ctol_(ctol), stol_(stol),
max_iter_(max_iter) {}
83 virtual bool check( AlgorithmState<Real> &state ) {
84 if ( ((state.gnorm > gtol_) || (state.cnorm > ctol_)) &&
85 (state.snorm > stol_) &&
90 state.statusFlag = ((state.gnorm <= gtol_) && (state.cnorm <= ctol_) ? EXITSTATUS_CONVERGED
91 : state.snorm <= stol_ ? EXITSTATUS_STEPTOL
92 : state.iter >=
max_iter_ ? EXITSTATUS_MAXITER
Provides an interface to check status of optimization algorithms for problems with equality constrain...
ConstraintStatusTest(ROL::ParameterList &parlist)
ConstraintStatusTest(Real gtol=1e-6, Real ctol=1e-6, Real stol=1e-12, int max_iter=100)
virtual bool check(AlgorithmState< Real > &state)
Check algorithm status.
virtual ~ConstraintStatusTest()
Provides an interface to check status of optimization algorithms.