1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
|
#ifndef SUPERLUC_H
#define SUPERLUC_H
#include "arch.h"
#include "arlspdef.h"
#include "arlsupm.h"
#include "arlcomp.h"
inline void gstrf(const char* refact, SuperMatrix* A, double diag_pivot_thresh,
double drop_tol, int relax, int panel_size,
int* etree, void* work, int lwork, int* perm_r,
int *perm_c, SuperMatrix *L, SuperMatrix *U, int *info)
{
if (A->Dtype == _D) {
dgstrf(refact,A,diag_pivot_thresh,drop_tol,relax,
panel_size,etree,work,lwork,perm_r,perm_c,L,U,info);
}
else if (A->Dtype == _S) {
sgstrf(refact,A,(float)diag_pivot_thresh,(float)drop_tol,relax,
panel_size,etree,work,lwork,perm_r,perm_c,L,U,info);
}
else if (A->Dtype == _Z) {
#ifdef ARCOMP_H
zgstrf(refact,A,diag_pivot_thresh,drop_tol,relax,
panel_size,etree,work,lwork,perm_r,perm_c,L,U,info);
#endif
}
else {
#ifdef ARCOMP_H
cgstrf(refact,A,(float)diag_pivot_thresh,(float)drop_tol,relax,
panel_size,etree,work,lwork,perm_r,perm_c,L,U,info);
#endif
}
}
inline void gstrs(const char *trans, SuperMatrix *L, SuperMatrix *U,
int *perm_r, int *perm_c, SuperMatrix *B, int *info)
{
if (L->Dtype == _D) {
dgstrs(trans,L,U,perm_r,perm_c,B,info);
}
else if (L->Dtype == _S) {
sgstrs(trans,L,U,perm_r,perm_c,B,info);
}
else if (L->Dtype == _Z) {
#ifdef ARCOMP_H
zgstrs(trans,L,U,perm_r,perm_c,B,info);
#endif
}
else {
#ifdef ARCOMP_H
cgstrs(trans,L,U,perm_r,perm_c,B,info);
#endif
}
}
inline void Create_CompCol_Matrix(SuperMatrix* A, int m, int n, int nnz,
double* a, int* irow, int* pcol,
Stype_t S, Mtype_t M)
{
dCreate_CompCol_Matrix(A,m,n,nnz,a,irow,pcol,S,_D,M);
}
inline void Create_CompCol_Matrix(SuperMatrix* A, int m, int n, int nnz,
float* a, int* irow, int* pcol,
Stype_t S, Mtype_t M)
{
sCreate_CompCol_Matrix(A,m,n,nnz,a,irow,pcol,S,_S,M);
}
#ifdef ARCOMP_H
inline void Create_CompCol_Matrix(SuperMatrix* A, int m, int n, int nnz,
arcomplex<double>* a, int* irow, int* pcol,
Stype_t S, Mtype_t M)
{
zCreate_CompCol_Matrix(A,m,n,nnz,(ldcomplex*)a,irow,pcol,S,_Z,M);
}
inline void Create_CompCol_Matrix(SuperMatrix* A, int m, int n, int nnz,
arcomplex<float>* a, int* irow, int* pcol,
Stype_t S, Mtype_t M)
{
cCreate_CompCol_Matrix(A,m,n,nnz,(lscomplex*)a,irow,pcol,S,_C,M);
}
#endif
inline void Create_Dense_Matrix(SuperMatrix* A, int m, int n, double* x,
int ldx, Stype_t S, Mtype_t M)
{
dCreate_Dense_Matrix(A,m,n,x,ldx,S,_D,M);
}
inline void Create_Dense_Matrix(SuperMatrix* A, int m, int n, float* x,
int ldx, Stype_t S, Mtype_t M)
{
sCreate_Dense_Matrix(A,m,n,x,ldx,S,_S,M);
}
#ifdef ARCOMP_H
inline void Create_Dense_Matrix(SuperMatrix* A, int m, int n, arcomplex<double>* x,
int ldx, Stype_t S, Mtype_t M)
{
zCreate_Dense_Matrix(A,m,n,(ldcomplex*)x,ldx,S,_Z,M);
}
inline void Create_Dense_Matrix(SuperMatrix* A, int m, int n, arcomplex<float>* x,
int ldx, Stype_t S, Mtype_t M)
{
cCreate_Dense_Matrix(A,m,n,(lscomplex*)x,ldx,S,_C,M);
}
#endif
#endif
|