From: willems Date: Wed, 7 Apr 2010 20:26:59 +0000 (+0000) Subject: Recognize the LAPACK functions dsygv and ssygv. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ddb681761474d2dac9ad3d7bf2ca7106ebfedd7;p=dealii-svn.git Recognize the LAPACK functions dsygv and ssygv. git-svn-id: https://svn.dealii.org/trunk@20963 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/configure.in b/deal.II/configure.in index cee2b7f5cb..7ce8604fce 100644 --- a/deal.II/configure.in +++ b/deal.II/configure.in @@ -567,7 +567,7 @@ fi AC_CHECK_FUNCS([daxpy_ saxpy_ dgemv_ sgemv_ dgeev_ sgeev_ dgeevx_ sgeevx_]) AC_CHECK_FUNCS([dgesvd_ sgesvd_ dgemm_ sgemm_ dgetrf_ sgetrf_ dgetri_ sgetri_]) AC_CHECK_FUNCS([dgeqrf_ sgeqrf_ dormqr_ sormqr_ dorgqr_ sorgqr_ dtrtrs_ strtrs_]) -AC_CHECK_FUNCS([dgetrs_ sgetrs_ dstev_ sstev_]) +AC_CHECK_FUNCS([dgetrs_ sgetrs_ dstev_ sstev_ dsygv_ ssygv_]) dnl ------------------------------------------------------------- dnl set include paths of several libraries diff --git a/deal.II/lac/include/lac/lapack_templates.h b/deal.II/lac/include/lac/lapack_templates.h index ea67a684c4..15ed5ecc69 100644 --- a/deal.II/lac/include/lac/lapack_templates.h +++ b/deal.II/lac/include/lac/lapack_templates.h @@ -142,6 +142,17 @@ void dsyev_ (const char *jobz, const char *uplo, const int *n, 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); +// General eigenvalues and eigenvectors of +// 1: A*x = lambda*B*x; 2: A*B*x = lambda*x; 3: B*A*x = lambda*x +// A and B are symmetric and B is definite +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); +void ssygv_ (const int* itype, const char* jobz, const char* uplo, + const int* n, float* A, const int* lda, float* B, + const int* ldb, float* w, float* work, + const int* lwork, int* info); // Compute singular value decomposition void dgesvd_ (int* jobu, int* jobvt, const int* n, const int* m, double* A, const int* lda, @@ -562,6 +573,36 @@ syev (const char *, const char *, const int *, float *, const int *, float *, fl #endif +#ifdef HAVE_DSYGV_ +inline void +sygv (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) +{ + dsygv_(itype, jobz, uplo, n, A, lda, B, ldb, w, work, lwork, info); +} +#else +inline void +sygv (const int*, const char*, const char*, const int*, double*, const int*, double*, const int*, double*, double*, const int*, int*) +{ + Assert (false, LAPACKSupport::ExcMissing("dsygv")); +} +#endif + + +#ifdef HAVE_SSYGV_ +inline void +sygv (const int* itype, const char* jobz, const char* uplo, const int* n, float* A, const int* lda, float* B, const int* ldb, float* w, float* work, const int* lwork, int* info) +{ + ssygv_(itype, jobz, uplo, n, A, lda, B, ldb, w, work, lwork, info); +} +#else +inline void +sygv (const int*, const char*, const char*, const int*, float*, const int*, float*, const int*, float*, float*, const int*, int*) +{ + Assert (false, LAPACKSupport::ExcMissing("ssygv")); +} +#endif + + #ifdef HAVE_DGESVD_ inline void gesvd (int* jobu, int* jobvt, const int* n, const int* m, double* A, const int* lda, double* s, double* u, const int* ldu, double* vt, const int* ldvt, double* work, const int* lwork, int* info)