source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/@sdpvar/ishermitian.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 753 bytes
Line 
1function issym=ishermitian(X)
2%ISHERMITIAN Check if variable is Hermitian
3
4% Author Johan Löfberg
5% $Id: ishermitian.m,v 1.7 2006/07/26 20:17:58 joloef Exp $
6
7n = X.dim(1);
8m = X.dim(2);
9issym = 0;
10if (n==m)
11
12    if isequal(X.conicinfo,[1 0])
13        issym = 1;
14        return
15    end
16   
17    if isa(X.basis,'lazybasis')
18        issym = 1;
19    else
20
21        % What are the linear indicies to the transposed matrices
22        ind = reshape(reshape(1:n^2,n,n)',n^2,1);
23
24        if ~isreal(X.basis)
25            residual = X.basis-conj(X.basis(ind,:));
26        else
27            residual = X.basis-X.basis(ind,:);
28        end
29
30        if nnz(residual)>0
31            issym = norm(residual,1)<1e-10;
32        else
33            issym = 1;
34        end
35    end
36end
Note: See TracBrowser for help on using the repository browser.