Skip to content
Snippets Groups Projects
Commit bd755d6c authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

added error messages to umfpack error codes

parent a6444316
No related branches found
No related tags found
No related merge requests found
......@@ -52,7 +52,7 @@ namespace AMDiS
try {
solver_.reset(new SolverType(matrix, symmetricStrategy_, allocInit_));
} catch (mtl::mat::umfpack::error const& e) {
error_exit("UMFPACK_ERROR(factorize, {}) = {}", e.code, e.what());
umfpack_error_exit("factorize", e.code);
}
}
......@@ -68,7 +68,7 @@ namespace AMDiS
try {
code = (*solver_)(x, b);
} catch (mtl::mat::umfpack::error& e) {
error_exit("UMFPACK_ERROR(solve, {}) = {}", e.code, e.what());
umfpack_error_exit("solve", e.code);
}
auto r = Vector(b);
......@@ -81,6 +81,30 @@ namespace AMDiS
return code;
}
static void umfpack_error_exit(std::string solutionPhase, int code)
{
static std::map<int, std::string> error_message = {
{UMFPACK_OK, "UMFPACK was successful"},
{UMFPACK_WARNING_singular_matrix, "Matrix is singular. There are exact zeros on the diagonal."},
{UMFPACK_WARNING_determinant_underflow, "The determinant is nonzero, but smaller in magnitude than the smallest positive floating-point number."},
{UMFPACK_WARNING_determinant_overflow, "The determinant is larger in magnitude than the largest positive floating-point number (IEEE Inf)."},
{UMFPACK_ERROR_out_of_memory, "Not enough memory. The ANSI C malloc or realloc routine failed."},
{UMFPACK_ERROR_invalid_Numeric_object, "Invalid Numeric object."},
{UMFPACK_ERROR_invalid_Symbolic_object, "Invalid Symbolic object."},
{UMFPACK_ERROR_argument_missing, "Some required arguments are missing."},
{UMFPACK_ERROR_n_nonpositive, "The number of rows or columns of the matrix must be greater than zero."},
{UMFPACK_ERROR_invalid_matrix, "The matrix is invalid."},
{UMFPACK_ERROR_different_pattern, "The pattern of the matrix has changed between the symbolic and numeric factorization."},
{UMFPACK_ERROR_invalid_system, "The sys argument provided to one of the solve routines is invalid."},
{UMFPACK_ERROR_invalid_permutation, "The permutation vector provided as input is invalid."},
{UMFPACK_ERROR_file_IO, "Error in file IO"},
{UMFPACK_ERROR_ordering_failed, "The ordering method failed."},
{UMFPACK_ERROR_internal_error, "An internal error has occurred, of unknown cause."}
};
error_exit("UMFPACK_ERROR({}, {}) = {}", solutionPhase, code, error_message[code]);
}
protected:
std::shared_ptr<SolverType> solver_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment