44 #ifndef ROL_KRYLOVFACTORY_H
45 #define ROL_KRYLOVFACTORY_H
49 #include "ROL_ParameterList.hpp"
50 #include "ROL_Ptr.hpp"
64 inline ROL::Ptr<Krylov<Real> >
KrylovFactory( ROL::ParameterList &parlist ) {
65 Real em4(1e-4), em2(1e-2);
67 parlist.sublist(
"General").sublist(
"Krylov").get(
"Type",
"Conjugate Gradients"));
68 Real absTol = parlist.sublist(
"General").sublist(
"Krylov").get(
"Absolute Tolerance", em4);
69 Real relTol = parlist.sublist(
"General").sublist(
"Krylov").get(
"Relative Tolerance", em2);
70 int maxit = parlist.sublist(
"General").sublist(
"Krylov").get(
"Iteration Limit", 20);
71 bool inexact = parlist.sublist(
"General").get(
"Inexact Hessian-Times-A-Vector",
false);
74 return ROL::makePtr<ConjugateResiduals<Real>>(absTol,relTol,maxit,inexact);
76 return ROL::makePtr<ConjugateGradients<Real>>(absTol,relTol,maxit,inexact);
78 return ROL::makePtr<MINRES<Real>>(absTol,relTol,maxit,inexact);
80 return ROL::makePtr<GMRES<Real>>(parlist);
81 default:
return ROL::nullPtr;
Contains definitions of custom data types in ROL.
EKrylov
Enumeration of Krylov methods.
EKrylov StringToEKrylov(std::string s)
ROL::Ptr< Krylov< Real > > KrylovFactory(ROL::ParameterList &parlist)