Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to check if a sparse matrix is symmetric?

1,606 views
Skip to first unread message

Michelle

unread,
Jun 19, 2012, 12:59:07 PM6/19/12
to
I have a sparse matrix that I cannot write in its full form (out of memory if I try)

The way I constructed my matrix, it is supposed to be a symmetric matrix but when I compute eigs it gives me complex values as a solution.

I'm pretty sure that matlab is not handling the symmetry. A start point for me would be to check if my sparse matix is symmetric.

Any suggestions? Thanks

Michelle

Matt J

unread,
Jun 19, 2012, 2:31:06 PM6/19/12
to
"Michelle " <michellem...@gmail.com> wrote in message <jrqb4r$s4c$1...@newscl01ah.mathworks.com>...
> I have a sparse matrix that I cannot write in its full form (out of memory if I try)
>
> The way I constructed my matrix, it is supposed to be a symmetric matrix but when I compute eigs it gives me complex values as a solution.
==================

Is it real?


> I'm pretty sure that matlab is not handling the symmetry. A start point for me would be to check if my sparse matix is symmetric.
>
> Any suggestions? Thanks
==============


[i,j,s]=find(A);
[I,J,S]=find(A.');

issymetric=isequal([i,j,s], [I,J,S]);

Matt J

unread,
Jun 19, 2012, 2:36:07 PM6/19/12
to
"Matt J" wrote in message <jrqgha$o1r$1...@newscl01ah.mathworks.com>...
>
>
> [i,j,s]=find(A);
> [I,J,S]=find(A.');
>
> issymetric=isequal([i,j,s], [I,J,S]);

Forget that. Just do isequal(A,A.')
0 new messages