34#ifndef NEKTAR_LIB_UTILITIES_LAPACK_HPP
35#define NEKTAR_LIB_UTILITIES_LAPACK_HPP
44 void F77NAME(
dsptrf)(
const char &uplo,
const int &n,
double *ap,
int *ipiv,
46 void F77NAME(
ssptrf)(
const char &uplo,
const int &n,
float *ap,
int *ipiv,
49 const double *ap,
const int *ipiv,
double *b,
50 const int &ldb,
int &info);
52 const float *ap,
const int *ipiv,
float *b,
53 const int &ldb,
int &info);
55 const int *ipiv,
double *work,
int &info);
57 const int *ipiv,
float *work,
int &info);
58 void F77NAME(
dtrtrs)(
const char &uplo,
const char &trans,
const char &diag,
59 const int &n,
const int &nrhs,
const double *a,
60 const int &lda,
double *b,
const int &ldb,
int &info);
61 void F77NAME(
dtptrs)(
const char &uplo,
const char &trans,
const char &diag,
62 const int &n,
const int &nrhs,
const double *a,
63 double *b,
const int &ldb,
int &info);
64 void F77NAME(
dpptrf)(
const char &uplo,
const int &n,
double *ap,
int &info);
66 const double *ap,
double *b,
const int &ldb,
69 double *ab,
const int &ldab,
int &info);
71 const int &nrhs,
const double *ab,
const int &ldab,
72 double *b,
const int &ldb,
int &info);
74 const int &ku,
double *a,
const int &lda,
int *ipiv,
77 const int &ku,
const int &nrhs,
const double *a,
78 const int &lda,
const int *ipiv,
double *b,
79 const int &ldb,
int &info);
80 void F77NAME(
dgetrf)(
const int &m,
const int &n,
double *a,
const int &lda,
81 int *ipiv,
int &info);
82 void F77NAME(
sgetrf)(
const int &m,
const int &n,
float *a,
const int &lda,
83 int *ipiv,
int &info);
85 const double *a,
const int &lda,
int *ipiv,
double *b,
86 const int &ldb,
int &info);
88 const int *ipiv,
double *wk,
const int &lwk,
91 const int *ipiv,
float *wk,
const int &lwk,
int &info);
93 void F77NAME(
dgeev)(
const char &uplo,
const char &lrev,
const int &n,
94 const double *a,
const int &lda,
double *wr,
double *wi,
95 double *rev,
const int &ldr,
double *lev,
96 const int &ldv,
double *work,
const int &lwork,
98 void F77NAME(
sgeev)(
const char &uplo,
const char &lrev,
const int &n,
99 const float *a,
const int &lda,
float *wr,
float *wi,
100 float *rev,
const int &ldr,
float *lev,
const int &ldv,
101 float *work,
const int &lwork,
int &info);
103 double *ap,
double *
w,
double *
z,
const int &ldz,
104 double *work,
int &info);
106 const int &ku,
double *ap,
const int &lda,
double *
w,
107 double *
z,
const int &ldz,
double *work,
int &info);
112static inline void DoSsptrf(
const char &uplo,
const int &n,
double *ap,
113 int *ipiv,
int &info)
120static inline void DoSsptrf(
const char &uplo,
const int &n,
float *ap,
121 int *ipiv,
int &info)
128static inline void Dsptrf(
const char &uplo,
const int &n,
double *ap,
int *ipiv,
136static inline void DoSsptrs(
const char &uplo,
const int &n,
const int &nrhs,
137 const double *ap,
const int *ipiv,
double *b,
138 const int &ldb,
int &info)
145static inline void DoSsptrs(
const char &uplo,
const int &n,
const int &nrhs,
146 const float *ap,
const int *ipiv,
float *b,
147 const int &ldb,
int &info)
154static inline void Dsptrs(
const char &uplo,
const int &n,
const int &nrhs,
155 const double *ap,
const int *ipiv,
double *b,
156 const int &ldb,
int &info)
162static inline void DoSsptri(
const char &uplo,
const int &n,
const double *ap,
163 const int *ipiv,
double *work,
int &info)
169static inline void DoSsptri(
const char &uplo,
const int &n,
const float *ap,
170 const int *ipiv,
float *work,
int &info)
176static inline void Dtrtrs(
const char &uplo,
const char &trans,
const char &diag,
177 const int &n,
const int &nrhs,
const double *a,
178 const int &lda,
double *b,
const int &ldb,
int &info)
180 F77NAME(
dtrtrs)(uplo, trans, diag, n, nrhs, a, lda, b, ldb, info);
184static inline void Dtptrs(
const char &uplo,
const char &trans,
const char &diag,
185 const int &n,
const int &nrhs,
const double *a,
186 double *b,
const int &ldb,
int &info)
188 F77NAME(
dtptrs)(uplo, trans, diag, n, nrhs, a, b, ldb, info);
192static inline void Dsptri(
const char &uplo,
const int &n,
const double *ap,
193 const int *ipiv,
double *work,
int &info)
199static inline void Dpptrf(
const char &uplo,
const int &n,
double *ap,
int &info)
206static inline void Dpptrs(
const char &uplo,
const int &n,
const int &nrhs,
207 const double *ap,
double *b,
const int &ldb,
215static inline void Dpbtrf(
const char &uplo,
const int &n,
const int &kd,
216 double *ab,
const int &ldab,
int &info)
223static inline void Dpbtrs(
const char &uplo,
const int &n,
const int &kd,
224 const int &nrhs,
const double *ab,
const int &ldab,
225 double *b,
const int &ldb,
int &info)
231static inline void Dgbtrf(
const int &m,
const int &n,
const int &kl,
232 const int &ku,
double *a,
const int &lda,
int *ipiv,
239static inline void Dgbtrs(
const char &trans,
const int &n,
const int &kl,
240 const int &ku,
const int &nrhs,
const double *a,
241 const int &lda,
const int *ipiv,
double *b,
242 const int &ldb,
int &info)
244 F77NAME(
dgbtrs)(trans, n, kl, ku, nrhs, a, lda, ipiv, b, ldb, info);
248static inline void DoSgetrf(
const int &m,
const int &n,
double *a,
249 const int &lda,
int *ipiv,
int &info)
255static inline void DoSgetrf(
const int &m,
const int &n,
float *a,
256 const int &lda,
int *ipiv,
int &info)
262static inline void Dgetrf(
const int &m,
const int &n,
double *a,
const int &lda,
263 int *ipiv,
int &info)
269static inline void Dgetrs(
const char &trans,
const int &n,
const int &nrhs,
270 const double *a,
const int &lda,
int *ipiv,
double *b,
271 const int &ldb,
int &info)
277static inline void DoSgetri(
const int &n,
double *a,
const int &lda,
278 const int *ipiv,
double *wk,
const int &lwk,
285static inline void DoSgetri(
const int &n,
float *a,
const int &lda,
286 const int *ipiv,
float *wk,
const int &lwk,
293static inline void Dgetri(
const int &n,
double *a,
const int &lda,
294 const int *ipiv,
double *wk,
const int &lwk,
301static inline void Dsterf(
const int &n,
double *
d,
double *e,
int &info)
307static inline void DoSgeev(
const char &uplo,
const char &lrev,
const int &n,
308 const double *a,
const int &lda,
double *wr,
309 double *wi,
double *rev,
const int &ldr,
double *lev,
310 const int &ldv,
double *work,
const int &lwork,
314 (uplo, lrev, n, a, lda, wr, wi, rev, ldr, lev, ldv, work, lwork, info);
318static inline void DoSgeev(
const char &uplo,
const char &lrev,
const int &n,
319 const float *a,
const int &lda,
float *wr,
float *wi,
320 float *rev,
const int &ldr,
float *lev,
321 const int &ldv,
float *work,
const int &lwork,
325 (uplo, lrev, n, a, lda, wr, wi, rev, ldr, lev, ldv, work, lwork, info);
329static inline void Dgeev(
const char &uplo,
const char &lrev,
const int &n,
330 const double *a,
const int &lda,
double *wr,
331 double *wi,
double *rev,
const int &ldr,
double *lev,
332 const int &ldv,
double *work,
const int &lwork,
336 (uplo, lrev, n, a, lda, wr, wi, rev, ldr, lev, ldv, work, lwork, info);
340static inline void Dspev(
const char &jobz,
const char &uplo,
const int &n,
341 double *ap,
double *
w,
double *
z,
const int &ldz,
342 double *work,
int &info)
348static inline void Dsbev(
const char &jobz,
const char &uplo,
const int &kl,
349 const int &ku,
double *ap,
const int &lda,
double *
w,
350 double *
z,
const int &ldz,
double *work,
int &info)
352 F77NAME(
dsbev)(jobz, uplo, kl, ku, ap, lda,
w,
z, ldz, work, info);
#define F77NAME(x)
Fortran routines need an underscore.
void F77NAME() dsbev(const char &jobz, const char &uplo, const int &kl, const int &ku, double *ap, const int &lda, double *w, double *z, const int &ldz, double *work, int &info)
void F77NAME() dpbtrf(const char &uplo, const int &n, const int &kd, double *ab, const int &ldab, int &info)
static void Dspev(const char &jobz, const char &uplo, const int &n, double *ap, double *w, double *z, const int &ldz, double *work, int &info)
Solve packed-symmetric real matrix eigenproblem.
void F77NAME() dpptrf(const char &uplo, const int &n, double *ap, int &info)
void F77NAME() ssptrf(const char &uplo, const int &n, float *ap, int *ipiv, int &info)
static void Dpptrs(const char &uplo, const int &n, const int &nrhs, const double *ap, double *b, const int &ldb, int &info)
Solve a real positive definite symmetric matrix problem using Cholesky factorization.
static void Dgeev(const char &uplo, const char &lrev, const int &n, const double *a, const int &lda, double *wr, double *wi, double *rev, const int &ldr, double *lev, const int &ldv, double *work, const int &lwork, int &info)
Solve general real matrix eigenproblem.
void F77NAME() dgetrs(const char &trans, const int &n, const int &nrhs, const double *a, const int &lda, int *ipiv, double *b, const int &ldb, int &info)
void F77NAME() dgetri(const int &n, double *a, const int &lda, const int *ipiv, double *wk, const int &lwk, int &info)
static void Dgbtrf(const int &m, const int &n, const int &kl, const int &ku, double *a, const int &lda, int *ipiv, int &info)
General banded matrix LU factorisation.
void F77NAME() dgetrf(const int &m, const int &n, double *a, const int &lda, int *ipiv, int &info)
static void Dsptrs(const char &uplo, const int &n, const int &nrhs, const double *ap, const int *ipiv, double *b, const int &ldb, int &info)
Solve a real packed-symmetric matrix problem using Bunch-Kaufman pivoting.
static void Dsbev(const char &jobz, const char &uplo, const int &kl, const int &ku, double *ap, const int &lda, double *w, double *z, const int &ldz, double *work, int &info)
Solve packed-banded real matrix eigenproblem.
static void Dtrtrs(const char &uplo, const char &trans, const char &diag, const int &n, const int &nrhs, const double *a, const int &lda, double *b, const int &ldb, int &info)
Solve a triangular system.
static void DoSsptrf(const char &uplo, const int &n, double *ap, int *ipiv, int &info)
factor a real packed-symmetric matrix using Bunch-Kaufman pivoting.
void F77NAME() sgeev(const char &uplo, const char &lrev, const int &n, const float *a, const int &lda, float *wr, float *wi, float *rev, const int &ldr, float *lev, const int &ldv, float *work, const int &lwork, int &info)
static void Dgetrf(const int &m, const int &n, double *a, const int &lda, int *ipiv, int &info)
General matrix LU factorisation.
void F77NAME() dgeev(const char &uplo, const char &lrev, const int &n, const double *a, const int &lda, double *wr, double *wi, double *rev, const int &ldr, double *lev, const int &ldv, double *work, const int &lwork, int &info)
static void Dpptrf(const char &uplo, const int &n, double *ap, int &info)
Cholesky factor a real positive definite packed-symmetric matrix.
static void DoSsptri(const char &uplo, const int &n, const double *ap, const int *ipiv, double *work, int &info)
Invert a real packed-symmetric matrix problem.
static void Dsptri(const char &uplo, const int &n, const double *ap, const int *ipiv, double *work, int &info)
Invert a real packed-symmetric matrix problem.
static void Dgetrs(const char &trans, const int &n, const int &nrhs, const double *a, const int &lda, int *ipiv, double *b, const int &ldb, int &info)
General matrix LU backsolve.
void F77NAME() dsterf(const int &n, double *d, double *e, int &info)
static void Dsptrf(const char &uplo, const int &n, double *ap, int *ipiv, int &info)
factor a real packed-symmetric matrix using Bunch-Kaufman pivoting.
static void Dpbtrf(const char &uplo, const int &n, const int &kd, double *ab, const int &ldab, int &info)
Cholesky factorize a real positive definite banded-symmetric matrix.
void F77NAME() sgetri(const int &n, float *a, const int &lda, const int *ipiv, float *wk, const int &lwk, int &info)
void F77NAME() dsptri(const char &uplo, const int &n, const double *ap, const int *ipiv, double *work, int &info)
void F77NAME() dspev(const char &jobz, const char &uplo, const int &n, double *ap, double *w, double *z, const int &ldz, double *work, int &info)
static void Dgbtrs(const char &trans, const int &n, const int &kl, const int &ku, const int &nrhs, const double *a, const int &lda, const int *ipiv, double *b, const int &ldb, int &info)
Solve general banded matrix using LU factorisation.
static void DoSgetrf(const int &m, const int &n, double *a, const int &lda, int *ipiv, int &info)
General matrix LU factorisation.
static void Dgetri(const int &n, double *a, const int &lda, const int *ipiv, double *wk, const int &lwk, int &info)
General matrix inverse.
static void DoSgetri(const int &n, double *a, const int &lda, const int *ipiv, double *wk, const int &lwk, int &info)
General matrix inverse.
void F77NAME() dgbtrs(const char &trans, const int &n, const int &kl, const int &ku, const int &nrhs, const double *a, const int &lda, const int *ipiv, double *b, const int &ldb, int &info)
static void Dsterf(const int &n, double *d, double *e, int &info)
Find eigenvalues of symmetric tridiagonal matrix.
void F77NAME() dsptrf(const char &uplo, const int &n, double *ap, int *ipiv, int &info)
void F77NAME() dpptrs(const char &uplo, const int &n, const int &nrhs, const double *ap, double *b, const int &ldb, int &info)
static void DoSgeev(const char &uplo, const char &lrev, const int &n, const double *a, const int &lda, double *wr, double *wi, double *rev, const int &ldr, double *lev, const int &ldv, double *work, const int &lwork, int &info)
Solve general real matrix eigenproblem.
void F77NAME() sgetrf(const int &m, const int &n, float *a, const int &lda, int *ipiv, int &info)
void F77NAME() ssptrs(const char &uplo, const int &n, const int &nrhs, const float *ap, const int *ipiv, float *b, const int &ldb, int &info)
void F77NAME() ssptri(const char &uplo, const int &n, const float *ap, const int *ipiv, float *work, int &info)
static void Dtptrs(const char &uplo, const char &trans, const char &diag, const int &n, const int &nrhs, const double *a, double *b, const int &ldb, int &info)
Solve a triangular system.
static void DoSsptrs(const char &uplo, const int &n, const int &nrhs, const double *ap, const int *ipiv, double *b, const int &ldb, int &info)
Solve a real packed-symmetric matrix problem using Bunch-Kaufman pivoting.
void F77NAME() dsptrs(const char &uplo, const int &n, const int &nrhs, const double *ap, const int *ipiv, double *b, const int &ldb, int &info)
void F77NAME() dtrtrs(const char &uplo, const char &trans, const char &diag, const int &n, const int &nrhs, const double *a, const int &lda, double *b, const int &ldb, int &info)
void F77NAME() dtptrs(const char &uplo, const char &trans, const char &diag, const int &n, const int &nrhs, const double *a, double *b, const int &ldb, int &info)
void F77NAME() dpbtrs(const char &uplo, const int &n, const int &kd, const int &nrhs, const double *ab, const int &ldab, double *b, const int &ldb, int &info)
void F77NAME() dgbtrf(const int &m, const int &n, const int &kl, const int &ku, double *a, const int &lda, int *ipiv, int &info)
static void Dpbtrs(const char &uplo, const int &n, const int &kd, const int &nrhs, const double *ab, const int &ldab, double *b, const int &ldb, int &info)
Solve a real, positive definite banded-symmetric matrix problem using Cholesky factorization.
std::vector< double > w(NPUPPER)
std::vector< double > z(NPUPPER)
std::vector< double > d(NPUPPER *NPUPPER)