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.
0 件のコメント
採用された回答
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!