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"   
   41 #include "pssp_defs.h"           
   45 #include "pdsp_defs.h"           
   48 #ifdef HAVE_TEUCHOS_COMPLEX 
   50 #include "pcsp_defs.h"           
   54 #include "pzsp_defs.h"           
   56 #endif  // HAVE_TEUCHOS_COMPLEX 
   64   template <
class Matrix, 
class Vector> 
class Superlumt;
 
  101   struct FunctionMap<Superlumt,float>
 
  103     typedef TypeMap<Superlumt,float> type_map;
 
  108     static void gssvx(SLUMT::superlumt_options_t* options, SLUMT::SuperMatrix* A,
 
  109           int* perm_c, 
int* perm_r, 
int* etree, SLUMT::equed_t* equed, 
float* R, 
float* C,
 
  110           SLUMT::SuperMatrix* L, SLUMT::SuperMatrix* U, 
void* work, 
int lwork,
 
  111           SLUMT::SuperMatrix* B, SLUMT::SuperMatrix* X, 
float* recip_pivot_growth,
 
  112           float* rcond, 
float* ferr, 
float* berr, SLUMT::superlu_memusage_t* mem_usage,
 
  113           SLUMT::Gstat_t* stat, 
int* info)
 
  115       options->etree = etree;
 
  116       options->perm_c = perm_c;
 
  117       options->perm_r = perm_r;
 
  119       options->work = work;
 
  120       options->lwork = lwork;
 
  122       SLUMT::S::psgssvx(options->nprocs, options, A, perm_c, perm_r,
 
  123       equed, R, C, L, U, B, X, recip_pivot_growth, rcond, ferr,
 
  124       berr, mem_usage, info);
 
  130     static void gstrs(SLUMT::trans_t trans, SLUMT::SuperMatrix* L,
 
  131           SLUMT::SuperMatrix* U, 
int* perm_r, 
int* perm_c,
 
  132           SLUMT::SuperMatrix* B, SLUMT::Gstat_t* Gstat, 
int* info)
 
  134       SLUMT::S::sgstrs(trans, L, U, perm_r, perm_c, B, Gstat, info);
 
  154     static void gstrf(SLUMT::superlumt_options_t* options, SLUMT::SuperMatrix* A,
 
  155           int* perm_r, SLUMT::SuperMatrix* L, SLUMT::SuperMatrix* U,
 
  156           SLUMT::Gstat_t* stat, 
int* info)
 
  158       SLUMT::S::psgstrf(options, A, perm_r, L, U, stat, info);
 
  174     static void create_CompCol_Matrix(SLUMT::SuperMatrix* A, 
int m, 
int n, 
int nnz,
 
  175               type_map::type* nzval, 
int* rowind, 
int* colptr,
 
  176               SLUMT::Stype_t stype, SLUMT::Dtype_t dtype, SLUMT::Mtype_t mtype)
 
  178       SLUMT::S::sCreate_CompCol_Matrix(A, m, n, nnz, nzval, rowind, colptr,
 
  179                stype, dtype, mtype);
 
  193     static void create_Dense_Matrix(SLUMT::SuperMatrix* X, 
int m, 
int n,
 
  194             type_map::type* x, 
int ldx, SLUMT::Stype_t stype,
 
  195             SLUMT::Dtype_t dtype, SLUMT::Mtype_t mtype)
 
  197       SLUMT::S::sCreate_Dense_Matrix(X, m, n, x, ldx, stype, dtype, mtype);
 
  206     static void gsequ(SLUMT::SuperMatrix* A,
 
  207           type_map::magnitude_type* r,
 
  208           type_map::magnitude_type* c,
 
  209           type_map::magnitude_type* rowcnd,
 
  210           type_map::magnitude_type* colcnd,
 
  211           type_map::magnitude_type* amax,
 
  214       SLUMT::S::sgsequ(A, r, c, rowcnd, colcnd, amax, info);
 
  225     static void laqgs(SLUMT::SuperMatrix* A,
 
  226           type_map::magnitude_type* r,
 
  227           type_map::magnitude_type* c,
 
  228           type_map::magnitude_type rowcnd,
 
  229           type_map::magnitude_type colcnd,
 
  230           type_map::magnitude_type amax,
 
  231           SLUMT::equed_t* equed)
 
  233       SLUMT::S::slaqgs(A, r, c, rowcnd, colcnd, amax, equed);
 
  239   struct FunctionMap<Superlumt,double>
 
  241     typedef TypeMap<Superlumt,double> type_map;
 
  243     static void gssvx(SLUMT::superlumt_options_t* options, SLUMT::SuperMatrix* A,
 
  244           int* perm_c, 
int* perm_r, 
int* etree, SLUMT::equed_t* equed, 
double* R, 
double* C,
 
  245           SLUMT::SuperMatrix* L, SLUMT::SuperMatrix* U, 
void* work, 
int lwork,
 
  246           SLUMT::SuperMatrix* B, SLUMT::SuperMatrix* X, 
double* recip_pivot_growth,
 
  247           double* rcond, 
double* ferr, 
double* berr, SLUMT::superlu_memusage_t* mem_usage,
 
  248           SLUMT::Gstat_t* stat, 
int* info)
 
  250       options->etree = etree;
 
  251       options->perm_c = perm_c;
 
  252       options->perm_r = perm_r;
 
  254       options->work = work;
 
  255       options->lwork = lwork;
 
  257       SLUMT::D::pdgssvx(options->nprocs, options, A, perm_c, perm_r, 
 
  258       equed, R, C, L, U, B, X, recip_pivot_growth, rcond, ferr,
 
  259       berr, mem_usage, info);
 
  262     static void gstrs(SLUMT::trans_t trans, SLUMT::SuperMatrix* L,
 
  263           SLUMT::SuperMatrix* U, 
int* perm_r, 
int* perm_c,
 
  264           SLUMT::SuperMatrix* B, SLUMT::Gstat_t* Gstat, 
int* info)
 
  266       SLUMT::D::dgstrs(trans, L, U, perm_r, perm_c, B, Gstat, info);
 
  269     static void gstrf(SLUMT::superlumt_options_t* options, SLUMT::SuperMatrix* A,
 
  270           int* perm_r, SLUMT::SuperMatrix* L, SLUMT::SuperMatrix* U,
 
  271           SLUMT::Gstat_t* stat, 
int* info)
 
  273       SLUMT::D::pdgstrf(options, A, perm_r, L, U, stat, info);
 
  276     static void create_CompCol_Matrix(SLUMT::SuperMatrix* A, 
int m, 
int n, 
int nnz,
 
  277               type_map::type* nzval, 
int* rowind, 
int* colptr,
 
  278               SLUMT::Stype_t stype, SLUMT::Dtype_t dtype, SLUMT::Mtype_t mtype)
 
  280       SLUMT::D::dCreate_CompCol_Matrix(A, m, n, nnz, nzval, rowind, colptr,
 
  281                stype, dtype, mtype);
 
  284     static void create_Dense_Matrix(SLUMT::SuperMatrix* X, 
int m, 
int n,
 
  285             type_map::type* x, 
int ldx, SLUMT::Stype_t stype,
 
  286             SLUMT::Dtype_t dtype, SLUMT::Mtype_t mtype)
 
  288       SLUMT::D::dCreate_Dense_Matrix(X, m, n, x, ldx, stype, dtype, mtype);
 
  291     static void gsequ(SLUMT::SuperMatrix* A,
 
  292           type_map::magnitude_type* r,
 
  293           type_map::magnitude_type* c,
 
  294           type_map::magnitude_type* rowcnd,
 
  295           type_map::magnitude_type* colcnd,
 
  296           type_map::magnitude_type* amax,
 
  299       SLUMT::D::dgsequ(A, r, c, rowcnd, colcnd, amax, info);
 
  302     static void laqgs(SLUMT::SuperMatrix* A,
 
  303           type_map::magnitude_type* r,
 
  304           type_map::magnitude_type* c,
 
  305           type_map::magnitude_type rowcnd,
 
  306           type_map::magnitude_type colcnd,
 
  307           type_map::magnitude_type amax,
 
  308           SLUMT::equed_t* equed)
 
  310       SLUMT::D::dlaqgs(A, r, c, rowcnd, colcnd, amax, equed);
 
  315 #ifdef HAVE_TEUCHOS_COMPLEX 
  320   struct FunctionMap<Superlumt,SLUMT::C::complex>
 
  322     typedef TypeMap<Superlumt,SLUMT::C::complex> type_map;
 
  324     static void gssvx(SLUMT::superlumt_options_t* options, SLUMT::SuperMatrix* A,
 
  325           int* perm_c, 
int* perm_r, 
int* etree, SLUMT::equed_t* equed, 
float* R, 
float* C,
 
  326           SLUMT::SuperMatrix* L, SLUMT::SuperMatrix* U, 
void* work, 
int lwork,
 
  327           SLUMT::SuperMatrix* B, SLUMT::SuperMatrix* X, 
float* recip_pivot_growth,
 
  328           float* rcond, 
float* ferr, 
float* berr, SLUMT::superlu_memusage_t* mem_usage,
 
  329           SLUMT::Gstat_t* stat, 
int* info)
 
  331       options->etree = etree;
 
  332       options->perm_c = perm_c;
 
  333       options->perm_r = perm_r;
 
  335       options->work = work;
 
  336       options->lwork = lwork;
 
  338       SLUMT::C::pcgssvx(options->nprocs, options, A, perm_c, perm_r, 
 
  339       equed, R, C, L, U, B, X, recip_pivot_growth, rcond, ferr,
 
  340       berr, mem_usage, info);
 
  343     static void gstrs(SLUMT::trans_t trans, SLUMT::SuperMatrix* L,
 
  344           SLUMT::SuperMatrix* U, 
int* perm_r, 
int* perm_c,
 
  345           SLUMT::SuperMatrix* B, SLUMT::Gstat_t* Gstat, 
int* info)
 
  347       SLUMT::C::cgstrs(trans, L, U, perm_r, perm_c, B, Gstat, info);
 
  350     static void gstrf(SLUMT::superlumt_options_t* options, SLUMT::SuperMatrix* A,
 
  351           int* perm_r, SLUMT::SuperMatrix* L, SLUMT::SuperMatrix* U,
 
  352           SLUMT::Gstat_t* stat, 
int* info)
 
  354       SLUMT::C::pcgstrf(options, A, perm_r, L, U, stat, info);
 
  357     static void create_CompCol_Matrix(SLUMT::SuperMatrix* A, 
int m, 
int n, 
int nnz,
 
  358               type_map::type* nzval, 
int* rowind, 
int* colptr,
 
  359               SLUMT::Stype_t stype, SLUMT::Dtype_t dtype, SLUMT::Mtype_t mtype)
 
  361       SLUMT::C::cCreate_CompCol_Matrix(A, m, n, nnz, nzval, rowind, colptr,
 
  362                stype, dtype, mtype);
 
  365     static void create_Dense_Matrix(SLUMT::SuperMatrix* X, 
int m, 
int n,
 
  366             type_map::type* x, 
int ldx, SLUMT::Stype_t stype,
 
  367             SLUMT::Dtype_t dtype, SLUMT::Mtype_t mtype)
 
  369       SLUMT::C::cCreate_Dense_Matrix(X, m, n, x, ldx, stype, dtype, mtype);
 
  372     static void gsequ(SLUMT::SuperMatrix* A, 
float* r, 
float* c,
 
  373           float* rowcnd, 
float* colcnd, 
float* amax, 
int* info)
 
  375       SLUMT::C::cgsequ(A, r, c, rowcnd, colcnd, amax, info);
 
  378     static void laqgs(SLUMT::SuperMatrix* A, 
float* r, 
float* c, 
float rowcnd,
 
  379           float colcnd, 
float amax, SLUMT::equed_t* equed)
 
  381       SLUMT::C::claqgs(A, r, c, rowcnd, colcnd, amax, equed);
 
  387   struct FunctionMap<Superlumt,SLUMT::Z::doublecomplex>
 
  389     typedef TypeMap<Superlumt,SLUMT::Z::doublecomplex> type_map;
 
  391     static void gssvx(SLUMT::superlumt_options_t* options, SLUMT::SuperMatrix* A,
 
  392           int* perm_c, 
int* perm_r, 
int* etree, SLUMT::equed_t* equed, 
double* R, 
double* C,
 
  393           SLUMT::SuperMatrix* L, SLUMT::SuperMatrix* U, 
void* work, 
int lwork,
 
  394           SLUMT::SuperMatrix* B, SLUMT::SuperMatrix* X, 
double* recip_pivot_growth,
 
  395           double* rcond, 
double* ferr, 
double* berr, SLUMT::superlu_memusage_t* mem_usage,
 
  396           SLUMT::Gstat_t* stat, 
int* info)
 
  398       options->etree = etree;
 
  399       options->perm_c = perm_c;
 
  400       options->perm_r = perm_r;
 
  402       options->work = work;
 
  403       options->lwork = lwork;
 
  405       SLUMT::Z::pzgssvx(options->nprocs, options, A, perm_c, perm_r, 
 
  406       equed, R, C, L, U, B, X, recip_pivot_growth, rcond, ferr,
 
  407       berr, mem_usage, info);
 
  410     static void gstrs(SLUMT::trans_t trans, SLUMT::SuperMatrix* L,
 
  411           SLUMT::SuperMatrix* U, 
int* perm_r, 
int* perm_c,
 
  412           SLUMT::SuperMatrix* B, SLUMT::Gstat_t* Gstat, 
int* info)
 
  414       SLUMT::Z::zgstrs(trans, L, U, perm_r, perm_c, B, Gstat, info);
 
  417     static void gstrf(SLUMT::superlumt_options_t* options, SLUMT::SuperMatrix* A,
 
  418           int* perm_r, SLUMT::SuperMatrix* L, SLUMT::SuperMatrix* U,
 
  419           SLUMT::Gstat_t* stat, 
int* info)
 
  421       SLUMT::Z::pzgstrf(options, A, perm_r, L, U, stat, info);
 
  424     static void create_CompCol_Matrix(SLUMT::SuperMatrix* A, 
int m, 
int n, 
int nnz,
 
  425               type_map::type* nzval, 
int* rowind, 
int* colptr,
 
  426               SLUMT::Stype_t stype, SLUMT::Dtype_t dtype, SLUMT::Mtype_t mtype)
 
  428       SLUMT::Z::zCreate_CompCol_Matrix(A, m, n, nnz, nzval, rowind, colptr,
 
  429                stype, dtype, mtype);
 
  432     static void create_Dense_Matrix(SLUMT::SuperMatrix* X, 
int m, 
int n,
 
  433             type_map::type* x, 
int ldx, SLUMT::Stype_t stype,
 
  434             SLUMT::Dtype_t dtype, SLUMT::Mtype_t mtype)
 
  436       SLUMT::Z::zCreate_Dense_Matrix(X, m, n, x, ldx, stype, dtype, mtype);
 
  439     static void gsequ(SLUMT::SuperMatrix* A, 
double* r, 
double* c,
 
  440           double* rowcnd, 
double* colcnd, 
double* amax, 
int* info)
 
  442       SLUMT::Z::zgsequ(A, r, c, rowcnd, colcnd, amax, info);
 
  445     static void laqgs(SLUMT::SuperMatrix* A, 
double* r, 
double* c, 
double rowcnd,
 
  446           double colcnd, 
double amax, SLUMT::equed_t* equed)
 
  448       SLUMT::Z::zlaqgs(A, r, c, rowcnd, colcnd, amax, equed);
 
  451 #endif  // HAVE_TEUCHOS_COMPLEX 
  458 #endif  // AMESOS2_SUPERLUMT_FUNCTIONMAP_HPP 
Declaration of Function mapping class for Amesos2. 
 
Provides definition of SuperLU_MT types as well as conversions and type traits.