ROL
ROL_LineSearchFactory.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Rapid Optimization Library (ROL) Package
4 //
5 // Copyright 2014 NTESS and the ROL contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef ROL_LINESEARCHFACTORY_H
11 #define ROL_LINESEARCHFACTORY_H
12 
13 #include "ROL_Types.hpp"
14 
15 #include "ROL_ParameterList.hpp"
16 #include "ROL_Ptr.hpp"
17 
18 #include "ROL_LineSearch.hpp"
19 #include "ROL_IterationScaling.hpp"
21 #include "ROL_BackTracking.hpp"
22 #include "ROL_CubicInterp.hpp"
23 #include "ROL_Bisection.hpp"
24 #include "ROL_GoldenSection.hpp"
25 #include "ROL_Brents.hpp"
27 
28 namespace ROL {
29  template<class Real>
30  inline ROL::Ptr<LineSearch<Real> > LineSearchFactory(ROL::ParameterList &parlist) {
32  parlist.sublist("Step").sublist("Line Search").sublist("Line-Search Method").get("Type","Cubic Interpolation"));
33  switch(els) {
34  case LINESEARCH_ITERATIONSCALING: return ROL::makePtr<IterationScaling<Real>>(parlist);
35  case LINESEARCH_PATHBASEDTARGETLEVEL: return ROL::makePtr<PathBasedTargetLevel<Real>>(parlist);
36  case LINESEARCH_BACKTRACKING: return ROL::makePtr<BackTracking<Real>>(parlist);
37  case LINESEARCH_CUBICINTERP: return ROL::makePtr<CubicInterp<Real>>(parlist);
38 // case LINESEARCH_BISECTION: return ROL::makePtr<Bisection<Real>>(parlist);
39 // case LINESEARCH_BRENTS: return ROL::makePtr<Brents<Real>>(parlist);
40 // case LINESEARCH_GOLDENSECTION: return ROL::makePtr<GoldenSection<Real>>(parlist);
41  case LINESEARCH_BRENTS:
43  case LINESEARCH_BISECTION: return ROL::makePtr<ScalarMinimizationLineSearch<Real>>(parlist);
44  default: return ROL::nullPtr;
45  }
46  }
47 }
48 
49 #endif
ELineSearch StringToELineSearch(std::string s)
Definition: ROL_Types.hpp:690
Contains definitions of custom data types in ROL.
ELineSearch
Enumeration of line-search types.
Definition: ROL_Types.hpp:624
ROL::Ptr< LineSearch< Real > > LineSearchFactory(ROL::ParameterList &parlist)