17 #ifndef QMCPLUSPLUS_NUMERIC_BLAS_H 18 #define QMCPLUSPLUS_NUMERIC_BLAS_H 46 constexpr
float sone = 1.0e0;
48 constexpr
double done = 1.0e0;
50 constexpr std::complex<float>
cone = 1.0e0;
51 constexpr std::complex<float>
czero = 0.0e0;
52 constexpr std::complex<double>
zone = 1.0e0;
53 constexpr std::complex<double>
zzero = 0.0e0;
55 inline static void axpy(
int n,
double x,
const double* a,
double* b) {
daxpy(
n, x, a,
INCX, b,
INCY); }
57 inline static void axpy(
int n,
double x,
const double* a,
int incx,
double* b,
int incy)
59 daxpy(
n, x, a, incx, b, incy);
64 inline static void axpy(
int n,
float x,
const float* a,
int incx,
float* b,
int incy)
66 saxpy(
n, x, a, incx, b, incy);
72 const std::complex<float> x,
73 const std::complex<float>* a,
75 std::complex<float>* b,
78 caxpy(
n, x, a, incx, b, incy);
82 const std::complex<double> x,
83 const std::complex<double>* a,
85 std::complex<double>* b,
88 zaxpy(
n, x, a, incx, b, incy);
91 inline static float norm2(
int n,
const float* a,
int incx = 1) {
return snrm2(
n, a, incx); }
93 inline static float norm2(
int n,
const std::complex<float>* a,
int incx = 1) {
return scnrm2(
n, a, incx); }
95 inline static double norm2(
int n,
const double* a,
int incx = 1) {
return dnrm2(
n, a, incx); }
97 inline static double norm2(
int n,
const std::complex<double>* a,
int incx = 1) {
return dznrm2(
n, a, incx); }
99 inline static void scal(
int n,
float alpha,
float* x,
int incx = 1) {
sscal(
n, alpha, x, incx); }
101 inline static void scal(
int n, std::complex<float> alpha, std::complex<float>* x,
int incx = 1)
106 inline static void scal(
int n,
double alpha,
double* x,
int incx = 1) {
dscal(
n, alpha, x, incx); }
108 inline static void scal(
int n, std::complex<double> alpha, std::complex<double>* x,
int incx = 1)
113 inline static void scal(
int n,
double alpha, std::complex<double>* x,
int incx = 1) {
zdscal(
n, alpha, x, incx); }
115 inline static void scal(
int n,
float alpha, std::complex<float>* x,
int incx = 1) {
csscal(
n, alpha, x, incx); }
118 inline static void gemv(
int n,
int m,
const double* restrict amat,
const double* restrict x,
double* restrict y)
120 dgemv(
NOTRANS,
m,
n,
done, amat,
m, x,
INCX,
dzero, y,
INCY);
123 inline static void gemv(
int n,
int m,
const float* restrict amat,
const float* restrict x,
float* restrict y)
125 sgemv(
NOTRANS,
m,
n,
done, amat,
m, x,
INCX,
dzero, y,
INCY);
130 const std::complex<double>* restrict amat,
131 const std::complex<double>* restrict x,
132 std::complex<double>* restrict y)
134 zgemv(
NOTRANS,
m,
n,
zone, amat,
m, x,
INCX,
zzero, y,
INCY);
139 const std::complex<float>* restrict amat,
140 const std::complex<float>* restrict x,
141 std::complex<float>* restrict y)
143 cgemv(
NOTRANS,
m,
n,
cone, amat,
m, x,
INCX,
czero, y,
INCY);
147 inline static void gemv_trans(
int n,
int m,
const double* restrict amat,
const double* restrict x,
double* restrict y)
149 dgemv(
TRANS,
m,
n,
done, amat,
m, x,
INCX,
dzero, y,
INCY);
152 inline static void gemv_trans(
int n,
int m,
const float* restrict amat,
const float* restrict x,
float* restrict y)
154 sgemv(
TRANS,
m,
n,
done, amat,
m, x,
INCX,
dzero, y,
INCY);
159 const std::complex<double>* restrict amat,
160 const std::complex<double>* restrict x,
161 std::complex<double>* restrict y)
163 zgemv(
TRANS,
m,
n,
done, amat,
m, x,
INCX,
dzero, y,
INCY);
168 const std::complex<float>* restrict amat,
169 const std::complex<float>* restrict x,
170 std::complex<float>* restrict y)
172 cgemv(
TRANS,
m,
n,
done, amat,
m, x,
INCX,
dzero, y,
INCY);
175 inline static void gemv(
char trans_in,
179 const double* restrict amat,
187 dgemv(trans_in,
n,
m, alpha, amat,
lda, x, incx, beta, y, incy);
190 inline static void gemv(
char trans_in,
194 const float* restrict amat,
202 sgemv(trans_in,
n,
m, alpha, amat,
lda, x, incx, beta, y, incy);
205 inline static void gemv(
char trans_in,
208 const std::complex<double>& alpha,
209 const std::complex<double>* restrict amat,
211 const std::complex<double>* restrict x,
213 const std::complex<double>& beta,
214 std::complex<double>* y,
217 zgemv(trans_in,
n,
m, alpha, amat,
lda, x, incx, beta, y, incy);
220 inline static void gemv(
char trans_in,
223 const std::complex<float>& alpha,
224 const std::complex<float>* restrict amat,
226 const std::complex<float>* restrict x,
228 const std::complex<float>& beta,
229 std::complex<float>* y,
232 cgemv(trans_in,
n,
m, alpha, amat,
lda, x, incx, beta, y, incy);
235 inline static void gemm(
char Atrans,
243 const double* restrict
B,
249 dgemm(Atrans, Btrans, M,
N,
K, alpha,
A,
lda,
B, ldb, beta,
C, ldc);
252 inline static void gemm(
char Atrans,
260 const float* restrict
B,
266 sgemm(Atrans, Btrans, M,
N,
K, alpha,
A,
lda,
B, ldb, beta,
C, ldc);
269 inline static void gemm(
char Atrans,
274 std::complex<double> alpha,
275 const std::complex<double>*
A,
277 const std::complex<double>* restrict
B,
279 std::complex<double> beta,
280 std::complex<double>* restrict
C,
283 zgemm(Atrans, Btrans, M,
N,
K, alpha,
A,
lda,
B, ldb, beta,
C, ldc);
286 inline static void gemm(
char Atrans,
291 std::complex<float> alpha,
292 const std::complex<float>*
A,
294 const std::complex<float>* restrict
B,
296 std::complex<float> beta,
297 std::complex<float>* restrict
C,
300 cgemm(Atrans, Btrans, M,
N,
K, alpha,
A,
lda,
B, ldb, beta,
C, ldc);
304 inline static T
dot(
int n,
const T* restrict a,
const T* restrict b)
307 for (
int i = 0; i <
n; ++i)
313 inline static std::complex<T>
dot(
int n,
const std::complex<T>* restrict a,
const T* restrict b)
315 std::complex<T> res = T(0);
316 for (
int i = 0; i <
n; ++i)
322 inline static std::complex<T>
dot(
int n,
const std::complex<T>* restrict a,
const std::complex<T>* restrict b)
324 std::complex<T> res = 0.0;
325 for (
int i = 0; i <
n; ++i)
332 inline static std::complex<T>
dot(
int n,
const T* restrict a,
const std::complex<T>* restrict b)
334 std::complex<T> res = 0.0;
335 for (
int i = 0; i <
n; ++i)
341 inline static T
dot(
int n,
const T* restrict a,
int incx,
const T* restrict b,
int incy)
344 for (
int i = 0, ia = 0, ib = 0; i <
n; ++i, ia += incx, ib += incy)
345 res += a[ia] * b[ib];
350 inline static std::complex<T>
dot(
int n,
const std::complex<T>* restrict a,
int incx,
const T* restrict b,
int incy)
352 std::complex<T> res = T(0);
353 for (
int i = 0, ia = 0, ib = 0; i <
n; ++i, ia += incx, ib += incy)
354 res += a[ia] * b[ib];
359 inline static std::complex<T>
dot(
int n,
const T* restrict a,
int incx,
const std::complex<T>* restrict b,
int incy)
361 std::complex<T> res = T(0);
362 for (
int i = 0, ia = 0, ib = 0; i <
n; ++i, ia += incx, ib += incy)
363 res += a[ia] * b[ib];
368 inline static std::complex<T>
dot(
int n,
369 const std::complex<T>* restrict a,
371 const std::complex<T>* restrict b,
374 std::complex<T> res = T(0);
375 for (
int i = 0, ia = 0, ib = 0; i <
n; ++i, ia += incx, ib += incy)
376 res += a[ia] * b[ib];
381 inline static void copy(
int n,
const T* restrict a, T* restrict b)
383 memcpy(b, a,
sizeof(T) *
n);
392 inline static void copy(T* restrict target,
const T* restrict source,
int n)
394 memcpy(target, source,
sizeof(T) *
n);
398 inline static void copy(
int n,
const std::complex<T>* restrict a, T* restrict b)
400 for (
int i = 0; i <
n; ++i)
405 inline static void copy(
int n,
const T* restrict a, std::complex<T>* restrict b)
407 for (
int i = 0; i <
n; ++i)
412 inline static void copy(
int n,
const T* restrict x,
int incx, T* restrict y,
int incy)
414 const int xmax = incx *
n;
415 for (
int ic = 0, jc = 0; ic < xmax; ic += incx, jc += incy)
447 dger(&
m, &
n, &alpha, x, &incx, y, &incy, a, &
lda);
460 sger(&
m, &
n, &alpha, x, &incx, y, &incy, a, &
lda);
465 const std::complex<double>& alpha,
466 const std::complex<double>* x,
468 const std::complex<double>* y,
470 std::complex<double>* a,
473 zgeru(&
m, &
n, &alpha, x, &incx, y, &incy, a, &
lda);
478 const std::complex<float>& alpha,
479 const std::complex<float>* x,
481 const std::complex<float>* y,
483 std::complex<float>* a,
486 cgeru(&
m, &
n, &alpha, x, &incx, y, &incy, a, &
lda);
492 inline static void heev(
char& jobz,
495 std::complex<float>* a,
498 std::complex<float>* work,
503 cheev(jobz, uplo,
n, a,
lda, w, work, lwork, rwork, info);
506 inline static void heev(
char& jobz,
509 std::complex<double>* a,
512 std::complex<double>* work,
517 zheev(jobz, uplo,
n, a,
lda, w, work, lwork, rwork, info);
520 inline static void gesvd(
const char& jobu,
535 sgesvd(jobu, jobvt,
m,
n, a,
lda,
s, u, ldu, vt, ldvt, work, lwork, info);
538 inline static void gesvd(
const char& jobu,
553 dgesvd(jobu, jobvt,
m,
n, a,
lda,
s, u, ldu, vt, ldvt, work, lwork, info);
556 inline static void gesvd(
const char& jobu,
560 std::complex<float>* a,
563 std::complex<float>* u,
565 std::complex<float>* vt,
567 std::complex<float>* work,
572 cgesvd(jobu, jobvt,
m,
n, a,
lda,
s, u, ldu, vt, ldvt, work, lwork, rwork, info);
575 inline static void gesvd(
const char& jobu,
579 std::complex<double>* a,
582 std::complex<double>* u,
584 std::complex<double>* vt,
586 std::complex<double>* work,
591 zgesvd(jobu, jobvt,
m,
n, a,
lda,
s, u, ldu, vt, ldvt, work, lwork, rwork, info);
594 inline static void geev(
char* jobvl,
609 dgeev(jobvl, jobvr,
n, a,
lda, alphar, alphai, vl, ldvl, vr, ldvr, work, lwork, info);
612 inline static void geev(
char* jobvl,
627 sgeev(jobvl, jobvr,
n, a,
lda, alphar, alphai, vl, ldvl, vr, ldvr, work, lwork, info);
630 inline static void geev(
char* jobvl,
633 std::complex<double>* a,
635 std::complex<double>* alpha,
636 std::complex<double>* vl,
638 std::complex<double>* vr,
640 std::complex<double>* work,
645 zgeev(jobvl, jobvr,
n, a,
lda, alpha, vl, ldvl, vr, ldvr, work, lwork, rwork, info);
648 inline static void geev(
char* jobvl,
651 std::complex<float>* a,
653 std::complex<float>* alpha,
654 std::complex<float>* vl,
656 std::complex<float>* vr,
658 std::complex<float>* work,
663 cgeev(jobvl, jobvr,
n, a,
lda, alpha, vl, ldvl, vr, ldvr, work, lwork, rwork, info);
667 inline static void ggev(
char* jobvl,
685 dggev(jobvl, jobvr,
n, a,
lda, b, ldb, alphar, alphai, beta, vl, ldvl, vr, ldvr, work, lwork, info);
688 inline static void ggev(
char* jobvl,
706 sggev(jobvl, jobvr,
n, a,
lda, b, ldb, alphar, alphai, beta, vl, ldvl, vr, ldvr, work, lwork, info);
709 inline static void hevr(
char& JOBZ,
735 ssyevr(JOBZ, RANGE,
UPLO,
N,
A, LDA, VL, VU, IL, IU, ABSTOL, M, W, Z, LDZ, ISUPPZ, RWORK, LRWORK, IWORK, LIWORK,
739 inline static void hevr(
char& JOBZ,
765 dsyevr(JOBZ, RANGE,
UPLO,
N,
A, LDA, VL, VU, IL, IU, ABSTOL, M, W, Z, LDZ, ISUPPZ, RWORK, LRWORK, IWORK, LIWORK,
769 inline static void hevr(
char& JOBZ,
773 std::complex<float>*
A,
782 std::complex<float>* Z,
785 std::complex<float>* WORK,
793 cheevr(JOBZ, RANGE,
UPLO,
N,
A, LDA, VL, VU, IL, IU, ABSTOL, M, W, Z, LDZ, ISUPPZ, WORK, LWORK, RWORK, LRWORK,
794 IWORK, LIWORK, INFO);
797 inline static void hevr(
char& JOBZ,
801 std::complex<double>*
A,
810 std::complex<double>* Z,
813 std::complex<double>* WORK,
821 zheevr(JOBZ, RANGE,
UPLO,
N,
A, LDA, VL, VU, IL, IU, ABSTOL, M, W, Z, LDZ, ISUPPZ, WORK, LWORK, RWORK, LRWORK,
822 IWORK, LIWORK, INFO);
825 static void getrf(
const int&
n,
const int&
m,
double* a,
const int& n0,
int* piv,
int& st)
830 static void getrf(
const int&
n,
const int&
m,
float* a,
const int& n0,
int* piv,
int& st)
835 static void getrf(
const int&
n,
const int&
m, std::complex<double>* a,
const int& n0,
int* piv,
int& st)
840 static void getrf(
const int&
n,
const int&
m, std::complex<float>* a,
const int& n0,
int* piv,
int& st)
848 int const* restrict piv,
849 float* restrict work,
853 sgetri(
n, a, n0, piv, work, n1, status);
859 int const* restrict piv,
860 double* restrict work,
864 dgetri(
n, a, n0, piv, work, n1, status);
868 std::complex<float>* restrict a,
870 int const* restrict piv,
871 std::complex<float>* restrict work,
875 cgetri(
n, a, n0, piv, work, n1, status);
879 std::complex<double>* restrict a,
881 int const* restrict piv,
882 std::complex<double>* restrict work,
886 zgetri(
n, a, n0, piv, work, n1, status);
891 std::complex<double>*
A,
893 std::complex<double>* TAU,
894 std::complex<double>* WORK,
898 zgeqrf(M,
N,
A, LDA, TAU, WORK, LWORK, INFO);
901 static void geqrf(
int M,
int N,
double*
A,
const int LDA,
double* TAU,
double* WORK,
int LWORK,
int& INFO)
903 dgeqrf(M,
N,
A, LDA, TAU, WORK, LWORK, INFO);
908 std::complex<float>*
A,
910 std::complex<float>* TAU,
911 std::complex<float>* WORK,
915 cgeqrf(M,
N,
A, LDA, TAU, WORK, LWORK, INFO);
918 static void geqrf(
int M,
int N,
float*
A,
const int LDA,
float* TAU,
float* WORK,
int LWORK,
int& INFO)
920 sgeqrf(M,
N,
A, LDA, TAU, WORK, LWORK, INFO);
925 std::complex<double>*
A,
927 std::complex<double>* TAU,
928 std::complex<double>* WORK,
932 zgelqf(M,
N,
A, LDA, TAU, WORK, LWORK, INFO);
935 static void gelqf(
int M,
int N,
double*
A,
const int LDA,
double* TAU,
double* WORK,
int LWORK,
int& INFO)
937 dgelqf(M,
N,
A, LDA, TAU, WORK, LWORK, INFO);
942 std::complex<float>*
A,
944 std::complex<float>* TAU,
945 std::complex<float>* WORK,
949 cgelqf(M,
N,
A, LDA, TAU, WORK, LWORK, INFO);
952 static void gelqf(
int M,
int N,
float*
A,
const int LDA,
float* TAU,
float* WORK,
int LWORK,
int& INFO)
954 sgelqf(M,
N,
A, LDA, TAU, WORK, LWORK, INFO);
960 std::complex<double>*
A,
962 std::complex<double>* TAU,
963 std::complex<double>* WORK,
967 zungqr(M,
N,
K,
A, LDA, TAU, WORK, LWORK, INFO);
970 static void gqr(
int M,
int N,
int K,
double*
A,
const int LDA,
double* TAU,
double* WORK,
int LWORK,
int& INFO)
972 dorgqr(M,
N,
K,
A, LDA, TAU, WORK, LWORK, INFO);
978 std::complex<float>*
A,
980 std::complex<float>* TAU,
981 std::complex<float>* WORK,
985 cungqr(M,
N,
K,
A, LDA, TAU, WORK, LWORK, INFO);
988 static void gqr(
int M,
int N,
int K,
float*
A,
const int LDA,
float* TAU,
float* WORK,
int LWORK,
int& INFO)
990 sorgqr(M,
N,
K,
A, LDA, TAU, WORK, LWORK, INFO);
996 std::complex<double>*
A,
998 std::complex<double>* TAU,
999 std::complex<double>* WORK,
1003 zunglq(M,
N,
K,
A, LDA, TAU, WORK, LWORK, INFO);
1006 static void glq(
int M,
int N,
int K,
double*
A,
const int LDA,
double* TAU,
double* WORK,
int LWORK,
int& INFO)
1008 dorglq(M,
N,
K,
A, LDA, TAU, WORK, LWORK, INFO);
1014 std::complex<float>*
A,
1016 std::complex<float>* TAU,
1017 std::complex<float>* WORK,
1021 cunglq(M,
N,
K,
A, LDA, TAU, WORK, LWORK, INFO);
1024 static void glq(
int M,
int N,
int K,
float*
A,
const int LDA,
float* TAU,
float* WORK,
int const LWORK,
int& INFO)
1026 sorglq(M,
N,
K,
A, LDA, TAU, WORK, LWORK, INFO);
1029 static void potrf(
const char&
UPLO,
const int&
N,
float*
A,
const int& LDA,
int& INFO)
1034 static void potrf(
const char&
UPLO,
const int&
N,
double*
A,
const int& LDA,
int& INFO)
1039 static void potrf(
const char&
UPLO,
const int&
N, std::complex<float>*
A,
const int& LDA,
int& INFO)
1044 static void potrf(
const char&
UPLO,
const int&
N, std::complex<double>*
A,
const int& LDA,
int& INFO)
1051 #endif // OHMMS_BLAS_H void zungqr(const int &M, const int &N, const int &K, std::complex< double > *A, const int &LDA, std::complex< double > *TAU, std::complex< double > *WORK, const int &LWORK, int &INFO)
static void gqr(int M, int N, int K, float *A, const int LDA, float *TAU, float *WORK, int LWORK, int &INFO)
static void getrf(const int &n, const int &m, std::complex< float > *a, const int &n0, int *piv, int &st)
static void gesvd(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)
void zgemm(const char &, const char &, const int &, const int &, const int &, const std::complex< double > &, const std::complex< double > *, const int &, const std::complex< double > *, const int &, const std::complex< double > &, std::complex< double > *, const int &)
static void ggev(char *jobvl, char *jobvr, int *n, double *a, int *lda, double *b, int *ldb, double *alphar, double *alphai, double *beta, double *vl, int *ldvl, double *vr, int *ldvr, double *work, int *lwork, int *info)
void sgemm(const char &, const char &, const int &, const int &, const int &, const float &, const float *, const int &, const float *, const int &, const float &, float *, const int &)
static void getrf(const int &n, const int &m, float *a, const int &n0, int *piv, int &st)
static void gemv_trans(int n, int m, const double *restrict amat, const double *restrict x, double *restrict y)
void zheev(char &JOBZ, char &UPLO, int &N, std::complex< double > *A, int &LDA, double *W, std::complex< double > *WORK, int &LWORK, double *RWORK, int &INFO)
static void potrf(const char &UPLO, const int &N, double *A, const int &LDA, int &INFO)
static void glq(int M, int N, int K, std::complex< float > *A, const int LDA, std::complex< float > *TAU, std::complex< float > *WORK, int LWORK, int &INFO)
void zgeru(const int *m, const int *n, const std::complex< double > *alpha, const std::complex< double > *x, const int *incx, const std::complex< double > *y, const int *incy, std::complex< double > *a, const int *lda)
static void geqrf(int M, int N, std::complex< double > *A, const int LDA, std::complex< double > *TAU, std::complex< double > *WORK, int LWORK, int &INFO)
double dnrm2(const int &n, const double *dx, const int &incx)
void saxpy(const int &n, const float &da, const float *dx, const int &incx, float *dy, const int &incy)
void cscal(const int &n, const std::complex< float > &, std::complex< float > *x, const int &)
void dorgqr(const int &M, const int &N, const int &K, double *A, const int &LDA, double *TAU, double *WORK, const int &LWORK, int &INFO)
void zdscal(const int &n, const double &, std::complex< double > *x, const int &)
constexpr std::complex< float > czero
static void gqr(int M, int N, int K, std::complex< float > *A, const int LDA, std::complex< float > *TAU, std::complex< float > *WORK, int LWORK, int &INFO)
void sgelqf(const int &M, const int &N, float *A, const int &LDA, float *TAU, float *WORK, const int &LWORK, int &INFO)
constexpr std::complex< float > cone
Interfaces to blas library.
void cgetri(const int &n, std::complex< float > *a, const int &n0, int const *piv, std::complex< float > *work, const int &, int &st)
void sgeqrf(const int &M, const int &N, float *A, const int &LDA, float *TAU, float *WORK, const int &LWORK, int &INFO)
void cgeru(const int *m, const int *n, const std::complex< float > *alpha, const std::complex< float > *x, const int *incx, const std::complex< float > *y, const int *incy, std::complex< float > *a, const int *lda)
void dpotrf(const char &UPLO, const int &N, double *A, const int &LDA, int &INFO)
static void hevr(char &JOBZ, char &RANGE, char &UPLO, int &N, double *A, int &LDA, double &VL, double &VU, int &IL, int &IU, double &ABSTOL, int &M, double *W, double *Z, int &LDZ, int *ISUPPZ, double *WORK, int &LWORK, double *RWORK, int &LRWORK, int *IWORK, int &LIWORK, int &INFO)
void dgeqrf(const int &M, const int &N, double *A, const int &LDA, double *TAU, double *WORK, const int &LWORK, int &INFO)
static void gelqf(int M, int N, double *A, const int LDA, double *TAU, double *WORK, int LWORK, int &INFO)
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)
void zgesvd(const char &JOBU, const char &JOBVT, const int &M, const int &N, std::complex< double > *A, const int &LDA, double *S, std::complex< double > *U, const int &LDU, std::complex< double > *VT, const int &LDVT, std::complex< double > *work, const int &LWORK, double *RWORK, int &INFO)
static float norm2(int n, const float *a, int incx=1)
void dgemm(const char &, const char &, const int &, const int &, const int &, const double &, const double *, const int &, const double *, const int &, const double &, double *, const int &)
void dgelqf(const int &M, const int &N, double *A, const int &LDA, double *TAU, double *WORK, const int &LWORK, int &INFO)
void zgeqrf(const int &M, const int &N, std::complex< double > *A, const int &LDA, std::complex< double > *TAU, std::complex< double > *WORK, const int &LWORK, int &INFO)
void sorglq(const int &M, const int &N, const int &K, float *A, const int &LDA, float *TAU, float *WORK, const int &LWORK, int &INFO)
static void hevr(char &JOBZ, char &RANGE, char &UPLO, int &N, std::complex< float > *A, int &LDA, float &VL, float &VU, int &IL, int &IU, float &ABSTOL, int &M, float *W, std::complex< float > *Z, int &LDZ, int *ISUPPZ, std::complex< float > *WORK, int &LWORK, float *RWORK, int &LRWORK, int *IWORK, int &LIWORK, int &INFO)
static void gqr(int M, int N, int K, double *A, const int LDA, double *TAU, double *WORK, int LWORK, int &INFO)
void dorglq(const int &M, const int &N, const int &K, double *A, const int &LDA, double *TAU, double *WORK, const int &LWORK, int &INFO)
static void gelqf(int M, int N, std::complex< float > *A, const int LDA, std::complex< float > *TAU, std::complex< float > *WORK, int LWORK, int &INFO)
static void gemv(int n, int m, const double *restrict amat, const double *restrict x, double *restrict y)
void cgeev(char *JOBVL, char *JOBVR, int *N, std::complex< float > *A, int *LDA, std::complex< float > *ALPHA, std::complex< float > *VL, int *LDVL, std::complex< float > *VR, int *LDVR, std::complex< float > *WORK, int *LWORK, float *RWORK, int *INFO)
void dscal(const int &n, const double &, double *x, const int &)
void zaxpy(const int &n, const std::complex< double > &da, const std::complex< double > *dx, const int &incx, std::complex< double > *dy, const int &incy)
static void gelqf(int M, int N, float *A, const int LDA, float *TAU, float *WORK, int LWORK, int &INFO)
static void potrf(const char &UPLO, const int &N, std::complex< float > *A, const int &LDA, int &INFO)
constexpr std::complex< double > zone
void zgemv(const char &trans, const int &nr, const int &nc, const std::complex< double > &alpha, const std::complex< double > *amat, const int &lda, const std::complex< double > *bv, const int &incx, const std::complex< double > &beta, std::complex< double > *cv, const int &incy)
static void geqrf(int M, int N, double *A, const int LDA, double *TAU, double *WORK, int LWORK, int &INFO)
void sscal(const int &n, const float &, float *x, const int &)
void dggev(char *JOBVL, char *JOBVR, int *N, double *A, int *LDA, double *B, int *LDB, double *ALPHAR, double *ALPHAI, double *BETA, double *VL, int *LDVL, double *VR, int *LDVR, double *WORK, int *LWORK, int *INFO)
void cgelqf(const int &M, const int &N, std::complex< float > *A, const int &LDA, std::complex< float > *TAU, std::complex< float > *WORK, const int &LWORK, int &INFO)
void sorgqr(const int &M, const int &N, const int &K, float *A, const int &LDA, float *TAU, float *WORK, const int &LWORK, int &INFO)
void zheevr(char &JOBZ, char &RANGE, char &UPLO, int &N, std::complex< double > *A, int &LDA, double &VL, double &VU, int &IL, int &IU, double &ABSTOL, int &M, double *W, std::complex< double > *Z, int &LDZ, int *ISUPPZ, std::complex< double > *WORK, int &LWORK, double *RWORK, int &LRWORK, int *IWORK, int &LIWORK, int &INFO)
static void heev(char &jobz, char &uplo, int &n, std::complex< double > *a, int &lda, double *w, std::complex< double > *work, int &lwork, double *rwork, int &info)
void sgetri(const int &n, float *a, const int &n0, int const *piv, float *work, const int &, int &st)
static void potrf(const char &UPLO, const int &N, std::complex< double > *A, const int &LDA, int &INFO)
static void hevr(char &JOBZ, char &RANGE, char &UPLO, int &N, float *A, int &LDA, float &VL, float &VU, int &IL, int &IU, float &ABSTOL, int &M, float *W, float *Z, int &LDZ, int *ISUPPZ, float *WORK, int &LWORK, float *RWORK, int &LRWORK, int *IWORK, int &LIWORK, int &INFO)
static void getri(int n, double *restrict a, int n0, int const *restrict piv, double *restrict work, int const &n1, int &status)
void sgeev(char *JOBVL, char *JOBVR, int *N, float *A, int *LDA, float *ALPHAR, float *ALPHAI, float *VL, int *LDVL, float *VR, int *LDVR, float *WORK, int *LWORK, int *INFO)
static void gesvd(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)
static void getri(int n, std::complex< float > *restrict a, int n0, int const *restrict piv, std::complex< float > *restrict work, int const &n1, int &status)
static void glq(int M, int N, int K, float *A, const int LDA, float *TAU, float *WORK, int const LWORK, int &INFO)
void dger(const int *m, const int *n, const double *alpha, const double *x, const int *incx, const double *y, const int *incy, double *a, const int *lda)
static void heev(char &jobz, char &uplo, int &n, std::complex< float > *a, int &lda, float *w, std::complex< float > *work, int &lwork, float *rwork, int &info)
void ssyevr(char &JOBZ, char &RANGE, char &UPLO, int &N, float *A, int &LDA, float &VL, float &VU, int &IL, int &IU, float &ABSTOL, int &M, float *W, float *Z, int &LDZ, int *ISUPPZ, float *WORK, int &LWORK, int *IWORK, int &LIWORK, int &INFO)
static void gqr(int M, int N, int K, std::complex< double > *A, const int LDA, std::complex< double > *TAU, std::complex< double > *WORK, int LWORK, int &INFO)
void dgetrf(const int &n, const int &m, double *a, const int &n0, int *piv, int &st)
static void geev(char *jobvl, char *jobvr, int *n, std::complex< double > *a, int *lda, std::complex< double > *alpha, std::complex< double > *vl, int *ldvl, std::complex< double > *vr, int *ldvr, std::complex< double > *work, int *lwork, double *rwork, int *info)
static void ger(int m, int n, double alpha, const double *x, int incx, const double *y, int incy, double *a, int lda)
void zgeev(char *JOBVL, char *JOBVR, int *N, std::complex< double > *A, int *LDA, std::complex< double > *ALPHA, std::complex< double > *VL, int *LDVL, std::complex< double > *VR, int *LDVR, std::complex< double > *WORK, int *LWORK, double *RWORK, int *INFO)
void sggev(char *JOBVL, char *JOBVR, int *N, float *A, int *LDA, float *B, int *LDB, float *ALPHAR, float *ALPHAI, float *BETA, float *VL, int *LDVL, float *VR, int *LDVR, float *WORK, int *LWORK, int *INFO)
static T dot(int n, const T *restrict a, const T *restrict b)
static void ggev(char *jobvl, char *jobvr, int *n, float *a, int *lda, float *b, int *ldb, float *alphar, float *alphai, float *beta, float *vl, int *ldvl, float *vr, int *ldvr, float *work, int *lwork, int *info)
void cgemm(const char &, const char &, const int &, const int &, const int &, const std::complex< float > &, const std::complex< float > *, const int &, const std::complex< float > *, const int &, const std::complex< float > &, std::complex< float > *, const int &)
void cgetrf(const int &n, const int &m, std::complex< float > *a, const int &n0, int *piv, int &st)
constexpr std::complex< double > zzero
void zgetri(const int &n, std::complex< double > *a, const int &n0, int const *piv, std::complex< double > *work, const int &, int &st)
float scnrm2(const int &n, const std::complex< float > *dx, const int &incx)
void sgetrf(const int &n, const int &m, float *a, const int &n0, int *piv, int &st)
void zpotrf(const char &UPLO, const int &N, std::complex< double > *A, const int &LDA, int &INFO)
void cgemv(const char &trans, const int &nr, const int &nc, const std::complex< float > &alpha, const std::complex< float > *amat, const int &lda, const std::complex< float > *bv, const int &incx, const std::complex< float > &beta, std::complex< float > *cv, const int &incy)
static void potrf(const char &UPLO, const int &N, float *A, const int &LDA, int &INFO)
void cgesvd(const char &JOBU, const char &JOBVT, const int &M, const int &N, std::complex< float > *A, const int &LDA, float *S, std::complex< float > *U, const int &LDU, std::complex< float > *VT, const int &LDVT, std::complex< float > *work, const int &LWORK, float *RWORK, int &INFO)
static void getrf(const int &n, const int &m, std::complex< double > *a, const int &n0, int *piv, int &st)
void cunglq(const int &M, const int &N, const int &K, std::complex< float > *A, const int &LDA, std::complex< float > *TAU, std::complex< float > *WORK, const int &LWORK, int &INFO)
double dznrm2(const int &n, const std::complex< double > *dx, const int &incx)
static void gelqf(int M, int N, std::complex< double > *A, const int LDA, std::complex< double > *TAU, std::complex< double > *WORK, int LWORK, int &INFO)
void caxpy(const int &n, const std::complex< float > &da, const std::complex< float > *dx, const int &incx, std::complex< float > *dy, const int &incy)
static void geqrf(int M, int N, float *A, const int LDA, float *TAU, float *WORK, int LWORK, int &INFO)
void cheevr(char &JOBZ, char &RANGE, char &UPLO, int &N, std::complex< float > *A, int &LDA, float &VL, float &VU, int &IL, int &IU, float &ABSTOL, int &M, float *W, std::complex< float > *Z, int &LDZ, int *ISUPPZ, std::complex< float > *WORK, int &LWORK, float *RWORK, int &LRWORK, int *IWORK, int &LIWORK, int &INFO)
static void gesvd(const char &jobu, const char &jobvt, const int &m, const int &n, std::complex< double > *a, const int &lda, double *s, std::complex< double > *u, const int &ldu, std::complex< double > *vt, const int &ldvt, std::complex< double > *work, const int &lwork, double *rwork, int &info)
void cungqr(const int &M, const int &N, const int &K, std::complex< float > *A, const int &LDA, std::complex< float > *TAU, std::complex< float > *WORK, const int &LWORK, int &INFO)
float snrm2(const int &n, const float *dx, const int &incx)
static void geqrf(int M, int N, std::complex< float > *A, const int LDA, std::complex< float > *TAU, std::complex< float > *WORK, int LWORK, int &INFO)
static void hevr(char &JOBZ, char &RANGE, char &UPLO, int &N, std::complex< double > *A, int &LDA, double &VL, double &VU, int &IL, int &IU, double &ABSTOL, int &M, double *W, std::complex< double > *Z, int &LDZ, int *ISUPPZ, std::complex< double > *WORK, int &LWORK, double *RWORK, int &LRWORK, int *IWORK, int &LIWORK, int &INFO)
void cpotrf(const char &UPLO, const int &N, std::complex< float > *A, const int &LDA, int &INFO)
void sger(const int *m, const int *n, const float *alpha, const float *x, const int *incx, const float *y, const int *incy, float *a, const int *lda)
void spotrf(const char &UPLO, const int &N, float *A, const int &LDA, int &INFO)
void zgelqf(const int &M, const int &N, std::complex< double > *A, const int &LDA, std::complex< double > *TAU, std::complex< double > *WORK, const int &LWORK, int &INFO)
void csscal(const int &n, const float &, std::complex< float > *x, const int &)
static void copy(int n, const T *restrict a, T *restrict b)
static void geev(char *jobvl, char *jobvr, int *n, float *a, int *lda, float *alphar, float *alphai, float *vl, int *ldvl, float *vr, int *ldvr, float *work, int *lwork, int *info)
static void axpy(int n, double x, const double *a, double *b)
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)
void zscal(const int &n, const std::complex< double > &, std::complex< double > *x, const int &)
void zunglq(const int &M, const int &N, const int &K, std::complex< double > *A, const int &LDA, std::complex< double > *TAU, std::complex< double > *WORK, const int &LWORK, int &INFO)
static void getri(int n, float *restrict a, int n0, int const *restrict piv, float *restrict work, int const &n1, int &status)
void daxpy(const int &n, const double &da, const double *dx, const int &incx, double *dy, const int &incy)
void dgeev(char *JOBVL, char *JOBVR, int *N, double *A, int *LDA, double *ALPHAR, double *ALPHAI, double *VL, int *LDVL, double *VR, int *LDVR, double *WORK, int *LWORK, int *INFO)
static void gemm(char Atrans, char Btrans, int M, int N, int K, double alpha, const double *A, int lda, const double *restrict B, int ldb, double beta, double *restrict C, int ldc)
double B(double x, int k, int i, const std::vector< double > &t)
void cgeqrf(const int &M, const int &N, std::complex< float > *A, const int &LDA, std::complex< float > *TAU, std::complex< float > *WORK, const int &LWORK, int &INFO)
static void geev(char *jobvl, char *jobvr, int *n, std::complex< float > *a, int *lda, std::complex< float > *alpha, std::complex< float > *vl, int *ldvl, std::complex< float > *vr, int *ldvr, std::complex< float > *work, int *lwork, float *rwork, int *info)
void dgemv(const char &trans, const int &nr, const int &nc, const double &alpha, const double *amat, const int &lda, const double *bv, const int &incx, const double &beta, double *cv, const int &incy)
void dsyevr(char &JOBZ, char &RANGE, char &UPLO, int &N, double *A, int &LDA, double &VL, double &VU, int &IL, int &IU, double &ABSTOL, int &M, double *W, double *Z, int &LDZ, int *ISUPPZ, double *WORK, int &LWORK, int *IWORK, int &LIWORK, int &INFO)
static void geev(char *jobvl, char *jobvr, int *n, double *a, int *lda, double *alphar, double *alphai, double *vl, int *ldvl, double *vr, int *ldvr, double *work, int *lwork, int *info)
static void getrf(const int &n, const int &m, double *a, const int &n0, int *piv, int &st)
static void getri(int n, std::complex< double > *restrict a, int n0, int const *restrict piv, std::complex< double > *restrict work, int const &n1, int &status)
static void gesvd(const char &jobu, const char &jobvt, const int &m, const int &n, std::complex< float > *a, const int &lda, float *s, std::complex< float > *u, const int &ldu, std::complex< float > *vt, const int &ldvt, std::complex< float > *work, const int &lwork, float *rwork, int &info)
static void glq(int M, int N, int K, double *A, const int LDA, double *TAU, double *WORK, int LWORK, int &INFO)
void zgetrf(const int &n, const int &m, std::complex< double > *a, const int &n0, int *piv, int &st)
void dgetri(const int &n, double *a, const int &n0, int const *piv, double *work, const int &, int &st)
void sgemv(const char &trans, const int &nr, const int &nc, const float &alpha, const float *amat, const int &lda, const float *bv, const int &incx, const float &beta, float *cv, const int &incy)
static void glq(int M, int N, int K, std::complex< double > *A, const int LDA, std::complex< double > *TAU, std::complex< double > *WORK, int LWORK, int &INFO)
static void scal(int n, float alpha, float *x, int incx=1)
void cheev(char &JOBZ, char &UPLO, int &N, std::complex< float > *A, int &LDA, float *W, std::complex< float > *WORK, int &LWORK, float *RWORK, int &INFO)