X-Git-Url: http://gitweb.michael.orlitzky.com/?p=octave.git;a=blobdiff_plain;f=envelope.m;h=fd668421debc745c92fb15db086537e2ff79cbef;hp=e54f8185f49a1452846411ee654888f01f3cd1c4;hb=b12c6c2a4bf4cef29b2e08b743c92889505c7ed9;hpb=e1b71b4ca7cfa08ac76744a17a3778d4ccfaa7e2 diff --git a/envelope.m b/envelope.m index e54f818..fd66842 100644 --- a/envelope.m +++ b/envelope.m @@ -1,26 +1,26 @@ function envelope = envelope(A) - ## Compute the envelope of the matrix ``A``. The envelope of a matrix - ## is defined as the set of indices, - ## - ## E = { (i,j) : i < j, A(k,j) != 0 for some k <= i } - ## + % Compute the envelope of the matrix ``A``. The envelope of a matrix + % is defined as the set of indices, + % + % E = { (i,j) : i < j, A(k,j) != 0 for some k <= i } + % if (!issymmetric(A) && !is_upper_triangular(A)) - ## The envelope of a matrix is only defined for U-T or symmetric - ## matrices. + % The envelope of a matrix is only defined for U-T or symmetric + % matrices. envelope = {NA}; return; end - ## Start with an empty result, and append to it as we find - ## satisfactory indices. + % Start with an empty result, and append to it as we find + % satisfactory indices. envelope = {}; for j = [ 1 : columns(A) ] - ## Everything below the first non-zero element in a column will be - ## part of the envelope. Since we're moving from top to bottom, we - ## can simply set a flag indicating that we've found the first - ## non-zero element. Thereafter, everything we encounter should be - ## added to the envelope. + % Everything below the first non-zero element in a column will be + % part of the envelope. Since we're moving from top to bottom, we + % can simply set a flag indicating that we've found the first + % non-zero element. Thereafter, everything we encounter should be + % added to the envelope. found_nonzero = false; for i = [ 1 : j-1 ]