10 #ifndef ROL_BISECTION_H
11 #define ROL_BISECTION_H
27 ROL::Ptr<LineSearch<Real> >
btls_;
36 tol_ = parlist.sublist(
"Step").sublist(
"Line Search").sublist(
"Line-Search Method").get(
"Bracketing Tolerance",oem8);
37 btls_ = ROL::makePtr<BackTracking<Real>>(parlist);
44 btls_->initialize(x,s,g,obj,con);
47 void run( Real &alpha, Real &fval,
int &ls_neval,
int &ls_ngrad,
50 Real tol = std::sqrt(ROL_EPSILON<Real>()), half(0.5);
68 if ( val_tr < val_tl ) {
69 if (
LineSearch<Real>::status(
LINESEARCH_BISECTION,ls_neval,ls_ngrad,tr,fval,gs,val_tr,x,s,obj,con) ) {
79 if ( val_tl < val_tr ) {
89 Real tc = half*(tl+tr);
95 if ( val_tc < val_t ) {
100 Real t1(0), val_t1(0);
101 Real t2(0), val_t2(0);
103 while ( !
LineSearch<Real>::status(
LINESEARCH_BISECTION,ls_neval,ls_ngrad,t,fval,gs,val_t,x,s,obj,con)
104 && std::abs(tr - tl) >
tol_ ) {
117 if ( ( (val_tl <= val_tr) && (val_tl <= val_t1) && (val_tl <= val_t2) && (val_tl <= val_tc) )
118 || ( (val_t1 <= val_tr) && (val_t1 <= val_tl) && (val_t1 <= val_t2) && (val_t1 <= val_tc) ) ) {
119 if ( val_tl < val_t1 ) {
133 else if ( ( (val_tc <= val_tr) && (val_tc <= val_tl) && (val_tc <= val_t1) && (val_tc <= val_t2) ) ) {
142 else if ( ( (val_t2 <= val_tr) && (val_t2 <= val_tl) && (val_t2 <= val_t1) && (val_t2 <= val_tc) )
143 || ( (val_tr <= val_tl) && (val_tr <= val_t1) && (val_tr <= val_t2) && (val_tr <= val_tc) ) ) {
144 if ( val_tr < val_t2 ) {
163 if ( alpha < ROL_EPSILON<Real>() ) {
164 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.
virtual void update(const Vector< Real > &x, UpdateType type, int iter=-1)
Update objective function.
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.
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)