Lines 20-36
Link Here
|
20 |
// |
20 |
// |
21 |
// You should have received a copy of the GNU Lesser General Public |
21 |
// You should have received a copy of the GNU Lesser General Public |
22 |
// License and a copy of the GNU General Public License along with |
22 |
// License and a copy of the GNU General Public License along with |
23 |
// Eigen. If not, see <http://www.gnu.org/licenses/>. |
23 |
// Eigen. If not, see <http://www.gnu.org/licenses/>. |
24 |
|
24 |
|
25 |
#ifndef EIGEN_ARPACKGENERALIZEDSELFADJOINTEIGENSOLVER_H |
25 |
#ifndef EIGEN_ARPACKGENERALIZEDSELFADJOINTEIGENSOLVER_H |
26 |
#define EIGEN_ARPACKGENERALIZEDSELFADJOINTEIGENSOLVER_H |
26 |
#define EIGEN_ARPACKGENERALIZEDSELFADJOINTEIGENSOLVER_H |
27 |
|
27 |
|
28 |
|
28 |
#include <Eigen/Dense> |
29 |
|
29 |
|
30 |
namespace Eigen { |
30 |
namespace Eigen { |
31 |
|
31 |
|
32 |
namespace internal { |
32 |
namespace internal { |
33 |
template<typename Scalar, typename RealScalar> struct arpack_wrapper; |
33 |
template<typename Scalar, typename RealScalar> struct arpack_wrapper; |
34 |
template<typename MatrixSolver, typename MatrixType, typename Scalar, bool BisSPD> struct OP; |
34 |
template<typename MatrixSolver, typename MatrixType, typename Scalar, bool BisSPD> struct OP; |
35 |
} |
35 |
} |
36 |
|
36 |
|
Lines 332-347
protected:
Link Here
|
332 |
template<typename MatrixType, typename MatrixSolver, bool BisSPD> |
332 |
template<typename MatrixType, typename MatrixSolver, bool BisSPD> |
333 |
ArpackGeneralizedSelfAdjointEigenSolver<MatrixType, MatrixSolver, BisSPD>& |
333 |
ArpackGeneralizedSelfAdjointEigenSolver<MatrixType, MatrixSolver, BisSPD>& |
334 |
ArpackGeneralizedSelfAdjointEigenSolver<MatrixType, MatrixSolver, BisSPD> |
334 |
ArpackGeneralizedSelfAdjointEigenSolver<MatrixType, MatrixSolver, BisSPD> |
335 |
::compute(const MatrixType& A, Index nbrEigenvalues, |
335 |
::compute(const MatrixType& A, Index nbrEigenvalues, |
336 |
std::string eigs_sigma, int options, RealScalar tol) |
336 |
std::string eigs_sigma, int options, RealScalar tol) |
337 |
{ |
337 |
{ |
338 |
MatrixType B(0,0); |
338 |
MatrixType B(0,0); |
339 |
compute(A, B, nbrEigenvalues, eigs_sigma, options, tol); |
339 |
compute(A, B, nbrEigenvalues, eigs_sigma, options, tol); |
|
|
340 |
|
341 |
return *this; |
340 |
} |
342 |
} |
341 |
|
343 |
|
342 |
|
344 |
|
343 |
template<typename MatrixType, typename MatrixSolver, bool BisSPD> |
345 |
template<typename MatrixType, typename MatrixSolver, bool BisSPD> |
344 |
ArpackGeneralizedSelfAdjointEigenSolver<MatrixType, MatrixSolver, BisSPD>& |
346 |
ArpackGeneralizedSelfAdjointEigenSolver<MatrixType, MatrixSolver, BisSPD>& |
345 |
ArpackGeneralizedSelfAdjointEigenSolver<MatrixType, MatrixSolver, BisSPD> |
347 |
ArpackGeneralizedSelfAdjointEigenSolver<MatrixType, MatrixSolver, BisSPD> |
346 |
::compute(const MatrixType& A, const MatrixType& B, Index nbrEigenvalues, |
348 |
::compute(const MatrixType& A, const MatrixType& B, Index nbrEigenvalues, |
347 |
std::string eigs_sigma, int options, RealScalar tol) |
349 |
std::string eigs_sigma, int options, RealScalar tol) |
Lines 676-700
extern "C" void dseupd_(int *rvec, char
Link Here
|
676 |
namespace internal { |
678 |
namespace internal { |
677 |
|
679 |
|
678 |
template<typename Scalar, typename RealScalar> struct arpack_wrapper |
680 |
template<typename Scalar, typename RealScalar> struct arpack_wrapper |
679 |
{ |
681 |
{ |
680 |
static inline void saupd(int *ido, char *bmat, int *n, char *which, |
682 |
static inline void saupd(int *ido, char *bmat, int *n, char *which, |
681 |
int *nev, RealScalar *tol, Scalar *resid, int *ncv, |
683 |
int *nev, RealScalar *tol, Scalar *resid, int *ncv, |
682 |
Scalar *v, int *ldv, int *iparam, int *ipntr, |
684 |
Scalar *v, int *ldv, int *iparam, int *ipntr, |
683 |
Scalar *workd, Scalar *workl, int *lworkl, int *info) |
685 |
Scalar *workd, Scalar *workl, int *lworkl, int *info) |
684 |
{ EIGEN_STATIC_ASSERT(false, static_assertion<true>::NUMERIC_TYPE_MUST_BE_REAL); } |
686 |
{ |
|
|
687 |
EIGEN_STATIC_ASSERT(!NumTraits<Scalar>::IsComplex, NUMERIC_TYPE_MUST_BE_REAL) |
688 |
} |
685 |
|
689 |
|
686 |
static inline void seupd(int *rvec, char *All, int *select, Scalar *d, |
690 |
static inline void seupd(int *rvec, char *All, int *select, Scalar *d, |
687 |
Scalar *z, int *ldz, RealScalar *sigma, |
691 |
Scalar *z, int *ldz, RealScalar *sigma, |
688 |
char *bmat, int *n, char *which, int *nev, |
692 |
char *bmat, int *n, char *which, int *nev, |
689 |
RealScalar *tol, Scalar *resid, int *ncv, Scalar *v, |
693 |
RealScalar *tol, Scalar *resid, int *ncv, Scalar *v, |
690 |
int *ldv, int *iparam, int *ipntr, Scalar *workd, |
694 |
int *ldv, int *iparam, int *ipntr, Scalar *workd, |
691 |
Scalar *workl, int *lworkl, int *ierr) |
695 |
Scalar *workl, int *lworkl, int *ierr) |
692 |
{ EIGEN_STATIC_ASSERT(false, static_assertion<true>::NUMERIC_TYPE_MUST_BE_REAL); } |
696 |
{ |
|
|
697 |
EIGEN_STATIC_ASSERT(!NumTraits<Scalar>::IsComplex, NUMERIC_TYPE_MUST_BE_REAL) |
698 |
} |
693 |
}; |
699 |
}; |
694 |
|
700 |
|
695 |
template <> struct arpack_wrapper<float, float> |
701 |
template <> struct arpack_wrapper<float, float> |
696 |
{ |
702 |
{ |
697 |
static inline void saupd(int *ido, char *bmat, int *n, char *which, |
703 |
static inline void saupd(int *ido, char *bmat, int *n, char *which, |
698 |
int *nev, float *tol, float *resid, int *ncv, |
704 |
int *nev, float *tol, float *resid, int *ncv, |
699 |
float *v, int *ldv, int *iparam, int *ipntr, |
705 |
float *v, int *ldv, int *iparam, int *ipntr, |
700 |
float *workd, float *workl, int *lworkl, int *info) |
706 |
float *workd, float *workl, int *lworkl, int *info) |