QMCPACK
BLAS.hpp
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2016 Jeongnim Kim and QMCPACK developers.
6 //
7 // File developed by: Ken Esler, kpesler@gmail.com, University of Illinois at Urbana-Champaign
8 // Miguel Morales, moralessilva2@llnl.gov, Lawrence Livermore National Laboratory
9 // Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
10 // Jeremy McMinnis, jmcminis@gmail.com, University of Illinois at Urbana-Champaign
11 // Mark A. Berrill, berrillma@ornl.gov, Oak Ridge National Laboratory
12 //
13 // File created by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
14 //////////////////////////////////////////////////////////////////////////////////////
15 
16 
17 #ifndef QMCPLUSPLUS_NUMERIC_BLAS_H
18 #define QMCPLUSPLUS_NUMERIC_BLAS_H
19 
20 //generic header for blas routines
21 #include "Blasf.h"
22 
23 /** Interfaces to blas library
24  *
25  * static data members to facilitate /Fortran blas interface
26  * static member functions to use blas functions
27  * - inline static void axpy
28  * - inline static double norm2
29  * - inline static float norm2
30  * - inline static void symv
31  * - inline static double dot
32  * - inline static float dot
33  *
34  * Arguments (float/double/complex<float>/complex<double>) determine
35  * which BLAS routines are actually used.
36  * Note that symv can be call in many ways.
37  */
38 namespace BLAS
39 {
40  constexpr int INCX = 1;
41  constexpr int INCY = 1;
42  constexpr char UPLO = 'L';
43  constexpr char TRANS = 'T';
44  constexpr char NOTRANS = 'N';
45 
46  constexpr float sone = 1.0e0;
47  constexpr float szero = 0.0e0;
48  constexpr double done = 1.0e0;
49  constexpr double dzero = 0.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;
54 
55  inline static void axpy(int n, double x, const double* a, double* b) { daxpy(n, x, a, INCX, b, INCY); }
56 
57  inline static void axpy(int n, double x, const double* a, int incx, double* b, int incy)
58  {
59  daxpy(n, x, a, incx, b, incy);
60  }
61 
62  inline static void axpy(int n, const double* a, double* b) { daxpy(n, done, a, INCX, b, INCY); }
63 
64  inline static void axpy(int n, float x, const float* a, int incx, float* b, int incy)
65  {
66  saxpy(n, x, a, incx, b, incy);
67  }
68 
69  inline static void axpy(int n, float x, const float* a, float* b) { saxpy(n, x, a, INCX, b, INCY); }
70 
71  inline static void axpy(int n,
72  const std::complex<float> x,
73  const std::complex<float>* a,
74  int incx,
75  std::complex<float>* b,
76  int incy)
77  {
78  caxpy(n, x, a, incx, b, incy);
79  }
80 
81  inline static void axpy(int n,
82  const std::complex<double> x,
83  const std::complex<double>* a,
84  int incx,
85  std::complex<double>* b,
86  int incy)
87  {
88  zaxpy(n, x, a, incx, b, incy);
89  }
90 
91  inline static float norm2(int n, const float* a, int incx = 1) { return snrm2(n, a, incx); }
92 
93  inline static float norm2(int n, const std::complex<float>* a, int incx = 1) { return scnrm2(n, a, incx); }
94 
95  inline static double norm2(int n, const double* a, int incx = 1) { return dnrm2(n, a, incx); }
96 
97  inline static double norm2(int n, const std::complex<double>* a, int incx = 1) { return dznrm2(n, a, incx); }
98 
99  inline static void scal(int n, float alpha, float* x, int incx = 1) { sscal(n, alpha, x, incx); }
100 
101  inline static void scal(int n, std::complex<float> alpha, std::complex<float>* x, int incx = 1)
102  {
103  cscal(n, alpha, x, incx);
104  }
105 
106  inline static void scal(int n, double alpha, double* x, int incx = 1) { dscal(n, alpha, x, incx); }
107 
108  inline static void scal(int n, std::complex<double> alpha, std::complex<double>* x, int incx = 1)
109  {
110  zscal(n, alpha, x, incx);
111  }
112 
113  inline static void scal(int n, double alpha, std::complex<double>* x, int incx = 1) { zdscal(n, alpha, x, incx); }
114 
115  inline static void scal(int n, float alpha, std::complex<float>* x, int incx = 1) { csscal(n, alpha, x, incx); }
116 
117  // amat is [n][m] in C
118  inline static void gemv(int n, int m, const double* restrict amat, const double* restrict x, double* restrict y)
119  {
120  dgemv(NOTRANS, m, n, done, amat, m, x, INCX, dzero, y, INCY);
121  }
122 
123  inline static void gemv(int n, int m, const float* restrict amat, const float* restrict x, float* restrict y)
124  {
125  sgemv(NOTRANS, m, n, done, amat, m, x, INCX, dzero, y, INCY);
126  }
127 
128  inline static void gemv(int n,
129  int m,
130  const std::complex<double>* restrict amat,
131  const std::complex<double>* restrict x,
132  std::complex<double>* restrict y)
133  {
134  zgemv(NOTRANS, m, n, zone, amat, m, x, INCX, zzero, y, INCY);
135  }
136 
137  inline static void gemv(int n,
138  int m,
139  const std::complex<float>* restrict amat,
140  const std::complex<float>* restrict x,
141  std::complex<float>* restrict y)
142  {
143  cgemv(NOTRANS, m, n, cone, amat, m, x, INCX, czero, y, INCY);
144  }
145 
146  // amat is [n][m] in C
147  inline static void gemv_trans(int n, int m, const double* restrict amat, const double* restrict x, double* restrict y)
148  {
149  dgemv(TRANS, m, n, done, amat, m, x, INCX, dzero, y, INCY);
150  }
151 
152  inline static void gemv_trans(int n, int m, const float* restrict amat, const float* restrict x, float* restrict y)
153  {
154  sgemv(TRANS, m, n, done, amat, m, x, INCX, dzero, y, INCY);
155  }
156 
157  inline static void gemv_trans(int n,
158  int m,
159  const std::complex<double>* restrict amat,
160  const std::complex<double>* restrict x,
161  std::complex<double>* restrict y)
162  {
163  zgemv(TRANS, m, n, done, amat, m, x, INCX, dzero, y, INCY);
164  }
165 
166  inline static void gemv_trans(int n,
167  int m,
168  const std::complex<float>* restrict amat,
169  const std::complex<float>* restrict x,
170  std::complex<float>* restrict y)
171  {
172  cgemv(TRANS, m, n, done, amat, m, x, INCX, dzero, y, INCY);
173  }
174 
175  inline static void gemv(char trans_in,
176  int n,
177  int m,
178  double alpha,
179  const double* restrict amat,
180  int lda,
181  const double* x,
182  int incx,
183  double beta,
184  double* y,
185  int incy)
186  {
187  dgemv(trans_in, n, m, alpha, amat, lda, x, incx, beta, y, incy);
188  }
189 
190  inline static void gemv(char trans_in,
191  int n,
192  int m,
193  float alpha,
194  const float* restrict amat,
195  int lda,
196  const float* x,
197  int incx,
198  float beta,
199  float* y,
200  int incy)
201  {
202  sgemv(trans_in, n, m, alpha, amat, lda, x, incx, beta, y, incy);
203  }
204 
205  inline static void gemv(char trans_in,
206  int n,
207  int m,
208  const std::complex<double>& alpha,
209  const std::complex<double>* restrict amat,
210  int lda,
211  const std::complex<double>* restrict x,
212  int incx,
213  const std::complex<double>& beta,
214  std::complex<double>* y,
215  int incy)
216  {
217  zgemv(trans_in, n, m, alpha, amat, lda, x, incx, beta, y, incy);
218  }
219 
220  inline static void gemv(char trans_in,
221  int n,
222  int m,
223  const std::complex<float>& alpha,
224  const std::complex<float>* restrict amat,
225  int lda,
226  const std::complex<float>* restrict x,
227  int incx,
228  const std::complex<float>& beta,
229  std::complex<float>* y,
230  int incy)
231  {
232  cgemv(trans_in, n, m, alpha, amat, lda, x, incx, beta, y, incy);
233  }
234 
235  inline static void gemm(char Atrans,
236  char Btrans,
237  int M,
238  int N,
239  int K,
240  double alpha,
241  const double* A,
242  int lda,
243  const double* restrict B,
244  int ldb,
245  double beta,
246  double* restrict C,
247  int ldc)
248  {
249  dgemm(Atrans, Btrans, M, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
250  }
251 
252  inline static void gemm(char Atrans,
253  char Btrans,
254  int M,
255  int N,
256  int K,
257  float alpha,
258  const float* A,
259  int lda,
260  const float* restrict B,
261  int ldb,
262  float beta,
263  float* restrict C,
264  int ldc)
265  {
266  sgemm(Atrans, Btrans, M, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
267  }
268 
269  inline static void gemm(char Atrans,
270  char Btrans,
271  int M,
272  int N,
273  int K,
274  std::complex<double> alpha,
275  const std::complex<double>* A,
276  int lda,
277  const std::complex<double>* restrict B,
278  int ldb,
279  std::complex<double> beta,
280  std::complex<double>* restrict C,
281  int ldc)
282  {
283  zgemm(Atrans, Btrans, M, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
284  }
285 
286  inline static void gemm(char Atrans,
287  char Btrans,
288  int M,
289  int N,
290  int K,
291  std::complex<float> alpha,
292  const std::complex<float>* A,
293  int lda,
294  const std::complex<float>* restrict B,
295  int ldb,
296  std::complex<float> beta,
297  std::complex<float>* restrict C,
298  int ldc)
299  {
300  cgemm(Atrans, Btrans, M, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
301  }
302 
303  template<typename T>
304  inline static T dot(int n, const T* restrict a, const T* restrict b)
305  {
306  T res = T(0);
307  for (int i = 0; i < n; ++i)
308  res += a[i] * b[i];
309  return res;
310  }
311 
312  template<typename T>
313  inline static std::complex<T> dot(int n, const std::complex<T>* restrict a, const T* restrict b)
314  {
315  std::complex<T> res = T(0);
316  for (int i = 0; i < n; ++i)
317  res += a[i] * b[i];
318  return res;
319  }
320 
321  template<typename T>
322  inline static std::complex<T> dot(int n, const std::complex<T>* restrict a, const std::complex<T>* restrict b)
323  {
324  std::complex<T> res = 0.0;
325  for (int i = 0; i < n; ++i)
326  res += a[i] * b[i];
327  return res;
328  }
329 
330 
331  template<typename T>
332  inline static std::complex<T> dot(int n, const T* restrict a, const std::complex<T>* restrict b)
333  {
334  std::complex<T> res = 0.0;
335  for (int i = 0; i < n; ++i)
336  res += a[i] * b[i];
337  return res;
338  }
339 
340  template<typename T>
341  inline static T dot(int n, const T* restrict a, int incx, const T* restrict b, int incy)
342  {
343  T res = T(0);
344  for (int i = 0, ia = 0, ib = 0; i < n; ++i, ia += incx, ib += incy)
345  res += a[ia] * b[ib];
346  return res;
347  }
348 
349  template<typename T>
350  inline static std::complex<T> dot(int n, const std::complex<T>* restrict a, int incx, const T* restrict b, int incy)
351  {
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];
355  return res;
356  }
357 
358  template<typename T>
359  inline static std::complex<T> dot(int n, const T* restrict a, int incx, const std::complex<T>* restrict b, int incy)
360  {
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];
364  return res;
365  }
366 
367  template<typename T>
368  inline static std::complex<T> dot(int n,
369  const std::complex<T>* restrict a,
370  int incx,
371  const std::complex<T>* restrict b,
372  int incy)
373  {
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];
377  return res;
378  }
379 
380  template<typename T>
381  inline static void copy(int n, const T* restrict a, T* restrict b)
382  {
383  memcpy(b, a, sizeof(T) * n);
384  }
385 
386  /** copy using memcpy(target,source,size)
387  * @param target starting address of the targe
388  * @param source starting address of the source
389  * @param number of elements to copy
390  */
391  template<typename T>
392  inline static void copy(T* restrict target, const T* restrict source, int n)
393  {
394  memcpy(target, source, sizeof(T) * n);
395  }
396 
397  template<typename T>
398  inline static void copy(int n, const std::complex<T>* restrict a, T* restrict b)
399  {
400  for (int i = 0; i < n; ++i)
401  b[i] = a[i].real();
402  }
403 
404  template<typename T>
405  inline static void copy(int n, const T* restrict a, std::complex<T>* restrict b)
406  {
407  for (int i = 0; i < n; ++i)
408  b[i] = a[i];
409  }
410 
411  template<typename T>
412  inline static void copy(int n, const T* restrict x, int incx, T* restrict y, int incy)
413  {
414  const int xmax = incx * n;
415  for (int ic = 0, jc = 0; ic < xmax; ic += incx, jc += incy)
416  y[jc] = x[ic];
417  }
418 
419  /*
420  inline static
421  void copy(int n, double x, double* a) {
422  dinit(n,x,a,INCX);
423  }
424 
425  inline static
426  void copy(int n, const std::complex<double>* restrict a, std::complex<double>* restrict b)
427  {
428  zcopy(n,a,INCX,b,INCY);
429  }
430 
431  inline static
432  void copy(int n, const std::complex<double>* restrict a, int ia, std::complex<double>* restrict b, int ib) {
433  zcopy(n,a,ia,b,ib);
434  }
435  */
436 
437  inline static void ger(int m,
438  int n,
439  double alpha,
440  const double* x,
441  int incx,
442  const double* y,
443  int incy,
444  double* a,
445  int lda)
446  {
447  dger(&m, &n, &alpha, x, &incx, y, &incy, a, &lda);
448  }
449 
450  inline static void ger(int m,
451  int n,
452  float alpha,
453  const float* x,
454  int incx,
455  const float* y,
456  int incy,
457  float* a,
458  int lda)
459  {
460  sger(&m, &n, &alpha, x, &incx, y, &incy, a, &lda);
461  }
462 
463  inline static void ger(int m,
464  int n,
465  const std::complex<double>& alpha,
466  const std::complex<double>* x,
467  int incx,
468  const std::complex<double>* y,
469  int incy,
470  std::complex<double>* a,
471  int lda)
472  {
473  zgeru(&m, &n, &alpha, x, &incx, y, &incy, a, &lda);
474  }
475 
476  inline static void ger(int m,
477  int n,
478  const std::complex<float>& alpha,
479  const std::complex<float>* x,
480  int incx,
481  const std::complex<float>* y,
482  int incy,
483  std::complex<float>* a,
484  int lda)
485  {
486  cgeru(&m, &n, &alpha, x, &incx, y, &incy, a, &lda);
487  }
488 };
489 
490 struct LAPACK
491 {
492  inline static void heev(char& jobz,
493  char& uplo,
494  int& n,
495  std::complex<float>* a,
496  int& lda,
497  float* w,
498  std::complex<float>* work,
499  int& lwork,
500  float* rwork,
501  int& info)
502  {
503  cheev(jobz, uplo, n, a, lda, w, work, lwork, rwork, info);
504  }
505 
506  inline static void heev(char& jobz,
507  char& uplo,
508  int& n,
509  std::complex<double>* a,
510  int& lda,
511  double* w,
512  std::complex<double>* work,
513  int& lwork,
514  double* rwork,
515  int& info)
516  {
517  zheev(jobz, uplo, n, a, lda, w, work, lwork, rwork, info);
518  }
519 
520  inline static void gesvd(const char& jobu,
521  const char& jobvt,
522  const int& m,
523  const int& n,
524  float* a,
525  const int& lda,
526  float* s,
527  float* u,
528  const int& ldu,
529  float* vt,
530  const int& ldvt,
531  float* work,
532  const int& lwork,
533  int& info)
534  {
535  sgesvd(jobu, jobvt, m, n, a, lda, s, u, ldu, vt, ldvt, work, lwork, info);
536  }
537 
538  inline static void gesvd(const char& jobu,
539  const char& jobvt,
540  const int& m,
541  const int& n,
542  double* a,
543  const int& lda,
544  double* s,
545  double* u,
546  const int& ldu,
547  double* vt,
548  const int& ldvt,
549  double* work,
550  const int& lwork,
551  int& info)
552  {
553  dgesvd(jobu, jobvt, m, n, a, lda, s, u, ldu, vt, ldvt, work, lwork, info);
554  }
555 
556  inline static void gesvd(const char& jobu,
557  const char& jobvt,
558  const int& m,
559  const int& n,
560  std::complex<float>* a,
561  const int& lda,
562  float* s,
563  std::complex<float>* u,
564  const int& ldu,
565  std::complex<float>* vt,
566  const int& ldvt,
567  std::complex<float>* work,
568  const int& lwork,
569  float* rwork,
570  int& info)
571  {
572  cgesvd(jobu, jobvt, m, n, a, lda, s, u, ldu, vt, ldvt, work, lwork, rwork, info);
573  }
574 
575  inline static void gesvd(const char& jobu,
576  const char& jobvt,
577  const int& m,
578  const int& n,
579  std::complex<double>* a,
580  const int& lda,
581  double* s,
582  std::complex<double>* u,
583  const int& ldu,
584  std::complex<double>* vt,
585  const int& ldvt,
586  std::complex<double>* work,
587  const int& lwork,
588  double* rwork,
589  int& info)
590  {
591  zgesvd(jobu, jobvt, m, n, a, lda, s, u, ldu, vt, ldvt, work, lwork, rwork, info);
592  }
593 
594  inline static void geev(char* jobvl,
595  char* jobvr,
596  int* n,
597  double* a,
598  int* lda,
599  double* alphar,
600  double* alphai,
601  double* vl,
602  int* ldvl,
603  double* vr,
604  int* ldvr,
605  double* work,
606  int* lwork,
607  int* info)
608  {
609  dgeev(jobvl, jobvr, n, a, lda, alphar, alphai, vl, ldvl, vr, ldvr, work, lwork, info);
610  }
611 
612  inline static void geev(char* jobvl,
613  char* jobvr,
614  int* n,
615  float* a,
616  int* lda,
617  float* alphar,
618  float* alphai,
619  float* vl,
620  int* ldvl,
621  float* vr,
622  int* ldvr,
623  float* work,
624  int* lwork,
625  int* info)
626  {
627  sgeev(jobvl, jobvr, n, a, lda, alphar, alphai, vl, ldvl, vr, ldvr, work, lwork, info);
628  }
629 
630  inline static void geev(char* jobvl,
631  char* jobvr,
632  int* n,
633  std::complex<double>* a,
634  int* lda,
635  std::complex<double>* alpha,
636  std::complex<double>* vl,
637  int* ldvl,
638  std::complex<double>* vr,
639  int* ldvr,
640  std::complex<double>* work,
641  int* lwork,
642  double* rwork,
643  int* info)
644  {
645  zgeev(jobvl, jobvr, n, a, lda, alpha, vl, ldvl, vr, ldvr, work, lwork, rwork, info);
646  }
647 
648  inline static void geev(char* jobvl,
649  char* jobvr,
650  int* n,
651  std::complex<float>* a,
652  int* lda,
653  std::complex<float>* alpha,
654  std::complex<float>* vl,
655  int* ldvl,
656  std::complex<float>* vr,
657  int* ldvr,
658  std::complex<float>* work,
659  int* lwork,
660  float* rwork,
661  int* info)
662  {
663  cgeev(jobvl, jobvr, n, a, lda, alpha, vl, ldvl, vr, ldvr, work, lwork, rwork, info);
664  }
665 
666 
667  inline static void ggev(char* jobvl,
668  char* jobvr,
669  int* n,
670  double* a,
671  int* lda,
672  double* b,
673  int* ldb,
674  double* alphar,
675  double* alphai,
676  double* beta,
677  double* vl,
678  int* ldvl,
679  double* vr,
680  int* ldvr,
681  double* work,
682  int* lwork,
683  int* info)
684  {
685  dggev(jobvl, jobvr, n, a, lda, b, ldb, alphar, alphai, beta, vl, ldvl, vr, ldvr, work, lwork, info);
686  }
687 
688  inline static void ggev(char* jobvl,
689  char* jobvr,
690  int* n,
691  float* a,
692  int* lda,
693  float* b,
694  int* ldb,
695  float* alphar,
696  float* alphai,
697  float* beta,
698  float* vl,
699  int* ldvl,
700  float* vr,
701  int* ldvr,
702  float* work,
703  int* lwork,
704  int* info)
705  {
706  sggev(jobvl, jobvr, n, a, lda, b, ldb, alphar, alphai, beta, vl, ldvl, vr, ldvr, work, lwork, info);
707  }
708 
709  inline static void hevr(char& JOBZ,
710  char& RANGE,
711  char& UPLO,
712  int& N,
713  float* A,
714  int& LDA,
715  float& VL,
716  float& VU,
717  int& IL,
718  int& IU,
719  float& ABSTOL,
720  int& M,
721  float* W,
722  float* Z,
723  int& LDZ,
724  int* ISUPPZ,
725  float* WORK,
726  int& LWORK,
727  float* RWORK,
728  int& LRWORK,
729  int* IWORK,
730  int& LIWORK,
731  int& INFO)
732  {
733  if (WORK)
734  WORK[0] = 0;
735  ssyevr(JOBZ, RANGE, UPLO, N, A, LDA, VL, VU, IL, IU, ABSTOL, M, W, Z, LDZ, ISUPPZ, RWORK, LRWORK, IWORK, LIWORK,
736  INFO);
737  }
738 
739  inline static void hevr(char& JOBZ,
740  char& RANGE,
741  char& UPLO,
742  int& N,
743  double* A,
744  int& LDA,
745  double& VL,
746  double& VU,
747  int& IL,
748  int& IU,
749  double& ABSTOL,
750  int& M,
751  double* W,
752  double* Z,
753  int& LDZ,
754  int* ISUPPZ,
755  double* WORK,
756  int& LWORK,
757  double* RWORK,
758  int& LRWORK,
759  int* IWORK,
760  int& LIWORK,
761  int& INFO)
762  {
763  if (WORK)
764  WORK[0] = 0;
765  dsyevr(JOBZ, RANGE, UPLO, N, A, LDA, VL, VU, IL, IU, ABSTOL, M, W, Z, LDZ, ISUPPZ, RWORK, LRWORK, IWORK, LIWORK,
766  INFO);
767  }
768 
769  inline static void hevr(char& JOBZ,
770  char& RANGE,
771  char& UPLO,
772  int& N,
773  std::complex<float>* A,
774  int& LDA,
775  float& VL,
776  float& VU,
777  int& IL,
778  int& IU,
779  float& ABSTOL,
780  int& M,
781  float* W,
782  std::complex<float>* Z,
783  int& LDZ,
784  int* ISUPPZ,
785  std::complex<float>* WORK,
786  int& LWORK,
787  float* RWORK,
788  int& LRWORK,
789  int* IWORK,
790  int& LIWORK,
791  int& INFO)
792  {
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);
795  }
796 
797  inline static void hevr(char& JOBZ,
798  char& RANGE,
799  char& UPLO,
800  int& N,
801  std::complex<double>* A,
802  int& LDA,
803  double& VL,
804  double& VU,
805  int& IL,
806  int& IU,
807  double& ABSTOL,
808  int& M,
809  double* W,
810  std::complex<double>* Z,
811  int& LDZ,
812  int* ISUPPZ,
813  std::complex<double>* WORK,
814  int& LWORK,
815  double* RWORK,
816  int& LRWORK,
817  int* IWORK,
818  int& LIWORK,
819  int& INFO)
820  {
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);
823  }
824 
825  static void getrf(const int& n, const int& m, double* a, const int& n0, int* piv, int& st)
826  {
827  dgetrf(n, m, a, n0, piv, st);
828  }
829 
830  static void getrf(const int& n, const int& m, float* a, const int& n0, int* piv, int& st)
831  {
832  sgetrf(n, m, a, n0, piv, st);
833  }
834 
835  static void getrf(const int& n, const int& m, std::complex<double>* a, const int& n0, int* piv, int& st)
836  {
837  zgetrf(n, m, a, n0, piv, st);
838  }
839 
840  static void getrf(const int& n, const int& m, std::complex<float>* a, const int& n0, int* piv, int& st)
841  {
842  cgetrf(n, m, a, n0, piv, st);
843  }
844 
845  static void getri(int n,
846  float* restrict a,
847  int n0,
848  int const* restrict piv,
849  float* restrict work,
850  int const& n1,
851  int& status)
852  {
853  sgetri(n, a, n0, piv, work, n1, status);
854  }
855 
856  static void getri(int n,
857  double* restrict a,
858  int n0,
859  int const* restrict piv,
860  double* restrict work,
861  int const& n1,
862  int& status)
863  {
864  dgetri(n, a, n0, piv, work, n1, status);
865  }
866 
867  static void getri(int n,
868  std::complex<float>* restrict a,
869  int n0,
870  int const* restrict piv,
871  std::complex<float>* restrict work,
872  int const& n1,
873  int& status)
874  {
875  cgetri(n, a, n0, piv, work, n1, status);
876  }
877 
878  static void getri(int n,
879  std::complex<double>* restrict a,
880  int n0,
881  int const* restrict piv,
882  std::complex<double>* restrict work,
883  int const& n1,
884  int& status)
885  {
886  zgetri(n, a, n0, piv, work, n1, status);
887  }
888 
889  static void geqrf(int M,
890  int N,
891  std::complex<double>* A,
892  const int LDA,
893  std::complex<double>* TAU,
894  std::complex<double>* WORK,
895  int LWORK,
896  int& INFO)
897  {
898  zgeqrf(M, N, A, LDA, TAU, WORK, LWORK, INFO);
899  }
900 
901  static void geqrf(int M, int N, double* A, const int LDA, double* TAU, double* WORK, int LWORK, int& INFO)
902  {
903  dgeqrf(M, N, A, LDA, TAU, WORK, LWORK, INFO);
904  }
905 
906  static void geqrf(int M,
907  int N,
908  std::complex<float>* A,
909  const int LDA,
910  std::complex<float>* TAU,
911  std::complex<float>* WORK,
912  int LWORK,
913  int& INFO)
914  {
915  cgeqrf(M, N, A, LDA, TAU, WORK, LWORK, INFO);
916  }
917 
918  static void geqrf(int M, int N, float* A, const int LDA, float* TAU, float* WORK, int LWORK, int& INFO)
919  {
920  sgeqrf(M, N, A, LDA, TAU, WORK, LWORK, INFO);
921  }
922 
923  static void gelqf(int M,
924  int N,
925  std::complex<double>* A,
926  const int LDA,
927  std::complex<double>* TAU,
928  std::complex<double>* WORK,
929  int LWORK,
930  int& INFO)
931  {
932  zgelqf(M, N, A, LDA, TAU, WORK, LWORK, INFO);
933  }
934 
935  static void gelqf(int M, int N, double* A, const int LDA, double* TAU, double* WORK, int LWORK, int& INFO)
936  {
937  dgelqf(M, N, A, LDA, TAU, WORK, LWORK, INFO);
938  }
939 
940  static void gelqf(int M,
941  int N,
942  std::complex<float>* A,
943  const int LDA,
944  std::complex<float>* TAU,
945  std::complex<float>* WORK,
946  int LWORK,
947  int& INFO)
948  {
949  cgelqf(M, N, A, LDA, TAU, WORK, LWORK, INFO);
950  }
951 
952  static void gelqf(int M, int N, float* A, const int LDA, float* TAU, float* WORK, int LWORK, int& INFO)
953  {
954  sgelqf(M, N, A, LDA, TAU, WORK, LWORK, INFO);
955  }
956 
957  static void gqr(int M,
958  int N,
959  int K,
960  std::complex<double>* A,
961  const int LDA,
962  std::complex<double>* TAU,
963  std::complex<double>* WORK,
964  int LWORK,
965  int& INFO)
966  {
967  zungqr(M, N, K, A, LDA, TAU, WORK, LWORK, INFO);
968  }
969 
970  static void gqr(int M, int N, int K, double* A, const int LDA, double* TAU, double* WORK, int LWORK, int& INFO)
971  {
972  dorgqr(M, N, K, A, LDA, TAU, WORK, LWORK, INFO);
973  }
974 
975  static void gqr(int M,
976  int N,
977  int K,
978  std::complex<float>* A,
979  const int LDA,
980  std::complex<float>* TAU,
981  std::complex<float>* WORK,
982  int LWORK,
983  int& INFO)
984  {
985  cungqr(M, N, K, A, LDA, TAU, WORK, LWORK, INFO);
986  }
987 
988  static void gqr(int M, int N, int K, float* A, const int LDA, float* TAU, float* WORK, int LWORK, int& INFO)
989  {
990  sorgqr(M, N, K, A, LDA, TAU, WORK, LWORK, INFO);
991  }
992 
993  static void glq(int M,
994  int N,
995  int K,
996  std::complex<double>* A,
997  const int LDA,
998  std::complex<double>* TAU,
999  std::complex<double>* WORK,
1000  int LWORK,
1001  int& INFO)
1002  {
1003  zunglq(M, N, K, A, LDA, TAU, WORK, LWORK, INFO);
1004  }
1005 
1006  static void glq(int M, int N, int K, double* A, const int LDA, double* TAU, double* WORK, int LWORK, int& INFO)
1007  {
1008  dorglq(M, N, K, A, LDA, TAU, WORK, LWORK, INFO);
1009  }
1010 
1011  static void glq(int M,
1012  int N,
1013  int K,
1014  std::complex<float>* A,
1015  const int LDA,
1016  std::complex<float>* TAU,
1017  std::complex<float>* WORK,
1018  int LWORK,
1019  int& INFO)
1020  {
1021  cunglq(M, N, K, A, LDA, TAU, WORK, LWORK, INFO);
1022  }
1023 
1024  static void glq(int M, int N, int K, float* A, const int LDA, float* TAU, float* WORK, int const LWORK, int& INFO)
1025  {
1026  sorglq(M, N, K, A, LDA, TAU, WORK, LWORK, INFO);
1027  }
1028 
1029  static void potrf(const char& UPLO, const int& N, float* A, const int& LDA, int& INFO)
1030  {
1031  spotrf(UPLO, N, A, LDA, INFO);
1032  }
1033 
1034  static void potrf(const char& UPLO, const int& N, double* A, const int& LDA, int& INFO)
1035  {
1036  dpotrf(UPLO, N, A, LDA, INFO);
1037  }
1038 
1039  static void potrf(const char& UPLO, const int& N, std::complex<float>* A, const int& LDA, int& INFO)
1040  {
1041  cpotrf(UPLO, N, A, LDA, INFO);
1042  }
1043 
1044  static void potrf(const char& UPLO, const int& N, std::complex<double>* A, const int& LDA, int& INFO)
1045  {
1046  zpotrf(UPLO, N, A, LDA, INFO);
1047  }
1048 };
1049 
1050 
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)
Definition: BLAS.hpp:988
static void getrf(const int &n, const int &m, std::complex< float > *a, const int &n0, int *piv, int &st)
Definition: BLAS.hpp:840
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)
Definition: BLAS.hpp:538
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)
Definition: BLAS.hpp:667
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)
Definition: BLAS.hpp:830
constexpr int INCY
Definition: BLAS.hpp:41
static void gemv_trans(int n, int m, const double *restrict amat, const double *restrict x, double *restrict y)
Definition: BLAS.hpp:147
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)
Definition: BLAS.hpp:1034
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)
Definition: BLAS.hpp:1011
QMCTraits::RealType real
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)
Definition: BLAS.hpp:889
constexpr double dzero
Definition: BLAS.hpp:49
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
Definition: BLAS.hpp:51
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)
Definition: BLAS.hpp:975
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
Definition: BLAS.hpp:50
Interfaces to blas library.
Definition: BLAS.hpp:38
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)
Definition: BLAS.hpp:739
constexpr int INCX
Definition: BLAS.hpp:40
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)
Definition: BLAS.hpp:935
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)
Definition: BLAS.hpp:91
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)
Definition: BLAS.hpp:769
static void gqr(int M, int N, int K, double *A, const int LDA, double *TAU, double *WORK, int LWORK, int &INFO)
Definition: BLAS.hpp:970
constexpr char UPLO
Definition: BLAS.hpp:42
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)
Definition: BLAS.hpp:940
static void gemv(int n, int m, const double *restrict amat, const double *restrict x, double *restrict y)
Definition: BLAS.hpp:118
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)
Definition: BLAS.hpp:952
static void potrf(const char &UPLO, const int &N, std::complex< float > *A, const int &LDA, int &INFO)
Definition: BLAS.hpp:1039
constexpr std::complex< double > zone
Definition: BLAS.hpp:52
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)
Definition: BLAS.hpp:901
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)
Definition: BLAS.hpp:506
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)
Definition: BLAS.hpp:1044
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)
Definition: BLAS.hpp:709
static void getri(int n, double *restrict a, int n0, int const *restrict piv, double *restrict work, int const &n1, int &status)
Definition: BLAS.hpp:856
Definition: BLAS.hpp:490
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)
Definition: BLAS.hpp:520
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)
Definition: BLAS.hpp:867
static void glq(int M, int N, int K, float *A, const int LDA, float *TAU, float *WORK, int const LWORK, int &INFO)
Definition: BLAS.hpp:1024
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)
Definition: BLAS.hpp:492
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)
Definition: BLAS.hpp:957
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)
Definition: BLAS.hpp:630
static void ger(int m, int n, double alpha, const double *x, int incx, const double *y, int incy, double *a, int lda)
Definition: BLAS.hpp:437
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)
Definition: BLAS.hpp:304
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)
Definition: BLAS.hpp:688
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
Definition: BLAS.hpp:53
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)
Definition: BLAS.hpp:1029
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)
Definition: BLAS.hpp:835
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)
Definition: BLAS.hpp:923
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)
Definition: BLAS.hpp:918
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)
Definition: BLAS.hpp:575
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)
constexpr double done
Definition: BLAS.hpp:48
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)
Definition: BLAS.hpp:906
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)
Definition: BLAS.hpp:797
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)
Definition: BLAS.hpp:381
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)
Definition: BLAS.hpp:612
static void axpy(int n, double x, const double *a, double *b)
Definition: BLAS.hpp:55
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 &)
constexpr char TRANS
Definition: BLAS.hpp:43
constexpr float sone
Definition: BLAS.hpp:46
constexpr float szero
Definition: BLAS.hpp:47
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)
Definition: BLAS.hpp:845
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)
Definition: BLAS.hpp:235
constexpr char NOTRANS
Definition: BLAS.hpp:44
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)
Definition: BLAS.hpp:648
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)
Definition: BLAS.hpp:594
static void getrf(const int &n, const int &m, double *a, const int &n0, int *piv, int &st)
Definition: BLAS.hpp:825
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)
Definition: BLAS.hpp:878
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)
Definition: BLAS.hpp:556
static void glq(int M, int N, int K, double *A, const int LDA, double *TAU, double *WORK, int LWORK, int &INFO)
Definition: BLAS.hpp:1006
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)
Definition: BLAS.hpp:993
static void scal(int n, float alpha, float *x, int incx=1)
Definition: BLAS.hpp:99
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)