eigs problem when solving real symmetric sparse matrix

2 次查看(过去 30 天)
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.

采纳的回答

Walter Roberson
Walter Roberson 2011-5-12
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 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by