ROL
ROL_StatusTestFactory.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_STATUSFACTORY_H
11 #define ROL_STATUSFACTORY_H
12 
13 #include "ROL_Types.hpp"
14 
15 #include "ROL_ParameterList.hpp"
16 #include "ROL_Ptr.hpp"
17 
18 #include "ROL_StatusTest.hpp"
19 #include "ROL_BundleStatusTest.hpp"
22 
23 namespace ROL {
24  template<class Real>
26  public:
28 
29  ROL::Ptr<StatusTest<Real> > getStatusTest(const std::string step,
30  ROL::ParameterList &parlist) {
31  EStep els = StringToEStep(step);
32  switch(els) {
33  case STEP_BUNDLE: return ROL::makePtr<BundleStatusTest<Real>>(parlist);
34  case STEP_AUGMENTEDLAGRANGIAN: return ROL::makePtr<ConstraintStatusTest<Real>>(parlist);
35  case STEP_COMPOSITESTEP: return ROL::makePtr<ConstraintStatusTest<Real>>(parlist);
36  case STEP_MOREAUYOSIDAPENALTY: return ROL::makePtr<ConstraintStatusTest<Real>>(parlist);
37  case STEP_INTERIORPOINT: return ROL::makePtr<ConstraintStatusTest<Real>>(parlist);
38  case STEP_LINESEARCH: return ROL::makePtr<StatusTest<Real>>(parlist);
39  case STEP_PRIMALDUALACTIVESET: return ROL::makePtr<StatusTest<Real>>(parlist);
40  case STEP_TRUSTREGION: return ROL::makePtr<StatusTest<Real>>(parlist);
41  case STEP_FLETCHER: return ROL::makePtr<FletcherStatusTest<Real>>(parlist);
42  default: return ROL::nullPtr;
43  }
44  }
45  };
46 }
47 
48 #endif
ROL::Ptr< StatusTest< Real > > getStatusTest(const std::string step, ROL::ParameterList &parlist)
EStep StringToEStep(std::string s)
Definition: ROL_Types.hpp:361
Contains definitions of custom data types in ROL.
EStep
Enumeration of step types.
Definition: ROL_Types.hpp:243