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!