10 #define LAPACK_INLINE inline
12 #include "tbci/std_cplx.h"
13 #include "tbci/f_matrix.h"
14 #include "tbci/f_bandmatrix.h"
15 #include "tbci/lapack/lapack_lib.h"
45 for (
int i=0;
i<n;
i++)
55 STD__ cerr <<
"Error inverting Matrix A!" <<
STD__ endl;
79 STD__ cerr <<
"Error inverting Matrix A!" <<
STD__ endl;
95 double ew_min,
double ew_max);
111 zgeev_(&jobvl, &jobvr, &N,
114 &N, vr, &N, work, &lwork, rwork, &info);
133 &N, (
doublecomplex*) EV.get_fortran_matrix(), &N, work, &lwork, rwork, &info);
155 long ldab=A.numSuper()+1;
156 long ldbb=B.numSuper()+1;
158 long Anzahl_Eigenwerte;
177 for (j=i; j<i+ldab && j<n; j++)
187 for (j=i; j<i+ldbb && j<n; j++)
200 double* ew =
new double[n];
201 long *iwork =
new long[5*n];
202 double *rwork =
new double[7*n];
208 long info=
own_ew_(&BerechneEV, &uplo, &n, &Anzahl_Eigenwerte, ab, &ldab, bb, &ldbb,
209 &EW_min, &EW_max, ew, q, &n, work, rwork, iwork);
212 STD__ cerr <<
" Error calculating eigenvalues: (status " << info <<
")" <<
STD__ endl;
218 if (BerechneEV==1 && Anzahl_Eigenwerte>0)
222 long *ifail =
new long[Anzahl_Eigenwerte];
224 for (i=0;i<n*Anzahl_Eigenwerte;i++)
229 info=
own_ev_(&n, &Anzahl_Eigenwerte, ew, EV, &n, q, &n, work, rwork, iwork, ifail);
232 STD__ cerr <<
" Error calculating eigenvectors" <<
STD__ endl;
237 Eigenvectoren.resize(n,Anzahl_Eigenwerte);
238 for (j=0;j<Anzahl_Eigenwerte;j++)
240 for (
int i=0; i<n; i++)
250 Eigenwerte.
resize(Anzahl_Eigenwerte);
251 for(i=0; i<Anzahl_Eigenwerte; i++) Eigenwerte(i) = ew[
i];
274 double *rwork =
new double[3*n-2];
283 STD__ cerr <<
" Error calculating eigenvalues: (status " << info <<
")" <<
STD__ endl;
302 double *rwork =
new double[3*n-2];
310 STD__ cerr <<
" Error calculating eigenvalues: (status " << info <<
")" <<
STD__ endl;
int zgeev_(const char *jobvl, const char *jobvr, int *n, __complex__ double *a, int *lda, __complex__ double *w, __complex__ double *vl, int *ldvl, __complex__ double *vr, int *ldvr, __complex__ double *work, int *lwork, double *rwork, int *info)
const Vector< T > const Vector< T > & x
provides basic Vector functionality but arithmetic operators (+=, - , *, /...).
long int own_ew_(long int *job, long int *up, long int *n, long int *m, __complex__ double *ab, long int *ldab, __complex__ double *bb, long int *ldbb, double *vl, double *vu, double *w, __complex__ double *q, long int *ldq, __complex__ double *work, double *rwork, long int *iwork)
– AHLAND driver routine (version 2.0) – Modified LAPACK-ROUTINE for the calculation of selected Eigen...
F_TMatrix< double > inv(const F_Matrix< double > &A, int overwriteA=0)
F_TMatrix< double > lu_solve(const F_Matrix< double > &A, const F_Matrix< double > &B, int overwriteA=0)
F_Matrix< T > & resize(const unsigned r, const unsigned c)
T * get_fortran_matrix() const
long int own_ev_(long int *n, long int *m, double *w, __complex__ double *z, long int *ldz, __complex__ double *q, long int *ldq, __complex__ double *work, double *rwork, long int *iwork, long int *ifail)
– AHLAND driver routine (version 2.0) –
T * get_fortran_matrix() const
void setval(const T val, const unsigned int r, const unsigned int c)
TVector< double > lu_solve_expert(const F_BandMatrix< double > &A, const Vector< double > &B, int equilibrate=1)
Solution of linear eqution systems, partial pivoting.
For specializations of the memory allocator:
int integer
barf [ba:rf] 2.
T *const & get_fortran_vector() const
C++ class for banded matrices using band storage in a one-dimensional array.
int zheev_(const char *jobz, const char *uplo, int *n, __complex__ double *a, int *lda, double *w, __complex__ double *work, int *lwork, double *rwork, int *info)
Temporary Base Class (non referable!) (acc.
BVector< T > & resize(const BVector< T > &)
Actually it's a resize and copy (some people would expect the assignment op to do this) ...
int zgesv_(int *n, int *nrhs, __complex__ double *a, int *lda, int *ipiv, __complex__ double *b, int *ldb, int *info)
#define TBCIDELETE(t, v, sz)
Temporary Base Class Idiom: Class TVector is used for temporary variables.
const Vector< T > Vector< T > Vector< T > Vector< T > & y
int eig(const F_Matrix< double > &A, Vector< double > &EW)
eigenvalues (and eigenvectors) A*EV=EW*EV of symmetric double Matrix A