Umfpack.h
Go to the documentation of this file.
1 /*
2  * Medical Image Registration ToolKit (MIRTK)
3  *
4  * Copyright 2013-2015 Imperial College London
5  * Copyright 2013-2015 Andreas Schuh
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 
20 /**
21  * \file mirtk/Umfpack.h
22  * \brief Interface to UMFPACK routines.
23  *
24  * \attention Include this header in internal files such as .cc translation units only!
25  */
26 
27 #ifndef MIRTK_Umfpack_H
28 #define MIRTK_Umfpack_H
29 
30 #include <umfpack.h>
31 
32 
33 namespace mirtk {
34 
35 
36 // -----------------------------------------------------------------------------
37 /// Translate UMFPACK status code to message string
38 const char *umfpack_status_message(int status)
39 {
40  switch (status) {
41  case UMFPACK_OK: return "Success";
42 #ifdef UMFPACK_WARNING_singular_matrix
43  case UMFPACK_WARNING_singular_matrix: return "Matrix is singular";
44 #endif
45 #ifdef UMFPACK_WARNING_determinant_underflow
46  case UMFPACK_WARNING_determinant_underflow: return "Determinant underflow";
47 #endif
48 #ifdef UMFPACK_WARNING_determinant_overflow
49  case UMFPACK_WARNING_determinant_overflow: return "Determinant overflow";
50 #endif
51 #ifdef UMFPACK_ERROR_out_of_memory
52  case UMFPACK_ERROR_out_of_memory: return "Out of memory";
53 #endif
54 #ifdef UMFPACK_ERROR_invalid_Numeric_object
55  case UMFPACK_ERROR_invalid_Numeric_object: return "Invalid Numeric object";
56 #endif
57 #ifdef UMFPACK_ERROR_invalid_Symbolic_object
58  case UMFPACK_ERROR_invalid_Symbolic_object: return "Invalid Symbolic object";
59 #endif
60 #ifdef UMFPACK_ERROR_argument_missing
61  case UMFPACK_ERROR_argument_missing: return "Argument missing";
62 #endif
63 #ifdef UMFPACK_ERROR_n_nonpositive
64  case UMFPACK_ERROR_n_nonpositive: return "N non-positive";
65 #endif
66 #ifdef UMFPACK_ERROR_invalid_matrix
67  case UMFPACK_ERROR_invalid_matrix: return "Invalid matrix";
68 #endif
69 #ifdef UMFPACK_ERROR_different_pattern
70  case UMFPACK_ERROR_different_pattern: return "Different pattern";
71 #endif
72 #ifdef UMFPACK_ERROR_invalid_system
73  case UMFPACK_ERROR_invalid_system: return "Invalid system";
74 #endif
75 #ifdef UMFPACK_ERROR_invalid_permutation
76  case UMFPACK_ERROR_invalid_permutation: return "Invalid permutation";
77 #endif
78 #ifdef UMFPACK_ERROR_internal_error
79  case UMFPACK_ERROR_internal_error: return "Internal error";
80 #endif
81 #ifdef UMFPACK_ERROR_file_IO
82  case UMFPACK_ERROR_file_IO: return "File I/O error";
83 #endif
84 #ifdef UMFPACK_ERROR_ordering_failed
85  case UMFPACK_ERROR_ordering_failed: return "Ordering failed";
86 #endif
87  }
88  return "Unknown status code";
89 }
90 
91 
92 } // namespace mirtk
93 
94 #endif // MIRTK_Umfpack_H_
const char * umfpack_status_message(int status)
Translate UMFPACK status code to message string.
Definition: Umfpack.h:38
Definition: IOConfig.h:41