34#ifndef NEKTAR_LIB_UTILITIES_LAPACK_HPP
35#define NEKTAR_LIB_UTILITIES_LAPACK_HPP
45 const int &lda,
int *ipiv,
double *b,
const int &ldb,
48 void F77NAME(
dsptrf)(
const char &uplo,
const int &n,
double *ap,
int *ipiv,
50 void F77NAME(
ssptrf)(
const char &uplo,
const int &n,
float *ap,
int *ipiv,
53 const double *ap,
const int *ipiv,
double *b,
54 const int &ldb,
int &info);
56 const float *ap,
const int *ipiv,
float *b,
57 const int &ldb,
int &info);
59 const int *ipiv,
double *work,
int &info);
61 const int *ipiv,
float *work,
int &info);
62 void F77NAME(
dtrtrs)(
const char &uplo,
const char &trans,
const char &diag,
63 const int &n,
const int &nrhs,
const double *a,
64 const int &lda,
double *b,
const int &ldb,
int &info);
65 void F77NAME(
dtptrs)(
const char &uplo,
const char &trans,
const char &diag,
66 const int &n,
const int &nrhs,
const double *a,
67 double *b,
const int &ldb,
int &info);
68 void F77NAME(
dpptrf)(
const char &uplo,
const int &n,
double *ap,
int &info);
70 const double *ap,
double *b,
const int &ldb,
73 double *ab,
const int &ldab,
int &info);
75 const int &nrhs,
const double *ab,
const int &ldab,
76 double *b,
const int &ldb,
int &info);
78 const int &ku,
double *a,
const int &lda,
int *ipiv,
81 const int &ku,
const int &nrhs,
const double *a,
82 const int &lda,
const int *ipiv,
double *b,
83 const int &ldb,
int &info);
84 void F77NAME(
dgetrf)(
const int &m,
const int &n,
double *a,
const int &lda,
85 int *ipiv,
int &info);
86 void F77NAME(
sgetrf)(
const int &m,
const int &n,
float *a,
const int &lda,
87 int *ipiv,
int &info);
89 const double *a,
const int &lda,
int *ipiv,
double *b,
90 const int &ldb,
int &info);
92 const int *ipiv,
double *wk,
const int &lwk,
95 const int *ipiv,
float *wk,
const int &lwk,
int &info);
97 void F77NAME(
dgeev)(
const char &uplo,
const char &lrev,
const int &n,
98 const double *a,
const int &lda,
double *wr,
double *wi,
99 double *rev,
const int &ldr,
double *lev,
100 const int &ldv,
double *work,
const int &lwork,
103 const float *a,
const int &lda,
float *wr,
float *wi,
104 float *rev,
const int &ldr,
float *lev,
const int &ldv,
105 float *work,
const int &lwork,
int &info);
107 double *ap,
double *w,
double *z,
const int &ldz,
108 double *work,
int &info);
110 const int &ku,
double *ap,
const int &lda,
double *w,
111 double *z,
const int &ldz,
double *work,
int &info);
114 const int &n,
double *a,
const int &lda,
double *s,
115 double *u,
const int &ldu,
double *vt,
const int &ldvt,
116 double *work,
const int &lwork,
int &info);
118 const int &n,
float *a,
const int &lda,
float *s,
119 float *u,
const int &ldu,
float *vt,
const int &ldvt,
120 float *work,
const int &lwork,
int &info);
122 const int &nrhs,
double *a,
const int &lda,
double *b,
123 const int &ldb,
double *work,
const int &lwork,
126 const int &nrhs,
float *a,
const int &lda,
float *b,
127 const int &ldb,
float *work,
const int &lwork,
131static inline void Dgesv(
const int &n,
const int &nrhs,
double *a,
132 const int &lda,
int *ipiv,
double *b,
const int &ldb,
140static inline void DoSsptrf(
const char &uplo,
const int &n,
double *ap,
141 int *ipiv,
int &info)
148static inline void DoSsptrf(
const char &uplo,
const int &n,
float *ap,
149 int *ipiv,
int &info)
156static inline void Dsptrf(
const char &uplo,
const int &n,
double *ap,
int *ipiv,
164static inline void DoSsptrs(
const char &uplo,
const int &n,
const int &nrhs,
165 const double *ap,
const int *ipiv,
double *b,
166 const int &ldb,
int &info)
173static inline void DoSsptrs(
const char &uplo,
const int &n,
const int &nrhs,
174 const float *ap,
const int *ipiv,
float *b,
175 const int &ldb,
int &info)
182static inline void Dsptrs(
const char &uplo,
const int &n,
const int &nrhs,
183 const double *ap,
const int *ipiv,
double *b,
184 const int &ldb,
int &info)
190static inline void DoSsptri(
const char &uplo,
const int &n,
const double *ap,
191 const int *ipiv,
double *work,
int &info)
197static inline void DoSsptri(
const char &uplo,
const int &n,
const float *ap,
198 const int *ipiv,
float *work,
int &info)
204static inline void Dtrtrs(
const char &uplo,
const char &trans,
const char &diag,
205 const int &n,
const int &nrhs,
const double *a,
206 const int &lda,
double *b,
const int &ldb,
int &info)
208 F77NAME(
dtrtrs)(uplo, trans, diag, n, nrhs, a, lda, b, ldb, info);
212static inline void Dtptrs(
const char &uplo,
const char &trans,
const char &diag,
213 const int &n,
const int &nrhs,
const double *a,
214 double *b,
const int &ldb,
int &info)
216 F77NAME(
dtptrs)(uplo, trans, diag, n, nrhs, a, b, ldb, info);
220static inline void Dsptri(
const char &uplo,
const int &n,
const double *ap,
221 const int *ipiv,
double *work,
int &info)
227static inline void Dpptrf(
const char &uplo,
const int &n,
double *ap,
int &info)
234static inline void Dpptrs(
const char &uplo,
const int &n,
const int &nrhs,
235 const double *ap,
double *b,
const int &ldb,
243static inline void Dpbtrf(
const char &uplo,
const int &n,
const int &kd,
244 double *ab,
const int &ldab,
int &info)
251static inline void Dpbtrs(
const char &uplo,
const int &n,
const int &kd,
252 const int &nrhs,
const double *ab,
const int &ldab,
253 double *b,
const int &ldb,
int &info)
259static inline void Dgbtrf(
const int &m,
const int &n,
const int &kl,
260 const int &ku,
double *a,
const int &lda,
int *ipiv,
267static inline void Dgbtrs(
const char &trans,
const int &n,
const int &kl,
268 const int &ku,
const int &nrhs,
const double *a,
269 const int &lda,
const int *ipiv,
double *b,
270 const int &ldb,
int &info)
272 F77NAME(
dgbtrs)(trans, n, kl, ku, nrhs, a, lda, ipiv, b, ldb, info);
276static inline void DoSgetrf(
const int &m,
const int &n,
double *a,
277 const int &lda,
int *ipiv,
int &info)
283static inline void DoSgetrf(
const int &m,
const int &n,
float *a,
284 const int &lda,
int *ipiv,
int &info)
290static inline void Dgetrf(
const int &m,
const int &n,
double *a,
const int &lda,
291 int *ipiv,
int &info)
297static inline void Dgetrs(
const char &trans,
const int &n,
const int &nrhs,
298 const double *a,
const int &lda,
int *ipiv,
double *b,
299 const int &ldb,
int &info)
305static inline void DoSgetri(
const int &n,
double *a,
const int &lda,
306 const int *ipiv,
double *wk,
const int &lwk,
313static inline void DoSgetri(
const int &n,
float *a,
const int &lda,
314 const int *ipiv,
float *wk,
const int &lwk,
321static inline void Dgetri(
const int &n,
double *a,
const int &lda,
322 const int *ipiv,
double *wk,
const int &lwk,
329static inline void Dsterf(
const int &n,
double *d,
double *e,
int &info)
335static inline void DoSgeev(
const char &uplo,
const char &lrev,
const int &n,
336 const double *a,
const int &lda,
double *wr,
337 double *wi,
double *rev,
const int &ldr,
double *lev,
338 const int &ldv,
double *work,
const int &lwork,
342 (uplo, lrev, n, a, lda, wr, wi, rev, ldr, lev, ldv, work, lwork, info);
346static inline void DoSgeev(
const char &uplo,
const char &lrev,
const int &n,
347 const float *a,
const int &lda,
float *wr,
float *wi,
348 float *rev,
const int &ldr,
float *lev,
349 const int &ldv,
float *work,
const int &lwork,
353 (uplo, lrev, n, a, lda, wr, wi, rev, ldr, lev, ldv, work, lwork, info);
357static inline void Dgeev(
const char &uplo,
const char &lrev,
const int &n,
358 const double *a,
const int &lda,
double *wr,
359 double *wi,
double *rev,
const int &ldr,
double *lev,
360 const int &ldv,
double *work,
const int &lwork,
364 (uplo, lrev, n, a, lda, wr, wi, rev, ldr, lev, ldv, work, lwork, info);
368static inline void Dspev(
const char &jobz,
const char &uplo,
const int &n,
369 double *ap,
double *w,
double *z,
const int &ldz,
370 double *work,
int &info)
372 F77NAME(
dspev)(jobz, uplo, n, ap, w, z, ldz, work, info);
376static inline void Dsbev(
const char &jobz,
const char &uplo,
const int &kl,
377 const int &ku,
double *ap,
const int &lda,
double *w,
378 double *z,
const int &ldz,
double *work,
int &info)
380 F77NAME(
dsbev)(jobz, uplo, kl, ku, ap, lda, w, z, ldz, work, info);
385static inline void Dgesvd(
const char &jobu,
const char &jobvt,
const int &m,
386 const int &n,
double *a,
const int &lda,
double *s,
387 double *u,
const int &ldu,
double *vt,
388 const int &ldvt,
double *work,
const int &lwork,
392 (jobu, jobvt, m, n, a, lda, s, u, ldu, vt, ldvt, work, lwork, info);
397static inline void Sgesvd(
const char &jobu,
const char &jobvt,
const int &m,
398 const int &n,
float *a,
const int &lda,
float *s,
399 float *u,
const int &ldu,
float *vt,
const int &ldvt,
400 float *work,
const int &lwork,
int &info)
403 (jobu, jobvt, m, n, a, lda, s, u, ldu, vt, ldvt, work, lwork, info);
408static inline void Dgels(
const char &trans,
const int &m,
const int &n,
409 const int &nrhs,
double *a,
const int &lda,
double *b,
410 const int &ldb,
double *work,
const int &lwork,
413 F77NAME(
dgels)(trans, m, n, nrhs, a, lda, b, ldb, work, lwork, info);
418static inline void Sgels(
const char &trans,
const int &m,
const int &n,
419 const int &nrhs,
float *a,
const int &lda,
float *b,
420 const int &ldb,
float *work,
const int &lwork,
423 F77NAME(
sgels)(trans, m, n, nrhs, a, lda, b, ldb, work, lwork, 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.
void F77NAME() dgesvd(const char &jobu, const char &jobvt, const int &m, const int &n, double *a, const int &lda, double *s, double *u, const int &ldu, double *vt, const int &ldvt, double *work, const int &lwork, int &info)
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)
void F77NAME() sgels(const char &trans, const int &m, const int &n, const int &nrhs, float *a, const int &lda, float *b, const int &ldb, float *work, const int &lwork, 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 Sgesvd(const char &jobu, const char &jobvt, const int &m, const int &n, float *a, const int &lda, float *s, float *u, const int &ldu, float *vt, const int &ldvt, float *work, const int &lwork, int &info)
Singular Value Decomposition (SVD) of a real matrix (single precision)
void F77NAME() dgesv(const int &n, const int &nrhs, double *a, const int &lda, int *ipiv, double *b, const int &ldb, int &info)
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() dgels(const char &trans, const int &m, const int &n, const int &nrhs, double *a, const int &lda, double *b, const int &ldb, double *work, const int &lwork, int &info)
void F77NAME() sgesvd(const char &jobu, const char &jobvt, const int &m, const int &n, float *a, const int &lda, float *s, float *u, const int &ldu, float *vt, const int &ldvt, float *work, const int &lwork, int &info)
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)
static void Dgels(const char &trans, const int &m, const int &n, const int &nrhs, double *a, const int &lda, double *b, const int &ldb, double *work, const int &lwork, int &info)
Solve least squares/minimum norm problems for real matrices (double precision)
static void Dgesvd(const char &jobu, const char &jobvt, const int &m, const int &n, double *a, const int &lda, double *s, double *u, const int &ldu, double *vt, const int &ldvt, double *work, const int &lwork, int &info)
Singular Value Decomposition (SVD) of a real matrix (double precision)
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 Sgels(const char &trans, const int &m, const int &n, const int &nrhs, float *a, const int &lda, float *b, const int &ldb, float *work, const int &lwork, int &info)
Solve least squares/minimum norm problems for real matrices (single precision)
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.
static void Dgesv(const int &n, const int &nrhs, double *a, const int &lda, int *ipiv, double *b, const int &ldb, int &info)
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.