| #pragma once |
| |
| #ifndef TLIN_SUPERLU_WRAP |
| #define TLIN_SUPERLU_WRAP |
| |
| #include "tcommon.h" |
| |
| #undef DVAPI |
| #undef DVVAR |
| #ifdef TNZEXT_EXPORTS |
| #define DVAPI DV_EXPORT_API |
| #define DVVAR DV_EXPORT_VAR |
| #else |
| #define DVAPI DV_IMPORT_API |
| #define DVVAR DV_IMPORT_VAR |
| #endif |
| |
| #include "tlin_matrix.h" |
| #include "tlin_sparsemat.h" |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| namespace tlin { |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| struct SuperMatrix; |
| struct superlu_options_t; |
| |
| struct SuperFactors { |
| SuperMatrix *L; |
| SuperMatrix *U; |
| int *perm_c; |
| int *perm_r; |
| }; |
| |
| |
| |
| |
| |
| void DVAPI allocS(SuperMatrix *&A, int rows, int cols, |
| int nnz); |
| void DVAPI allocD(SuperMatrix *&A, int rows, |
| int cols); |
| |
| |
| void DVAPI allocS(SuperMatrix *&A, int rows, int cols, int nnz, int *colptr, |
| int *rowind, double *values); |
| void DVAPI allocD(SuperMatrix *&A, int rows, int cols, int lda, double *values); |
| |
| void DVAPI freeS(SuperMatrix *A); |
| void DVAPI freeD(SuperMatrix *A); |
| void DVAPI freeF(SuperFactors *F); |
| |
| |
| void DVAPI createS(SuperMatrix &A, int rows, int cols, int nnz); |
| void DVAPI createD(SuperMatrix &A, int rows, int cols); |
| |
| |
| void DVAPI createS(SuperMatrix &A, int rows, int cols, int nnz, int *colptr, |
| int *rowind, double *values); |
| void DVAPI createD(SuperMatrix &A, int rows, int cols, int lda, double *values); |
| |
| |
| |
| void DVAPI destroyS(SuperMatrix &A, bool destroyData = true); |
| void DVAPI destroyD(SuperMatrix &A, bool destroyData = true); |
| |
| void DVAPI readDN(SuperMatrix *A, int &lda, |
| double *&values); |
| void DVAPI readNC(SuperMatrix *A, int &nnz, int *&colptr, int *&rowind, |
| double *&values); |
| |
| |
| |
| void DVAPI traduceS(tlin::sparse_matrix<double> &m, SuperMatrix *&A); |
| void DVAPI traduceD(const tlin::matrix<double> &m, SuperMatrix *&A); |
| void DVAPI traduceD(const tlin::sparse_matrix<double> &m, SuperMatrix *&A); |
| |
| |
| |
| |
| |
| |
| void DVAPI factorize(SuperMatrix *A, SuperFactors *&F, |
| superlu_options_t *opt = 0); |
| |
| void DVAPI solve(SuperFactors *F, SuperMatrix *BX, superlu_options_t *opt = 0); |
| void DVAPI solve(SuperFactors *F, SuperMatrix *B, SuperMatrix *&X, |
| superlu_options_t *opt = 0); |
| void DVAPI solve(SuperMatrix *A, SuperMatrix *BX, superlu_options_t *opt = 0); |
| void DVAPI solve(SuperMatrix *A, SuperMatrix *B, SuperMatrix *&X, |
| superlu_options_t *opt = 0); |
| |
| void DVAPI solve(SuperFactors *F, double *bx, superlu_options_t *opt = 0); |
| void DVAPI solve(SuperFactors *F, double *b, double *&x, |
| superlu_options_t *opt = 0); |
| void DVAPI solve(SuperMatrix *A, double *bx, superlu_options_t *opt = 0); |
| void DVAPI solve(SuperMatrix *A, double *b, double *&x, |
| superlu_options_t *opt = 0); |
| |
| |
| |
| |
| |
| void DVAPI multiplyS(const SuperMatrix *A, const double *v, double *&Av); |
| void DVAPI multiplyD(const SuperMatrix *A, const double *v, double *&Av); |
| |
| } |
| |
| #endif |