48 convertStatusTypeToRawString (
const StatusType status)
52 }
else if (status ==
Failed) {
57 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
58 "Belos::convertStatusTypeToRawString: Invalid StatusType enum value " 64 const char* TEUCHOS_DEPRECATED
67 return convertStatusTypeToRawString (status);
73 return convertStatusTypeToRawString (status);
79 if (status ==
"Passed") {
81 }
else if (status ==
"Failed") {
83 }
else if (status ==
"Undefined") {
86 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
87 "Belos::convertStringToStatusType: Invalid string \"" << status
95 if (scaleType ==
"Norm of Initial Residual") {
97 }
else if (scaleType ==
"Norm of Preconditioned Initial Residual") {
99 }
else if (scaleType ==
"Norm of RHS") {
101 }
else if (scaleType ==
"None") {
103 }
else if (scaleType ==
"User Provided") {
106 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
107 "Belos::convertStringToScaleType(): Invalid residual scaling type \"" 108 << scaleType <<
"\".");
116 return "Norm of Initial Residual";
118 return "Norm of Preconditioned Initial Residual";
120 return "Norm of RHS";
124 return "User Provided";
126 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
127 "Belos::convertScaleTypeToString(): Invalid residual scaling type " 128 "value " << scaleType <<
".");
135 typedef std::vector<int>::size_type size_type;
139 const size_type numValidTypes = 8;
140 const int validTypes[] = {
150 const char* typeNames[] = {
166 std::vector<size_type> theList;
167 for (size_type nameIndex = 0; nameIndex < numValidTypes; ++nameIndex) {
168 if (msgType & validTypes[nameIndex]) {
169 theList.push_back (nameIndex);
172 std::ostringstream os;
173 for (size_type k = 0; k < theList.size(); ++k) {
174 const size_type nameIndex = theList[k];
175 os << typeNames[nameIndex];
176 if (nameIndex < theList.size() - 1) {
189 return "Unconverged";
191 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
192 "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.
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.
const char *TEUCHOS_DEPRECATED toString(const StatusType status)
The string name corresponding to the given StatusType enum value.
StatusType convertStringToStatusType(const std::string &status)
The StatusType enum value corresponding to the given string name.