eigs problem when solving real symmetric sparse matrix
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
when i preparing my thesis, i have to get eigenvalues and vectors of matrix W(graph laplacian), which is real, symmtric and positive semi-definite, more specifically.And the matrix W is created by mex file i compiled from c++ file.
this is the code i use to solve it:
#
opts.issym = 1;
opts.isreal = 1;
opts.disp = 2;
[V,D] = eigs(eye_minus(A), k, 'sa', opts);
#
when i run it, i got the following problem.
??? Error using ==> eigs>checkInputs at 986 Eigenvalue range sigma must be a valid 2-element string. For non-symmetric or complex A, the choices are 'LM', 'SM', 'LR', 'SR', 'LI' or 'SI'.
anybody could help get this problem fixed. i'd appreciate that. and by the way, i want to know whether using eigs to solve this problem is efficient in terms of time consumption.
0 commentaires
Réponse acceptée
Walter Roberson
le 12 Mai 2011
My recommendation would be to cross-check that the matrix you received is real has symmetric indices, and then if necessary, cross-check that the supposedly symmetric locations exactly equal each other.
It is not uncommon that when matrices are computed that are theoretically symmetrical, that differences in round-off lead to small differences in the mirror locations. A common way of dealing with that with full matrices is to use
(A + A.')/2
That is probably not the most efficient method with a sparse matrix though.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!