ROL
ROL_TrustRegion_U_Factory.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 
15 #ifndef ROL_TRUSTREGION_U_FACTORY_HPP
16 #define ROL_TRUSTREGION_U_FACTORY_HPP
17 
19 #include "ROL_CauchyPoint_U.hpp"
20 #include "ROL_DogLeg_U.hpp"
21 #include "ROL_DoubleDogLeg_U.hpp"
22 #include "ROL_TruncatedCG_U.hpp"
23 #include "ROL_SPGTrustRegion_U.hpp"
24 
25 namespace ROL {
26  template<typename Real>
27  inline Ptr<TrustRegion_U<Real>> TrustRegionUFactory(ParameterList &list) {
29  list.sublist("Step").sublist("Trust Region").get("Subproblem Solver","Dogleg"));
30  switch(etr) {
31  case TRUSTREGION_U_CAUCHYPOINT: return makePtr<CauchyPoint_U<Real>>();
32  case TRUSTREGION_U_DOGLEG: return makePtr<DogLeg_U<Real>>();
33  case TRUSTREGION_U_DOUBLEDOGLEG: return makePtr<DoubleDogLeg_U<Real>>();
34  case TRUSTREGION_U_TRUNCATEDCG: return makePtr<TruncatedCG_U<Real>>(list);
35  case TRUSTREGION_U_SPG: return makePtr<SPGTrustRegion_U<Real>>(list);
36  default: return nullPtr;
37  }
38  }
39 } // ROL
40 
41 #endif
ETrustRegionU StringToETrustRegionU(std::string s)
Ptr< TrustRegion_U< Real > > TrustRegionUFactory(ParameterList &list)
Contains definitions of enums for trust region algorithms.
ETrustRegionU
Enumeration of trust-region solver types.