49 convertStatusTypeToRawString (
const StatusType status)
53 }
else if (status ==
Failed) {
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") {
82 "Belos::convertStringToStatusType: Invalid string \"" << status
90 if (scaleType ==
"Norm of Initial Residual") {
92 }
else if (scaleType ==
"Norm of Preconditioned Initial Residual") {
94 }
else if (scaleType ==
"Norm of RHS") {
96 }
else if (scaleType ==
"None") {
98 }
else if (scaleType ==
"User Provided") {
102 "Belos::convertStringToScaleType(): Invalid residual scaling type \"" 103 << scaleType <<
"\".");
111 return "Norm of Initial Residual";
113 return "Norm of Preconditioned Initial Residual";
115 return "Norm of RHS";
119 return "User Provided";
122 "Belos::convertScaleTypeToString(): Invalid residual scaling type " 123 "value " << scaleType <<
".");
130 typedef std::vector<int>::size_type size_type;
134 const size_type numValidTypes = 8;
135 const int validTypes[] = {
145 const char* typeNames[] = {
161 std::vector<size_type> theList;
162 for (size_type nameIndex = 0; nameIndex < numValidTypes; ++nameIndex) {
163 if (msgType & validTypes[nameIndex]) {
164 theList.push_back (nameIndex);
167 std::ostringstream os;
168 for (size_type k = 0; k < theList.size(); ++k) {
169 const size_type nameIndex = theList[k];
170 os << typeNames[nameIndex];
171 if (nameIndex < theList.size() - 1) {
184 return "Unconverged";
187 "Belos::convertReturnTypeToString: Invalid ReturnType enum value " ScaleType convertStringToScaleType(const std::string &scaleType)
Convert the given string to its ScaleType enum value.
Collection of types and exceptions used within the Belos solvers.
ScaleType
The type of scaling to use on the residual norm value.
MsgType
Available message types recognized by the linear solvers.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
StatusType
Whether the StatusTest wants iteration to stop.
std::string convertStatusTypeToString(const StatusType status)
The string name corresponding to the given StatusType enum value.
std::string convertScaleTypeToString(const ScaleType scaleType)
Convert the given ScaleType enum value to its corresponding string.
std::string convertMsgTypeToString(const MsgType msgType)
Show MsgType as a comma-delimited list of names.
ReturnType
Whether the Belos solve converged for all linear systems.
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.