10 #ifndef ROL_KRYLOVFACTORY_H
11 #define ROL_KRYLOVFACTORY_H
13 #include "ROL_Ptr.hpp"
42 std::string retString;
44 case KRYLOV_CG: retString =
"Conjugate Gradients";
break;
45 case KRYLOV_CR: retString =
"Conjugate Residuals";
break;
49 case KRYLOV_LAST: retString =
"Last Type (Dummy)";
break;
50 default: retString =
"INVALID EKrylov";
68 return type =
static_cast<EKrylov>(type+1);
78 return type =
static_cast<EKrylov>(type-1);
99 Real em4(1e-4), em2(1e-2);
101 parlist.sublist(
"General").sublist(
"Krylov").get(
"Type",
"GMRES"));
102 Real absTol = parlist.sublist(
"General").sublist(
"Krylov").get(
"Absolute Tolerance", em4);
103 Real relTol = parlist.sublist(
"General").sublist(
"Krylov").get(
"Relative Tolerance", em2);
104 int maxit = parlist.sublist(
"General").sublist(
"Krylov").get(
"Iteration Limit", 20);
105 bool inexact = parlist.sublist(
"General").get(
"Inexact Hessian-Times-A-Vector",
false);
108 return makePtr<ConjugateResiduals<Real>>(absTol,relTol,maxit,inexact);
110 return makePtr<ConjugateGradients<Real>>(absTol,relTol,maxit,inexact);
112 return makePtr<MINRES<Real>>(absTol,relTol,maxit,inexact);
114 return makePtr<GMRES<Real>>(parlist);
EPolyProjAlgo & operator++(EPolyProjAlgo &type)
Contains definitions of custom data types in ROL.
std::string removeStringFormat(std::string s)
EKrylov
Enumeration of Krylov methods.
EKrylov StringToEKrylov(std::string s)
EPolyProjAlgo & operator--(EPolyProjAlgo &type)
Ptr< Krylov< Real > > KrylovFactory(ParameterList &parlist)
std::string EKrylovToString(EKrylov type)
int isValidKrylov(EKrylov type)
Verifies validity of a Krylov enum.