44 #ifndef AMESOS2_UMFPACK_FUNCTIONMAP_HPP
45 #define AMESOS2_UMFPACK_FUNCTIONMAP_HPP
47 #ifdef HAVE_TEUCHOS_COMPLEX
52 #include "Amesos2_Umfpack_TypeMap.hpp"
67 struct FunctionMap<Umfpack,double>
69 typedef TypeMap<Umfpack,double> type_map;
75 static int umfpack_solve(
83 const double Control [UMFPACK_CONTROL],
84 double Info [UMFPACK_INFO])
86 return ::umfpack_di_solve(sys, Ap, Ai, Ax, X, B, Numeric, Control, Info);
89 static int umfpack_numeric(
95 const double Control [UMFPACK_CONTROL],
96 double Info [UMFPACK_INFO])
98 return ::umfpack_di_numeric(Ap, Ai, Ax, Symbolic, Numeric, Control, Info);
101 static int umfpack_symbolic(
108 const double Control [UMFPACK_CONTROL],
109 double Info [UMFPACK_INFO])
111 return ::umfpack_di_symbolic(n_row, n_col, Ap, Ai, Ax, Symbolic, Control, Info);
114 static void umfpack_defaults(
115 double Control [UMFPACK_CONTROL])
117 ::umfpack_di_defaults(Control);
120 static void umfpack_free_numeric(
void **Numeric)
122 return ::umfpack_di_free_numeric(Numeric);
125 static void umfpack_free_symbolic(
void **Symbolic)
127 return ::umfpack_di_free_symbolic(Symbolic);
132 #ifdef HAVE_TEUCHOS_COMPLEX
135 struct FunctionMap<Umfpack,std::complex<double>>
137 typedef TypeMap<Umfpack,std::complex<double>> type_map;
143 static double * stdComplexToUmfpackDoubleConversion(
144 const std::complex<double> v [ ])
146 return (
double*)(&v[0]);
149 static int umfpack_solve(
153 const std::complex<double> Ax [ ],
154 std::complex<double> X [ ],
155 const std::complex<double> B [ ],
157 const double Control [UMFPACK_CONTROL],
158 double Info [UMFPACK_INFO])
160 return ::umfpack_zi_solve(sys, Ap, Ai,
161 stdComplexToUmfpackDoubleConversion(Ax), NULL,
162 stdComplexToUmfpackDoubleConversion(X), NULL,
163 stdComplexToUmfpackDoubleConversion(B), NULL,
164 Numeric, Control, Info);
167 static int umfpack_numeric(
170 const std::complex<double> Ax [ ],
173 const double Control[UMFPACK_CONTROL],
174 double Info[UMFPACK_INFO])
176 return ::umfpack_zi_numeric(Ap, Ai, stdComplexToUmfpackDoubleConversion(Ax), NULL, Symbolic, Numeric, Control, Info);
179 static int umfpack_symbolic(
184 const std::complex<double> Ax [ ],
186 const double Control [UMFPACK_CONTROL],
187 double Info [UMFPACK_INFO])
189 return ::umfpack_zi_symbolic(n_row, n_col, Ap, Ai, stdComplexToUmfpackDoubleConversion(Ax), NULL, Symbolic, Control, Info);
192 static void umfpack_defaults(
double Control [UMFPACK_CONTROL])
194 ::umfpack_zi_defaults(Control);
197 static void umfpack_free_numeric(
void **Numeric)
199 ::umfpack_zi_free_numeric(Numeric);
202 static void umfpack_free_symbolic(
void **Symbolic)
204 ::umfpack_zi_free_symbolic(Symbolic);
208 #endif // HAVE_TEUCHOS_COMPLEX
215 #endif // AMESOS2_UMFPACK_FUNCTIONMAP_HPP
Declaration of Function mapping class for Amesos2.