53 #ifndef AMESOS2_SUPERLU_FUNCTIONMAP_HPP 54 #define AMESOS2_SUPERLU_FUNCTIONMAP_HPP 56 #ifdef HAVE_TEUCHOS_COMPLEX 78 #include "supermatrix.h" 80 #include "superlu_enum_consts.h" 97 #ifdef HAVE_AMESOS2_SUPERLU5_API 114 ExpHeader *expanders;
120 sCompRow_to_CompCol(
int,
int,
int,
float*,
int*,
int*,
121 float **,
int **,
int **);
123 sgssvx(SLU::superlu_options_t *, SLU::SuperMatrix *,
int *,
int *,
int *,
124 char *,
float *,
float *, SLU::SuperMatrix *, SLU::SuperMatrix *,
125 void *,
int, SLU::SuperMatrix *, SLU::SuperMatrix *,
126 float *,
float *,
float *,
float *,
127 #ifdef HAVE_AMESOS2_SUPERLU5_API
130 SLU::mem_usage_t *, SLU::SuperLUStat_t *,
int *);
132 sgstrf (SLU::superlu_options_t*, SLU::SuperMatrix*,
133 int,
int,
int*,
void *,
int,
int *,
int *,
134 SLU::SuperMatrix *, SLU::SuperMatrix *,
135 #ifdef HAVE_AMESOS2_SUPERLU5_API
138 SLU::SuperLUStat_t*,
int *);
140 sgsisx(SLU::superlu_options_t *, SLU::SuperMatrix *,
int *,
int *,
int *,
141 char *,
float *,
float *, SLU::SuperMatrix *, SLU::SuperMatrix *,
142 void *,
int, SLU::SuperMatrix *, SLU::SuperMatrix *,
144 #ifdef HAVE_AMESOS2_SUPERLU5_API
147 SLU::mem_usage_t *, SLU::SuperLUStat_t *,
int *);
149 sgsitrf (SLU::superlu_options_t*, SLU::SuperMatrix*,
150 int,
int,
int*,
void *,
int,
int *,
int *,
151 SLU::SuperMatrix *, SLU::SuperMatrix *,
152 #ifdef HAVE_AMESOS2_SUPERLU5_API
155 SLU::SuperLUStat_t*,
int *);
157 sCreate_CompCol_Matrix(SLU::SuperMatrix *,
int,
int,
int,
float *,
158 int *,
int *, SLU::Stype_t, SLU::Dtype_t, SLU::Mtype_t);
160 sCreate_CompRow_Matrix(SLU::SuperMatrix *,
int,
int,
int,
float *,
161 int *,
int *, SLU::Stype_t, SLU::Dtype_t, SLU::Mtype_t);
163 sCreate_Dense_Matrix(SLU::SuperMatrix *,
int,
int,
float *,
int,
164 SLU::Stype_t, SLU::Dtype_t, SLU::Mtype_t);
167 sgsequ (SLU::SuperMatrix *,
float *,
float *,
float *,
168 float *,
float *,
int *);
171 slaqgs (SLU::SuperMatrix *,
float *,
float *,
float,
172 float,
float,
char *);
179 #ifdef HAVE_AMESOS2_SUPERLU5_API 196 ExpHeader *expanders;
202 dCompRow_to_CompCol(
int,
int,
int,
double*,
int*,
int*,
203 double **,
int **,
int **);
205 dgssvx(SLU::superlu_options_t *, SLU::SuperMatrix *,
int *,
int *,
int *,
206 char *,
double *,
double *, SLU::SuperMatrix *, SLU::SuperMatrix *,
207 void *,
int, SLU::SuperMatrix *, SLU::SuperMatrix *,
208 double *,
double *,
double *,
double *,
209 #ifdef HAVE_AMESOS2_SUPERLU5_API
212 SLU::mem_usage_t *, SLU::SuperLUStat_t *,
int *);
214 dgstrf (SLU::superlu_options_t*, SLU::SuperMatrix*,
215 int,
int,
int*,
void *,
int,
int *,
int *,
216 SLU::SuperMatrix *, SLU::SuperMatrix *,
217 #ifdef HAVE_AMESOS2_SUPERLU5_API
220 SLU::SuperLUStat_t*,
int *);
222 dgsisx(SLU::superlu_options_t *, SLU::SuperMatrix *,
int *,
int *,
int *,
223 char *,
double *,
double *, SLU::SuperMatrix *, SLU::SuperMatrix *,
224 void *,
int, SLU::SuperMatrix *, SLU::SuperMatrix *,
226 #ifdef HAVE_AMESOS2_SUPERLU5_API
229 SLU::mem_usage_t *, SLU::SuperLUStat_t *,
int *);
231 dgsitrf (SLU::superlu_options_t*, SLU::SuperMatrix*,
232 int,
int,
int*,
void *,
int,
int *,
int *,
233 SLU::SuperMatrix *, SLU::SuperMatrix *,
234 #ifdef HAVE_AMESOS2_SUPERLU5_API
237 SLU::SuperLUStat_t*,
int *);
239 dCreate_CompCol_Matrix(SLU::SuperMatrix *,
int,
int,
int,
double *,
240 int *,
int *, SLU::Stype_t, SLU::Dtype_t, SLU::Mtype_t);
242 dCreate_CompRow_Matrix(SLU::SuperMatrix *,
int,
int,
int,
double *,
243 int *,
int *, SLU::Stype_t, SLU::Dtype_t, SLU::Mtype_t);
245 dCreate_Dense_Matrix(SLU::SuperMatrix *,
int,
int,
double *,
int,
246 SLU::Stype_t, SLU::Dtype_t, SLU::Mtype_t);
249 dlaqgs (SLU::SuperMatrix *,
double *,
double *,
double,
250 double,
double,
char *);
253 dgsequ (SLU::SuperMatrix *,
double *,
double *,
double *,
254 double *,
double *,
int *);
259 #ifdef HAVE_TEUCHOS_COMPLEX 262 #ifdef HAVE_AMESOS2_SUPERLU5_API 279 ExpHeader *expanders;
285 cCompRow_to_CompCol(
int,
int,
int, complex*,
int*,
int*,
286 complex **,
int **,
int **);
288 cgssvx(SLU::superlu_options_t *, SLU::SuperMatrix *,
int *,
int *,
int *,
289 char *,
float *,
float *, SLU::SuperMatrix *, SLU::SuperMatrix *,
290 void *,
int, SLU::SuperMatrix *, SLU::SuperMatrix *,
291 float *,
float *,
float *,
float *,
292 #ifdef HAVE_AMESOS2_SUPERLU5_API
295 SLU::mem_usage_t *, SLU::SuperLUStat_t *,
int *);
297 cgstrf (SLU::superlu_options_t*, SLU::SuperMatrix*,
298 int,
int,
int*,
void *,
int,
int *,
int *,
299 SLU::SuperMatrix *, SLU::SuperMatrix *,
300 #ifdef HAVE_AMESOS2_SUPERLU5_API
303 SLU::SuperLUStat_t*,
int *);
305 cgsisx(SLU::superlu_options_t *, SLU::SuperMatrix *,
int *,
int *,
int *,
306 char *,
float *,
float *, SLU::SuperMatrix *, SLU::SuperMatrix *,
307 void *,
int, SLU::SuperMatrix *, SLU::SuperMatrix *,
309 #ifdef HAVE_AMESOS2_SUPERLU5_API
312 SLU::mem_usage_t *, SLU::SuperLUStat_t *,
int *);
314 cgsitrf (SLU::superlu_options_t*, SLU::SuperMatrix*,
315 int,
int,
int*,
void *,
int,
int *,
int *,
316 SLU::SuperMatrix *, SLU::SuperMatrix *,
317 #ifdef HAVE_AMESOS2_SUPERLU5_API
320 SLU::SuperLUStat_t*,
int *);
322 cCreate_CompCol_Matrix(SLU::SuperMatrix *,
int,
int,
int, complex *,
323 int *,
int *, SLU::Stype_t, SLU::Dtype_t, SLU::Mtype_t);
325 cCreate_CompRow_Matrix(SLU::SuperMatrix *,
int,
int,
int, complex *,
326 int *,
int *, SLU::Stype_t, SLU::Dtype_t, SLU::Mtype_t);
328 cCreate_Dense_Matrix(SLU::SuperMatrix *,
int,
int, complex *,
int,
329 SLU::Stype_t, SLU::Dtype_t, SLU::Mtype_t);
332 cgsequ (SLU::SuperMatrix *,
float *,
float *,
float *,
333 float *,
float *,
int *);
336 claqgs (SLU::SuperMatrix *,
float *,
float *,
float,
337 float,
float,
char *);
344 #ifdef HAVE_AMESOS2_SUPERLU5_API 350 doublecomplex *lusup;
361 ExpHeader *expanders;
367 zCompRow_to_CompCol(
int,
int,
int, doublecomplex*,
int*,
int*,
368 doublecomplex **,
int **,
int **);
370 zgssvx(SLU::superlu_options_t *, SLU::SuperMatrix *,
int *,
int *,
int *,
371 char *,
double *,
double *, SLU::SuperMatrix *, SLU::SuperMatrix *,
372 void *,
int, SLU::SuperMatrix *, SLU::SuperMatrix *,
373 double *,
double *,
double *,
double *,
374 #ifdef HAVE_AMESOS2_SUPERLU5_API
377 SLU::mem_usage_t *, SLU::SuperLUStat_t *,
int *);
379 zgstrf (SLU::superlu_options_t*, SLU::SuperMatrix*,
380 int,
int,
int*,
void *,
int,
int *,
int *,
381 SLU::SuperMatrix *, SLU::SuperMatrix *,
382 #ifdef HAVE_AMESOS2_SUPERLU5_API
385 SLU::SuperLUStat_t*,
int *);
387 zgsisx(SLU::superlu_options_t *, SLU::SuperMatrix *,
int *,
int *,
int *,
388 char *,
double *,
double *, SLU::SuperMatrix *, SLU::SuperMatrix *,
389 void *,
int, SLU::SuperMatrix *, SLU::SuperMatrix *,
391 #ifdef HAVE_AMESOS2_SUPERLU5_API
394 SLU::mem_usage_t *, SLU::SuperLUStat_t *,
int *);
396 zgsitrf (SLU::superlu_options_t*, SLU::SuperMatrix*,
397 int,
int,
int*,
void *,
int,
int *,
int *,
398 SLU::SuperMatrix *, SLU::SuperMatrix *,
399 #ifdef HAVE_AMESOS2_SUPERLU5_API
402 SLU::SuperLUStat_t*,
int *);
404 zCreate_CompCol_Matrix(SLU::SuperMatrix *,
int,
int,
int, doublecomplex *,
405 int *,
int *, SLU::Stype_t, SLU::Dtype_t, SLU::Mtype_t);
407 zCreate_CompRow_Matrix(SLU::SuperMatrix *,
int,
int,
int, doublecomplex *,
408 int *,
int *, SLU::Stype_t, SLU::Dtype_t, SLU::Mtype_t);
410 zCreate_Dense_Matrix(SLU::SuperMatrix *,
int,
int, doublecomplex *,
int,
411 SLU::Stype_t, SLU::Dtype_t, SLU::Mtype_t);
414 zgsequ (SLU::SuperMatrix *,
double *,
double *,
double *,
415 double *,
double *,
int *);
418 zlaqgs (SLU::SuperMatrix *,
double *,
double *,
double,
419 double,
double,
char *);
423 #endif // HAVE_TEUCHOS_COMPLEX 461 struct FunctionMap<Superlu,float>
463 typedef TypeMap<Superlu,float> type_map;
465 #ifdef HAVE_AMESOS2_SUPERLU5_API 466 typedef typename SLU::S::GlobalLU_t GlobalLU_type;
472 static void gssvx(SLU::superlu_options_t* options, SLU::SuperMatrix* A,
473 int* perm_c,
int* perm_r,
int* etree,
char* equed,
float* R,
float* C,
474 SLU::SuperMatrix* L, SLU::SuperMatrix* U,
void* work,
int lwork,
475 SLU::SuperMatrix* B, SLU::SuperMatrix* X,
float* recip_pivot_growth,
476 float* rcond,
float* ferr,
float* berr,
477 #ifdef HAVE_AMESOS2_SUPERLU5_API
480 SLU::mem_usage_t* mem_usage,
481 SLU::SuperLUStat_t* stat,
int* info)
483 SLU::S::sgssvx(options, A, perm_c, perm_r, etree, equed, R, C, L, U, work,
484 lwork, B, X, recip_pivot_growth, rcond, ferr, berr,
485 #ifdef HAVE_AMESOS2_SUPERLU5_API
488 mem_usage, stat, info);
491 static void gsisx(SLU::superlu_options_t* options, SLU::SuperMatrix* A,
492 int* perm_c,
int* perm_r,
int* etree,
char* equed,
float* R,
float* C,
493 SLU::SuperMatrix* L, SLU::SuperMatrix* U,
void* work,
int lwork,
494 SLU::SuperMatrix* B, SLU::SuperMatrix* X,
float* recip_pivot_growth,
496 #ifdef HAVE_AMESOS2_SUPERLU5_API
499 SLU::mem_usage_t* mem_usage,
500 SLU::SuperLUStat_t* stat,
int* info)
502 SLU::S::sgsisx(options, A, perm_c, perm_r, etree, equed, R, C, L, U, work,
503 lwork, B, X, recip_pivot_growth, rcond,
504 #ifdef HAVE_AMESOS2_SUPERLU5_API
507 mem_usage, stat, info);
529 static void gstrf(SLU::superlu_options_t* options, SLU::SuperMatrix* AC,
530 int relax,
int panel_size,
int* etree,
void* work,
531 int lwork,
int* perm_c,
int* perm_r, SLU::SuperMatrix* L,
533 #ifdef HAVE_AMESOS2_SUPERLU5_API
536 SLU::SuperLUStat_t* stat,
int* info)
538 SLU::S::sgstrf(options, AC, relax, panel_size, etree,
539 work, lwork, perm_c, perm_r, L, U,
540 #ifdef HAVE_AMESOS2_SUPERLU5_API
546 static void gsitrf(SLU::superlu_options_t* options, SLU::SuperMatrix* AC,
547 int relax,
int panel_size,
int* etree,
void* work,
548 int lwork,
int* perm_c,
int* perm_r, SLU::SuperMatrix* L,
550 #ifdef HAVE_AMESOS2_SUPERLU5_API
553 SLU::SuperLUStat_t* stat,
int* info)
555 SLU::S::sgsitrf(options, AC, relax, panel_size, etree,
556 work, lwork, perm_c, perm_r, L, U,
557 #ifdef HAVE_AMESOS2_SUPERLU5_API
566 template<
class view_t>
567 static void create_CompCol_Matrix(SLU::SuperMatrix* A,
int m,
int n,
int nnz,
568 Teuchos::Array<float> & convert_nzval, view_t & nzval,
569 int* rowind,
int* colptr,
570 SLU::Stype_t stype, SLU::Dtype_t dtype, SLU::Mtype_t mtype)
573 SLU::S::sCreate_CompCol_Matrix(A, m, n, nnz, nzval.data(), rowind, colptr,
574 stype, dtype, mtype);
580 static void create_CompRow_Matrix(SLU::SuperMatrix* A,
int m,
int n,
581 int nnz,
float* nzval,
int* rowind,
int* colptr,
582 SLU::Stype_t stype, SLU::Dtype_t dtype, SLU::Mtype_t mtype)
584 SLU::S::sCreate_CompRow_Matrix(A, m, n, nnz, nzval, rowind, colptr,
585 stype, dtype, mtype);
597 template<
class view_t>
598 static void create_Dense_Matrix(SLU::SuperMatrix* X,
int m,
int n,
599 Teuchos::Array<float> & convert_x, view_t & x,
600 int ldx, SLU::Stype_t stype,
601 SLU::Dtype_t dtype, SLU::Mtype_t mtype)
604 SLU::S::sCreate_Dense_Matrix(X, m, n, x.data(), ldx, stype, dtype, mtype);
607 template<
class view_t>
608 static void convert_back_Dense_Matrix(
609 Teuchos::Array<float> & convert_x, view_t & x)
617 static void gsequ(SLU::SuperMatrix* A,
float* R,
float* C,
618 float* rowcnd,
float* colcnd,
float* amax,
int* info)
620 SLU::S::sgsequ(A, R, C, rowcnd, colcnd, amax, info);
637 static void laqgs(SLU::SuperMatrix* A,
float* R,
float* C,
638 float rowcnd,
float colcnd,
float amax,
char* equed)
640 SLU::S::slaqgs(A, R, C, rowcnd, colcnd, amax, equed);
646 struct FunctionMap<Superlu,double>
648 typedef TypeMap<Superlu,double> type_map;
650 #ifdef HAVE_AMESOS2_SUPERLU5_API 651 typedef typename SLU::D::GlobalLU_t GlobalLU_type;
654 static void gssvx(SLU::superlu_options_t* options, SLU::SuperMatrix* A,
655 int* perm_c,
int* perm_r,
int* etree,
char* equed,
double* R,
double* C,
656 SLU::SuperMatrix* L, SLU::SuperMatrix* U,
void* work,
int lwork,
657 SLU::SuperMatrix* B, SLU::SuperMatrix* X,
double* recip_pivot_growth,
658 double* rcond,
double* ferr,
double* berr,
659 #ifdef HAVE_AMESOS2_SUPERLU5_API
662 SLU::mem_usage_t* mem_usage,
663 SLU::SuperLUStat_t* stat,
int* info)
665 SLU::D::dgssvx(options, A, perm_c, perm_r, etree, equed, R, C, L, U, work,
666 lwork, B, X, recip_pivot_growth, rcond, ferr, berr,
667 #ifdef HAVE_AMESOS2_SUPERLU5_API
670 mem_usage, stat, info);
673 static void gstrf(SLU::superlu_options_t* options, SLU::SuperMatrix* AC,
674 int relax,
int panel_size,
int* etree,
void* work,
int lwork,
int* perm_c,
675 int* perm_r, SLU::SuperMatrix* L, SLU::SuperMatrix* U,
676 #ifdef HAVE_AMESOS2_SUPERLU5_API
679 SLU::SuperLUStat_t* stat,
int* info)
681 SLU::D::dgstrf(options, AC, relax, panel_size, etree,
682 work, lwork, perm_c, perm_r, L, U,
683 #ifdef HAVE_AMESOS2_SUPERLU5_API
689 static void gsisx(SLU::superlu_options_t* options, SLU::SuperMatrix* A,
690 int* perm_c,
int* perm_r,
int* etree,
char* equed,
double* R,
double* C,
691 SLU::SuperMatrix* L, SLU::SuperMatrix* U,
void* work,
int lwork,
692 SLU::SuperMatrix* B, SLU::SuperMatrix* X,
double* recip_pivot_growth,
694 #ifdef HAVE_AMESOS2_SUPERLU5_API
697 SLU::mem_usage_t* mem_usage,
698 SLU::SuperLUStat_t* stat,
int* info)
700 SLU::D::dgsisx(options, A, perm_c, perm_r, etree, equed, R, C, L, U, work,
701 lwork, B, X, recip_pivot_growth, rcond,
702 #ifdef HAVE_AMESOS2_SUPERLU5_API
705 mem_usage, stat, info);
708 static void gsitrf(SLU::superlu_options_t* options, SLU::SuperMatrix* AC,
709 int relax,
int panel_size,
int* etree,
void* work,
int lwork,
int* perm_c,
710 int* perm_r, SLU::SuperMatrix* L, SLU::SuperMatrix* U,
711 #ifdef HAVE_AMESOS2_SUPERLU5_API
714 SLU::SuperLUStat_t* stat,
int* info)
716 SLU::D::dgsitrf(options, AC, relax, panel_size, etree,
717 work, lwork, perm_c, perm_r, L, U,
718 #ifdef HAVE_AMESOS2_SUPERLU5_API
724 template<
class view_t>
725 static void create_CompCol_Matrix(SLU::SuperMatrix* A,
int m,
int n,
int nnz,
726 Teuchos::Array<double> & convert_nzval, view_t & nzval,
727 int* rowind,
int* colptr,
728 SLU::Stype_t stype, SLU::Dtype_t dtype, SLU::Mtype_t mtype)
731 SLU::D::dCreate_CompCol_Matrix(A, m, n, nnz, nzval.data(), rowind, colptr,
732 stype, dtype, mtype);
735 static void create_CompRow_Matrix(SLU::SuperMatrix* A,
int m,
int n,
736 int nnz,
double* nzval,
int* rowind,
int* colptr,
737 SLU::Stype_t stype, SLU::Dtype_t dtype, SLU::Mtype_t mtype)
739 SLU::D::dCreate_CompRow_Matrix(A, m, n, nnz, nzval, rowind, colptr,
740 stype, dtype, mtype);
743 template<
class view_t>
744 static void create_Dense_Matrix(SLU::SuperMatrix* X,
int m,
int n,
745 Teuchos::Array<double> & convert_x, view_t & x,
746 int ldx, SLU::Stype_t stype,
747 SLU::Dtype_t dtype, SLU::Mtype_t mtype)
750 SLU::D::dCreate_Dense_Matrix(X, m, n, x.data(), ldx, stype, dtype, mtype);
753 template<
class view_t>
754 static void convert_back_Dense_Matrix(
755 Teuchos::Array<double> & convert_x, view_t & x)
760 static void gsequ(SLU::SuperMatrix* A,
double* R,
double* C,
761 double* rowcnd,
double* colcnd,
double* amax,
int* info)
763 SLU::D::dgsequ(A, R, C, rowcnd, colcnd, amax, info);
766 static void laqgs(SLU::SuperMatrix* A,
double* R,
double* C,
767 double rowcnd,
double colcnd,
double amax,
char* equed)
769 SLU::D::dlaqgs(A, R, C, rowcnd, colcnd, amax, equed);
775 #ifdef HAVE_TEUCHOS_COMPLEX 778 struct FunctionMap<Superlu, Kokkos::complex<float>>
780 #ifdef HAVE_AMESOS2_SUPERLU5_API 781 typedef typename SLU::C::GlobalLU_t GlobalLU_type;
784 static void gssvx(SLU::superlu_options_t* options, SLU::SuperMatrix* A,
785 int* perm_c,
int* perm_r,
int* etree,
char* equed,
float* R,
float* C,
786 SLU::SuperMatrix* L, SLU::SuperMatrix* U,
void* work,
int lwork,
787 SLU::SuperMatrix* B, SLU::SuperMatrix* X,
float* recip_pivot_growth,
788 float* rcond,
float* ferr,
float* berr,
789 #ifdef HAVE_AMESOS2_SUPERLU5_API
792 SLU::mem_usage_t* mem_usage,
793 SLU::SuperLUStat_t* stat,
int* info)
795 SLU::C::cgssvx(options, A, perm_c, perm_r, etree, equed, R, C, L, U, work,
796 lwork, B, X, recip_pivot_growth, rcond, ferr, berr,
797 #ifdef HAVE_AMESOS2_SUPERLU5_API
800 mem_usage, stat, info);
803 static void gstrf(SLU::superlu_options_t* options, SLU::SuperMatrix* AC,
804 int relax,
int panel_size,
int* etree,
void* work,
int lwork,
int* perm_c,
805 int* perm_r, SLU::SuperMatrix* L, SLU::SuperMatrix* U,
806 #ifdef HAVE_AMESOS2_SUPERLU5_API
809 SLU::SuperLUStat_t* stat,
int* info)
811 SLU::C::cgstrf(options, AC, relax, panel_size, etree,
812 work, lwork, perm_c, perm_r, L, U,
813 #ifdef HAVE_AMESOS2_SUPERLU5_API
819 static void gsisx(SLU::superlu_options_t* options, SLU::SuperMatrix* A,
820 int* perm_c,
int* perm_r,
int* etree,
char* equed,
float* R,
float* C,
821 SLU::SuperMatrix* L, SLU::SuperMatrix* U,
void* work,
int lwork,
822 SLU::SuperMatrix* B, SLU::SuperMatrix* X,
float* recip_pivot_growth,
824 #ifdef HAVE_AMESOS2_SUPERLU5_API
827 SLU::mem_usage_t* mem_usage,
828 SLU::SuperLUStat_t* stat,
int* info)
830 SLU::C::cgsisx(options, A, perm_c, perm_r, etree, equed, R, C, L, U, work,
831 lwork, B, X, recip_pivot_growth, rcond,
832 #ifdef HAVE_AMESOS2_SUPERLU5_API
835 mem_usage, stat, info);
838 static void gsitrf(SLU::superlu_options_t* options, SLU::SuperMatrix* AC,
839 int relax,
int panel_size,
int* etree,
void* work,
int lwork,
int* perm_c,
840 int* perm_r, SLU::SuperMatrix* L, SLU::SuperMatrix* U,
841 #ifdef HAVE_AMESOS2_SUPERLU5_API
844 SLU::SuperLUStat_t* stat,
int* info)
846 SLU::C::cgsitrf(options, AC, relax, panel_size, etree,
847 work, lwork, perm_c, perm_r, L, U,
848 #ifdef HAVE_AMESOS2_SUPERLU5_API
854 template<
class view_t>
855 static void create_CompCol_Matrix(SLU::SuperMatrix* A,
int m,
int n,
int nnz,
856 Teuchos::Array<SLU::C::complex> & convert_nzval, view_t & nzval,
857 int* rowind,
int* colptr,
858 SLU::Stype_t stype, SLU::Dtype_t dtype, SLU::Mtype_t mtype)
860 convert_nzval.resize(nnz);
861 for(
int i = 0; i < nnz; ++i) {
862 convert_nzval[i] = Teuchos::as<SLU::C::complex>(nzval(i));
864 SLU::C::cCreate_CompCol_Matrix(A, m, n, nnz, convert_nzval.data(), rowind, colptr,
865 stype, dtype, mtype);
868 static void create_CompRow_Matrix(SLU::SuperMatrix* A,
int m,
int n,
int nnz,
869 SLU::C::complex* nzval,
int* rowind,
int* colptr,
870 SLU::Stype_t stype, SLU::Dtype_t dtype, SLU::Mtype_t mtype)
872 SLU::C::cCreate_CompRow_Matrix(A, m, n, nnz, nzval, rowind, colptr,
873 stype, dtype, mtype);
876 template<
class view_t>
877 static void create_Dense_Matrix(SLU::SuperMatrix* X,
int m,
int n,
878 Teuchos::Array<SLU::C::complex> & convert_x, view_t & x,
879 int ldx, SLU::Stype_t stype,
880 SLU::Dtype_t dtype, SLU::Mtype_t mtype)
882 convert_x.resize(m * n);
884 for(
int j = 0; j < n; ++j) {
885 for(
int i = 0; i < m; ++i) {
886 convert_x[write_index++] = Teuchos::as<SLU::C::complex>(x(i,j));
889 SLU::C::cCreate_Dense_Matrix(X, m, n, convert_x.data(), ldx, stype, dtype, mtype);
892 template<
class view_t>
893 static void convert_back_Dense_Matrix(
894 Teuchos::Array<SLU::C::complex> & convert_x, view_t & x)
897 for(
int j = 0; j < static_cast<int>(x.extent(1)); ++j) {
898 for(
int i = 0; i < static_cast<int>(x.extent(0)); ++i) {
899 x(i,j) = Teuchos::as<Kokkos::complex<float>>(convert_x[read_index++]);
904 static void gsequ(SLU::SuperMatrix* A,
float* R,
float* C,
905 float* rowcnd,
float* colcnd,
float* amax,
int* info)
907 SLU::C::cgsequ(A, R, C, rowcnd, colcnd, amax, info);
910 static void laqgs(SLU::SuperMatrix* A,
float* R,
float* C,
911 float rowcnd,
float colcnd,
float amax,
char* equed)
913 SLU::C::claqgs(A, R, C, rowcnd, colcnd, amax, equed);
919 struct FunctionMap<Superlu,Kokkos::complex<double>>
921 #ifdef HAVE_AMESOS2_SUPERLU5_API 922 typedef typename SLU::Z::GlobalLU_t GlobalLU_type;
925 static void gssvx(SLU::superlu_options_t* options, SLU::SuperMatrix* A,
926 int* perm_c,
int* perm_r,
int* etree,
char* equed,
double* R,
double* C,
927 SLU::SuperMatrix* L, SLU::SuperMatrix* U,
void* work,
int lwork,
928 SLU::SuperMatrix* B, SLU::SuperMatrix* X,
double* recip_pivot_growth,
929 double* rcond,
double* ferr,
double* berr,
930 #ifdef HAVE_AMESOS2_SUPERLU5_API
933 SLU::mem_usage_t* mem_usage,
934 SLU::SuperLUStat_t* stat,
int* info)
936 SLU::Z::zgssvx(options, A, perm_c, perm_r, etree, equed, R, C, L, U, work,
937 lwork, B, X, recip_pivot_growth, rcond, ferr, berr,
938 #ifdef HAVE_AMESOS2_SUPERLU5_API
941 mem_usage, stat, info);
944 static void gstrf(SLU::superlu_options_t* options, SLU::SuperMatrix* AC,
945 int relax,
int panel_size,
int* etree,
void* work,
int lwork,
int* perm_c,
946 int* perm_r, SLU::SuperMatrix* L, SLU::SuperMatrix* U,
947 #ifdef HAVE_AMESOS2_SUPERLU5_API
950 SLU::SuperLUStat_t* stat,
int* info)
952 SLU::Z::zgstrf(options, AC, relax, panel_size, etree,
953 work, lwork, perm_c, perm_r, L, U,
954 #ifdef HAVE_AMESOS2_SUPERLU5_API
960 static void gsisx(SLU::superlu_options_t* options, SLU::SuperMatrix* A,
961 int* perm_c,
int* perm_r,
int* etree,
char* equed,
double* R,
double* C,
962 SLU::SuperMatrix* L, SLU::SuperMatrix* U,
void* work,
int lwork,
963 SLU::SuperMatrix* B, SLU::SuperMatrix* X,
double* recip_pivot_growth,
965 #ifdef HAVE_AMESOS2_SUPERLU5_API
968 SLU::mem_usage_t* mem_usage,
969 SLU::SuperLUStat_t* stat,
int* info)
971 SLU::Z::zgsisx(options, A, perm_c, perm_r, etree, equed, R, C, L, U, work,
972 lwork, B, X, recip_pivot_growth, rcond,
973 #ifdef HAVE_AMESOS2_SUPERLU5_API
976 mem_usage, stat, info);
979 static void gsitrf(SLU::superlu_options_t* options, SLU::SuperMatrix* AC,
980 int relax,
int panel_size,
int* etree,
void* work,
int lwork,
int* perm_c,
981 int* perm_r, SLU::SuperMatrix* L, SLU::SuperMatrix* U,
982 #ifdef HAVE_AMESOS2_SUPERLU5_API
985 SLU::SuperLUStat_t* stat,
int* info)
987 SLU::Z::zgsitrf(options, AC, relax, panel_size, etree,
988 work, lwork, perm_c, perm_r, L, U,
989 #ifdef HAVE_AMESOS2_SUPERLU5_API
995 template<
class view_t>
996 static void create_CompCol_Matrix(SLU::SuperMatrix* A,
int m,
int n,
int nnz,
997 Teuchos::Array<SLU::Z::doublecomplex> & convert_nzval, view_t & nzval,
998 int* rowind,
int* colptr,
999 SLU::Stype_t stype, SLU::Dtype_t dtype, SLU::Mtype_t mtype)
1001 convert_nzval.resize(nnz);
1002 for(
int i = 0; i < nnz; ++i) {
1003 convert_nzval[i] = Teuchos::as<SLU::Z::doublecomplex>(nzval(i));
1005 SLU::Z::zCreate_CompCol_Matrix(A, m, n, nnz, convert_nzval.data(), rowind, colptr,
1006 stype, dtype, mtype);
1008 TEUCHOS_TEST_FOR_EXCEPTION( A == NULL,
1010 "Supermatrix A not initialized properly!");
1014 static void create_CompRow_Matrix(SLU::SuperMatrix* A,
int m,
int n,
int nnz,
1015 SLU::Z::doublecomplex* nzval,
int* rowind,
int* colptr,
1016 SLU::Stype_t stype, SLU::Dtype_t dtype, SLU::Mtype_t mtype)
1018 SLU::Z::zCreate_CompRow_Matrix(A, m, n, nnz, nzval, rowind, colptr,
1019 stype, dtype, mtype);
1021 TEUCHOS_TEST_FOR_EXCEPTION( A == NULL,
1023 "Supermatrix A not initialized properly!");
1026 template<
class view_t>
1027 static void create_Dense_Matrix(SLU::SuperMatrix* X,
int m,
int n,
1028 Teuchos::Array<SLU::Z::doublecomplex> & convert_x, view_t & x,
1029 int ldx, SLU::Stype_t stype,
1030 SLU::Dtype_t dtype, SLU::Mtype_t mtype)
1032 convert_x.resize(m * n);
1033 int write_index = 0;
1034 for(
int j = 0; j < n; ++j) {
1035 for(
int i = 0; i < m; ++i) {
1036 convert_x[write_index++] = Teuchos::as<SLU::Z::doublecomplex>(x(i,j));
1039 SLU::Z::zCreate_Dense_Matrix(X, m, n, convert_x.data(), ldx, stype, dtype, mtype);
1042 template<
class view_t>
1043 static void convert_back_Dense_Matrix(
1044 Teuchos::Array<SLU::Z::doublecomplex> & convert_x, view_t & x)
1047 for(
int j = 0; j < static_cast<int>(x.extent(1)); ++j) {
1048 for(
int i = 0; i < static_cast<int>(x.extent(0)); ++i) {
1049 x(i,j) = Teuchos::as<Kokkos::complex<double>>(convert_x[read_index++]);
1054 static void gsequ(SLU::SuperMatrix* A,
double* R,
double* C,
1055 double* rowcnd,
double* colcnd,
double* amax,
int* info)
1057 SLU::Z::zgsequ(A, R, C, rowcnd, colcnd, amax, info);
1060 static void laqgs(SLU::SuperMatrix* A,
double* R,
double* C,
1061 double rowcnd,
double colcnd,
double amax,
char* equed)
1063 SLU::Z::zlaqgs(A, R, C, rowcnd, colcnd, amax, equed);
1066 #endif // HAVE_TEUCHOS_COMPLEX 1073 #endif // AMESOS2_SUPERLU_FUNCTIONMAP_HPP Declaration of Function mapping class for Amesos2.
Definition: Amesos2_AbstractConcreteMatrixAdapter.hpp:48
Provides definition of SuperLU types as well as conversions and type traits.
Definition: Amesos2_Superlu_FunctionMap.hpp:74