36 #ifndef NEKTAR_LIB_UTILITIES_LINEAR_ALGEBRA_BLAS_HPP
37 #define NEKTAR_LIB_UTILITIES_LINEAR_ALGEBRA_BLAS_HPP
48 void F77NAME(
dcopy) (
const int& n,
const double *x,
const int& incx,
49 double *y,
const int& incy);
50 void F77NAME(
daxpy) (
const int& n,
const double& alpha,
const double *x,
51 const int& incx,
const double *y,
const int& incy);
52 void F77NAME(
dswap) (
const int& n,
double *x,
const int& incx,
53 double *y,
const int& incy);
54 void F77NAME(
dscal) (
const int& n,
const double& alpha,
double *x,
56 void F77NAME(
drot) (
const int& n,
double *x,
const int& incx,
57 double *y,
const int& incy,
const double& c,
59 double F77NAME(
ddot) (
const int& n,
const double *x,
const int& incx,
60 const double *y,
const int& incy);
61 double F77NAME(
dnrm2) (
const int& n,
const double *x,
const int& incx);
62 double F77NAME(
dasum) (
const int& n,
const double *x,
const int& incx);
63 int F77NAME(
idamax)(
const int& n,
const double *x,
const int& incx);
67 const int& n,
const double& alpha,
68 const double* a,
const int& lda,
69 const double* x,
const int& incx,
70 const double& beta,
double* y,
const int& incy);
73 const int& n,
const int& kl,
const int& ku,
75 const double* a,
const int& lda,
76 const double* x,
const int& incx,
77 const double& beta,
double* y,
const int& incy);
79 void F77NAME(
dtpmv) (
const char& uplo,
const char& trans,
const char& diag,
80 const int& n,
const double* ap,
double* x,
const int& incx);
82 void F77NAME(
dspmv) (
const char& uplo,
const int& n,
const double& alpha,
83 const double* a,
const double* x,
const int& incx,
84 const double& beta,
double* y,
const int& incy);
87 const int& k,
const double& alpha,
88 const double* a,
const int& lda,
89 const double* x,
const int& incx,
90 const double& beta,
double* y,
const int& incy);
93 void F77NAME(
dgemm) (
const char& trans,
const char& transb,
94 const int& m1,
const int& n,
95 const int& k,
const double& alpha,
96 const double* a,
const int& lda,
97 const double* b,
const int& ldb,
98 const double& beta,
double* c,
const int& ldc);
101 #ifdef NEKTAR_USING_BLAS
103 static inline void Dcopy (
const int& n,
const double *x,
const int& incx,
104 double *y,
const int& incy)
110 static inline void Daxpy (
const int& n,
const double& alpha,
const double *x,
111 const int& incx,
const double *y,
const int& incy)
118 static inline void Dswap (
const int& n,
double *x,
const int& incx,
119 double *y,
const int& incy)
125 static inline void Dscal (
const int& n,
const double& alpha,
double *x,
132 static inline void Drot (
const int& n,
double *x,
const int& incx,
133 double *y,
const int& incy,
const double& c,
140 static inline double Ddot (
const int& n,
const double *x,
const int& incx,
141 const double *y,
const int& incy)
148 static inline double Dnrm2 (
const int& n,
const double *x,
const int& incx)
154 static inline double Dasum (
const int& n,
const double *x,
const int& incx)
162 static inline int Idamax (
const int& n,
const double *x,
const int& incx)
168 static inline void Dgemv (
const char& trans,
const int& m,
const int& n,
169 const double& alpha,
const double* a,
const int& lda,
170 const double* x,
const int& incx,
const double& beta,
171 double* y,
const int& incy)
173 F77NAME(
dgemv) (trans,m,n,alpha,a,lda,x,incx,beta,y,incy);
176 static inline void Dgbmv (
const char& trans,
const int& m,
177 const int& n,
const int& kl,
const int& ku,
179 const double* a,
const int& lda,
180 const double* x,
const int& incx,
181 const double& beta,
double* y,
const int& incy)
183 F77NAME(
dgbmv) (trans, m, n, kl, ku, alpha, a, lda, x, incx, beta, y, incy);
187 static inline void Dtpmv(
const char& uplo,
const char& trans,
const char& diag,
188 const int& n,
const double* ap,
double* x,
const int& incx)
195 static inline void Dspmv (
const char& uplo,
const int& n,
const double& alpha,
196 const double* a,
const double* x,
const int& incx,
197 const double& beta,
double* y,
const int& incy)
202 static inline void Dsbmv (
const char& uplo,
const int& m,
const int& k,
203 const double& alpha,
const double* a,
const int& lda,
204 const double* x,
const int& incx,
const double& beta,
205 double* y,
const int& incy)
207 F77NAME(
dsbmv) (uplo,m,k,alpha,a,lda,x,incx,beta,y,incy);
213 static inline void Dgemm (
const char& transa,
const char& transb,
const int& m,
214 const int& n,
const int& k,
const double& alpha,
215 const double* a,
const int& lda,
const double* b,
216 const int& ldb,
const double& beta,
double* c,
219 F77NAME(
dgemm) (transa,transb,m,n,k,alpha,a,lda,b,ldb,beta,c,ldc);
224 static inline void Cdgemm(
const int M,
const int N,
const int K,
const double a,
225 const double *
A,
const int ldA,
const double * B,
const int ldB,
226 const double b,
double *C,
const int ldC)
228 Dgemm(
'N',
'N',N,M,K,a,B,N,A,K,b,C,N) ;
230 #endif //NEKTAR_USING_BLAS
232 #endif //NEKTAR_LIB_UTILITIES_LINEAR_ALGEBRA_BLAS_HPP
void F77NAME() dscal(const int &n, const double &alpha, double *x, const int &incx)
void F77NAME() dgbmv(const char &trans, const int &m, const int &n, const int &kl, const int &ku, const double &alpha, const double *a, const int &lda, const double *x, const int &incx, const double &beta, double *y, const int &incy)
void F77NAME() dgemv(const char &trans, const int &m, const int &n, const double &alpha, const double *a, const int &lda, const double *x, const int &incx, const double &beta, double *y, const int &incy)
int F77NAME() idamax(const int &n, const double *x, const int &incx)
double F77NAME() dnrm2(const int &n, const double *x, const int &incx)
void F77NAME() dcopy(const int &n, const double *x, const int &incx, double *y, const int &incy)
void F77NAME() drot(const int &n, double *x, const int &incx, double *y, const int &incy, const double &c, const double &s)
#define F77NAME(x)
Fortran routines need an underscore.
void F77NAME() dsbmv(const char &uplo, const int &m, const int &k, const double &alpha, const double *a, const int &lda, const double *x, const int &incx, const double &beta, double *y, const int &incy)
void F77NAME() dspmv(const char &uplo, const int &n, const double &alpha, const double *a, const double *x, const int &incx, const double &beta, double *y, const int &incy)
void F77NAME() dswap(const int &n, double *x, const int &incx, double *y, const int &incy)
double F77NAME() ddot(const int &n, const double *x, const int &incx, const double *y, const int &incy)
void F77NAME() daxpy(const int &n, const double &alpha, const double *x, const int &incx, const double *y, const int &incy)
double F77NAME() dasum(const int &n, const double *x, const int &incx)
T Ddot(int n, const Array< OneD, const T > &w, const int incw, const Array< OneD, const T > &x, const int incx, const Array< OneD, const int > &y, const int incy)
void F77NAME() dtpmv(const char &uplo, const char &trans, const char &diag, const int &n, const double *ap, double *x, const int &incx)
void F77NAME() dgemm(const char &trans, const char &transb, const int &m1, const int &n, const int &k, const double &alpha, const double *a, const int &lda, const double *b, const int &ldb, const double &beta, double *c, const int &ldc)