19#ifndef AMESOS2_SUPERLUMT_FUNCTIONMAP_HPP
20#define AMESOS2_SUPERLUMT_FUNCTIONMAP_HPP
22#ifdef HAVE_TEUCHOS_COMPLEX
27#include "Amesos2_MatrixAdapter.hpp"
37#include "slu_mt_util.h"
38#include "pxgstrf_synch.h"
49#ifdef HAVE_TEUCHOS_COMPLEX
65 template <
class Matrix,
class Vector>
class Superlumt;
102 struct FunctionMap<Superlumt,float>
104 typedef TypeMap<Superlumt,float> type_map;
109 static void gssvx(SLUMT::superlumt_options_t* options, SLUMT::SuperMatrix* A,
110 int* perm_c,
int* perm_r,
int* etree, SLUMT::equed_t* equed,
float* R,
float* C,
111 SLUMT::SuperMatrix* L, SLUMT::SuperMatrix* U,
void* work,
int lwork,
112 SLUMT::SuperMatrix* B, SLUMT::SuperMatrix* X,
float* recip_pivot_growth,
113 float* rcond,
float* ferr,
float* berr, SLUMT::superlu_memusage_t* mem_usage,
114 SLUMT::Gstat_t* stat,
int* info)
116 options->etree = etree;
117 options->perm_c = perm_c;
118 options->perm_r = perm_r;
120 options->work = work;
121 options->lwork = lwork;
123 SLUMT::S::psgssvx(options->nprocs, options, A, perm_c, perm_r,
124 equed, R, C, L, U, B, X, recip_pivot_growth, rcond, ferr,
125 berr, mem_usage, info);
131 static void gstrs(SLUMT::trans_t trans, SLUMT::SuperMatrix* L,
132 SLUMT::SuperMatrix* U,
int* perm_r,
int* perm_c,
133 SLUMT::SuperMatrix* B, SLUMT::Gstat_t* Gstat,
int* info)
135 SLUMT::S::sgstrs(trans, L, U, perm_r, perm_c, B, Gstat, info);
155 static void gstrf(SLUMT::superlumt_options_t* options, SLUMT::SuperMatrix* A,
156 int* perm_r, SLUMT::SuperMatrix* L, SLUMT::SuperMatrix* U,
157 SLUMT::Gstat_t* stat,
int* info)
159 SLUMT::S::psgstrf(options, A, perm_r, L, U, stat, info);
175 static void create_CompCol_Matrix(SLUMT::SuperMatrix* A,
int m,
int n,
int nnz,
176 type_map::type* nzval,
int* rowind,
int* colptr,
177 SLUMT::Stype_t stype, SLUMT::Dtype_t dtype, SLUMT::Mtype_t mtype)
179 SLUMT::S::sCreate_CompCol_Matrix(A, m, n, nnz, nzval, rowind, colptr,
180 stype, dtype, mtype);
194 static void create_Dense_Matrix(SLUMT::SuperMatrix* X,
int m,
int n,
195 type_map::type* x,
int ldx, SLUMT::Stype_t stype,
196 SLUMT::Dtype_t dtype, SLUMT::Mtype_t mtype)
198 SLUMT::S::sCreate_Dense_Matrix(X, m, n, x, ldx, stype, dtype, mtype);
207 static void gsequ(SLUMT::SuperMatrix* A,
208 type_map::magnitude_type* r,
209 type_map::magnitude_type* c,
210 type_map::magnitude_type* rowcnd,
211 type_map::magnitude_type* colcnd,
212 type_map::magnitude_type* amax,
215 SLUMT::S::sgsequ(A, r, c, rowcnd, colcnd, amax, info);
226 static void laqgs(SLUMT::SuperMatrix* A,
227 type_map::magnitude_type* r,
228 type_map::magnitude_type* c,
229 type_map::magnitude_type rowcnd,
230 type_map::magnitude_type colcnd,
231 type_map::magnitude_type amax,
232 SLUMT::equed_t* equed)
234 SLUMT::S::slaqgs(A, r, c, rowcnd, colcnd, amax, equed);
240 struct FunctionMap<Superlumt,double>
242 typedef TypeMap<Superlumt,double> type_map;
244 static void gssvx(SLUMT::superlumt_options_t* options, SLUMT::SuperMatrix* A,
245 int* perm_c,
int* perm_r,
int* etree, SLUMT::equed_t* equed,
double* R,
double* C,
246 SLUMT::SuperMatrix* L, SLUMT::SuperMatrix* U,
void* work,
int lwork,
247 SLUMT::SuperMatrix* B, SLUMT::SuperMatrix* X,
double* recip_pivot_growth,
248 double* rcond,
double* ferr,
double* berr, SLUMT::superlu_memusage_t* mem_usage,
249 SLUMT::Gstat_t* stat,
int* info)
251 options->etree = etree;
252 options->perm_c = perm_c;
253 options->perm_r = perm_r;
255 options->work = work;
256 options->lwork = lwork;
258 SLUMT::D::pdgssvx(options->nprocs, options, A, perm_c, perm_r,
259 equed, R, C, L, U, B, X, recip_pivot_growth, rcond, ferr,
260 berr, mem_usage, info);
263 static void gstrs(SLUMT::trans_t trans, SLUMT::SuperMatrix* L,
264 SLUMT::SuperMatrix* U,
int* perm_r,
int* perm_c,
265 SLUMT::SuperMatrix* B, SLUMT::Gstat_t* Gstat,
int* info)
267 SLUMT::D::dgstrs(trans, L, U, perm_r, perm_c, B, Gstat, info);
270 static void gstrf(SLUMT::superlumt_options_t* options, SLUMT::SuperMatrix* A,
271 int* perm_r, SLUMT::SuperMatrix* L, SLUMT::SuperMatrix* U,
272 SLUMT::Gstat_t* stat,
int* info)
274 SLUMT::D::pdgstrf(options, A, perm_r, L, U, stat, info);
277 static void create_CompCol_Matrix(SLUMT::SuperMatrix* A,
int m,
int n,
int nnz,
278 type_map::type* nzval,
int* rowind,
int* colptr,
279 SLUMT::Stype_t stype, SLUMT::Dtype_t dtype, SLUMT::Mtype_t mtype)
281 SLUMT::D::dCreate_CompCol_Matrix(A, m, n, nnz, nzval, rowind, colptr,
282 stype, dtype, mtype);
285 static void create_Dense_Matrix(SLUMT::SuperMatrix* X,
int m,
int n,
286 type_map::type* x,
int ldx, SLUMT::Stype_t stype,
287 SLUMT::Dtype_t dtype, SLUMT::Mtype_t mtype)
289 SLUMT::D::dCreate_Dense_Matrix(X, m, n, x, ldx, stype, dtype, mtype);
292 static void gsequ(SLUMT::SuperMatrix* A,
293 type_map::magnitude_type* r,
294 type_map::magnitude_type* c,
295 type_map::magnitude_type* rowcnd,
296 type_map::magnitude_type* colcnd,
297 type_map::magnitude_type* amax,
300 SLUMT::D::dgsequ(A, r, c, rowcnd, colcnd, amax, info);
303 static void laqgs(SLUMT::SuperMatrix* A,
304 type_map::magnitude_type* r,
305 type_map::magnitude_type* c,
306 type_map::magnitude_type rowcnd,
307 type_map::magnitude_type colcnd,
308 type_map::magnitude_type amax,
309 SLUMT::equed_t* equed)
311 SLUMT::D::dlaqgs(A, r, c, rowcnd, colcnd, amax, equed);
316#ifdef HAVE_TEUCHOS_COMPLEX
321 struct FunctionMap<Superlumt,SLUMT::C::complex>
323 typedef TypeMap<Superlumt,SLUMT::C::complex> type_map;
325 static void gssvx(SLUMT::superlumt_options_t* options, SLUMT::SuperMatrix* A,
326 int* perm_c,
int* perm_r,
int* etree, SLUMT::equed_t* equed,
float* R,
float* C,
327 SLUMT::SuperMatrix* L, SLUMT::SuperMatrix* U,
void* work,
int lwork,
328 SLUMT::SuperMatrix* B, SLUMT::SuperMatrix* X,
float* recip_pivot_growth,
329 float* rcond,
float* ferr,
float* berr, SLUMT::superlu_memusage_t* mem_usage,
330 SLUMT::Gstat_t* stat,
int* info)
332 options->etree = etree;
333 options->perm_c = perm_c;
334 options->perm_r = perm_r;
336 options->work = work;
337 options->lwork = lwork;
339 SLUMT::C::pcgssvx(options->nprocs, options, A, perm_c, perm_r,
340 equed, R, C, L, U, B, X, recip_pivot_growth, rcond, ferr,
341 berr, mem_usage, info);
344 static void gstrs(SLUMT::trans_t trans, SLUMT::SuperMatrix* L,
345 SLUMT::SuperMatrix* U,
int* perm_r,
int* perm_c,
346 SLUMT::SuperMatrix* B, SLUMT::Gstat_t* Gstat,
int* info)
348 SLUMT::C::cgstrs(trans, L, U, perm_r, perm_c, B, Gstat, info);
351 static void gstrf(SLUMT::superlumt_options_t* options, SLUMT::SuperMatrix* A,
352 int* perm_r, SLUMT::SuperMatrix* L, SLUMT::SuperMatrix* U,
353 SLUMT::Gstat_t* stat,
int* info)
355 SLUMT::C::pcgstrf(options, A, perm_r, L, U, stat, info);
358 static void create_CompCol_Matrix(SLUMT::SuperMatrix* A,
int m,
int n,
int nnz,
359 type_map::type* nzval,
int* rowind,
int* colptr,
360 SLUMT::Stype_t stype, SLUMT::Dtype_t dtype, SLUMT::Mtype_t mtype)
362 SLUMT::C::cCreate_CompCol_Matrix(A, m, n, nnz, nzval, rowind, colptr,
363 stype, dtype, mtype);
366 static void create_Dense_Matrix(SLUMT::SuperMatrix* X,
int m,
int n,
367 type_map::type* x,
int ldx, SLUMT::Stype_t stype,
368 SLUMT::Dtype_t dtype, SLUMT::Mtype_t mtype)
370 SLUMT::C::cCreate_Dense_Matrix(X, m, n, x, ldx, stype, dtype, mtype);
373 static void gsequ(SLUMT::SuperMatrix* A,
float* r,
float* c,
374 float* rowcnd,
float* colcnd,
float* amax,
int* info)
376 SLUMT::C::cgsequ(A, r, c, rowcnd, colcnd, amax, info);
379 static void laqgs(SLUMT::SuperMatrix* A,
float* r,
float* c,
float rowcnd,
380 float colcnd,
float amax, SLUMT::equed_t* equed)
382 SLUMT::C::claqgs(A, r, c, rowcnd, colcnd, amax, equed);
388 struct FunctionMap<Superlumt,SLUMT::Z::doublecomplex>
390 typedef TypeMap<Superlumt,SLUMT::Z::doublecomplex> type_map;
392 static void gssvx(SLUMT::superlumt_options_t* options, SLUMT::SuperMatrix* A,
393 int* perm_c,
int* perm_r,
int* etree, SLUMT::equed_t* equed,
double* R,
double* C,
394 SLUMT::SuperMatrix* L, SLUMT::SuperMatrix* U,
void* work,
int lwork,
395 SLUMT::SuperMatrix* B, SLUMT::SuperMatrix* X,
double* recip_pivot_growth,
396 double* rcond,
double* ferr,
double* berr, SLUMT::superlu_memusage_t* mem_usage,
397 SLUMT::Gstat_t* stat,
int* info)
399 options->etree = etree;
400 options->perm_c = perm_c;
401 options->perm_r = perm_r;
403 options->work = work;
404 options->lwork = lwork;
406 SLUMT::Z::pzgssvx(options->nprocs, options, A, perm_c, perm_r,
407 equed, R, C, L, U, B, X, recip_pivot_growth, rcond, ferr,
408 berr, mem_usage, info);
411 static void gstrs(SLUMT::trans_t trans, SLUMT::SuperMatrix* L,
412 SLUMT::SuperMatrix* U,
int* perm_r,
int* perm_c,
413 SLUMT::SuperMatrix* B, SLUMT::Gstat_t* Gstat,
int* info)
415 SLUMT::Z::zgstrs(trans, L, U, perm_r, perm_c, B, Gstat, info);
418 static void gstrf(SLUMT::superlumt_options_t* options, SLUMT::SuperMatrix* A,
419 int* perm_r, SLUMT::SuperMatrix* L, SLUMT::SuperMatrix* U,
420 SLUMT::Gstat_t* stat,
int* info)
422 SLUMT::Z::pzgstrf(options, A, perm_r, L, U, stat, info);
425 static void create_CompCol_Matrix(SLUMT::SuperMatrix* A,
int m,
int n,
int nnz,
426 type_map::type* nzval,
int* rowind,
int* colptr,
427 SLUMT::Stype_t stype, SLUMT::Dtype_t dtype, SLUMT::Mtype_t mtype)
429 SLUMT::Z::zCreate_CompCol_Matrix(A, m, n, nnz, nzval, rowind, colptr,
430 stype, dtype, mtype);
433 static void create_Dense_Matrix(SLUMT::SuperMatrix* X,
int m,
int n,
434 type_map::type* x,
int ldx, SLUMT::Stype_t stype,
435 SLUMT::Dtype_t dtype, SLUMT::Mtype_t mtype)
437 SLUMT::Z::zCreate_Dense_Matrix(X, m, n, x, ldx, stype, dtype, mtype);
440 static void gsequ(SLUMT::SuperMatrix* A,
double* r,
double* c,
441 double* rowcnd,
double* colcnd,
double* amax,
int* info)
443 SLUMT::Z::zgsequ(A, r, c, rowcnd, colcnd, amax, info);
446 static void laqgs(SLUMT::SuperMatrix* A,
double* r,
double* c,
double rowcnd,
447 double colcnd,
double amax, SLUMT::equed_t* equed)
449 SLUMT::Z::zlaqgs(A, r, c, rowcnd, colcnd, amax, equed);
Declaration of Function mapping class for Amesos2.
Provides definition of SuperLU_MT types as well as conversions and type traits.