49 convertStatusTypeToRawString (
const StatusType status)
53 }
else if (status ==
Failed) {
58 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
59 "Belos::convertStatusTypeToRawString: Invalid StatusType enum value "
68 return convertStatusTypeToRawString (status);
74 if (status ==
"Passed") {
76 }
else if (status ==
"Failed") {
78 }
else if (status ==
"Undefined") {
81 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
82 "Belos::convertStringToStatusType: Invalid string \"" << status
90 if (normType ==
"OneNorm") {
92 }
else if (normType ==
"TwoNorm") {
94 }
else if (normType ==
"InfNorm") {
96 }
else if (normType ==
"PreconditionerNorm") {
99 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
100 "Belos::convertStringToNormType(): Invalid norm type \""
101 << normType <<
"\".");
108 if (scaleType ==
"Norm of Initial Residual") {
110 }
else if (scaleType ==
"Norm of Preconditioned Initial Residual") {
112 }
else if (scaleType ==
"Norm of RHS") {
114 }
else if (scaleType ==
"None") {
116 }
else if (scaleType ==
"User Provided") {
119 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
120 "Belos::convertStringToScaleType(): Invalid residual scaling type \""
121 << scaleType <<
"\".");
129 return "Norm of Initial Residual";
131 return "Norm of Preconditioned Initial Residual";
133 return "Norm of RHS";
137 return "User Provided";
139 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
140 "Belos::convertScaleTypeToString(): Invalid residual scaling type "
141 "value " << scaleType <<
".");
148 typedef std::vector<int>::size_type size_type;
152 const size_type numValidTypes = 8;
153 const int validTypes[] = {
163 const char* typeNames[] = {
179 std::vector<size_type> theList;
180 for (size_type nameIndex = 0; nameIndex < numValidTypes; ++nameIndex) {
181 if (msgType & validTypes[nameIndex]) {
182 theList.push_back (nameIndex);
185 std::ostringstream os;
186 for (size_type k = 0; k < theList.size(); ++k) {
187 const size_type nameIndex = theList[k];
188 os << typeNames[nameIndex];
189 if (nameIndex < theList.size() - 1) {
202 return "Unconverged";
204 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
205 "Belos::convertReturnTypeToString: Invalid ReturnType enum value "
Collection of types and exceptions used within the Belos solvers.
std::string convertMsgTypeToString(const MsgType msgType)
Show MsgType as a comma-delimited list of names.
ScaleType convertStringToScaleType(const std::string &scaleType)
Convert the given string to its ScaleType enum value.
NormType
The type of vector norm to compute.
MsgType
Available message types recognized by the linear solvers.
StatusType
Whether the StatusTest wants iteration to stop.
NormType convertStringToNormType(const std::string &normType)
Convert the given string to its NormType enum value.
ReturnType
Whether the Belos solve converged for all linear systems.
std::string convertScaleTypeToString(const ScaleType scaleType)
Convert the given ScaleType enum value to its corresponding string.
std::string convertStatusTypeToString(const StatusType status)
The string name corresponding to the given StatusType enum value.
ScaleType
The type of scaling to use on the residual norm value.
std::string convertReturnTypeToString(const ReturnType result)
Convert the given ReturnType enum value to its corresponding string.
StatusType convertStringToStatusType(const std::string &status)
The StatusType enum value corresponding to the given string name.
static const double resScaleFactor
User-defined residual scaling factor.
static const double impTolScale
"Implicit Tolerance Scale Factor"
static const double convTol
Default convergence tolerance.
static const double orthoKappa
DGKS orthogonalization constant.
static const double polyTol
Relative residual tolerance for matrix polynomial construction.