44 #ifndef ROL_KRYLOVFACTORY_H
45 #define ROL_KRYLOVFACTORY_H
47 #include "ROL_Ptr.hpp"
76 std::string retString;
78 case KRYLOV_CG: retString =
"Conjugate Gradients";
break;
79 case KRYLOV_CR: retString =
"Conjugate Residuals";
break;
83 case KRYLOV_LAST: retString =
"Last Type (Dummy)";
break;
84 default: retString =
"INVALID EKrylov";
102 return type =
static_cast<EKrylov>(type+1);
112 return type =
static_cast<EKrylov>(type-1);
133 Real em4(1e-4), em2(1e-2);
135 parlist.sublist(
"General").sublist(
"Krylov").get(
"Type",
"GMRES"));
136 Real absTol = parlist.sublist(
"General").sublist(
"Krylov").get(
"Absolute Tolerance", em4);
137 Real relTol = parlist.sublist(
"General").sublist(
"Krylov").get(
"Relative Tolerance", em2);
138 int maxit = parlist.sublist(
"General").sublist(
"Krylov").get(
"Iteration Limit", 20);
139 bool inexact = parlist.sublist(
"General").get(
"Inexact Hessian-Times-A-Vector",
false);
142 return makePtr<ConjugateResiduals<Real>>(absTol,relTol,maxit,inexact);
144 return makePtr<ConjugateGradients<Real>>(absTol,relTol,maxit,inexact);
146 return makePtr<MINRES<Real>>(absTol,relTol,maxit,inexact);
148 return makePtr<GMRES<Real>>(parlist);
EKrylov & operator++(EKrylov &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)
Ptr< Krylov< Real > > KrylovFactory(ParameterList &parlist)
std::string EKrylovToString(EKrylov type)
int isValidKrylov(EKrylov type)
Verifies validity of a Krylov enum.
EKrylov & operator--(EKrylov &type)