53#ifndef AMESOS2_SUPERLUDIST_FUNCTIONMAP_HPP
54#define AMESOS2_SUPERLUDIST_FUNCTIONMAP_HPP
56#ifdef HAVE_TEUCHOS_COMPLEX
60#include "Amesos2_config.h"
62#include "Amesos2_MatrixAdapter.hpp"
69#define AMESOS2_SLUD_GET_DIAG_SCALE(eq) (((eq)=='N') ? SLUD::NOEQUIL : ((eq)=='R') ? SLUD::ROW : ((eq)=='C') ? SLUD::COL : SLUD::BOTH)
71#define AMESOS2_SLUD_GET_EQUED(ds) (((ds)==SLUD::NOEQUIL) ? 'N' : ((ds)==SLUD::ROW) ? 'R' : ((ds)==SLUD::COL) ? 'C' : 'B')
75 template <
class Matrix,
class Vector>
class Superludist;
77 SLUD::DiagScale_t get_diag_scale(
char eq);
78 char get_equed(SLUD::DiagScale_t ds);
109 struct FunctionMap<Superludist,double>
111 typedef TypeMap<Superludist,double> type_map;
126 static void gstrf(SLUD::amesos2_superlu_dist_options_t* options,
int m,
int n,
double anorm,
127 type_map::LUstruct_t* LU, SLUD::gridinfo_t* grid, SLUD::SuperLUStat_t* stat,
130 SLUD::D::pdgstrf(options, m, n, anorm, LU, grid, stat, info);
137#if (SUPERLU_DIST_MAJOR_VERSION > 7)
138 static void gstrs(SLUD::amesos2_superlu_dist_options_t* options,
139 SLUD::int_t n, type_map::LUstruct_t* lu_struct,
140 SLUD::D::dScalePermstruct_t* scale_perm_struct, SLUD::gridinfo_t* grid,
141 type_map::type* B, SLUD::int_t l_numrows, SLUD::int_t fst_global_row,
142 SLUD::int_t ldb,
int nrhs, type_map::SOLVEstruct_t* solve_struct,
143 SLUD::SuperLUStat_t* stat,
int* info)
144#elif SUPERLU_DIST_MAJOR_VERSION > 6 || (SUPERLU_DIST_MAJOR_VERSION == 6 && SUPERLU_DIST_MINOR_VERSION > 2)
145 static void gstrs(SLUD::int_t n, type_map::LUstruct_t* lu_struct,
146 SLUD::D::dScalePermstruct_t* scale_perm_struct, SLUD::gridinfo_t* grid,
147 type_map::type* B, SLUD::int_t l_numrows, SLUD::int_t fst_global_row,
148 SLUD::int_t ldb,
int nrhs, type_map::SOLVEstruct_t* solve_struct,
149 SLUD::SuperLUStat_t* stat,
int* info)
151 static void gstrs(SLUD::int_t n, type_map::LUstruct_t* lu_struct,
152 SLUD::ScalePermstruct_t* scale_perm_struct, SLUD::gridinfo_t* grid,
153 type_map::type* B, SLUD::int_t l_numrows, SLUD::int_t fst_global_row,
154 SLUD::int_t ldb,
int nrhs, type_map::SOLVEstruct_t* solve_struct,
155 SLUD::SuperLUStat_t* stat,
int* info)
158#if (SUPERLU_DIST_MAJOR_VERSION > 7)
159 SLUD::D::pdgstrs(options, n, lu_struct, scale_perm_struct, grid, B, l_numrows,
160 fst_global_row, ldb, nrhs, solve_struct, stat, info);
162 SLUD::D::pdgstrs(n, lu_struct, scale_perm_struct, grid, B, l_numrows,
163 fst_global_row, ldb, nrhs, solve_struct, stat, info);
174#if (SUPERLU_DIST_MAJOR_VERSION > 7)
175 static void gstrs_Bglobal(SLUD::amesos2_superlu_dist_options_t* options,
176 SLUD::int_t n, type_map::LUstruct_t* lu_struct,
177 SLUD::gridinfo_t* grid, type_map::type* B,
178 SLUD::int_t ldb,
int nrhs,
179 SLUD::SuperLUStat_t* stat,
int* info)
182 SLUD::D::pdgstrs_Bglobal(options, n, lu_struct, grid, B, ldb, nrhs, stat, info);
185 static void gstrs_Bglobal(SLUD::int_t n, type_map::LUstruct_t* lu_struct,
186 SLUD::gridinfo_t* grid, type_map::type* B,
187 SLUD::int_t ldb,
int nrhs,
188 SLUD::SuperLUStat_t* stat,
int* info)
191 SLUD::D::pdgstrs_Bglobal(n, lu_struct, grid, B, ldb, nrhs, stat, info);
198#if (SUPERLU_DIST_MAJOR_VERSION > 7)
199 static void gsrfs(SLUD::amesos2_superlu_dist_options_t* options,
200 SLUD::int_t n, SLUD::SuperMatrix* A,
double anorm,
201 type_map::LUstruct_t* lu_struct,
202 SLUD::D::dScalePermstruct_t* scale_perm,
203 SLUD::gridinfo_t* grid, type_map::type* B, SLUD::int_t ldb,
204 type_map::type* X, SLUD::int_t ldx,
int nrhs,
205 type_map::SOLVEstruct_t* solve_struct,
double* berr,
206 SLUD::SuperLUStat_t* stat,
int* info)
207#elif SUPERLU_DIST_MAJOR_VERSION > 6 || (SUPERLU_DIST_MAJOR_VERSION == 6 && SUPERLU_DIST_MINOR_VERSION > 2)
208 static void gsrfs(SLUD::int_t n, SLUD::SuperMatrix* A,
double anorm,
209 type_map::LUstruct_t* lu_struct,
210 SLUD::D::dScalePermstruct_t* scale_perm,
211 SLUD::gridinfo_t* grid, type_map::type* B, SLUD::int_t ldb,
212 type_map::type* X, SLUD::int_t ldx,
int nrhs,
213 type_map::SOLVEstruct_t* solve_struct,
double* berr,
214 SLUD::SuperLUStat_t* stat,
int* info)
216 static void gsrfs(SLUD::int_t n, SLUD::SuperMatrix* A,
double anorm,
217 type_map::LUstruct_t* lu_struct,
218 SLUD::ScalePermstruct_t* scale_perm,
219 SLUD::gridinfo_t* grid, type_map::type* B, SLUD::int_t ldb,
220 type_map::type* X, SLUD::int_t ldx,
int nrhs,
221 type_map::SOLVEstruct_t* solve_struct,
double* berr,
222 SLUD::SuperLUStat_t* stat,
int* info)
225#if (SUPERLU_DIST_MAJOR_VERSION > 7)
226 SLUD::D::pdgsrfs(options, n, A, anorm, lu_struct, scale_perm, grid, B, ldb,
227 X, ldx, nrhs, solve_struct, berr, stat, info);
229 SLUD::D::pdgsrfs(n, A, anorm, lu_struct, scale_perm, grid, B, ldb,
230 X, ldx, nrhs, solve_struct, berr, stat, info);
241#if (SUPERLU_DIST_MAJOR_VERSION > 7)
242 static void gsrfs_ABXglobal(SLUD::amesos2_superlu_dist_options_t* options,
243 SLUD::int_t n, SLUD::SuperMatrix* A,
double anorm,
244 type_map::LUstruct_t* lu_struct, SLUD::gridinfo_t* grid,
245 type_map::type* B, SLUD::int_t ldb, type_map::type* X,
246 SLUD::int_t ldx,
int nrhs,
double* berr,
247 SLUD::SuperLUStat_t* stat,
int* info)
249 SLUD::D::pdgsrfs_ABXglobal(options, n, A, anorm, lu_struct, grid, B, ldb,
250 X, ldx, nrhs, berr, stat, info);
253 static void gsrfs_ABXglobal(SLUD::int_t n, SLUD::SuperMatrix* A,
double anorm,
254 type_map::LUstruct_t* lu_struct, SLUD::gridinfo_t* grid,
255 type_map::type* B, SLUD::int_t ldb, type_map::type* X,
256 SLUD::int_t ldx,
int nrhs,
double* berr,
257 SLUD::SuperLUStat_t* stat,
int* info)
259 SLUD::D::pdgsrfs_ABXglobal(n, A, anorm, lu_struct, grid, B, ldb,
260 X, ldx, nrhs, berr, stat, info);
268 static void create_CompRowLoc_Matrix(SLUD::SuperMatrix* A, SLUD::int_t g_numrows,
269 SLUD::int_t g_numcols, SLUD::int_t l_nnz,
270 SLUD::int_t l_numrows, SLUD::int_t fst_global_row,
271 type_map::type* nzval, SLUD::int_t* colind,
272 SLUD::int_t* rowptr, SLUD::Stype_t storage_t,
273 SLUD::Dtype_t data_t, SLUD::Mtype_t mat_t)
275 SLUD::D::dCreate_CompRowLoc_Matrix_dist(A, g_numrows, g_numcols, l_nnz,
276 l_numrows, fst_global_row,
277 nzval, colind, rowptr,
278 storage_t, data_t, mat_t);
288 static void create_CompCol_Matrix(SLUD::SuperMatrix* A, SLUD::int_t numrows,
289 SLUD::int_t numcols, SLUD::int_t nnz,
290 type_map::type* nzval, SLUD::int_t* rowind,
291 SLUD::int_t* colptr, SLUD::Stype_t storage_t,
292 SLUD::Dtype_t data_t, SLUD::Mtype_t mat_t)
294 SLUD::D::dCreate_CompCol_Matrix_dist(A, numrows, numcols, nnz,
295 nzval, rowind, colptr,
296 storage_t, data_t, mat_t);
307 static void create_Dense_Matrix(SLUD::SuperMatrix* X,
int m,
int n,
308 type_map::type* x,
int ldx, SLUD::Stype_t stype,
309 SLUD::Dtype_t dtype, SLUD::Mtype_t mtype)
311 SLUD::D::dCreate_Dense_Matrix_dist(X, m, n, x, ldx, stype, dtype, mtype);
314 static void permute_Dense_Matrix(SLUD::int_t fst_row, SLUD::int_t m_loc,
315 SLUD::int_t* row_to_proc, SLUD::int_t* perm,
316 type_map::type* X,
int ldx, type_map::type* B,
317 int ldb,
int nrhs, SLUD::gridinfo_t* grid)
319 SLUD::D::pdPermute_Dense_Matrix(fst_row, m_loc, row_to_proc, perm,
320 X, ldx, B, ldb, nrhs, grid);
331 static void gsequ_loc(SLUD::SuperMatrix* A,
double* r,
double* c,
332 double* rowcnd,
double* colcnd,
double* amax, SLUD::int_t* info,
333 SLUD::gridinfo_t* grid)
335 SLUD::D::pdgsequ(A, r, c, rowcnd, colcnd, amax, info, grid);
342 static void gsequ(SLUD::SuperMatrix* A,
double* r,
double* c,
343 double* rowcnd,
double* colcnd,
double* amax, SLUD::int_t* info)
345 SLUD::D::dgsequ_dist(A, r, c, rowcnd, colcnd, amax, info);
351 static void laqgs_loc(SLUD::SuperMatrix* A,
double* r,
double* c,
352 double rowcnd,
double colcnd,
double amax,
353 SLUD::DiagScale_t* equed)
355 char eq = AMESOS2_SLUD_GET_EQUED(*equed);
356 SLUD::D::pdlaqgs(A, r, c, rowcnd, colcnd, amax, &eq);
357 *equed = AMESOS2_SLUD_GET_DIAG_SCALE(eq);
373 static void laqgs(SLUD::SuperMatrix* A,
double* r,
double* c,
374 double rowcnd,
double colcnd,
double amax, SLUD::DiagScale_t* equed)
376 char eq = AMESOS2_SLUD_GET_EQUED(*equed);
377 SLUD::D::dlaqgs_dist(A, r, c, rowcnd, colcnd, amax, &eq);
378 *equed = AMESOS2_SLUD_GET_DIAG_SCALE(eq);
384#if (SUPERLU_DIST_MAJOR_VERSION > 7)
385 static void distribute(SLUD::amesos2_superlu_dist_options_t* options,
386 SLUD::fact_t fact, SLUD::int_t n,
387 SLUD::SuperMatrix* A, SLUD::Glu_freeable_t* glu_freeable,
388 type_map::LUstruct_t* lu, SLUD::gridinfo_t* grid)
390 SLUD::D::ddistribute(options, n, A, glu_freeable, lu, grid);
393 static void distribute(SLUD::fact_t fact, SLUD::int_t n,
394 SLUD::SuperMatrix* A, SLUD::Glu_freeable_t* glu_freeable,
395 type_map::LUstruct_t* lu, SLUD::gridinfo_t* grid)
397 SLUD::D::ddistribute(fact, n, A, glu_freeable, lu, grid);
408#if (SUPERLU_DIST_MAJOR_VERSION > 7)
409 static void pdistribute(SLUD::amesos2_superlu_dist_options_t* options,
411 SLUD::SuperMatrix* A, SLUD::D::dScalePermstruct_t* scale_perm,
412 SLUD::Glu_freeable_t* glu_freeable, type_map::LUstruct_t* lu,
413 SLUD::gridinfo_t* grid)
414#elif SUPERLU_DIST_MAJOR_VERSION > 6 || (SUPERLU_DIST_MAJOR_VERSION == 6 && SUPERLU_DIST_MINOR_VERSION > 2)
415 static void pdistribute(SLUD::fact_t fact, SLUD::int_t n,
416 SLUD::SuperMatrix* A, SLUD::D::dScalePermstruct_t* scale_perm,
417 SLUD::Glu_freeable_t* glu_freeable, type_map::LUstruct_t* lu,
418 SLUD::gridinfo_t* grid)
420 static void pdistribute(SLUD::fact_t fact, SLUD::int_t n,
421 SLUD::SuperMatrix* A, SLUD::ScalePermstruct_t* scale_perm,
422 SLUD::Glu_freeable_t* glu_freeable, type_map::LUstruct_t* lu,
423 SLUD::gridinfo_t* grid)
426#if (SUPERLU_DIST_MAJOR_VERSION > 7)
427 SLUD::D::pddistribute(options, n, A, scale_perm, glu_freeable, lu, grid);
429 SLUD::D::pddistribute(fact, n, A, scale_perm, glu_freeable, lu, grid);
441#if (SUPERLU_DIST_MAJOR_VERSION > 7)
442 static void dist_psymbtonum(SLUD::amesos2_superlu_dist_options_t* options,
443 SLUD::int_t n, SLUD::SuperMatrix* A,
444 SLUD::D::dScalePermstruct_t* scale_perm,
445 SLUD::Pslu_freeable_t* pslu_freeable,
446 type_map::LUstruct_t* lu, SLUD::gridinfo_t* grid)
447#elif SUPERLU_DIST_MAJOR_VERSION > 6 || (SUPERLU_DIST_MAJOR_VERSION == 6 && SUPERLU_DIST_MINOR_VERSION > 2)
448 static void dist_psymbtonum(SLUD::fact_t fact, SLUD::int_t n, SLUD::SuperMatrix* A,
449 SLUD::D::dScalePermstruct_t* scale_perm,
450 SLUD::Pslu_freeable_t* pslu_freeable,
451 type_map::LUstruct_t* lu, SLUD::gridinfo_t* grid)
453 static void dist_psymbtonum(SLUD::fact_t fact, SLUD::int_t n, SLUD::SuperMatrix* A,
454 SLUD::ScalePermstruct_t* scale_perm,
455 SLUD::Pslu_freeable_t* pslu_freeable,
456 type_map::LUstruct_t* lu, SLUD::gridinfo_t* grid)
459#if (SUPERLU_DIST_MAJOR_VERSION > 7)
460 SLUD::D::ddist_psymbtonum(options, n, A, scale_perm, pslu_freeable, lu, grid);
462 SLUD::D::ddist_psymbtonum(fact, n, A, scale_perm, pslu_freeable, lu, grid);
473 static double plangs(
char* norm, SLUD::SuperMatrix* A, SLUD::gridinfo_t* grid)
475 return SLUD::D::pdlangs(norm, A, grid);
478 static void SolveInit(SLUD::amesos2_superlu_dist_options_t* options, SLUD::SuperMatrix* A,
479 SLUD::int_t* perm_r, SLUD::int_t* perm_c, SLUD::int_t nrhs,
480 type_map::LUstruct_t* lu, SLUD::gridinfo_t* grid,
481 type_map::SOLVEstruct_t* solve_struct)
483 SLUD::D::dSolveInit(options, A, perm_r, perm_c, nrhs, lu, grid, solve_struct);
486 static void LUstructInit(SLUD::int_t m, SLUD::int_t n,
487 type_map::LUstruct_t* lu)
491#if SUPERLU_DIST_MAJOR_VERSION > 6 || (SUPERLU_DIST_MAJOR_VERSION == 6 && SUPERLU_DIST_MINOR_VERSION > 2)
492 SLUD::D::dLUstructInit(n, lu);
493#elif defined(AMESOS2_ENABLES_SUPERLUDIST_VERSION5_AND_HIGHER)
494 SLUD::D::LUstructInit(n, lu);
496#ifdef HAVE_SUPERLUDIST_LUSTRUCTINIT_2ARG
497 SLUD::D::LUstructInit(n, lu);
499 SLUD::D::LUstructInit(m, n, lu);
504 static void Destroy_LU(SLUD::int_t m, SLUD::gridinfo_t* grid,
505 type_map::LUstruct_t* lu)
507#if SUPERLU_DIST_MAJOR_VERSION > 6 || (SUPERLU_DIST_MAJOR_VERSION == 6 && SUPERLU_DIST_MINOR_VERSION > 2)
508 SLUD::D::dDestroy_LU(m, grid, lu);
510 SLUD::D::Destroy_LU(m, grid, lu);
514 static void LUstructFree(type_map::LUstruct_t* lu)
516#if SUPERLU_DIST_MAJOR_VERSION > 6 || (SUPERLU_DIST_MAJOR_VERSION == 6 && SUPERLU_DIST_MINOR_VERSION > 2)
517 SLUD::D::dLUstructFree(lu);
519 SLUD::D::LUstructFree(lu);
523 static void SolveFinalize(SLUD::amesos2_superlu_dist_options_t* options,
524 type_map::SOLVEstruct_t* solve_struct)
526 SLUD::D::dSolveFinalize(options, solve_struct);
531#if defined(HAVE_TEUCHOS_COMPLEX) && !defined(__clang__)
536 struct FunctionMap<Superludist,SLUD::Z::doublecomplex>
538 typedef TypeMap<Superludist,std::complex<double> > type_map;
540 static void gstrf(SLUD::amesos2_superlu_dist_options_t* options,
int m,
int n,
double anorm,
541 type_map::LUstruct_t* LU, SLUD::gridinfo_t* grid,
542 SLUD::SuperLUStat_t* stat,
int* info)
544 SLUD::Z::pzgstrf(options, m, n, anorm, LU, grid, stat, info);
547#if (SUPERLU_DIST_MAJOR_VERSION > 7)
548 static void gstrs(SLUD::amesos2_superlu_dist_options_t* options,
549 SLUD::int_t n, type_map::LUstruct_t* lu_struct,
550 SLUD::Z::zScalePermstruct_t* scale_perm_struct,
551 SLUD::gridinfo_t* grid, type_map::type* B,
552 SLUD::int_t l_numrows, SLUD::int_t fst_global_row,
553 SLUD::int_t ldb,
int nrhs,
554 type_map::SOLVEstruct_t* solve_struct,
555 SLUD::SuperLUStat_t* stat,
int* info)
556#elif SUPERLU_DIST_MAJOR_VERSION > 6 || (SUPERLU_DIST_MAJOR_VERSION == 6 && SUPERLU_DIST_MINOR_VERSION > 2)
557 static void gstrs(SLUD::int_t n, type_map::LUstruct_t* lu_struct,
558 SLUD::Z::zScalePermstruct_t* scale_perm_struct,
559 SLUD::gridinfo_t* grid, type_map::type* B,
560 SLUD::int_t l_numrows, SLUD::int_t fst_global_row,
561 SLUD::int_t ldb,
int nrhs,
562 type_map::SOLVEstruct_t* solve_struct,
563 SLUD::SuperLUStat_t* stat,
int* info)
565 static void gstrs(SLUD::int_t n, type_map::LUstruct_t* lu_struct,
566 SLUD::ScalePermstruct_t* scale_perm_struct,
567 SLUD::gridinfo_t* grid, type_map::type* B,
568 SLUD::int_t l_numrows, SLUD::int_t fst_global_row,
569 SLUD::int_t ldb,
int nrhs,
570 type_map::SOLVEstruct_t* solve_struct,
573#if (SUPERLU_DIST_MAJOR_VERSION > 7)
574 SLUD::Z::pzgstrs(options, n, lu_struct, scale_perm_struct, grid, B, l_numrows,
575 fst_global_row, ldb, nrhs, solve_struct, stat, info);
577 SLUD::Z::pzgstrs(n, lu_struct, scale_perm_struct, grid, B, l_numrows,
578 fst_global_row, ldb, nrhs, solve_struct, stat, info);
582#if (SUPERLU_DIST_MAJOR_VERSION > 7)
583 static void gstrs_Bglobal(SLUD::amesos2_superlu_dist_options_t* options,
584 SLUD::int_t n, type_map::LUstruct_t* lu_struct,
585 SLUD::gridinfo_t* grid, type_map::type* B,
586 SLUD::int_t ldb,
int nrhs, SLUD::SuperLUStat_t* stat,
int* info)
588 SLUD::Z::pzgstrs_Bglobal(options,n, lu_struct, grid, B, ldb, nrhs, stat, info);
591 static void gstrs_Bglobal(SLUD::int_t n, type_map::LUstruct_t* lu_struct,
592 SLUD::gridinfo_t* grid, type_map::type* B,
593 SLUD::int_t ldb,
int nrhs, SLUD::SuperLUStat_t* stat,
int* info)
595 SLUD::Z::pzgstrs_Bglobal(n, lu_struct, grid, B, ldb, nrhs, stat, info);
599 static void create_CompRowLoc_Matrix(SLUD::SuperMatrix* A, SLUD::int_t g_numrows,
600 SLUD::int_t g_numcols, SLUD::int_t l_nnz,
601 SLUD::int_t l_numrows, SLUD::int_t fst_global_row,
602 type_map::type* nzval, SLUD::int_t* colind,
603 SLUD::int_t* rowptr, SLUD::Stype_t storage_t,
604 SLUD::Dtype_t data_t, SLUD::Mtype_t mat_t)
606 SLUD::Z::zCreate_CompRowLoc_Matrix_dist(A, g_numrows, g_numcols, l_nnz,
607 l_numrows, fst_global_row,
608 nzval, colind, rowptr,
609 storage_t, data_t, mat_t);
612 static void create_CompCol_Matrix(SLUD::SuperMatrix* A, SLUD::int_t numrows,
613 SLUD::int_t numcols, SLUD::int_t nnz,
614 type_map::type* nzval, SLUD::int_t* rowind,
615 SLUD::int_t* colptr, SLUD::Stype_t storage_t,
616 SLUD::Dtype_t data_t, SLUD::Mtype_t mat_t)
618 SLUD::Z::zCreate_CompCol_Matrix_dist(A, numrows, numcols, nnz,
619 nzval, rowind, colptr,
620 storage_t, data_t, mat_t);
623 static void create_Dense_Matrix(SLUD::SuperMatrix* X,
int m,
int n,
624 TypeMap<Superludist,std::complex<double> >::type* x,
int ldx,
625 SLUD::Stype_t stype, SLUD::Dtype_t dtype, SLUD::Mtype_t mtype)
627 SLUD::Z::zCreate_Dense_Matrix_dist(X, m, n, x, ldx, stype, dtype, mtype);
630 static void permute_Dense_Matrix(SLUD::int_t fst_row, SLUD::int_t m_loc,
631 SLUD::int_t* row_to_proc, SLUD::int_t* perm,
632 type_map::type* X,
int ldx,
633 type_map::type* B,
int ldb,
634 int nrhs, SLUD::gridinfo_t* grid)
636 SLUD::Z::pzPermute_Dense_Matrix(fst_row, m_loc, row_to_proc, perm,
637 X, ldx, B, ldb, nrhs, grid);
640 static void gsequ_loc(SLUD::SuperMatrix* A,
double* r,
double* c,
641 double* rowcnd,
double* colcnd,
double* amax, SLUD::int_t* info,
642 SLUD::gridinfo_t* grid)
644 SLUD::Z::pzgsequ(A, r, c, rowcnd, colcnd, amax, info, grid);
647 static void gsequ(SLUD::SuperMatrix* A,
double* r,
double* c,
648 double* rowcnd,
double* colcnd,
double* amax, SLUD::int_t* info)
650 SLUD::Z::zgsequ_dist(A, r, c, rowcnd, colcnd, amax, info);
653 static void laqgs_loc(SLUD::SuperMatrix* A,
double* r,
double* c,
654 double rowcnd,
double colcnd,
double amax, SLUD::DiagScale_t* equed)
656 char eq = AMESOS2_SLUD_GET_EQUED(*equed);
657 SLUD::Z::pzlaqgs(A, r, c, rowcnd, colcnd, amax, &eq);
658 *equed = AMESOS2_SLUD_GET_DIAG_SCALE(eq);
661 static void laqgs(SLUD::SuperMatrix* A,
double* r,
double* c,
662 double rowcnd,
double colcnd,
double amax, SLUD::DiagScale_t* equed)
664 char eq = AMESOS2_SLUD_GET_EQUED(*equed);
665 SLUD::Z::zlaqgs_dist(A, r, c, rowcnd, colcnd, amax, &eq);
666 *equed = AMESOS2_SLUD_GET_DIAG_SCALE(eq);
669#if (SUPERLU_DIST_MAJOR_VERSION > 7)
670 static void distribute(SLUD::amesos2_superlu_dist_options_t* options,
672 SLUD::SuperMatrix* A, SLUD::Glu_freeable_t* glu_freeable,
673 type_map::LUstruct_t* lu, SLUD::gridinfo_t* grid)
675 SLUD::Z::zdistribute(options, n, A, glu_freeable, lu, grid);
678 static void distribute(SLUD::fact_t fact, SLUD::int_t n,
679 SLUD::SuperMatrix* A, SLUD::Glu_freeable_t* glu_freeable,
680 type_map::LUstruct_t* lu, SLUD::gridinfo_t* grid)
682 SLUD::Z::zdistribute(fact, n, A, glu_freeable, lu, grid);
686#if (SUPERLU_DIST_MAJOR_VERSION > 7)
687 static void pdistribute(SLUD::amesos2_superlu_dist_options_t* options,
689 SLUD::SuperMatrix* A, SLUD::Z::zScalePermstruct_t* scale_perm,
690 SLUD::Glu_freeable_t* glu_freeable, type_map::LUstruct_t* lu,
691 SLUD::gridinfo_t* grid)
692#elif SUPERLU_DIST_MAJOR_VERSION > 6 || (SUPERLU_DIST_MAJOR_VERSION == 6 && SUPERLU_DIST_MINOR_VERSION > 2)
693 static void pdistribute(SLUD::fact_t fact, SLUD::int_t n,
694 SLUD::SuperMatrix* A, SLUD::Z::zScalePermstruct_t* scale_perm,
695 SLUD::Glu_freeable_t* glu_freeable, type_map::LUstruct_t* lu,
696 SLUD::gridinfo_t* grid)
698 static void pdistribute(SLUD::fact_t fact, SLUD::int_t n,
699 SLUD::SuperMatrix* A, SLUD::ScalePermstruct_t* scale_perm,
700 SLUD::Glu_freeable_t* glu_freeable, type_map::LUstruct_t* lu,
701 SLUD::gridinfo_t* grid)
704#if (SUPERLU_DIST_MAJOR_VERSION > 7)
705 SLUD::Z::pzdistribute(options, n, A, scale_perm, glu_freeable, lu, grid);
707 SLUD::Z::pzdistribute(fact, n, A, scale_perm, glu_freeable, lu, grid);
711#if (SUPERLU_DIST_MAJOR_VERSION > 7)
712 static void dist_psymbtonum(SLUD::amesos2_superlu_dist_options_t* options,
714 SLUD::SuperMatrix* A, SLUD::Z::zScalePermstruct_t* scale_perm,
715 SLUD::Pslu_freeable_t* pslu_freeable, type_map::LUstruct_t* lu,
716 SLUD::gridinfo_t* grid)
717#elif SUPERLU_DIST_MAJOR_VERSION > 6 || (SUPERLU_DIST_MAJOR_VERSION == 6 && SUPERLU_DIST_MINOR_VERSION > 2)
718 static void dist_psymbtonum(SLUD::fact_t fact, SLUD::int_t n,
719 SLUD::SuperMatrix* A, SLUD::Z::zScalePermstruct_t* scale_perm,
720 SLUD::Pslu_freeable_t* pslu_freeable, type_map::LUstruct_t* lu,
721 SLUD::gridinfo_t* grid)
723 static void dist_psymbtonum(SLUD::fact_t fact, SLUD::int_t n,
724 SLUD::SuperMatrix* A, SLUD::ScalePermstruct_t* scale_perm,
725 SLUD::Pslu_freeable_t* pslu_freeable, type_map::LUstruct_t* lu,
726 SLUD::gridinfo_t* grid)
729#if (SUPERLU_DIST_MAJOR_VERSION > 7)
730 SLUD::Z::zdist_psymbtonum(options, n, A, scale_perm, pslu_freeable, lu, grid);
732 SLUD::Z::zdist_psymbtonum(fact, n, A, scale_perm, pslu_freeable, lu, grid);
736 static double plangs(
char* norm, SLUD::SuperMatrix* A, SLUD::gridinfo_t* grid)
738 return SLUD::Z::pzlangs(norm, A, grid);
741 static void SolveInit(SLUD::amesos2_superlu_dist_options_t* options, SLUD::SuperMatrix* A,
742 SLUD::int_t* perm_r, SLUD::int_t* perm_c, SLUD::int_t nrhs,
743 type_map::LUstruct_t* lu, SLUD::gridinfo_t* grid,
744 type_map::SOLVEstruct_t* solve_struct)
746 SLUD::Z::zSolveInit(options, A, perm_r, perm_c, nrhs, lu, grid, solve_struct);
749 static void LUstructInit(SLUD::int_t m, SLUD::int_t n, type_map::LUstruct_t* lu)
753#if SUPERLU_DIST_MAJOR_VERSION > 6 || (SUPERLU_DIST_MAJOR_VERSION == 6 && SUPERLU_DIST_MINOR_VERSION > 2)
754 SLUD::Z::zLUstructInit(n, lu);
755#elif defined(AMESOS2_ENABLES_SUPERLUDIST_VERSION5_AND_HIGHER)
756 SLUD::Z::LUstructInit(n, lu);
758#ifdef HAVE_SUPERLUDIST_LUSTRUCTINIT_2ARG
759 SLUD::Z::LUstructInit(n, lu);
761 SLUD::Z::LUstructInit(m, n, lu);
766 static void Destroy_LU(SLUD::int_t m, SLUD::gridinfo_t* grid, type_map::LUstruct_t* lu)
768#if SUPERLU_DIST_MAJOR_VERSION > 6 || (SUPERLU_DIST_MAJOR_VERSION == 6 && SUPERLU_DIST_MINOR_VERSION > 2)
769 SLUD::Z::zDestroy_LU(m, grid, lu);
771 SLUD::Z::Destroy_LU(m, grid, lu);
775 static void LUstructFree(type_map::LUstruct_t* lu)
777#if SUPERLU_DIST_MAJOR_VERSION > 6 || (SUPERLU_DIST_MAJOR_VERSION == 6 && SUPERLU_DIST_MINOR_VERSION > 2)
778 SLUD::Z::zLUstructFree(lu);
780 SLUD::Z::LUstructFree(lu);
784 static void SolveFinalize(SLUD::amesos2_superlu_dist_options_t* options,
785 type_map::SOLVEstruct_t* solve_struct)
787 SLUD::Z::zSolveFinalize(options, solve_struct);
Declaration of Function mapping class for Amesos2.
Provides definition of SuperLU_DIST types as well as conversions and type traits.