~ubuntu-branches/ubuntu/hardy/suitesparse/hardy

« back to all changes in this revision

Viewing changes to CHOLMOD/MATLAB/spsym.m

  • Committer: Bazaar Package Importer
  • Author(s): Rafael Laboissiere
  • Date: 2008-02-21 14:46:50 UTC
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20080221144650-rwcyowy7vo3bxjtx
Tags: upstream-3.1.0
ImportĀ upstreamĀ versionĀ 3.1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
%   this case, it returns 1, even if the matrix might otherwise be symmetric or
24
24
%   Hermitian.
25
25
%
26
 
%   Regardless of the value of "quick", this function returns 5 or 6 if A is
 
26
%   Regardless of the value of "quick", this function returns 6 or 7 if A is
27
27
%   a candidate for sparse Cholesky.
28
28
%
29
29
%   For an MATLAB M-file function that computes the same thing as this
50
50
%       % is meant for testing and documentation only.
51
51
%       [m n] = size (A) ;
52
52
%       if (m ~= n)
53
 
%           result = 0 ;            % rectangular
 
53
%           result = 1 ;            % rectangular
54
54
%           return
55
55
%       end
56
56
%       if (nargin < 2)
59
59
%       d = diag (A) ;
60
60
%       posdiag = all (real (d) > 0) & all (imag (d) == 0) ;
61
61
%       if (quick & ~posdiag)
62
 
%           result = 1 ;            % Not a candidate for sparse Cholesky.
 
62
%           result = 2 ;            % Not a candidate for sparse Cholesky.
63
63
%       elseif (~isreal (A) & nnz (A-A') == 0)
64
64
%           if (posdiag)
65
 
%               result = 6 ;        % complex Hermitian, with positive diagonal
 
65
%               result = 7 ;        % complex Hermitian, with positive diagonal
66
66
%           else
67
 
%               result = 3 ;        % complex Hermitian, nonpositive diagonal
 
67
%               result = 4 ;        % complex Hermitian, nonpositive diagonal
68
68
%           end
69
69
%       elseif (nnz (A-A.') == 0)
70
70
%           if (posdiag)
71
 
%               result = 5 ;        % symmetric with positive diagonal
 
71
%               result = 6 ;        % symmetric with positive diagonal
72
72
%           else
73
 
%               result = 2 ;        % symmetric, nonpositive diagonal
 
73
%               result = 3 ;        % symmetric, nonpositive diagonal
74
74
%           end
75
75
%       elseif (nnz (A+A.') == 0)
76
 
%           result = 4 ;            % skew symmetric
 
76
%           result = 5 ;            % skew symmetric
77
77
%       else
78
 
%           result = 1 ;            % unsymmetric
 
78
%           result = 2 ;            % unsymmetric
79
79
%       end
80
80
 
81
81
%   Copyright 2006-2007, Timothy A. Davis