ROL
ROL_DescentDirection_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
10#ifndef ROL_DESCENTDIRECTION_U_FACTORY_H
11#define ROL_DESCENTDIRECTION_U_FACTORY_H
12
13#include "ROL_Gradient_U.hpp"
14#include "ROL_QuasiNewton_U.hpp"
15#include "ROL_NonlinearCG_U.hpp"
16#include "ROL_Newton_U.hpp"
19
20namespace ROL {
21template<typename Real>
22inline Ptr<DescentDirection_U<Real>> DescentDirectionUFactory(ParameterList &parlist, const Ptr<Secant<Real>> &secant = nullPtr) {
24 parlist.sublist("Step").sublist("Line Search").sublist("Descent Method").get("Type","Quasi-Newton Method"));
25 switch(edesc) {
26 case DESCENT_U_STEEPEST: return makePtr<Gradient_U<Real>>();
27 case DESCENT_U_NONLINEARCG: return makePtr<NonlinearCG_U<Real>>(parlist);
28 case DESCENT_U_SECANT: return makePtr<QuasiNewton_U<Real>>(parlist, secant);
29 case DESCENT_U_NEWTON: return makePtr<Newton_U<Real>>();
31 {
32 Ptr<Krylov<Real>> krylov = nullPtr;
33 return makePtr<NewtonKrylov_U<Real>>(parlist,krylov,secant);
34 }
35 default: return nullPtr;
36 }
37}
38} // namespace ROL
39
40#endif
Provides interface for and implements limited-memory secant operators.
EDescentU StringToEDescentU(std::string s)
Ptr< DescentDirection_U< Real > > DescentDirectionUFactory(ParameterList &parlist, const Ptr< Secant< Real > > &secant=nullPtr)