Line | |
---|
1 | function issym=issymmetric(X) |
---|
2 | %ISSYMMETRIC Check if variable is symmetric |
---|
3 | |
---|
4 | % Author Johan Löfberg |
---|
5 | % $Id: issymmetric.m,v 1.6 2006/07/26 20:17:58 joloef Exp $ |
---|
6 | |
---|
7 | n = X.dim(1); |
---|
8 | m = X.dim(2); |
---|
9 | if (n==m) |
---|
10 | % What are the linar indicies to the transposed matrices |
---|
11 | if isa(X.basis,'lazybasis') |
---|
12 | issym = 1; |
---|
13 | else |
---|
14 | ind = reshape(reshape(1:n^2,n,n)',n^2,1); |
---|
15 | issym = norm(X.basis-X.basis(ind,:),1)<1e-10; |
---|
16 | end |
---|
17 | else |
---|
18 | issym = 0; |
---|
19 | end |
---|
20 | |
---|
Note: See
TracBrowser
for help on using the repository browser.