53 #define ROL_VALIDATE( A ) A
55 #define ROL_VALIDATE( A )
61 #include <Teuchos_RCP.hpp>
62 #include <Teuchos_ScalarTraits.hpp>
63 #include <Teuchos_TestForException.hpp>
69 #define ROL_NUM_CHECKDERIV_STEPS 13
94 gnorm(std::numeric_limits<Real>::max()),
95 cnorm(std::numeric_limits<Real>::max()),
96 snorm(std::numeric_limits<Real>::max()),
115 static const double ROL_EPSILON = std::abs(Teuchos::ScalarTraits<double>::eps());
123 static const double ROL_OVERFLOW = std::abs(Teuchos::ScalarTraits<double>::rmax());
127 static const double ROL_UNDERFLOW = std::abs(Teuchos::ScalarTraits<double>::rmin());
131 return (c ==
' ' || c ==
'-' || c ==
'(' || c ==
')' || c==
'\'' || c==
'\r' || c==
'\n' || c==
'\t');
136 std::string output = s;
138 std::transform( output.begin(), output.end(), output.begin(), ::tolower );
157 std::string retString;
163 default: retString =
"INVALID EBoundAlgorithm";
230 std::string retString;
237 case DESCENT_LAST: retString =
"Last Type (Dummy)";
break;
238 default: retString =
"INVALID ESecant";
258 return type =
static_cast<EDescent>(type+1);
268 return type =
static_cast<EDescent>(type-1);
305 std::string retString;
307 case SECANT_LBFGS: retString =
"Limited-Memory BFGS";
break;
308 case SECANT_LDFP: retString =
"Limited-Memory DFP";
break;
309 case SECANT_LSR1: retString =
"Limited-Memory SR1";
break;
312 case SECANT_LAST: retString =
"Last Type (Dummy)";
break;
313 default: retString =
"INVALID ESecant";
333 return type =
static_cast<ESecant>(type+1);
343 return type =
static_cast<ESecant>(type-1);
375 std::string retString;
377 case KRYLOV_CG: retString =
"Conjugate Gradients";
break;
378 case KRYLOV_CR: retString =
"Conjugate Residuals";
break;
379 case KRYLOV_LAST: retString =
"Last Type (Dummy)";
break;
380 default: retString =
"INVALID EKrylov";
396 return type =
static_cast<EKrylov>(type+1);
406 return type =
static_cast<EKrylov>(type-1);
452 std::string retString;
464 default: retString =
"INVALID ENonlinearCG";
540 std::string retString;
551 default: retString =
"INVALID ELineSearch";
621 std::string retString;
630 default: retString =
"INVALID ECurvatureCondition";
697 std::string retString;
704 default: retString =
"INVALID ETrustRegion";
775 std::string retString;
786 default: retString =
"INVALID ETestObjectives";
862 std::string retString;
874 default: retString =
"INVALID ETestOptProblem";
940 std::string retString;
945 default: retString =
"INVALID EConstraint";
991 namespace Finite_Difference_Arrays {
994 const int shifts[4][4] = { { 1, 0, 0, 0 },
1001 const double weights[4][5] = { { -1.0, 1.0, 0.0, 0.0, 0.0 },
1002 { 0.0, -1.0/2.0, 1.0/2.0, 0.0, 0.0 },
1003 { -1.0/2.0, -1.0/3.0, 1.0, -1.0/6.0, 0.0 },
1004 { 0.0, -2.0/3.0, 1.0/12.0, 2.0/3.0, -1.0/12.0 }
ETestOptProblem
Enumeration of test optimization problems.
int isValidKrylov(EKrylov d)
Verifies validity of a Secant enum.
int isValidConstraint(EConstraint c)
Verifies validity of a Secant enum.
int isValidSecant(ESecant s)
Verifies validity of a Secant enum.
const double weights[4][5]
ELineSearch StringToELineSearch(std::string s)
EBoundAlgorithm StringToEBoundAlgorithm(std::string s)
EBoundAlgorithm
Enumeration of algorithms to handle bound constraints.
Real aggregateGradientNorm
int isValidBoundAlgorithm(EBoundAlgorithm d)
Verifies validity of a Bound Algorithm enum.
std::string removeStringFormat(std::string s)
ELineSearch
Enumeration of line-search types.
static const double ROL_THRESHOLD
Tolerance for various equality tests.
EConstraint StringToEConstraint(std::string s)
ESecant StringToESecant(std::string s)
std::string EDescentToString(EDescent tr)
EROLBurkardt & operator++(EROLBurkardt &type)
int isValidTestOptProblem(ETestOptProblem to)
Verifies validity of a TestOptProblem enum.
Teuchos::RCP< Vector< Real > > descentVec
EKrylov
Enumeration of Krylov methods.
int isValidTestObjectives(ETestObjectives to)
Verifies validity of a TestObjectives enum.
int isValidTrustRegion(ETrustRegion ls)
Verifies validity of a TrustRegion enum.
EKrylov StringToEKrylov(std::string s)
EDescent StringToEDescent(std::string s)
State for algorithm class. Will be used for restarts.
EBoundAlgorithm & operator--(EBoundAlgorithm &type)
ENonlinearCG
Enumeration of nonlinear CG algorithms.
ETestObjectives StringToETestObjectives(std::string s)
std::string ECurvatureConditionToString(ECurvatureCondition ls)
std::string EConstraintToString(EConstraint c)
ESecant
Enumeration of secant update algorithms.
std::string ETestOptProblemToString(ETestOptProblem to)
std::string ENonlinearCGToString(ENonlinearCG tr)
ENonlinearCG StringToENonlinearCG(std::string s)
int isValidDescent(EDescent d)
Verifies validity of a Secant enum.
std::string ELineSearchToString(ELineSearch ls)
int isValidLineSearch(ELineSearch ls)
Verifies validity of a LineSearch enum.
State for step class. Will be used for restarts.
ETestObjectives
Enumeration of test objective functions.
Teuchos::RCP< Vector< Real > > minIterVec
std::string EKrylovToString(EKrylov tr)
int isValidCurvatureCondition(ECurvatureCondition ls)
Verifies validity of a CurvatureCondition enum.
ETrustRegion StringToETrustRegion(std::string s)
ECurvatureCondition
Enumeration of line-search curvature conditions.
std::string ETestObjectivesToString(ETestObjectives to)
Teuchos::RCP< Vector< Real > > lagmultVec
Teuchos::RCP< Vector< Real > > iterateVec
ECurvatureCondition StringToECurvatureCondition(std::string s)
ETrustRegion
Enumeration of trust-region solver types.
std::string ETrustRegionToString(ETrustRegion tr)
std::string ESecantToString(ESecant tr)
static const double ROL_OVERFLOW
Platform-dependent maximum double.
EConstraint
Enumeration of constraint types.
ETestOptProblem StringToETestOptProblem(std::string s)
int isValidNonlinearCG(ENonlinearCG s)
Verifies validity of a NonlinearCG enum.
std::string EBoundAlgorithmToString(EBoundAlgorithm tr)
EDescent
Enumeration of descent direction types.
Teuchos::RCP< Vector< Real > > gradientVec
static const double ROL_UNDERFLOW
Platform-dependent minimum double.
static const double ROL_EPSILON
Platform-dependent machine epsilon.