44 #ifndef ROL_BISECTION_H
45 #define ROL_BISECTION_H
61 ROL::Ptr<LineSearch<Real> >
btls_;
70 tol_ = parlist.sublist(
"Step").sublist(
"Line Search").sublist(
"Line-Search Method").get(
"Bracketing Tolerance",oem8);
71 btls_ = ROL::makePtr<BackTracking<Real>>(parlist);
78 btls_->initialize(x,s,g,obj,con);
81 void run( Real &alpha, Real &fval,
int &ls_neval,
int &ls_ngrad,
84 Real tol = std::sqrt(ROL_EPSILON<Real>()), half(0.5);
102 if ( val_tr < val_tl ) {
103 if (
LineSearch<Real>::status(
LINESEARCH_BISECTION,ls_neval,ls_ngrad,tr,fval,gs,val_tr,x,s,obj,con) ) {
113 if ( val_tl < val_tr ) {
123 Real tc = half*(tl+tr);
129 if ( val_tc < val_t ) {
134 Real t1(0), val_t1(0);
135 Real t2(0), val_t2(0);
137 while ( !
LineSearch<Real>::status(
LINESEARCH_BISECTION,ls_neval,ls_ngrad,t,fval,gs,val_t,x,s,obj,con)
138 && std::abs(tr - tl) >
tol_ ) {
151 if ( ( (val_tl <= val_tr) && (val_tl <= val_t1) && (val_tl <= val_t2) && (val_tl <= val_tc) )
152 || ( (val_t1 <= val_tr) && (val_t1 <= val_tl) && (val_t1 <= val_t2) && (val_t1 <= val_tc) ) ) {
153 if ( val_tl < val_t1 ) {
167 else if ( ( (val_tc <= val_tr) && (val_tc <= val_tl) && (val_tc <= val_t1) && (val_tc <= val_t2) ) ) {
176 else if ( ( (val_t2 <= val_tr) && (val_t2 <= val_tl) && (val_t2 <= val_t1) && (val_t2 <= val_tc) )
177 || ( (val_tr <= val_tl) && (val_tr <= val_t1) && (val_tr <= val_t2) && (val_tr <= val_tc) ) ) {
178 if ( val_tr < val_t2 ) {
197 if ( alpha < ROL_EPSILON<Real>() ) {
198 btls_->run(alpha,fval,ls_neval,ls_ngrad,gs,s,x,obj,con);
Provides the interface to evaluate objective functions.
void run(Real &alpha, Real &fval, int &ls_neval, int &ls_ngrad, const Real &gs, const Vector< Real > &s, const Vector< Real > &x, Objective< Real > &obj, BoundConstraint< Real > &con)
void updateIterate(Vector< Real > &xnew, const Vector< Real > &x, const Vector< Real > &s, Real alpha, BoundConstraint< Real > &con)
virtual Real getInitialAlpha(int &ls_neval, int &ls_ngrad, const Real fval, const Real gs, const Vector< Real > &x, const Vector< Real > &s, Objective< Real > &obj, BoundConstraint< Real > &con)
virtual ROL::Ptr< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
virtual Real value(const Vector< Real > &x, Real &tol)=0
Compute value.
Defines the linear algebra or vector space interface.
Provides interface for and implements line searches.
void initialize(const Vector< Real > &x, const Vector< Real > &s, const Vector< Real > &g, Objective< Real > &obj, BoundConstraint< Real > &con)
ROL::Ptr< Vector< Real > > xnew_
Provides the interface to apply upper and lower bound constraints.
Bisection(ROL::ParameterList &parlist)
Implements a bisection line search.
virtual void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update objective function.
ROL::Ptr< LineSearch< Real > > btls_
virtual void initialize(const Vector< Real > &x, const Vector< Real > &s, const Vector< Real > &g, Objective< Real > &obj, BoundConstraint< Real > &con)