- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
I'd recommend to use dsyev routine for computing all eigenvalues and eigenvectors of symmetric matrices. Here is an C example
#include
"mkl_lapack.h"
int
main(){
intm=3;
doublea[9] = {294.0, -180.0, 108.0, -180.0, -25.0, 240.0, 108.0, 240.0, 231.0};
charjobz='v', uplo='l';
intinfo, n=3, lwork=18, i, j;
doublew[3], work[18];
dsyev(&jobz, &uplo, &n, a, &n, w, work, &lwork, &info);
printf(" Eigenvalues computed ");
for(i=0; i
printf("%.5f ", w);
};
}
The input/output arraya if jobz= 'V' andinfo = 0, contains the orthonormal eigenvectors of the matrix A. You are not able to use dsteqr for the matrix given by yousince dsteqr is only for tridiagonal matrices and accepts onlythe main and subdiagonals as input parameters. So you have to use the following lapack routines dsytrd, dorgtr and dsteqr for solving the full eigenvalue problemfor dense symmetric matrix as it isimplemented in dsyev routine. Besides dsyev routine is doing a scaling of input matrix if it is necessary to get thehigh accuracy.
Lien copié
- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable