Amesos2 - Direct Sparse Solver Interfaces Version of the Day
Amesos2_Superlu_FunctionMap.hpp
Go to the documentation of this file.
00001 // @HEADER
00002 //
00003 // ***********************************************************************
00004 //
00005 //           Amesos2: Templated Direct Sparse Solver Package
00006 //                  Copyright 2011 Sandia Corporation
00007 //
00008 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00009 // the U.S. Government retains certain rights in this software.
00010 //
00011 // Redistribution and use in source and binary forms, with or without
00012 // modification, are permitted provided that the following conditions are
00013 // met:
00014 //
00015 // 1. Redistributions of source code must retain the above copyright
00016 // notice, this list of conditions and the following disclaimer.
00017 //
00018 // 2. Redistributions in binary form must reproduce the above copyright
00019 // notice, this list of conditions and the following disclaimer in the
00020 // documentation and/or other materials provided with the distribution.
00021 //
00022 // 3. Neither the name of the Corporation nor the names of the
00023 // contributors may be used to endorse or promote products derived from
00024 // this software without specific prior written permission.
00025 //
00026 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00027 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00028 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00029 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00030 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00031 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00032 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00033 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00034 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00035 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00036 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00037 //
00038 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
00039 //
00040 // ***********************************************************************
00041 //
00042 // @HEADER
00043 
00053 #ifndef AMESOS2_SUPERLU_FUNCTIONMAP_HPP
00054 #define AMESOS2_SUPERLU_FUNCTIONMAP_HPP
00055 
00056 #ifdef HAVE_TEUCHOS_COMPLEX
00057 #include <complex>
00058 #endif
00059 
00060 #include "Amesos2_FunctionMap.hpp"
00061 #include "Amesos2_Superlu_TypeMap.hpp"
00062 
00063 
00064 /* External definitions of the Superlu functions
00065  *
00066  * Note that we do include the "slu_*defs.h" files provided for each
00067  * data-type.  This produces linker warnings, but keeps us from
00068  * including SuperLU code in our own code (even if only extern
00069  * declarations, which would eliminate linker warnings).  This is
00070  * because there are several declarations (as of SuperLU 4.1) across
00071  * these headers which conflict with each other in C linkage.  All of
00072  * the conflicting functions, on the other hand, we do not care about.
00073  */
00074 namespace SLU {
00075 
00076   extern "C" {
00077     typedef int int_t;
00078 #include "supermatrix.h"
00079 #include "slu_util.h"
00080 
00081     namespace S {               // single-precision real definitions
00082       extern void
00083       sgssvx(SLU::superlu_options_t *, SLU::SuperMatrix *, int *, int *, int *,
00084              char *, float *, float *, SLU::SuperMatrix *, SLU::SuperMatrix *,
00085              void *, int, SLU::SuperMatrix *, SLU::SuperMatrix *,
00086              float *, float *, float *, float *,
00087              SLU::mem_usage_t *, SLU::SuperLUStat_t *, int *);
00088       extern void
00089       sgstrf (SLU::superlu_options_t*, SLU::SuperMatrix*,
00090               int, int, int*, void *, int, int *, int *,
00091               SLU::SuperMatrix *, SLU::SuperMatrix *, SLU::SuperLUStat_t*, int *);
00092       extern void
00093       sgsisx(SLU::superlu_options_t *, SLU::SuperMatrix *, int *, int *, int *,
00094              char *, float *, float *, SLU::SuperMatrix *, SLU::SuperMatrix *,
00095              void *, int, SLU::SuperMatrix *, SLU::SuperMatrix *,
00096              float *, float *, SLU::mem_usage_t *, SLU::SuperLUStat_t *, int *);
00097       extern void
00098       sgsitrf (SLU::superlu_options_t*, SLU::SuperMatrix*,
00099               int, int, int*, void *, int, int *, int *,
00100               SLU::SuperMatrix *, SLU::SuperMatrix *, SLU::SuperLUStat_t*, int *);
00101       extern void
00102       sCreate_CompCol_Matrix(SLU::SuperMatrix *, int, int, int, float *,
00103                              int *, int *, SLU::Stype_t, SLU::Dtype_t, SLU::Mtype_t);
00104       extern void
00105       sCreate_CompRow_Matrix(SLU::SuperMatrix *, int, int, int, float *,
00106                              int *, int *, SLU::Stype_t, SLU::Dtype_t, SLU::Mtype_t);
00107       extern void
00108       sCreate_Dense_Matrix(SLU::SuperMatrix *, int, int, float *, int,
00109                            SLU::Stype_t, SLU::Dtype_t, SLU::Mtype_t);
00110 
00111       extern void
00112       sgsequ (SLU::SuperMatrix *, float *, float *, float *,
00113         float *, float *, int *);
00114 
00115       extern void 
00116       slaqgs (SLU::SuperMatrix *, float *, float *, float,
00117               float, float, char *);
00118 
00119 //#include "slu_sdefs.h"
00120     }
00121 
00122     namespace D {               // double-precision real definitions
00123       extern void
00124       dgssvx(SLU::superlu_options_t *, SLU::SuperMatrix *, int *, int *, int *,
00125              char *, double *, double *, SLU::SuperMatrix *, SLU::SuperMatrix *,
00126              void *, int, SLU::SuperMatrix *, SLU::SuperMatrix *,
00127              double *, double *, double *, double *,
00128              SLU::mem_usage_t *, SLU::SuperLUStat_t *, int *);
00129       extern void
00130       dgstrf (SLU::superlu_options_t*, SLU::SuperMatrix*,
00131               int, int, int*, void *, int, int *, int *,
00132               SLU::SuperMatrix *, SLU::SuperMatrix *, SLU::SuperLUStat_t*, int *);
00133       extern void
00134       dgsisx(SLU::superlu_options_t *, SLU::SuperMatrix *, int *, int *, int *,
00135              char *, double *, double *, SLU::SuperMatrix *, SLU::SuperMatrix *,
00136              void *, int, SLU::SuperMatrix *, SLU::SuperMatrix *,
00137              double *, double *, SLU::mem_usage_t *, SLU::SuperLUStat_t *, int *);
00138       extern void
00139       dgsitrf (SLU::superlu_options_t*, SLU::SuperMatrix*,
00140               int, int, int*, void *, int, int *, int *,
00141               SLU::SuperMatrix *, SLU::SuperMatrix *, SLU::SuperLUStat_t*, int *);
00142       extern void
00143       dCreate_CompCol_Matrix(SLU::SuperMatrix *, int, int, int, double *,
00144                              int *, int *, SLU::Stype_t, SLU::Dtype_t, SLU::Mtype_t);
00145       extern void
00146       dCreate_CompRow_Matrix(SLU::SuperMatrix *, int, int, int, double *,
00147                              int *, int *, SLU::Stype_t, SLU::Dtype_t, SLU::Mtype_t);
00148       extern void
00149       dCreate_Dense_Matrix(SLU::SuperMatrix *, int, int, double *, int,
00150                            SLU::Stype_t, SLU::Dtype_t, SLU::Mtype_t);
00151 
00152       extern void
00153       dlaqgs (SLU::SuperMatrix *, double *, double *, double,
00154               double, double, char *);
00155 
00156       extern void
00157       dgsequ (SLU::SuperMatrix *, double *, double *, double *,
00158         double *, double *, int *);
00159 
00160 //#include "slu_ddefs.h"
00161     }
00162 
00163 #ifdef HAVE_TEUCHOS_COMPLEX
00164     namespace C {              // single-precision complex definitions
00165       extern void
00166       cgssvx(SLU::superlu_options_t *, SLU::SuperMatrix *, int *, int *, int *,
00167              char *, float *, float *, SLU::SuperMatrix *, SLU::SuperMatrix *,
00168              void *, int, SLU::SuperMatrix *, SLU::SuperMatrix *,
00169              float *, float *, float *, float *,
00170              SLU::mem_usage_t *, SLU::SuperLUStat_t *, int *);
00171       extern void
00172       cgstrf (SLU::superlu_options_t*, SLU::SuperMatrix*,
00173               int, int, int*, void *, int, int *, int *,
00174               SLU::SuperMatrix *, SLU::SuperMatrix *, SLU::SuperLUStat_t*, int *);
00175       extern void
00176       cgsisx(SLU::superlu_options_t *, SLU::SuperMatrix *, int *, int *, int *,
00177              char *, float *, float *, SLU::SuperMatrix *, SLU::SuperMatrix *,
00178              void *, int, SLU::SuperMatrix *, SLU::SuperMatrix *,
00179              float *, float *, SLU::mem_usage_t *, SLU::SuperLUStat_t *, int *);
00180       extern void
00181       cgsitrf (SLU::superlu_options_t*, SLU::SuperMatrix*,
00182               int, int, int*, void *, int, int *, int *,
00183               SLU::SuperMatrix *, SLU::SuperMatrix *, SLU::SuperLUStat_t*, int *);
00184       extern void
00185       cCreate_CompCol_Matrix(SLU::SuperMatrix *, int, int, int, complex *,
00186                              int *, int *, SLU::Stype_t, SLU::Dtype_t, SLU::Mtype_t);
00187       extern void
00188       cCreate_CompRow_Matrix(SLU::SuperMatrix *, int, int, int, complex *,
00189                              int *, int *, SLU::Stype_t, SLU::Dtype_t, SLU::Mtype_t);
00190       extern void
00191       cCreate_Dense_Matrix(SLU::SuperMatrix *, int, int, complex *, int,
00192                            SLU::Stype_t, SLU::Dtype_t, SLU::Mtype_t);
00193 
00194        extern void
00195        cgsequ (SLU::SuperMatrix *, float *, float *, float *,
00196                float *, float *, int *);
00197 
00198        extern void
00199        claqgs (SLU::SuperMatrix *, float *, float *, float,
00200                float, float, char *);
00201 
00202 //#include "slu_cdefs.h"
00203     }
00204 
00205     namespace Z {              // double-precision complex definitions
00206       extern void
00207       zgssvx(SLU::superlu_options_t *, SLU::SuperMatrix *, int *, int *, int *,
00208              char *, double *, double *, SLU::SuperMatrix *, SLU::SuperMatrix *,
00209              void *, int, SLU::SuperMatrix *, SLU::SuperMatrix *,
00210              double *, double *, double *, double *,
00211              SLU::mem_usage_t *, SLU::SuperLUStat_t *, int *);
00212       extern void
00213       zgstrf (SLU::superlu_options_t*, SLU::SuperMatrix*,
00214               int, int, int*, void *, int, int *, int *,
00215               SLU::SuperMatrix *, SLU::SuperMatrix *, SLU::SuperLUStat_t*, int *);
00216       extern void
00217       zgsisx(SLU::superlu_options_t *, SLU::SuperMatrix *, int *, int *, int *,
00218              char *, double *, double *, SLU::SuperMatrix *, SLU::SuperMatrix *,
00219              void *, int, SLU::SuperMatrix *, SLU::SuperMatrix *,
00220              double *, double *, SLU::mem_usage_t *, SLU::SuperLUStat_t *, int *);
00221       extern void
00222       zgsitrf (SLU::superlu_options_t*, SLU::SuperMatrix*,
00223               int, int, int*, void *, int, int *, int *,
00224               SLU::SuperMatrix *, SLU::SuperMatrix *, SLU::SuperLUStat_t*, int *);
00225       extern void
00226       zCreate_CompCol_Matrix(SLU::SuperMatrix *, int, int, int, doublecomplex *,
00227                              int *, int *, SLU::Stype_t, SLU::Dtype_t, SLU::Mtype_t);
00228       extern void
00229       zCreate_CompRow_Matrix(SLU::SuperMatrix *, int, int, int, doublecomplex *,
00230                              int *, int *, SLU::Stype_t, SLU::Dtype_t, SLU::Mtype_t);
00231       extern void
00232       zCreate_Dense_Matrix(SLU::SuperMatrix *, int, int, doublecomplex *, int,
00233                            SLU::Stype_t, SLU::Dtype_t, SLU::Mtype_t);
00234 
00235       extern void
00236       zgsequ (SLU::SuperMatrix *, double *, double *, double *,
00237               double *, double *, int *);
00238 
00239       extern void
00240       zlaqgs (SLU::SuperMatrix *, double *, double *, double,
00241               double, double, char *);
00242 
00243 //#include "slu_zdefs.h"
00244     }
00245 #endif  // HAVE_TEUCHOS_COMPLEX
00246 
00247   } // end extern "C"
00248 
00249 } // end namespace SLU
00250 
00251 
00252 namespace Amesos2 {
00253 
00254   /* ==================== Specializations ====================
00255    *
00256    * \cond Superlu_function_specializations
00257    */
00258 
00282   template <>
00283   struct FunctionMap<Superlu,float>
00284   {
00285     typedef TypeMap<Superlu,float> type_map;
00286 
00290     static void gssvx(SLU::superlu_options_t* options, SLU::SuperMatrix* A,
00291           int* perm_c, int* perm_r, int* etree, char* equed, float* R, float* C,
00292           SLU::SuperMatrix* L, SLU::SuperMatrix* U, void* work, int lwork,
00293           SLU::SuperMatrix* B, SLU::SuperMatrix* X, float* recip_pivot_growth,
00294           float* rcond, float* ferr, float* berr, SLU::mem_usage_t* mem_usage,
00295           SLU::SuperLUStat_t* stat, int* info)
00296     {
00297       SLU::S::sgssvx(options, A, perm_c, perm_r, etree, equed, R, C, L, U, work,
00298          lwork, B, X, recip_pivot_growth, rcond, ferr, berr, mem_usage, stat, info);
00299     }
00300 
00301     static void gsisx(SLU::superlu_options_t* options, SLU::SuperMatrix* A,
00302           int* perm_c, int* perm_r, int* etree, char* equed, float* R, float* C,
00303           SLU::SuperMatrix* L, SLU::SuperMatrix* U, void* work, int lwork,
00304           SLU::SuperMatrix* B, SLU::SuperMatrix* X, float* recip_pivot_growth,
00305           float* rcond, SLU::mem_usage_t* mem_usage,
00306           SLU::SuperLUStat_t* stat, int* info)
00307     {
00308       SLU::S::sgsisx(options, A, perm_c, perm_r, etree, equed, R, C, L, U, work,
00309          lwork, B, X, recip_pivot_growth, rcond, mem_usage, stat, info);
00310     }
00311 
00331     static void gstrf(SLU::superlu_options_t* options, SLU::SuperMatrix* AC,
00332           int relax, int panel_size, int* etree, void* work,
00333           int lwork, int* perm_c, int* perm_r, SLU::SuperMatrix* L,
00334           SLU::SuperMatrix* U, SLU::SuperLUStat_t* stat, int* info)
00335     {
00336       SLU::S::sgstrf(options, AC, relax, panel_size, etree,
00337          work, lwork, perm_c, perm_r, L, U, stat, info);
00338     }
00339 
00340     static void gsitrf(SLU::superlu_options_t* options, SLU::SuperMatrix* AC,
00341           int relax, int panel_size, int* etree, void* work,
00342           int lwork, int* perm_c, int* perm_r, SLU::SuperMatrix* L,
00343           SLU::SuperMatrix* U, SLU::SuperLUStat_t* stat, int* info)
00344     {
00345       SLU::S::sgsitrf(options, AC, relax, panel_size, etree,
00346           work, lwork, perm_c, perm_r, L, U, stat, info);
00347     }
00348 
00352     static void create_CompCol_Matrix(SLU::SuperMatrix* A, int m, int n, 
00353               int nnz, type_map::type* nzval, int* rowind, int* colptr, 
00354               SLU::Stype_t stype, SLU::Dtype_t dtype, SLU::Mtype_t mtype)
00355     {
00356       SLU::S::sCreate_CompCol_Matrix(A, m, n, nnz, nzval, rowind, colptr,
00357              stype, dtype, mtype);
00358     }
00359 
00363     static void create_CompRow_Matrix(SLU::SuperMatrix* A, int m, int n, 
00364               int nnz, type_map::type* nzval, int* rowind, int* colptr,
00365               SLU::Stype_t stype, SLU::Dtype_t dtype, SLU::Mtype_t mtype)
00366     {
00367       SLU::S::sCreate_CompRow_Matrix(A, m, n, nnz, nzval, rowind, colptr,
00368              stype, dtype, mtype);
00369     }
00370 
00371 
00380     static void create_Dense_Matrix(SLU::SuperMatrix* X, int m, int n,
00381             type_map::type* x, int ldx, SLU::Stype_t stype,
00382             SLU::Dtype_t dtype, SLU::Mtype_t mtype)
00383     {
00384       SLU::S::sCreate_Dense_Matrix(X, m, n, x, ldx, stype, dtype, mtype);
00385     }
00386 
00390     static void gsequ(SLU::SuperMatrix* A, float* R, float* C,
00391           float* rowcnd, float* colcnd, float* amax, int* info)
00392     {
00393       SLU::S::sgsequ(A, R, C, rowcnd, colcnd, amax, info);
00394     }
00395 
00410     static void laqgs(SLU::SuperMatrix* A, float* R, float* C,
00411           float rowcnd, float colcnd, float amax, char* equed)
00412     {
00413       SLU::S::slaqgs(A, R, C, rowcnd, colcnd, amax, equed);
00414     }
00415   };
00416 
00417 
00418   template <>
00419   struct FunctionMap<Superlu,double>
00420   {
00421     typedef TypeMap<Superlu,double> type_map;
00422 
00423     static void gssvx(SLU::superlu_options_t* options, SLU::SuperMatrix* A,
00424           int* perm_c, int* perm_r, int* etree, char* equed, double* R, double* C,
00425           SLU::SuperMatrix* L, SLU::SuperMatrix* U, void* work, int lwork,
00426           SLU::SuperMatrix* B, SLU::SuperMatrix* X, double* recip_pivot_growth,
00427           double* rcond, double* ferr, double* berr, SLU::mem_usage_t* mem_usage,
00428           SLU::SuperLUStat_t* stat, int* info)
00429     {
00430       SLU::D::dgssvx(options, A, perm_c, perm_r, etree, equed, R, C, L, U, work,
00431          lwork, B, X, recip_pivot_growth, rcond, ferr, berr, mem_usage, stat, info);
00432     }
00433 
00434     static void gstrf(SLU::superlu_options_t* options, SLU::SuperMatrix* AC,
00435           int relax, int panel_size, int* etree, void* work, int lwork, int* perm_c,
00436           int* perm_r, SLU::SuperMatrix* L, SLU::SuperMatrix* U,
00437           SLU::SuperLUStat_t* stat, int* info)
00438     {
00439       SLU::D::dgstrf(options, AC, relax, panel_size, etree,
00440          work, lwork, perm_c, perm_r, L, U, stat, info);
00441     }
00442 
00443     static void gsisx(SLU::superlu_options_t* options, SLU::SuperMatrix* A,
00444           int* perm_c, int* perm_r, int* etree, char* equed, double* R, double* C,
00445           SLU::SuperMatrix* L, SLU::SuperMatrix* U, void* work, int lwork,
00446           SLU::SuperMatrix* B, SLU::SuperMatrix* X, double* recip_pivot_growth,
00447           double* rcond, SLU::mem_usage_t* mem_usage,
00448           SLU::SuperLUStat_t* stat, int* info)
00449     {
00450       SLU::D::dgsisx(options, A, perm_c, perm_r, etree, equed, R, C, L, U, work,
00451          lwork, B, X, recip_pivot_growth, rcond, mem_usage, stat, info);
00452     }
00453 
00454     static void gsitrf(SLU::superlu_options_t* options, SLU::SuperMatrix* AC,
00455            int relax, int panel_size, int* etree, void* work, int lwork, int* perm_c,
00456            int* perm_r, SLU::SuperMatrix* L, SLU::SuperMatrix* U,
00457            SLU::SuperLUStat_t* stat, int* info)
00458     {
00459       SLU::D::dgsitrf(options, AC, relax, panel_size, etree,
00460           work, lwork, perm_c, perm_r, L, U, stat, info);
00461     }
00462 
00463     static void create_CompCol_Matrix(SLU::SuperMatrix* A, int m, int n, 
00464               int nnz, type_map::type* nzval, int* rowind, int* colptr, 
00465               SLU::Stype_t stype, SLU::Dtype_t dtype, SLU::Mtype_t mtype)
00466     {
00467       SLU::D::dCreate_CompCol_Matrix(A, m, n, nnz, nzval, rowind, colptr,
00468              stype, dtype, mtype);
00469     }
00470 
00471     static void create_CompRow_Matrix(SLU::SuperMatrix* A, int m, int n, 
00472               int nnz, type_map::type* nzval, int* rowind, int* colptr, 
00473               SLU::Stype_t stype, SLU::Dtype_t dtype, SLU::Mtype_t mtype)
00474     {
00475       SLU::D::dCreate_CompRow_Matrix(A, m, n, nnz, nzval, rowind, colptr,
00476              stype, dtype, mtype);
00477     }
00478 
00479     static void create_Dense_Matrix(SLU::SuperMatrix* X, int m, 
00480             int n, type_map::type* x, int ldx, SLU::Stype_t stype, 
00481             SLU::Dtype_t dtype, SLU::Mtype_t mtype)
00482     {
00483       SLU::D::dCreate_Dense_Matrix(X, m, n, x, ldx, stype, dtype, mtype);
00484     }
00485 
00486     static void gsequ(SLU::SuperMatrix* A, double* R, double* C,
00487           double* rowcnd, double* colcnd, double* amax, int* info)
00488     {
00489       SLU::D::dgsequ(A, R, C, rowcnd, colcnd, amax, info);
00490     }
00491 
00492     static void laqgs(SLU::SuperMatrix* A, double* R, double* C,
00493           double rowcnd, double colcnd, double amax, char* equed)
00494     {
00495       SLU::D::dlaqgs(A, R, C, rowcnd, colcnd, amax, equed);
00496     }
00497 
00498   };
00499 
00500 
00501 #ifdef HAVE_TEUCHOS_COMPLEX
00502 
00503   /* The specializations for Teuchos::as<> for SLU::complex and
00504    * SLU::doublecomplex are provided in Amesos2_Superlu_Type.hpp
00505    */
00506   template <>
00507   struct FunctionMap<Superlu,SLU::C::complex>
00508   {
00509     static void gssvx(SLU::superlu_options_t* options, SLU::SuperMatrix* A,
00510           int* perm_c, int* perm_r, int* etree, char* equed, float* R, float* C,
00511           SLU::SuperMatrix* L, SLU::SuperMatrix* U, void* work, int lwork,
00512           SLU::SuperMatrix* B, SLU::SuperMatrix* X, float* recip_pivot_growth,
00513           float* rcond, float* ferr, float* berr, SLU::mem_usage_t* mem_usage,
00514           SLU::SuperLUStat_t* stat, int* info)
00515     {
00516       SLU::C::cgssvx(options, A, perm_c, perm_r, etree, equed, R, C, L, U, work,
00517          lwork, B, X, recip_pivot_growth, rcond, ferr, berr, mem_usage, stat, info);
00518     }
00519 
00520     static void gstrf(SLU::superlu_options_t* options, SLU::SuperMatrix* AC,
00521           int relax, int panel_size, int* etree, void* work, int lwork, int* perm_c,
00522           int* perm_r, SLU::SuperMatrix* L, SLU::SuperMatrix* U,
00523           SLU::SuperLUStat_t* stat, int* info)
00524     {
00525       SLU::C::cgstrf(options, AC, relax, panel_size, etree,
00526          work, lwork, perm_c, perm_r, L, U, stat, info);
00527     }
00528 
00529     static void gsisx(SLU::superlu_options_t* options, SLU::SuperMatrix* A,
00530           int* perm_c, int* perm_r, int* etree, char* equed, float* R, float* C,
00531           SLU::SuperMatrix* L, SLU::SuperMatrix* U, void* work, int lwork,
00532           SLU::SuperMatrix* B, SLU::SuperMatrix* X, float* recip_pivot_growth,
00533           float* rcond, SLU::mem_usage_t* mem_usage,
00534           SLU::SuperLUStat_t* stat, int* info)
00535     {
00536       SLU::C::cgsisx(options, A, perm_c, perm_r, etree, equed, R, C, L, U, work,
00537          lwork, B, X, recip_pivot_growth, rcond, mem_usage, stat, info);
00538     }
00539 
00540     static void gsitrf(SLU::superlu_options_t* options, SLU::SuperMatrix* AC,
00541            int relax, int panel_size, int* etree, void* work, int lwork, int* perm_c,
00542            int* perm_r, SLU::SuperMatrix* L, SLU::SuperMatrix* U,
00543            SLU::SuperLUStat_t* stat, int* info)
00544     {
00545       SLU::C::cgsitrf(options, AC, relax, panel_size, etree,
00546           work, lwork, perm_c, perm_r, L, U, stat, info);
00547     }
00548 
00549     static void create_CompCol_Matrix(SLU::SuperMatrix* A, int m, int n, int nnz,
00550               SLU::C::complex* nzval, int* rowind, int* colptr,
00551               SLU::Stype_t stype, SLU::Dtype_t dtype, SLU::Mtype_t mtype)
00552     {
00553       SLU::C::cCreate_CompCol_Matrix(A, m, n, nnz, nzval, rowind, colptr,
00554              stype, dtype, mtype);
00555     }
00556 
00557     static void create_CompRow_Matrix(SLU::SuperMatrix* A, int m, int n, int nnz,
00558               SLU::C::complex* nzval, int* rowind, int* colptr,
00559               SLU::Stype_t stype, SLU::Dtype_t dtype, SLU::Mtype_t mtype)
00560     {
00561       SLU::C::cCreate_CompRow_Matrix(A, m, n, nnz, nzval, rowind, colptr,
00562              stype, dtype, mtype);
00563     }
00564 
00565     static void create_Dense_Matrix(SLU::SuperMatrix* X, int m, int n,
00566             SLU::C::complex* x, int ldx, SLU::Stype_t stype,
00567             SLU::Dtype_t dtype, SLU::Mtype_t mtype)
00568     {
00569       SLU::C::cCreate_Dense_Matrix(X, m, n, x, ldx, stype, dtype, mtype);
00570     }
00571 
00572     static void gsequ(SLU::SuperMatrix* A, float* R, float* C,
00573           float* rowcnd, float* colcnd, float* amax, int* info)
00574     {
00575       SLU::C::cgsequ(A, R, C, rowcnd, colcnd, amax, info);
00576     }
00577 
00578     static void laqgs(SLU::SuperMatrix* A, float* R, float* C,
00579           float rowcnd, float colcnd, float amax, char* equed)
00580     {
00581       SLU::C::claqgs(A, R, C, rowcnd, colcnd, amax, equed);
00582     }
00583   };
00584 
00585 
00586   template <>
00587   struct FunctionMap<Superlu,SLU::Z::doublecomplex>
00588   {
00589     static void gssvx(SLU::superlu_options_t* options, SLU::SuperMatrix* A,
00590           int* perm_c, int* perm_r, int* etree, char* equed, double* R, double* C,
00591           SLU::SuperMatrix* L, SLU::SuperMatrix* U, void* work, int lwork,
00592           SLU::SuperMatrix* B, SLU::SuperMatrix* X, double* recip_pivot_growth,
00593           double* rcond, double* ferr, double* berr, SLU::mem_usage_t* mem_usage,
00594           SLU::SuperLUStat_t* stat, int* info)
00595     {
00596       SLU::Z::zgssvx(options, A, perm_c, perm_r, etree, equed, R, C, L, U, work,
00597          lwork, B, X, recip_pivot_growth, rcond, ferr, berr, mem_usage, stat, info);
00598     }
00599 
00600     static void gstrf(SLU::superlu_options_t* options, SLU::SuperMatrix* AC,
00601           int relax, int panel_size, int* etree, void* work, int lwork, int* perm_c,
00602           int* perm_r, SLU::SuperMatrix* L, SLU::SuperMatrix* U,
00603           SLU::SuperLUStat_t* stat, int* info)
00604     {
00605       SLU::Z::zgstrf(options, AC, relax, panel_size, etree,
00606          work, lwork, perm_c, perm_r, L, U, stat, info);
00607     }
00608 
00609     static void gsisx(SLU::superlu_options_t* options, SLU::SuperMatrix* A,
00610           int* perm_c, int* perm_r, int* etree, char* equed, double* R, double* C,
00611           SLU::SuperMatrix* L, SLU::SuperMatrix* U, void* work, int lwork,
00612           SLU::SuperMatrix* B, SLU::SuperMatrix* X, double* recip_pivot_growth,
00613           double* rcond, SLU::mem_usage_t* mem_usage,
00614           SLU::SuperLUStat_t* stat, int* info)
00615     {
00616       SLU::Z::zgsisx(options, A, perm_c, perm_r, etree, equed, R, C, L, U, work,
00617          lwork, B, X, recip_pivot_growth, rcond, mem_usage, stat, info);
00618     }
00619 
00620     static void gsitrf(SLU::superlu_options_t* options, SLU::SuperMatrix* AC,
00621            int relax, int panel_size, int* etree, void* work, int lwork, int* perm_c,
00622            int* perm_r, SLU::SuperMatrix* L, SLU::SuperMatrix* U,
00623            SLU::SuperLUStat_t* stat, int* info)
00624     {
00625       SLU::Z::zgsitrf(options, AC, relax, panel_size, etree,
00626           work, lwork, perm_c, perm_r, L, U, stat, info);
00627     }
00628 
00629     static void create_CompCol_Matrix(SLU::SuperMatrix* A, int m, int n, int nnz,
00630               SLU::Z::doublecomplex* nzval, int* rowind, int* colptr,
00631               SLU::Stype_t stype, SLU::Dtype_t dtype, SLU::Mtype_t mtype)
00632     {
00633       SLU::Z::zCreate_CompCol_Matrix(A, m, n, nnz, nzval, rowind, colptr,
00634              stype, dtype, mtype);
00635 
00636       TEUCHOS_TEST_FOR_EXCEPTION( A == NULL,
00637         std::runtime_error,
00638         "Supermatrix A not initialized properly!");
00639     }
00640 
00641 
00642     static void create_CompRow_Matrix(SLU::SuperMatrix* A, int m, int n, int nnz,
00643               SLU::Z::doublecomplex* nzval, int* rowind, int* colptr,
00644               SLU::Stype_t stype, SLU::Dtype_t dtype, SLU::Mtype_t mtype)
00645     {
00646       SLU::Z::zCreate_CompRow_Matrix(A, m, n, nnz, nzval, rowind, colptr,
00647              stype, dtype, mtype);
00648 
00649       TEUCHOS_TEST_FOR_EXCEPTION( A == NULL,
00650         std::runtime_error,
00651         "Supermatrix A not initialized properly!");
00652     }
00653 
00654     static void create_Dense_Matrix(SLU::SuperMatrix* X, int m, int n,
00655             SLU::Z::doublecomplex* x, int ldx, SLU::Stype_t stype,
00656             SLU::Dtype_t dtype, SLU::Mtype_t mtype)
00657     {
00658       SLU::Z::zCreate_Dense_Matrix(X, m, n, x, ldx, stype, dtype, mtype);
00659     }
00660 
00661     static void gsequ(SLU::SuperMatrix* A, double* R, double* C,
00662           double* rowcnd, double* colcnd, double* amax, int* info)
00663     {
00664       SLU::Z::zgsequ(A, R, C, rowcnd, colcnd, amax, info);
00665     }
00666 
00667     static void laqgs(SLU::SuperMatrix* A, double* R, double* C,
00668           double rowcnd, double colcnd, double amax, char* equed)
00669     {
00670       SLU::Z::zlaqgs(A, R, C, rowcnd, colcnd, amax, equed);
00671     }
00672   };
00673 #endif  // HAVE_TEUCHOS_COMPLEX
00674 
00675   /* \endcond Superlu_function_specializations */
00676 
00677 
00678 } // end namespace Amesos2
00679 
00680 #endif  // AMESOS2_SUPERLU_FUNCTIONMAP_HPP