Skip to content

Commit 82222db

Browse files
committed
Add hegvx routine
1 parent 1f7e8fb commit 82222db

File tree

1 file changed

+83
-0
lines changed
  • source/source_base/module_container/base/third_party

1 file changed

+83
-0
lines changed

source/source_base/module_container/base/third_party/lapack.h

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,27 @@ void chegvd_(const int* itype, const char* jobz, const char* uplo, const int* n,
4646
std::complex<float>* work, int* lwork, float* rwork, int* lrwork,
4747
int* iwork, int* liwork, int* info);
4848

49+
void ssygvx_(const int* itype, const char* jobz, const char* range, const char* uplo,
50+
const int* n, float* A, const int* lda, float* B, const int* ldb,
51+
const float* vl, const float* vu, const int* il, const int* iu,
52+
const float* abstol, const int* m, float* w, float* Z, const int* ldz,
53+
float* work, const int* lwork, int* iwork, int* ifail, int* info);
54+
void dsygvx_(const int* itype, const char* jobz, const char* range, const char* uplo,
55+
const int* n, double* A, const int* lda, double* B, const int* ldb,
56+
const double* vl, const double* vu, const int* il, const int* iu,
57+
const double* abstol, const int* m, double* w, double* Z, const int* ldz,
58+
double* work, const int* lwork, int* iwork, int* ifail, int* info);
59+
void chegvx_(const int* itype, const char* jobz, const char* range, const char* uplo,
60+
const int* n, std::complex<float>* A, const int* lda, std::complex<float>* B, const int* ldb,
61+
const float* vl, const float* vu, const int* il, const int* iu,
62+
const float* abstol, const int* m, float* w, std::complex<float>* Z, const int* ldz,
63+
std::complex<float>* work, const int* lwork, float* rwork, int* iwork, int* ifail, int* info);
64+
void zhegvx_(const int* itype, const char* jobz, const char* range, const char* uplo,
65+
const int* n, std::complex<double>* A, const int* lda, std::complex<double>* B, const int* ldb,
66+
const double* vl, const double* vu, const int* il, const int* iu,
67+
const double* abstol, const int* m, double* w, std::complex<double>* Z, const int* ldz,
68+
std::complex<double>* work, const int* lwork, double* rwork, int* iwork, int* ifail, int* info);
69+
4970
void zhegvd_(const int* itype, const char* jobz, const char* uplo, const int* n,
5071
std::complex<double>* a, const int* lda,
5172
const std::complex<double>* b, const int* ldb, double* w,
@@ -190,6 +211,68 @@ void hegvd(const int itype, const char jobz, const char uplo, const int n,
190211
iwork, &liwork, &info);
191212
}
192213

214+
// Note
215+
// rwork is only needed for complex version
216+
// and we include rwork in the function parameter list
217+
// for simplicity of function overloading
218+
// and unification of function parameter list
219+
static inline
220+
void hegvx(const int itype, const char jobz, const char range, const char uplo, const int n,
221+
float* a, const int lda, float* b, const int ldb,
222+
const float vl, const float vu, const int il, const int iu, const float abstol,
223+
const int m, float* w, float* z, const int ldz,
224+
float* work, const int lwork, float* rwork, int* iwork, int* ifail, int& info)
225+
{
226+
ssygvx_(&itype, &jobz, &range, &uplo, &n,
227+
a, &lda, b, &ldb,
228+
&vl, &vu, &il, &iu,
229+
&abstol, &m, w, z, &ldz,
230+
work, &lwork, iwork, ifail, &info);
231+
}
232+
233+
static inline
234+
void hegvx(const int itype, const char jobz, const char range, const char uplo, const int n,
235+
double* a, const int lda, double* b, const int ldb,
236+
const double vl, const double vu, const int il, const int iu, const double abstol,
237+
const int m, double* w, double* z, const int ldz,
238+
double* work, const int lwork, double* rwork, int* iwork, int* ifail, int& info)
239+
{
240+
dsygvx_(&itype, &jobz, &range, &uplo, &n,
241+
a, &lda, b, &ldb,
242+
&vl, &vu, &il, &iu,
243+
&abstol, &m, w, z, &ldz,
244+
work, &lwork, iwork, ifail, &info);
245+
}
246+
247+
static inline
248+
void hegvx(const int itype, const char jobz, const char range, const char uplo, const int n,
249+
std::complex<float>* a, const int lda, std::complex<float>* b, const int ldb,
250+
const float vl, const float vu, const int il, const int iu, const float abstol,
251+
const int m, float* w, std::complex<float>* z, const int ldz,
252+
std::complex<float>* work, const int lwork, float* rwork, int* iwork, int* ifail, int& info)
253+
{
254+
chegvx_(&itype, &jobz, &range, &uplo, &n,
255+
a, &lda, b, &ldb,
256+
&vl, &vu, &il, &iu,
257+
&abstol, &m, w, z, &ldz,
258+
work, &lwork, rwork, iwork, ifail, &info);
259+
}
260+
261+
static inline
262+
void hegvx(const int itype, const char jobz, const char range, const char uplo, const int n,
263+
std::complex<double>* a, const int lda, std::complex<double>* b, const int ldb,
264+
const double vl, const double vu, const int il, const int iu, const double abstol,
265+
const int m, double* w, std::complex<double>* z, const int ldz,
266+
std::complex<double>* work, const int lwork, double* rwork, int* iwork, int* ifail, int& info)
267+
{
268+
zhegvx_(&itype, &jobz, &range, &uplo, &n,
269+
a, &lda, b, &ldb,
270+
&vl, &vu, &il, &iu,
271+
&abstol, &m, w, z, &ldz,
272+
work, &lwork, rwork, iwork, ifail, &info);
273+
}
274+
275+
193276
// wrap function of fortran lapack routine zheevx.
194277
static inline
195278
void heevx( const int itype, const char jobz, const char range, const char uplo, const int n,

0 commit comments

Comments
 (0)