ROL
ROL_TrustRegionFactory.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_TRUSTREGIONFACTORY_H
11#define ROL_TRUSTREGIONFACTORY_H
12
13#include "ROL_Types.hpp"
14
15#include "ROL_ParameterList.hpp"
16#include "ROL_Ptr.hpp"
17
18#include "ROL_TrustRegion.hpp"
19#include "ROL_CauchyPoint.hpp"
20#include "ROL_DogLeg.hpp"
21#include "ROL_DoubleDogLeg.hpp"
22#include "ROL_TruncatedCG.hpp"
23#include "ROL_LinMore.hpp"
24
25namespace ROL {
26template<class Real>
27 inline ROL::Ptr<TrustRegion<Real> > TrustRegionFactory(ROL::ParameterList &parlist) {
29 parlist.sublist("Step").sublist("Trust Region").get("Subproblem Solver","Dogleg"));
30 switch(etr) {
31 case TRUSTREGION_CAUCHYPOINT: return ROL::makePtr<CauchyPoint<Real>>(parlist);
32 case TRUSTREGION_DOGLEG: return ROL::makePtr<DogLeg<Real>>(parlist);
33 case TRUSTREGION_DOUBLEDOGLEG: return ROL::makePtr<DoubleDogLeg<Real>>(parlist);
34 case TRUSTREGION_TRUNCATEDCG: return ROL::makePtr<TruncatedCG<Real>>(parlist);
35 case TRUSTREGION_LINMORE: return ROL::makePtr<LinMore<Real>>(parlist);
36 default: return ROL::nullPtr;
37 }
38 }
39}
40
41#endif
Contains definitions of custom data types in ROL.
ETrustRegion StringToETrustRegion(std::string s)
ROL::Ptr< TrustRegion< Real > > TrustRegionFactory(ROL::ParameterList &parlist)