34 #ifndef NEKTAR_LIB_UTILITIES_LAPACK_HPP
35 #define NEKTAR_LIB_UTILITIES_LAPACK_HPP
45 double* ap,
int *ipiv,
int& info);
47 float* ap,
int *ipiv,
int& info);
49 const int& nrhs,
const double* ap,
50 const int *ipiv,
double* b,
51 const int& ldb,
int& info);
53 const int& nrhs,
const float* ap,
54 const int *ipiv,
float* b,
55 const int& ldb,
int& info);
58 const int *ipiv,
double* work,
62 const int *ipiv,
float* work,
64 void F77NAME(
dtrtrs) (
const char& uplo,
const char& trans,
const char& diag,
65 const int& n,
const int& nrhs,
const double* a,
66 const int& lda,
double* b,
const int& ldb,
int& info);
68 const char& uplo,
const char& trans,
const char& diag,
69 const int& n,
const int& nrhs,
const float* a,
70 const int& lda,
float* b,
const int& ldb,
int& info);
71 void F77NAME(
dtptrs) (
const char& uplo,
const char& trans,
const char& diag,
72 const int& n,
const int& nrhs,
const double* a,
73 double* b,
const int& ldb,
int& info);
75 const char& uplo,
const char& trans,
const char& diag,
76 const int& n,
const int& nrhs,
const float* a,
77 float* b,
const int& ldb,
int& info);
79 double* ap,
int& info);
81 float* ap,
int& info);
83 const int& nrhs,
const double* ap,
84 double* b,
const int& ldb,
int& info);
86 const int& nrhs,
const float* ap,
87 float* b,
const int& ldb,
int& info);
89 double* ab,
const int& ldab,
int& info);
91 float* ab,
const int& ldab,
int& info);
93 const int& kd,
const int& nrhs,
94 const float* ab,
const int& ldab,
95 float* b,
const int& ldb,
int& info);
97 const int& kd,
const int& nrhs,
98 const double* ab,
const int& ldab,
99 double* b,
const int& ldb,
int& info);
101 const int& ku,
double* a,
const int& lda,
102 int* ipiv,
int& info);
104 const int& ku,
float* a,
const int& lda,
105 int* ipiv,
int& info);
107 const int &ku,
const int& nrhs,
const double* a,
108 const int& lda,
const int* ipiv,
double* b,
109 const int& ldb,
int& info);
111 const int &ku,
const int& nrhs,
const float* a,
112 const int& lda,
const int* ipiv,
float* b,
113 const int& ldb,
int& info);
115 const int& lda,
int* ipiv,
int& info);
117 const int& lda,
int* ipiv,
int& info);
119 const double* a,
const int& lda,
int* ipiv,
120 double* b,
const int& ldb,
int& info);
122 const float* a,
const int& lda,
int* ipiv,
123 float* b,
const int& ldb,
int& info);
125 const int *ipiv,
double *wk,
const int& lwk,
128 const int *ipiv,
float *wk,
const int& lwk,
133 const double* a,
const int& lda,
double* wr,
double* wi,
134 double* rev,
const int& ldr,
135 double* lev,
const int& ldv,
136 double* work,
const int& lwork,
int& info);
138 const char& uplo,
const char& lrev,
const int& n,
139 const float* a,
const int& lda,
float* wr,
float* wi,
140 float* rev,
const int& ldr,
141 float* lev,
const int& ldv,
142 float* work,
const int& lwork,
int& info);
145 double* ap,
double* w,
double* z,
const int& ldz,
146 double* work,
int& info);
148 float* ap,
float* w,
float* z,
const int& ldz,
149 float* work,
int& info);
150 void F77NAME(
dsbev) (
const char& jobz,
const char& uplo,
const int& kl,
151 const int& ku,
double* ap,
const int& lda,
152 double* w,
double* z,
const int& ldz,
153 double* work,
int& info);
154 void F77NAME(
ssbev) (
const char& jobz,
const char& uplo,
const int& kl,
155 const int& ku,
float* ap,
const int& lda,
156 float* w,
float* z,
const int& ldz,
157 float* work,
int& info);
161 void sgetrs(
char trans,
int matrixRows,
int matrixColumns,
162 const float*
A,
float* x);
163 void dgetrs(
char trans,
int matrixRows,
int matrixColumns,
const double*
A,
double* x);
167 static inline void DoSsptrf (
const char& uplo,
const int& n,
168 double* ap,
int *ipiv,
int& info)
174 static inline void DoSsptrf (
const char& uplo,
const int& n,
175 float* ap,
int *ipiv,
int& info)
182 static inline void Dsptrf (
const char& uplo,
const int& n,
183 double* ap,
int *ipiv,
int& info)
190 static inline void DoSsptrs (
const char& uplo,
const int& n,
191 const int& nrhs,
const double* ap,
const int *ipiv,
double* b,
192 const int& ldb,
int& info)
199 static inline void DoSsptrs (
const char& uplo,
const int& n,
200 const int& nrhs,
const float* ap,
const int *ipiv,
float* b,
201 const int& ldb,
int& info)
209 static inline void Dsptrs (
const char& uplo,
const int& n,
const int& nrhs,
210 const double* ap,
const int *ipiv,
double* b,
211 const int& ldb,
int& info)
217 static inline void DoSsptri (
const char& uplo,
const int& n,
218 const double* ap,
const int *ipiv,
double* work,
224 static inline void DoSsptri (
const char& uplo,
const int& n,
225 const float* ap,
const int *ipiv,
float* work,
231 static inline void Dsptri (
const char& uplo,
const int& n,
232 const double* ap,
const int *ipiv,
double* work,
239 static inline void Dpptrf (
const char& uplo,
const int& n,
240 double *ap,
int& info)
247 static inline void Dpptrs (
const char& uplo,
const int& n,
const int& nrhs,
248 const double *ap,
double *b,
const int& ldb,
256 static inline void Dpbtrf (
const char& uplo,
const int& n,
const int& kd,
257 double *ab,
const int& ldab,
int& info)
265 static inline void Dpbtrs (
const char& uplo,
const int& n,
266 const int& kd,
const int& nrhs,
267 const double *ab,
const int& ldab,
268 double *b,
const int& ldb,
int& info)
274 static inline void Dgbtrf (
const int& m,
const int& n,
const int& kl,
275 const int& ku,
double* a,
const int& lda,
276 int* ipiv,
int& info)
282 static inline void Dgbtrs (
const char& trans,
const int& n,
const int& kl,
283 const int &ku,
const int& nrhs,
const double* a,
284 const int& lda,
const int* ipiv,
double* b,
285 const int& ldb,
int& info)
287 F77NAME(
dgbtrs)(trans,n,kl,ku,nrhs,a,lda,ipiv,b,ldb,info);
291 static inline void DoSgetrf (
const int& m,
const int& n,
double *a,
292 const int& lda,
int *ipiv,
int& info)
298 static inline void DoSgetrf (
const int& m,
const int& n,
float *a,
299 const int& lda,
int *ipiv,
int& info)
305 static inline void Dgetrf (
const int& m,
const int& n,
double *a,
306 const int& lda,
int *ipiv,
int& info)
312 static inline void Dgetrs (
const char& trans,
const int& n,
const int& nrhs,
313 const double* a,
const int& lda,
int* ipiv,
314 double* b,
const int& ldb,
int& info)
320 static inline void DoSgetri (
const int& n,
double *a,
const int& lda,
321 const int *ipiv,
double *wk,
const int& lwk,
int& info)
327 static inline void DoSgetri (
const int& n,
float *a,
const int& lda,
328 const int *ipiv,
float *wk,
const int& lwk,
int& info)
334 static inline void Dgetri (
const int& n,
double *a,
const int& lda,
335 const int *ipiv,
double *wk,
const int& lwk,
int& info)
341 static inline void Dsterf(
const int& n,
double *d,
double *e,
int& info)
347 static inline void DoSgeev (
const char& uplo,
const char& lrev,
348 const int& n,
const double* a,
const int& lda,
double* wr,
double* wi,
349 double* rev,
const int& ldr,
350 double* lev,
const int& ldv,
351 double* work,
const int& lwork,
int& info)
354 ldr, lev, ldv, work, lwork, info);
358 static inline void DoSgeev (
const char& uplo,
const char& lrev,
359 const int& n,
const float* a,
const int& lda,
float* wr,
float* wi,
360 float* rev,
const int& ldr,
361 float* lev,
const int& ldv,
362 float* work,
const int& lwork,
int& info)
365 ldr, lev, ldv, work, lwork, info);
370 static inline void Dgeev (
const char& uplo,
const char& lrev,
const int& n,
371 const double* a,
const int& lda,
double* wr,
double* wi,
372 double* rev,
const int& ldr,
373 double* lev,
const int& ldv,
374 double* work,
const int& lwork,
int& info)
377 ldr, lev, ldv, work, lwork, info);
381 static inline void Dspev (
const char& jobz,
const char& uplo,
const int& n,
382 double* ap,
double* w,
double* z,
const int& ldz,
383 double* work,
int& info)
385 F77NAME(
dspev) (jobz, uplo, n, ap, w, z, ldz, work, info);
389 static inline void Dsbev (
const char& jobz,
const char& uplo,
const int& kl,
390 const int& ku,
double* ap,
const int& lda,
391 double* w,
double* z,
const int& ldz,
392 double* work,
int& info)
394 F77NAME(
dsbev) (jobz, uplo, kl, ku, ap, lda, w, z, ldz, work, info);
397 static inline void Dtrtrs(
const char& uplo,
const char& trans,
const char& diag,
398 const int& n,
const int& nrhs,
const double* a,
399 const int& lda,
double* b,
const int& ldb,
int& info)
401 F77NAME(
dtrtrs) (uplo, trans, diag, n, nrhs, a, lda, b, ldb, info);
404 static inline void Dtptrs(
const char& uplo,
const char& trans,
const char& diag,
405 const int& n,
const int& nrhs,
const double* a,
406 double* b,
const int& ldb,
int& info)
408 F77NAME(
dtptrs) (uplo, trans, diag, n, nrhs, a, b, ldb, 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 defiinte 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)
void F77NAME() spbtrf(const char &uplo, const int &n, const int &kd, float *ab, const int &ldab, 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 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)
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 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 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)
void F77NAME() sspev(const char &jobz, const char &uplo, const int &n, float *ap, float *w, float *z, const int &ldz, float *work, 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.
void F77NAME() spbtrs(const char &uplo, const int &n, const int &kd, const int &nrhs, const float *ab, const int &ldab, float *b, const int &ldb, int &info)
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() ssbev(const char &jobz, const char &uplo, const int &kl, const int &ku, float *ap, const int &lda, float *w, float *z, const int &ldz, float *work, int &info)
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() spptrs(const char &uplo, const int &n, const int &nrhs, const float *ap, float *b, const int &ldb, int &info)
void F77NAME() sgbtrs(const char &trans, const int &n, const int &kl, const int &ku, const int &nrhs, const float *a, const int &lda, const int *ipiv, float *b, const int &ldb, 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)
Generate matrix inverse.
static void DoSgetri(const int &n, double *a, const int &lda, const int *ipiv, double *wk, const int &lwk, int &info)
Generate 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() stptrs(const char &uplo, const char &trans, const char &diag, const int &n, const int &nrhs, const float *a, float *b, const int &ldb, int &info)
void F77NAME() ssterf(const int &n, float *d, float *e, 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)
void F77NAME() spptrf(const char &uplo, const int &n, float *ap, 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() sgbtrf(const int &m, const int &n, const int &kl, const int &ku, float *a, const int &lda, int *ipiv, int &info)
void F77NAME() strtrs(const char &uplo, const char &trans, const char &diag, const int &n, const int &nrhs, const float *a, const int &lda, 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)
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 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() sgetrs(const char &trans, const int &n, const int &nrhs, const float *a, const int &lda, int *ipiv, float *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.