ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
lapack_connector.h
Go to the documentation of this file.
1
21
22#ifndef LAPACK_CONNECTOR_HPP
23#define LAPACK_CONNECTOR_HPP
24
25#include <new>
26#include <stdexcept>
27#include <iostream>
28#include <cassert>
29#include "../matrix.h"
30#include "../complexmatrix.h"
31#include "../global_function.h"
32
33#include <limits>
34// =========================================================
35// Tolerances for LAPACK/ScaLAPACK eigenvalue routines
36// =========================================================
37// Huawei KML strictly validates input parameters.
38// It rejects abstol=0 and orfac=-1, which are standard
39// defaults in open-source LAPACK to trigger internal logic.
40// We must explicitly pass the mathematically equivalent defaults.
41#ifdef __KML
42 constexpr double LAPACK_ABSTOL = 2*std::numeric_limits<double>::min(); // 2*PDLAMCH('S')
43 constexpr double LAPACK_ORFAC = 2.0e-12; // Default value
44#else
45 constexpr double LAPACK_ABSTOL = 0.0;
46 constexpr double LAPACK_ORFAC = -1.0;
47#endif
48// =========================================================
49
50//Naming convention of lapack subroutines : ammxxx, where
51//"a" specifies the data type:
52// - s stands for float
53// - d stands for double
54// - c stands for complex float
55// - z stands for complex double
56//"mm" specifies the type of matrix, for example:
57// - he stands for hermitian
58// - sy stands for symmetric
59//"xxx" specifies the type of problem, for example:
60// - gv stands for generalized eigenvalue
61
62// The following declarations cover only a subset of LAPACK routines.
63// If you need a LAPACK function that is not included here, feel free to add its declaration as needed.
64extern "C"
65{
66// === Generalized Hermitian-definite eigenproblems ===
67void dsygvd_(const int* itype, const char* jobz, const char* uplo, const int* n,
68 double* a, const int* lda,
69 double* b, const int* ldb,
70 double* w,
71 double* work, const int* lwork,
72 int* iwork, const int* liwork,
73 int* info);
74
75void chegvd_(const int* itype, const char* jobz, const char* uplo, const int* n,
76 std::complex<float>* a, const int* lda,
77 std::complex<float>* b, const int* ldb,
78 float* w,
79 std::complex<float>* work, const int* lwork,
80 float* rwork, const int* lrwork,
81 int* iwork, const int* liwork,
82 int* info);
83
84void zhegvd_(const int* itype, const char* jobz, const char* uplo, const int* n,
85 std::complex<double>* a, const int* lda,
86 std::complex<double>* b, const int* ldb,
87 double* w,
88 std::complex<double>* work, const int* lwork,
89 double* rwork, const int* lrwork,
90 int* iwork, const int* liwork,
91 int* info);
92
93// === Selected eigenvalues/vectors: standard Hermitian ===
94
95void dsyevx_(const char* jobz, const char* range, const char* uplo, const int* n,
96 double* a, const int* lda,
97 const double* vl, const double* vu,
98 const int* il, const int* iu,
99 const double* abstol,
100 int* m, double* w, double* z, const int* ldz,
101 double* work, const int* lwork,
102 int* iwork, int* ifail,
103 int* info);
104
105void cheevx_(const char* jobz, const char* range, const char* uplo, const int* n,
106 std::complex<float>* a, const int* lda,
107 const float* vl, const float* vu,
108 const int* il, const int* iu,
109 const float* abstol,
110 int* m, float* w, std::complex<float>* z, const int* ldz,
111 std::complex<float>* work, const int* lwork,
112 float* rwork, int* iwork, int* ifail,
113 int* info);
114
115void zheevx_(const char* jobz, const char* range, const char* uplo, const int* n,
116 std::complex<double>* a, const int* lda,
117 const double* vl, const double* vu,
118 const int* il, const int* iu,
119 const double* abstol,
120 int* m, double* w, std::complex<double>* z, const int* ldz,
121 std::complex<double>* work, const int* lwork,
122 double* rwork, int* iwork, int* ifail,
123 int* info);
124
125// === Selected eigenvalues/vectors: generalized Hermitian ===
126
127void dsygvx_(const int* itype, const char* jobz, const char* range, const char* uplo,
128 const int* n,
129 double* a, const int* lda,
130 double* b, const int* ldb,
131 const double* vl, const double* vu,
132 const int* il, const int* iu,
133 const double* abstol,
134 int* m, double* w, double* z, const int* ldz,
135 double* work, const int* lwork,
136 int* iwork, int* ifail,
137 int* info);
138
139void chegvx_(const int* itype, const char* jobz, const char* range, const char* uplo,
140 const int* n,
141 std::complex<float>* a, const int* lda,
142 std::complex<float>* b, const int* ldb,
143 const float* vl, const float* vu,
144 const int* il, const int* iu,
145 const float* abstol,
146 int* m, float* w, std::complex<float>* z, const int* ldz,
147 std::complex<float>* work, const int* lwork,
148 float* rwork, int* iwork, int* ifail,
149 int* info);
150
151void zhegvx_(const int* itype, const char* jobz, const char* range, const char* uplo,
152 const int* n,
153 std::complex<double>* a, const int* lda,
154 std::complex<double>* b, const int* ldb,
155 const double* vl, const double* vu,
156 const int* il, const int* iu,
157 const double* abstol,
158 int* m, double* w, std::complex<double>* z, const int* ldz,
159 std::complex<double>* work, const int* lwork,
160 double* rwork, int* iwork, int* ifail,
161 int* info);
162
163#ifdef __DSP
164void cpack_zhegvx_driver(const int* itype, const char* jobz, const char* range, const char* uplo,
165 const int* n,
166 std::complex<double>* a, const int* lda,
167 std::complex<double>* b, const int* ldb,
168 const double* vl, const double* vu,
169 const int* il, const int* iu,
170 const double* abstol,
171 int* m, double* w, std::complex<double>* z, const int* ldz,
172 std::complex<double>* work, const int* lwork,
173 double* rwork, int* iwork, int* ifail,
174 int* info);
175#endif
176
177// === Generalized Hermitian: all eigenvalues (simple driver) ===
178
179void dsygv_(const int* itype, const char* jobz, const char* uplo, const int* n,
180 double* a, const int* lda,
181 double* b, const int* ldb,
182 double* w,
183 double* work, const int* lwork,
184 int* info);
185
186void chegv_(const int* itype, const char* jobz, const char* uplo, const int* n,
187 std::complex<float>* a, const int* lda,
188 std::complex<float>* b, const int* ldb,
189 float* w,
190 std::complex<float>* work, const int* lwork,
191 float* rwork,
192 int* info);
193
194void zhegv_(const int* itype, const char* jobz, const char* uplo, const int* n,
195 std::complex<double>* a, const int* lda,
196 std::complex<double>* b, const int* ldb,
197 double* w,
198 std::complex<double>* work, const int* lwork,
199 double* rwork,
200 int* info);
201
202// === Standard Hermitian eigenproblem ===
203
204 void ssyev_(const char* jobz,
205 const char* uplo,
206 const int* n,
207 float* a,
208 const int* lda,
209 float* w,
210 float* work,
211 const int* lwork,
212 int* info);
213 void dsyev_(const char* jobz,
214 const char* uplo,
215 const int* n,
216 double* a,
217 const int* lda,
218 double* w,
219 double* work,
220 const int* lwork,
221 int* info);
222
223void cheev_(const char* jobz, const char* uplo, const int* n,
224 std::complex<float>* a, const int* lda,
225 float* w,
226 std::complex<float>* work, const int* lwork,
227 float* rwork,
228 int* info);
229
230void zheev_(const char* jobz, const char* uplo, const int* n,
231 std::complex<double>* a, const int* lda,
232 double* w,
233 std::complex<double>* work, const int* lwork,
234 double* rwork,
235 int* info);
236
237// === General (non-Hermitian) eigenproblem ===
238
239void dgeev_(const char* jobvl, const char* jobvr, const int* n,
240 double* a, const int* lda,
241 double* wr, double* wi,
242 double* vl, const int* ldvl,
243 double* vr, const int* ldvr,
244 double* work, const int* lwork,
245 int* info);
246
247void zgeev_(const char* jobvl, const char* jobvr, const int* n,
248 std::complex<double>* a, const int* lda,
249 std::complex<double>* w,
250 std::complex<double>* vl, const int* ldvl,
251 std::complex<double>* vr, const int* ldvr,
252 std::complex<double>* work, const int* lwork,
253 double* rwork,
254 int* info);
255
256// === Matrix inversion (LU) ===
257
258void dgetrf_(const int* m, const int* n, double* a, const int* lda,
259 int* ipiv, int* info);
260
261void dgetri_(const int* n, double* a, const int* lda,
262 const int* ipiv,
263 double* work, const int* lwork,
264 int* info);
265
266// === Symmetric indefinite inversion (Bunch-Kaufman) ===
267
268void dsytrf_(const char* uplo, const int* n, double* a, const int* lda,
269 int* ipiv, double* work, const int* lwork, int* info);
270
271void dsytri_(const char* uplo, const int* n, double* a, const int* lda,
272 const int* ipiv, double* work, int* info);
273
274// === Cholesky factorization & inversion ===
275
276void spotrf_(const char* uplo, const int* n, float* a, const int* lda, int* info);
277void dpotrf_(const char* uplo, const int* n, double* a, const int* lda, int* info);
278void cpotrf_(const char* uplo, const int* n, std::complex<float>* a, const int* lda, int* info);
279void zpotrf_(const char* uplo, const int* n, std::complex<double>* a, const int* lda, int* info);
280
281void spotri_(const char* uplo, const int* n, float* a, const int* lda, int* info);
282void dpotri_(const char* uplo, const int* n, double* a, const int* lda, int* info);
283void cpotri_(const char* uplo, const int* n, std::complex<float>* a, const int* lda, int* info);
284void zpotri_(const char* uplo, const int* n, std::complex<double>* a, const int* lda, int* info);
285
286// === Complex LU inversion ===
287
288void zgetrf_(const int* m, const int* n, std::complex<double>* a, const int* lda,
289 int* ipiv, int* info);
290
291void zgetri_(const int* n, std::complex<double>* a, const int* lda,
292 const int* ipiv,
293 std::complex<double>* work, const int* lwork,
294 int* info);
295
296
297// === Tridiagonal eigen solvers ===
298
299void dsterf_(const int* n, double* d, double* e, int* info);
300
301void dstein_(const int* n, const double* d, const double* e,
302 const int* m, const double* w,
303 const int* iblock, const int* isplit,
304 double* z, const int* ldz,
305 double* work, int* iwork, int* ifail,
306 int* info);
307
308void zstein_(const int* n, const double* d, const double* e,
309 const int* m, const double* w,
310 const int* iblock, const int* isplit,
311 std::complex<double>* z, const int* ldz,
312 double* work, int* iwork, int* ifail,
313 int* info);
314
315// === Unblocked Cholesky (level 2 BLAS) ===
316
317void dpotf2_(const char* uplo, const int* n, double* a, const int* lda, int* info);
318void zpotf2_(const char* uplo, const int* n, std::complex<double>* a, const int* lda, int* info);
319
320// === Tridiagonal solver ===
321
322void dgtsv_(const int* n, const int* nrhs,
323 double* dl, double* d, double* du,
324 double* b, const int* ldb,
325 int* info);
326
327// === Symmetric indefinite linear solver ===
328
329void dsysv_(const char* uplo, const int* n, const int* nrhs,
330 double* a, const int* lda,
331 int* ipiv,
332 double* b, const int* ldb,
333 double* work, const int* lwork,
334 int* info);
335
336// === calculate matrix norm ===
337double dlange_(const char* norm, const int* m, const int* n, const double* A, const int* lda, double* work);
338double zlange_(const char* norm, const int* m, const int* n, const std::complex<double>* A, const int* lda, double* work);
339} // extern "C"
340
341#ifdef GATHER_INFO
342#define zhegvx_ zhegvx_i
343void zhegvx_i(const int* itype,
344 const char* jobz,
345 const char* range,
346 const char* uplo,
347 const int* n,
348 std::complex<double>* a,
349 const int* lda,
350 std::complex<double>* b,
351 const int* ldb,
352 const double* vl,
353 const double* vu,
354 const int* il,
355 const int* iu,
356 const double* abstol,
357 int* m,
358 double* w,
359 std::complex<double>* z,
360 const int* ldz,
361 std::complex<double>* work,
362 const int* lwork,
363 double* rwork,
364 int* iwork,
365 int* ifail,
366 int* info);
367#endif // GATHER_INFO
368
369// Class LapackConnector provide the connector to fortran lapack routine.
370// The entire function in this class are static and inline function.
371// Usage example: LapackConnector::functionname(parameter list).
373{
374 // Transpose the std::complex matrix to the fortran-form real-std::complex array.
375 static inline
376 std::complex<double>* transpose(const ModuleBase::ComplexMatrix& a, const int n, const int lda)
377 {
378 std::complex<double>* aux = new std::complex<double>[lda*n];
379 for (int i = 0; i < n; ++i)
380 {
381 for (int j = 0; j < lda; ++j)
382 {
383 aux[i*lda+j] = a(j,i); // aux[i*lda+j] means aux[i][j] in semantic, not in syntax!
384 }
385 }
386 return aux;
387 }
388
389 static inline
390 std::complex<float>* transpose(const std::complex<float>* a, const int n, const int lda, const int nbase_x)
391 {
392 std::complex<float>* aux = new std::complex<float>[lda*n];
393 for (int i = 0; i < n; ++i)
394 {
395 for (int j = 0; j < lda; ++j)
396 {
397 aux[j * n + i] = a[i * nbase_x + j];
398 }
399 }
400 return aux;
401 }
402
403 static inline
404 std::complex<double>* transpose(const std::complex<double>* a, const int n, const int lda, const int nbase_x)
405 {
406 std::complex<double>* aux = new std::complex<double>[lda*n];
407 for (int i = 0; i < n; ++i)
408 {
409 for (int j = 0; j < lda; ++j)
410 {
411 aux[j * n + i] = a[i * nbase_x + j];
412 }
413 }
414 return aux;
415 }
416
417 // Transpose the fortran-form real-std::complex array to the std::complex matrix.
418 static inline
419 void transpose(const std::complex<double>* aux, ModuleBase::ComplexMatrix& a, const int n, const int lda)
420 {
421 for (int i = 0; i < n; ++i)
422 {
423 for (int j = 0; j < lda; ++j)
424 {
425 a(j, i) = aux[i*lda+j]; // aux[i*lda+j] means aux[i][j] in semantic, not in syntax!
426 }
427 }
428 }
429
430 // Transpose the fortran-form real-std::complex array to the std::complex matrix.
431 static inline
432 void transpose(const std::complex<float>* aux, std::complex<float>* a, const int n, const int lda, const int nbase_x)
433 {
434 for (int i = 0; i < n; ++i)
435 {
436 for (int j = 0; j < lda; ++j)
437 {
438 a[j * nbase_x + i] = aux[i * lda + j]; // aux[i*lda+j] means aux[i][j] in semantic, not in syntax!
439 }
440 }
441 }
442
443 // Transpose the fortran-form real-std::complex array to the std::complex matrix.
444 static inline
445 void transpose(const std::complex<double>* aux, std::complex<double>* a, const int n, const int lda, const int nbase_x)
446 {
447 for (int i = 0; i < n; ++i)
448 {
449 for (int j = 0; j < lda; ++j)
450 {
451 a[j * nbase_x + i] = aux[i * lda + j]; // aux[i*lda+j] means aux[i][j] in semantic, not in syntax!
452 }
453 }
454 }
455
456 // Peize Lin add 2015-12-27
457 static inline
458 char change_uplo(const char &uplo)
459 {
460 switch(uplo)
461 {
462 case 'U': return 'L';
463 case 'L': return 'U';
464 default: throw std::invalid_argument("uplo must be 'U' or 'L'");
465 }
466 }
467
468 // Peize Lin add 2019-04-14
469 static inline
470 char change_trans_NC(const char &trans)
471 {
472 switch(trans)
473 {
474 case 'N': return 'C';
475 case 'C': return 'N';
476 default: throw std::invalid_argument("trans must be 'N' or 'C'");
477 }
478 }
479
480 // wrap function of fortran lapack routine zheev.
481 static inline
482 void zheev( const char jobz,
483 const char uplo,
484 const int n,
486 const int lda,
487 double* w,
488 std::complex< double >* work,
489 const int lwork,
490 double* rwork,
491 int *info )
492 { // Transpose the std::complex matrix to the fortran-form real-std::complex array.
493 std::complex<double> *aux = LapackConnector::transpose(a, n, lda);
494 // call the fortran routine
495 zheev_(&jobz, &uplo, &n, aux, &lda, w, work, &lwork, rwork, info);
496 // Transpose the fortran-form real-std::complex array to the std::complex matrix.
497 LapackConnector::transpose(aux, a, n, lda);
498 // free the memory.
499 delete[] aux;
500 }
501
502 static inline
503 void zgetrf(int m, int n, ModuleBase::ComplexMatrix &a, const int lda, int *ipiv, int *info)
504 {
505 std::complex<double> *aux = LapackConnector::transpose(a, n, lda);
506 zgetrf_( &m, &n, aux, &lda, ipiv, info);
507 LapackConnector::transpose(aux, a, n, lda);
508 delete[] aux;
509 return;
510 }
511 static inline
512 void zgetri(int n, ModuleBase::ComplexMatrix &a, int lda, int *ipiv, std::complex<double> * work, int lwork, int *info)
513 {
514 std::complex<double> *aux = LapackConnector::transpose(a, n, lda);
515 zgetri_( &n, aux, &lda, ipiv, work, &lwork, info);
516 LapackConnector::transpose(aux, a, n, lda);
517 delete[] aux;
518 return;
519 }
520
521 // Peize Lin add 2016-07-09
522 static inline
523 void potrf( const char &uplo, const int &n, float*const A, const int &lda, int &info )
524 {
525 const char uplo_changed = change_uplo(uplo);
526 spotrf_( &uplo_changed, &n, A, &lda, &info );
527 }
528 static inline
529 void potrf( const char &uplo, const int &n, double*const A, const int &lda, int &info )
530 {
531 const char uplo_changed = change_uplo(uplo);
532 dpotrf_( &uplo_changed, &n, A, &lda, &info );
533 }
534 static inline
535 void potrf( const char &uplo, const int &n, std::complex<float>*const A, const int &lda, int &info )
536 {
537 const char uplo_changed = change_uplo(uplo);
538 cpotrf_( &uplo_changed, &n, A, &lda, &info );
539 }
540 static inline
541 void potrf( const char &uplo, const int &n, std::complex<double>*const A, const int &lda, int &info )
542 {
543 const char uplo_changed = change_uplo(uplo);
544 zpotrf_( &uplo_changed, &n, A, &lda, &info );
545 }
546
547
548 // Peize Lin add 2016-07-09
549 static inline
550 void potri( const char &uplo, const int &n, float*const A, const int &lda, int &info )
551 {
552 const char uplo_changed = change_uplo(uplo);
553 spotri_( &uplo_changed, &n, A, &lda, &info);
554 }
555 static inline
556 void potri( const char &uplo, const int &n, double*const A, const int &lda, int &info )
557 {
558 const char uplo_changed = change_uplo(uplo);
559 dpotri_( &uplo_changed, &n, A, &lda, &info);
560 }
561 static inline
562 void potri( const char &uplo, const int &n, std::complex<float>*const A, const int &lda, int &info )
563 {
564 const char uplo_changed = change_uplo(uplo);
565 cpotri_( &uplo_changed, &n, A, &lda, &info);
566 }
567 static inline
568 void potri( const char &uplo, const int &n, std::complex<double>*const A, const int &lda, int &info )
569 {
570 const char uplo_changed = change_uplo(uplo);
571 zpotri_( &uplo_changed, &n, A, &lda, &info);
572 }
573
574 // Peize Lin add 2016-07-09
575 static inline
576 void potrf( const char &uplo, const int &n, ModuleBase::matrix &A, const int &lda, int &info )
577 {
578 potrf( uplo, n, A.c, lda, info );
579 }
580 static inline
581 void potrf( const char &uplo, const int &n, ModuleBase::ComplexMatrix &A, const int &lda, int &info )
582 {
583 potrf( uplo, n, A.c, lda, info );
584 }
585
586 // Peize Lin add 2016-07-09
587 static inline
588 void potri( const char &uplo, const int &n, ModuleBase::matrix &A, const int &lda, int &info )
589 {
590 potri( uplo, n, A.c, lda, info);
591 }
592 static inline
593 void potri( const char &uplo, const int &n, ModuleBase::ComplexMatrix &A, const int &lda, int &info )
594 {
595 potri( uplo, n, A.c, lda, info);
596 }
597
598 // Peize Lin add 2019-04-14
599 // if trans=='N': C = a * A * A.H + b * C
600 // if trans=='C': C = a * A.H * A + b * C
601 static inline
602 void herk(const char uplo, const char trans, const int n, const int k,
603 const double alpha, const std::complex<double> *A, const int lda,
604 const double beta, std::complex<double> *C, const int ldc)
605 {
606 const char uplo_changed = change_uplo(uplo);
607 const char trans_changed = change_trans_NC(trans);
608 zherk_(&uplo_changed, &trans_changed, &n, &k, &alpha, A, &lda, &beta, C, &ldc);
609 }
610 static inline
611 void herk(const char uplo, const char trans, const int n, const int k,
612 const float alpha, const std::complex<float>* A, const int lda,
613 const float beta, std::complex<float>* C, const int ldc)
614 {
615 const char uplo_changed = change_uplo(uplo);
616 const char trans_changed = change_trans_NC(trans);
617 cherk_(&uplo_changed, &trans_changed, &n, &k, &alpha, A, &lda, &beta, C, &ldc);
618 }
619
620 static inline
621 double lange(const char& norm, const int& m, const int& n, const double* A, const int& lda, double* work)
622 {
623 return dlange_(&norm, &m, &n, A, &lda, work);
624 }
625
626 static inline
627 double lange(const char& norm, const int& m, const int& n, const std::complex<double>* A, const int& lda, double* work)
628 {
629 return zlange_(&norm, &m, &n, A, &lda, work);
630 }
631
632};
633#endif // LAPACKCONNECTOR_HPP
void spotri_(const char *uplo, const int *n, float *A, const int *lda, int *info)
void zgetrf_(const int *m, const int *n, std::complex< double > *a, const int *lda, int *ipiv, int *info)
void cpotrf_(const char *uplo, const int *n, std::complex< float > *A, const int *lda, int *info)
void zheev_(const char *jobz, const char *uplo, const int *n, std::complex< double > *a, const int *lda, double *w, std::complex< double > *work, const int *lwork, double *rwork, int *info)
void spotrf_(const char *uplo, const int *n, float *A, const int *lda, int *info)
void cpotri_(const char *uplo, const int *n, std::complex< float > *A, const int *lda, int *info)
void zpotri_(const char *uplo, const int *n, std::complex< double > *A, const int *lda, int *info)
void zpotrf_(const char *uplo, const int *n, std::complex< double > *A, const int *lda, int *info)
void dpotrf_(const char *uplo, const int *n, double *A, const int *lda, int *info)
void dpotri_(const char *uplo, const int *n, double *A, const int *lda, int *info)
void zgetri_(const int *n, std::complex< double > *A, const int *lda, const int *ipiv, std::complex< double > *work, const int *lwork, int *info)
void cherk_(const char *uplo, const char *trans, const int *n, const int *k, const float *alpha, const std::complex< float > *a, const int *lda, const float *beta, std::complex< float > *c, const int *ldc)
void zherk_(const char *uplo, const char *trans, const int *n, const int *k, const double *alpha, const std::complex< double > *a, const int *lda, const double *beta, std::complex< double > *c, const int *ldc)
Definition complexmatrix.h:11
Definition matrix.h:15
void zhegvx_i(const int *itype, const char *jobz, const char *range, const char *uplo, const int *n, std::complex< double > *a, const int *lda, std::complex< double > *b, const int *ldb, const double *vl, const double *vu, const int *il, const int *iu, const double *abstol, int *m, double *w, std::complex< double > *z, const int *ldz, std::complex< double > *work, const int *lwork, double *rwork, int *iwork, int *ifail, int *info)
Definition gather_math_lib_info.cpp:49
constexpr double LAPACK_ABSTOL
Definition lapack_connector.h:45
void chegvx_(const int *itype, const char *jobz, const char *range, const char *uplo, const int *n, std::complex< float > *a, const int *lda, std::complex< float > *b, const int *ldb, const float *vl, const float *vu, const int *il, const int *iu, const float *abstol, int *m, float *w, std::complex< float > *z, const int *ldz, std::complex< float > *work, const int *lwork, float *rwork, int *iwork, int *ifail, int *info)
void dgetrf_(const int *m, const int *n, double *a, const int *lda, int *ipiv, int *info)
void dsyevx_(const char *jobz, const char *range, const char *uplo, const int *n, double *a, const int *lda, const double *vl, const double *vu, const int *il, const int *iu, const double *abstol, int *m, double *w, double *z, const int *ldz, double *work, const int *lwork, int *iwork, int *ifail, int *info)
void chegv_(const int *itype, const char *jobz, const char *uplo, const int *n, std::complex< float > *a, const int *lda, std::complex< float > *b, const int *ldb, float *w, std::complex< float > *work, const int *lwork, float *rwork, int *info)
void cheevx_(const char *jobz, const char *range, const char *uplo, const int *n, std::complex< float > *a, const int *lda, const float *vl, const float *vu, const int *il, const int *iu, const float *abstol, int *m, float *w, std::complex< float > *z, const int *ldz, std::complex< float > *work, const int *lwork, float *rwork, int *iwork, int *ifail, int *info)
void spotrf_(const char *uplo, const int *n, float *a, const int *lda, int *info)
void dgtsv_(const int *n, const int *nrhs, double *dl, double *d, double *du, double *b, const int *ldb, int *info)
void dsygvd_(const int *itype, const char *jobz, const char *uplo, const int *n, double *a, const int *lda, double *b, const int *ldb, double *w, double *work, const int *lwork, int *iwork, const int *liwork, int *info)
void dgetri_(const int *n, double *a, const int *lda, const int *ipiv, double *work, const int *lwork, int *info)
void zpotrf_(const char *uplo, const int *n, std::complex< double > *a, const int *lda, int *info)
void dsygv_(const int *itype, const char *jobz, const char *uplo, const int *n, double *a, const int *lda, double *b, const int *ldb, double *w, double *work, const int *lwork, int *info)
double zlange_(const char *norm, const int *m, const int *n, const std::complex< double > *A, const int *lda, double *work)
double dlange_(const char *norm, const int *m, const int *n, const double *A, const int *lda, double *work)
void dpotrf_(const char *uplo, const int *n, double *a, const int *lda, int *info)
void zgetri_(const int *n, std::complex< double > *a, const int *lda, const int *ipiv, std::complex< double > *work, const int *lwork, int *info)
void dsterf_(const int *n, double *d, double *e, int *info)
void dsysv_(const char *uplo, const int *n, const int *nrhs, double *a, const int *lda, int *ipiv, double *b, const int *ldb, double *work, const int *lwork, int *info)
void zgetrf_(const int *m, const int *n, std::complex< double > *a, const int *lda, int *ipiv, int *info)
void zhegvd_(const int *itype, const char *jobz, const char *uplo, const int *n, std::complex< double > *a, const int *lda, std::complex< double > *b, const int *ldb, double *w, std::complex< double > *work, const int *lwork, double *rwork, const int *lrwork, int *iwork, const int *liwork, int *info)
void zhegv_(const int *itype, const char *jobz, const char *uplo, const int *n, std::complex< double > *a, const int *lda, std::complex< double > *b, const int *ldb, double *w, std::complex< double > *work, const int *lwork, double *rwork, int *info)
void zheev_(const char *jobz, const char *uplo, const int *n, std::complex< double > *a, const int *lda, double *w, std::complex< double > *work, const int *lwork, double *rwork, int *info)
void dsytri_(const char *uplo, const int *n, double *a, const int *lda, const int *ipiv, double *work, int *info)
void cheev_(const char *jobz, const char *uplo, const int *n, std::complex< float > *a, const int *lda, float *w, std::complex< float > *work, const int *lwork, float *rwork, int *info)
void zheevx_(const char *jobz, const char *range, const char *uplo, const int *n, std::complex< double > *a, const int *lda, const double *vl, const double *vu, const int *il, const int *iu, const double *abstol, int *m, double *w, std::complex< double > *z, const int *ldz, std::complex< double > *work, const int *lwork, double *rwork, int *iwork, int *ifail, int *info)
void zpotri_(const char *uplo, const int *n, std::complex< double > *a, const int *lda, int *info)
constexpr double LAPACK_ORFAC
Definition lapack_connector.h:46
void zhegvx_(const int *itype, const char *jobz, const char *range, const char *uplo, const int *n, std::complex< double > *a, const int *lda, std::complex< double > *b, const int *ldb, const double *vl, const double *vu, const int *il, const int *iu, const double *abstol, int *m, double *w, std::complex< double > *z, const int *ldz, std::complex< double > *work, const int *lwork, double *rwork, int *iwork, int *ifail, int *info)
void dsygvx_(const int *itype, const char *jobz, const char *range, const char *uplo, const int *n, double *a, const int *lda, double *b, const int *ldb, const double *vl, const double *vu, const int *il, const int *iu, const double *abstol, int *m, double *w, double *z, const int *ldz, double *work, const int *lwork, int *iwork, int *ifail, int *info)
void zgeev_(const char *jobvl, const char *jobvr, const int *n, std::complex< double > *a, const int *lda, std::complex< double > *w, std::complex< double > *vl, const int *ldvl, std::complex< double > *vr, const int *ldvr, std::complex< double > *work, const int *lwork, double *rwork, int *info)
void zstein_(const int *n, const double *d, const double *e, const int *m, const double *w, const int *iblock, const int *isplit, std::complex< double > *z, const int *ldz, double *work, int *iwork, int *ifail, int *info)
void dsytrf_(const char *uplo, const int *n, double *a, const int *lda, int *ipiv, double *work, const int *lwork, int *info)
void dstein_(const int *n, const double *d, const double *e, const int *m, const double *w, const int *iblock, const int *isplit, double *z, const int *ldz, double *work, int *iwork, int *ifail, int *info)
void dpotf2_(const char *uplo, const int *n, double *a, const int *lda, int *info)
void zpotf2_(const char *uplo, const int *n, std::complex< double > *a, const int *lda, int *info)
void chegvd_(const int *itype, const char *jobz, const char *uplo, const int *n, std::complex< float > *a, const int *lda, std::complex< float > *b, const int *ldb, float *w, std::complex< float > *work, const int *lwork, float *rwork, const int *lrwork, int *iwork, const int *liwork, int *info)
void dpotri_(const char *uplo, const int *n, double *a, const int *lda, int *info)
void dsyev_(const char *jobz, const char *uplo, const int *n, double *a, const int *lda, double *w, double *work, const int *lwork, int *info)
void dgeev_(const char *jobvl, const char *jobvr, const int *n, double *a, const int *lda, double *wr, double *wi, double *vl, const int *ldvl, double *vr, const int *ldvr, double *work, const int *lwork, int *info)
void spotri_(const char *uplo, const int *n, float *a, const int *lda, int *info)
void ssyev_(const char *jobz, const char *uplo, const int *n, float *a, const int *lda, float *w, float *work, const int *lwork, int *info)
void cpotri_(const char *uplo, const int *n, std::complex< float > *a, const int *lda, int *info)
void cpotrf_(const char *uplo, const int *n, std::complex< float > *a, const int *lda, int *info)
Definition lapack_connector.h:373
double norm(const Vec3 &v)
Definition test_partition.cpp:25