Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > b38d2da330d1936e5ab1307c039c4941 > files > 349

octave-doc-3.6.4-3.mga4.noarch.rpm

<html lang="en">
<head>
<title>Mathematical Considerations - GNU Octave</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="GNU Octave">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Operators-and-Functions.html#Operators-and-Functions" title="Operators and Functions">
<link rel="prev" href="Return-Types-of-Operators-and-Functions.html#Return-Types-of-Operators-and-Functions" title="Return Types of Operators and Functions">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc    { font-variant:small-caps }
  span.roman { font-family:serif; font-weight:normal; } 
  span.sansserif { font-family:sans-serif; font-weight:normal; } 
--></style>
</head>
<body>
<div class="node">
<a name="Mathematical-Considerations"></a>
<p>
Previous:&nbsp;<a rel="previous" accesskey="p" href="Return-Types-of-Operators-and-Functions.html#Return-Types-of-Operators-and-Functions">Return Types of Operators and Functions</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Operators-and-Functions.html#Operators-and-Functions">Operators and Functions</a>
<hr>
</div>

<h5 class="subsubsection">22.1.4.3 Mathematical Considerations</h5>

<p>The attempt has been made to make sparse matrices behave in exactly the
same manner as there full counterparts.  However, there are certain differences
and especially differences with other products sparse implementations.

   <p>Firstly, the "./" and ".^" operators must be used with care.  Consider what
the examples

<pre class="example">       s = speye (4);
       a1 = s .^ 2;
       a2 = s .^ s;
       a3 = s .^ -2;
       a4 = s ./ 2;
       a5 = 2 ./ s;
       a6 = s ./ s;
</pre>
   <p class="noindent">will give.  The first example of <var>s</var> raised to the power of 2 causes
no problems.  However <var>s</var> raised element-wise to itself involves a
large number of terms <code>0 .^ 0</code> which is 1. There <var>s</var><code> .^
</code><var>s</var> is a full matrix.

   <p>Likewise <var>s</var><code> .^ -2</code> involves terms like <code>0 .^ -2</code> which
is infinity, and so <var>s</var><code> .^ -2</code> is equally a full matrix.

   <p>For the "./" operator <var>s</var><code> ./ 2</code> has no problems, but
<code>2 ./ </code><var>s</var> involves a large number of infinity terms as well
and is equally a full matrix.  The case of <var>s</var><code> ./ </code><var>s</var>
involves terms like <code>0 ./ 0</code> which is a <code>NaN</code> and so this
is equally a full matrix with the zero elements of <var>s</var> filled with
<code>NaN</code> values.

   <p>The above behavior is consistent with full matrices, but is not
consistent with sparse implementations in other products.

   <p>A particular problem of sparse matrices comes about due to the fact that
as the zeros are not stored, the sign-bit of these zeros is equally not
stored.  In certain cases the sign-bit of zero is important.  For example:

<pre class="example">      a = 0 ./ [-1, 1; 1, -1];
      b = 1 ./ a
      &rArr; -Inf            Inf
          Inf           -Inf
      c = 1 ./ sparse (a)
      &rArr;  Inf            Inf
          Inf            Inf
</pre>
   <p>To correct this behavior would mean that zero elements with a negative
sign-bit would need to be stored in the matrix to ensure that their
sign-bit was respected.  This is not done at this time, for reasons of
efficiency, and so the user is warned that calculations where the sign-bit
of zero is important must not be done using sparse matrices.

   <p>In general any function or operator used on a sparse matrix will
result in a sparse matrix with the same or a larger number of non-zero
elements than the original matrix.  This is particularly true for the
important case of sparse matrix factorizations.  The usual way to
address this is to reorder the matrix, such that its factorization is
sparser than the factorization of the original matrix.  That is the
factorization of <code>L * U = P * S * Q</code> has sparser terms <code>L</code>
and <code>U</code> than the equivalent factorization <code>L * U = S</code>.

   <p>Several functions are available to reorder depending on the type of the
matrix to be factorized.  If the matrix is symmetric positive-definite,
then <dfn>symamd</dfn> or <dfn>csymamd</dfn> should be used.  Otherwise
<dfn>amd</dfn>, <dfn>colamd</dfn> or <dfn>ccolamd</dfn> should be used.  For completeness
the reordering functions <dfn>colperm</dfn> and <dfn>randperm</dfn> are
also available.

   <p>See <a href="fig_003asimplematrix.html#fig_003asimplematrix">fig:simplematrix</a>, for an example of the structure of a simple
positive definite matrix.

   <div class="float">
<a name="fig_003asimplematrix"></a><div align="center"><img src="spmatrix.png" alt="spmatrix.png"></div>
   <p><strong class="float-caption">Figure 22.3: Structure of simple sparse matrix.</strong></p></div>

   <p>The standard Cholesky&nbsp;factorization of this matrix can be
obtained by the same command that would be used for a full
matrix.  This can be visualized with the command
<code>r = chol(A); spy(r);</code>. 
See <a href="fig_003asimplechol.html#fig_003asimplechol">fig:simplechol</a>. 
The original matrix had
598
non-zero terms, while this Cholesky&nbsp;factorization has
10200,
with only half of the symmetric matrix being stored.  This
is a significant level of fill in, and although not an issue
for such a small test case, can represents a large overhead
in working with other sparse matrices.

   <p>The appropriate sparsity preserving permutation of the original
matrix is given by <dfn>symamd</dfn> and the factorization using this
reordering can be visualized using the command <code>q = symamd(A);
r = chol(A(q,q)); spy(r)</code>.  This gives
399
non-zero terms which is a significant improvement.

   <p>The Cholesky&nbsp;factorization itself can be used to determine the
appropriate sparsity preserving reordering of the matrix during the
factorization, In that case this might be obtained with three return
arguments as r<code>[r, p, q] = chol(A); spy(r)</code>.

   <div class="float">
<a name="fig_003asimplechol"></a><div align="center"><img src="spchol.png" alt="spchol.png"></div>
   <p><strong class="float-caption">Figure 22.4: Structure of the un-permuted Cholesky&nbsp;factorization of the above matrix.</strong></p></div>

   <div class="float">
<a name="fig_003asimplecholperm"></a><div align="center"><img src="spcholperm.png" alt="spcholperm.png"></div>
   <p><strong class="float-caption">Figure 22.5: Structure of the permuted Cholesky&nbsp;factorization of the above matrix.</strong></p></div>

   <p>In the case of an asymmetric matrix, the appropriate sparsity
preserving permutation is <dfn>colamd</dfn> and the factorization using
this reordering can be visualized using the command
<code>q = colamd(A); [l, u, p] = lu(A(:,q)); spy(l+u)</code>.

   <p>Finally, Octave implicitly reorders the matrix when using the div (/)
and ldiv (\) operators, and so no the user does not need to explicitly
reorder the matrix to maximize performance.

<!-- amd src/DLD-FUNCTIONS/amd.cc -->
   <p><a name="doc_002damd"></a>

<div class="defun">
&mdash; Loadable Function: <var>p</var> = <b>amd</b> (<var>S</var>)<var><a name="index-amd-2222"></a></var><br>
&mdash; Loadable Function: <var>p</var> = <b>amd</b> (<var>S, opts</var>)<var><a name="index-amd-2223"></a></var><br>
<blockquote>
        <p>Return the approximate minimum degree permutation of a matrix.  This
permutation such that the Cholesky&nbsp;factorization of <var>S</var><code>
(</code><var>p</var><code>, </code><var>p</var><code>)</code> tends to be sparser than the Cholesky&nbsp;factorization
of <var>S</var> itself.  <code>amd</code> is typically faster than <code>symamd</code> but
serves a similar purpose.

        <p>The optional parameter <var>opts</var> is a structure that controls the
behavior of <code>amd</code>.  The fields of the structure are

          <dl>
<dt><var>opts</var>.dense<dd>Determines what <code>amd</code> considers to be a dense row or column of the
input matrix.  Rows or columns with more than <code>max(16, (dense *
sqrt (</code><var>n</var><code>)</code> entries, where <var>n</var> is the order of the matrix <var>S</var>,
are ignored by <code>amd</code> during the calculation of the permutation
The value of dense must be a positive scalar and its default value is 10.0

          <br><dt><var>opts</var>.aggressive<dd>If this value is a non zero scalar, then <code>amd</code> performs aggressive
absorption.  The default is not to perform aggressive absorption. 
</dl>

        <p>The author of the code itself is Timothy A. Davis
<a href="mailto:davis@cise.ufl.edu">davis@cise.ufl.edu</a>, University of Florida (see
<a href="http://www.cise.ufl.edu/research/sparse/amd">http://www.cise.ufl.edu/research/sparse/amd</a>). 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002dsymamd.html#doc_002dsymamd">symamd</a>, <a href="doc_002dcolamd.html#doc_002dcolamd">colamd</a>. 
</p></blockquote></div>

<!-- ccolamd src/DLD-FUNCTIONS/ccolamd.cc -->
   <p><a name="doc_002dccolamd"></a>

<div class="defun">
&mdash; Loadable Function: <var>p</var> = <b>ccolamd</b> (<var>S</var>)<var><a name="index-ccolamd-2224"></a></var><br>
&mdash; Loadable Function: <var>p</var> = <b>ccolamd</b> (<var>S, knobs</var>)<var><a name="index-ccolamd-2225"></a></var><br>
&mdash; Loadable Function: <var>p</var> = <b>ccolamd</b> (<var>S, knobs, cmember</var>)<var><a name="index-ccolamd-2226"></a></var><br>
&mdash; Loadable Function: [<var>p</var>, <var>stats</var>] = <b>ccolamd</b> (<var><small class="dots">...</small></var>)<var><a name="index-ccolamd-2227"></a></var><br>
<blockquote>
        <p>Constrained column approximate minimum degree permutation. 
<var>p</var><code> = ccolamd (</code><var>S</var><code>)</code> returns the column approximate minimum
degree permutation vector for the sparse matrix <var>S</var>.  For a non-symmetric
matrix
<var>S</var>,
<var>S</var><code>(:, </code><var>p</var><code>)</code> tends to have sparser LU&nbsp;factors than
<var>S</var>.  <code>chol (</code><var>S</var><code>(:, </code><var>p</var><code>)' * </code><var>S</var><code>(:, </code><var>p</var><code>))</code> also
tends to be sparser than <code>chol (</code><var>S</var><code>' * </code><var>S</var><code>)</code>.  <var>p</var><code> =
ccolamd (</code><var>S</var><code>, 1)</code> optimizes the ordering for <code>lu (</code><var>S</var><code>(:,
</code><var>p</var><code>))</code>.  The ordering is followed by a column elimination tree
post-ordering.

        <p><var>knobs</var> is an optional 1-element to 5-element input vector, with a
default value of <code>[0 10 10 1 0]</code> if not present or empty.  Entries not
present are set to their defaults.

          <dl>
<dt><var>knobs</var><code>(1)</code><dd>if nonzero, the ordering is optimized for <code>lu (S(:, p))</code>.  It will be a
poor ordering for <code>chol (</code><var>S</var><code>(:, </code><var>p</var><code>)' * </code><var>S</var><code>(:,
</code><var>p</var><code>))</code>.  This is the most important knob for ccolamd.

          <br><dt><var>knobs</var><code>(2)</code><dd>if <var>S</var> is m-by-n, rows with more than <code>max (16, </code><var>knobs</var><code>(2) *
sqrt (n))</code> entries are ignored.

          <br><dt><var>knobs</var><code>(3)</code><dd>columns with more than <code>max (16, </code><var>knobs</var><code>(3) * sqrt (min (</code><var>m</var><code>,
</code><var>n</var><code>)))</code> entries are ignored and ordered last in the output permutation
(subject to the cmember constraints).

          <br><dt><var>knobs</var><code>(4)</code><dd>if nonzero, aggressive absorption is performed.

          <br><dt><var>knobs</var><code>(5)</code><dd>if nonzero, statistics and knobs are printed.

        </dl>

        <p><var>cmember</var> is an optional vector of length n.  It defines the
constraints on the column ordering.  If <var>cmember</var><code>(j) = </code><var>c</var>,
then column <var>j</var> is in constraint set <var>c</var> (<var>c</var> must be in the
range 1 to
n).  In the output permutation <var>p</var>, all columns in set 1 appear
first, followed by all columns in set 2, and so on.  <var>cmember</var><code> =
ones(1,n)</code> if not present or empty. 
<code>ccolamd (</code><var>S</var><code>, [], 1 : n)</code> returns <code>1 : n</code>

        <p><var>p</var><code> = ccolamd (</code><var>S</var><code>)</code> is about the same as
<var>p</var><code> = colamd (</code><var>S</var><code>)</code>.  <var>knobs</var> and its default values
differ.  <code>colamd</code> always does aggressive absorption, and it finds an
ordering suitable for both <code>lu (</code><var>S</var><code>(:, </code><var>p</var><code>))</code> and <code>chol
(</code><var>S</var><code>(:, </code><var>p</var><code>)' * </code><var>S</var><code>(:, </code><var>p</var><code>))</code>; it cannot optimize its
ordering for <code>lu (</code><var>S</var><code>(:, </code><var>p</var><code>))</code> to the extent that
<code>ccolamd (</code><var>S</var><code>, 1)</code> can.

        <p><var>stats</var> is an optional 20-element output vector that provides data
about the ordering and the validity of the input matrix <var>S</var>.  Ordering
statistics are in <var>stats</var><code>(1 : 3)</code>.  <var>stats</var><code>(1)</code> and
<var>stats</var><code>(2)</code> are the number of dense or empty rows and columns
ignored by <span class="sc">ccolamd</span> and <var>stats</var><code>(3)</code> is the number of garbage
collections performed on the internal data structure used by <span class="sc">ccolamd</span>
(roughly of size <code>2.2 * nnz (</code><var>S</var><code>) + 4 * </code><var>m</var><code> + 7 * </code><var>n</var>
integers).

        <p><var>stats</var><code>(4 : 7)</code> provide information if CCOLAMD was able to
continue.  The matrix is OK if <var>stats</var><code>(4)</code> is zero, or 1 if
invalid.  <var>stats</var><code>(5)</code> is the rightmost column index that is
unsorted or contains duplicate entries, or zero if no such column exists. 
<var>stats</var><code>(6)</code> is the last seen duplicate or out-of-order row
index in the column index given by <var>stats</var><code>(5)</code>, or zero if no
such row index exists.  <var>stats</var><code>(7)</code> is the number of duplicate
or out-of-order row indices.  <var>stats</var><code>(8 : 20)</code> is always zero in
the current version of <span class="sc">ccolamd</span> (reserved for future use).

        <p>The authors of the code itself are S. Larimore, T. Davis (Univ. of Florida)
and S. Rajamanickam in collaboration with J. Bilbert and E. Ng.  Supported
by the National Science Foundation (DMS-9504974, DMS-9803599, CCR-0203270),
and a grant from Sandia National Lab.  See
<a href="http://www.cise.ufl.edu/research/sparse">http://www.cise.ufl.edu/research/sparse</a> for ccolamd, csymamd, amd,
colamd, symamd, and other related orderings. 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002dcolamd.html#doc_002dcolamd">colamd</a>, <a href="doc_002dcsymamd.html#doc_002dcsymamd">csymamd</a>. 
</p></blockquote></div>

<!-- colamd src/DLD-FUNCTIONS/colamd.cc -->
   <p><a name="doc_002dcolamd"></a>

<div class="defun">
&mdash; Loadable Function: <var>p</var> = <b>colamd</b> (<var>S</var>)<var><a name="index-colamd-2228"></a></var><br>
&mdash; Loadable Function: <var>p</var> = <b>colamd</b> (<var>S, knobs</var>)<var><a name="index-colamd-2229"></a></var><br>
&mdash; Loadable Function: [<var>p</var>, <var>stats</var>] = <b>colamd</b> (<var>S</var>)<var><a name="index-colamd-2230"></a></var><br>
&mdash; Loadable Function: [<var>p</var>, <var>stats</var>] = <b>colamd</b> (<var>S, knobs</var>)<var><a name="index-colamd-2231"></a></var><br>
<blockquote>
        <p>Column approximate minimum degree permutation. 
<var>p</var><code> = colamd (</code><var>S</var><code>)</code> returns the column approximate minimum
degree permutation vector for the sparse matrix <var>S</var>.  For a
non-symmetric matrix <var>S</var>, <var>S</var><code>(:,</code><var>p</var><code>)</code> tends to have
sparser LU&nbsp;factors than <var>S</var>.  The Cholesky&nbsp;factorization of
<var>S</var><code>(:,</code><var>p</var><code>)' * </code><var>S</var><code>(:,</code><var>p</var><code>)</code> also tends to be sparser
than that of <var>S</var><code>' * </code><var>S</var>.

        <p><var>knobs</var> is an optional one- to three-element input vector.  If <var>S</var> is
m-by-n, then rows with more than <code>max(16,</code><var>knobs</var><code>(1)*sqrt(n))</code>
entries are ignored.  Columns with more than
<code>max(16,</code><var>knobs</var><code>(2)*sqrt(min(m,n)))</code> entries are removed prior to
ordering, and ordered last in the output permutation <var>p</var>.  Only
completely dense rows or columns are removed if <var>knobs</var><code>(1)</code> and
<var>knobs</var><code>(2)</code> are &lt; 0, respectively.  If <var>knobs</var><code>(3)</code> is
nonzero, <var>stats</var> and <var>knobs</var> are printed.  The default is
<var>knobs</var><code> = [10 10 0]</code>.  Note that <var>knobs</var> differs from earlier
versions of colamd.

        <p><var>stats</var> is an optional 20-element output vector that provides data
about the ordering and the validity of the input matrix <var>S</var>.  Ordering
statistics are in <var>stats</var><code>(1:3)</code>.  <var>stats</var><code>(1)</code> and
<var>stats</var><code>(2)</code> are the number of dense or empty rows and columns
ignored by <span class="sc">colamd</span> and <var>stats</var><code>(3)</code> is the number of garbage
collections performed on the internal data structure used by <span class="sc">colamd</span>
(roughly of size <code>2.2 * nnz(</code><var>S</var><code>) + 4 * </code><var>m</var><code> + 7 * </code><var>n</var>
integers).

        <p>Octave built-in functions are intended to generate valid sparse matrices,
with no duplicate entries, with ascending row indices of the nonzeros
in each column, with a non-negative number of entries in each column (!) 
and so on.  If a matrix is invalid, then <span class="sc">colamd</span> may or may not be able
to continue.  If there are duplicate entries (a row index appears two or
more times in the same column) or if the row indices in a column are out
of order, then <span class="sc">colamd</span> can correct these errors by ignoring the duplicate
entries and sorting each column of its internal copy of the matrix
<var>S</var> (the input matrix <var>S</var> is not repaired, however).  If a matrix
is invalid in other ways then <span class="sc">colamd</span> cannot continue, an error message
is printed, and no output arguments (<var>p</var> or <var>stats</var>) are returned. 
<span class="sc">colamd</span> is thus a simple way to check a sparse matrix to see if it's
valid.

        <p><var>stats</var><code>(4:7)</code> provide information if COLAMD was able to
continue.  The matrix is OK if <var>stats</var><code>(4)</code> is zero, or 1 if
invalid.  <var>stats</var><code>(5)</code> is the rightmost column index that is
unsorted or contains duplicate entries, or zero if no such column exists. 
<var>stats</var><code>(6)</code> is the last seen duplicate or out-of-order row
index in the column index given by <var>stats</var><code>(5)</code>, or zero if no
such row index exists.  <var>stats</var><code>(7)</code> is the number of duplicate
or out-of-order row indices.  <var>stats</var><code>(8:20)</code> is always zero in
the current version of <span class="sc">colamd</span> (reserved for future use).

        <p>The ordering is followed by a column elimination tree post-ordering.

        <p>The authors of the code itself are Stefan I. Larimore and Timothy A. 
Davis <a href="mailto:davis@cise.ufl.edu">davis@cise.ufl.edu</a>, University of Florida.  The algorithm was
developed in collaboration with John Gilbert, Xerox PARC, and Esmond
Ng, Oak Ridge National Laboratory.  (see
<a href="http://www.cise.ufl.edu/research/sparse/colamd">http://www.cise.ufl.edu/research/sparse/colamd</a>)
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002dcolperm.html#doc_002dcolperm">colperm</a>, <a href="doc_002dsymamd.html#doc_002dsymamd">symamd</a>, <a href="doc_002dccolamd.html#doc_002dccolamd">ccolamd</a>. 
</p></blockquote></div>

<!-- colperm scripts/sparse/colperm.m -->
   <p><a name="doc_002dcolperm"></a>

<div class="defun">
&mdash; Function File: <var>p</var> = <b>colperm</b> (<var>s</var>)<var><a name="index-colperm-2232"></a></var><br>
<blockquote><p>Return the column permutations such that the columns of
<var>s</var><code> (:, </code><var>p</var><code>)</code> are ordered in terms of increase number
of non-zero elements.  If <var>s</var> is symmetric, then <var>p</var> is chosen
such that <var>s</var><code> (</code><var>p</var><code>, </code><var>p</var><code>)</code> orders the rows and
columns with increasing number of non zeros elements. 
</p></blockquote></div>

<!-- csymamd src/DLD-FUNCTIONS/ccolamd.cc -->
   <p><a name="doc_002dcsymamd"></a>

<div class="defun">
&mdash; Loadable Function: <var>p</var> = <b>csymamd</b> (<var>S</var>)<var><a name="index-csymamd-2233"></a></var><br>
&mdash; Loadable Function: <var>p</var> = <b>csymamd</b> (<var>S, knobs</var>)<var><a name="index-csymamd-2234"></a></var><br>
&mdash; Loadable Function: <var>p</var> = <b>csymamd</b> (<var>S, knobs, cmember</var>)<var><a name="index-csymamd-2235"></a></var><br>
&mdash; Loadable Function: [<var>p</var>, <var>stats</var>] = <b>csymamd</b> (<var><small class="dots">...</small></var>)<var><a name="index-csymamd-2236"></a></var><br>
<blockquote>
        <p>For a symmetric positive definite matrix <var>S</var>, returns the permutation
vector <var>p</var> such that <var>S</var><code>(</code><var>p</var><code>,</code><var>p</var><code>)</code> tends to have a
sparser Cholesky&nbsp;factor than <var>S</var>.  Sometimes <code>csymamd</code> works
well for symmetric indefinite matrices too.  The matrix <var>S</var> is assumed
to be symmetric; only the strictly lower triangular part is referenced. 
<var>S</var> must be square.  The ordering is followed by an elimination tree
post-ordering.

        <p><var>knobs</var> is an optional 1-element to 3-element input vector, with a
default value of <code>[10 1 0]</code> if present or empty.  Entries not
present are set to their defaults.

          <dl>
<dt><var>knobs</var><code>(1)</code><dd>If <var>S</var> is n-by-n, then rows and columns with more than
<code>max(16,</code><var>knobs</var><code>(1)*sqrt(n))</code> entries are ignored, and ordered
last in the output permutation (subject to the cmember constraints).

          <br><dt><var>knobs</var><code>(2)</code><dd>If nonzero, aggressive absorption is performed.

          <br><dt><var>knobs</var><code>(3)</code><dd>If nonzero, statistics and knobs are printed.

        </dl>

        <p><var>cmember</var> is an optional vector of length n. It defines the constraints
on the ordering.  If <var>cmember</var><code>(j) = </code><var>S</var>, then row/column j is
in constraint set <var>c</var> (<var>c</var> must be in the range 1 to n).  In the
output permutation <var>p</var>, rows/columns in set 1 appear first, followed
by all rows/columns in set 2, and so on.  <var>cmember</var><code> = ones(1,n)</code>
if not present or empty.  <code>csymamd(</code><var>S</var><code>,[],1:n)</code> returns <code>1:n</code>.

        <p><var>p</var><code> = csymamd(</code><var>S</var><code>)</code> is about the same as <var>p</var><code> =
symamd(</code><var>S</var><code>)</code>.  <var>knobs</var> and its default values differ.

        <p><var>stats</var><code>(4:7)</code> provide information if CCOLAMD was able to
continue.  The matrix is OK if <var>stats</var><code>(4)</code> is zero, or 1 if
invalid.  <var>stats</var><code>(5)</code> is the rightmost column index that is
unsorted or contains duplicate entries, or zero if no such column exists. 
<var>stats</var><code>(6)</code> is the last seen duplicate or out-of-order row
index in the column index given by <var>stats</var><code>(5)</code>, or zero if no
such row index exists.  <var>stats</var><code>(7)</code> is the number of duplicate
or out-of-order row indices.  <var>stats</var><code>(8:20)</code> is always zero in
the current version of <span class="sc">ccolamd</span> (reserved for future use).

        <p>The authors of the code itself are S. Larimore, T. Davis (Uni of Florida)
and S. Rajamanickam in collaboration with J. Bilbert and E. Ng.  Supported
by the National Science Foundation (DMS-9504974, DMS-9803599, CCR-0203270),
and a grant from Sandia National Lab.  See
<a href="http://www.cise.ufl.edu/research/sparse">http://www.cise.ufl.edu/research/sparse</a> for ccolamd, csymamd, amd,
colamd, symamd, and other related orderings. 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002dsymamd.html#doc_002dsymamd">symamd</a>, <a href="doc_002dccolamd.html#doc_002dccolamd">ccolamd</a>. 
</p></blockquote></div>

<!-- dmperm src/DLD-FUNCTIONS/dmperm.cc -->
   <p><a name="doc_002ddmperm"></a>

<div class="defun">
&mdash; Loadable Function: <var>p</var> = <b>dmperm</b> (<var>S</var>)<var><a name="index-dmperm-2237"></a></var><br>
&mdash; Loadable Function: [<var>p</var>, <var>q</var>, <var>r</var>, <var>S</var>] = <b>dmperm</b> (<var>S</var>)<var><a name="index-dmperm-2238"></a></var><br>
<blockquote>
        <p><a name="index-Dulmage_002dMendelsohn-decomposition-2239"></a>Perform a Dulmage-Mendelsohn permutation of the sparse matrix <var>S</var>. 
With a single output argument <code>dmperm</code> performs the row permutations
<var>p</var> such that <var>S</var><code>(</code><var>p</var><code>,:)</code> has no zero elements on the
diagonal.

        <p>Called with two or more output arguments, returns the row and column
permutations, such that <var>S</var><code>(</code><var>p</var><code>, </code><var>q</var><code>)</code> is in block
triangular form.  The values of <var>r</var> and <var>S</var> define the boundaries
of the blocks.  If <var>S</var> is square then <var>r</var><code> == </code><var>S</var>.

        <p>The method used is described in: A. Pothen &amp; C.-J. Fan. <cite>Computing the
Block Triangular Form of a Sparse Matrix</cite>. ACM Trans. Math. Software,
16(4):303-324, 1990. 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002dcolamd.html#doc_002dcolamd">colamd</a>, <a href="doc_002dccolamd.html#doc_002dccolamd">ccolamd</a>. 
</p></blockquote></div>

<!-- symamd src/DLD-FUNCTIONS/colamd.cc -->
   <p><a name="doc_002dsymamd"></a>

<div class="defun">
&mdash; Loadable Function: <var>p</var> = <b>symamd</b> (<var>S</var>)<var><a name="index-symamd-2240"></a></var><br>
&mdash; Loadable Function: <var>p</var> = <b>symamd</b> (<var>S, knobs</var>)<var><a name="index-symamd-2241"></a></var><br>
&mdash; Loadable Function: [<var>p</var>, <var>stats</var>] = <b>symamd</b> (<var>S</var>)<var><a name="index-symamd-2242"></a></var><br>
&mdash; Loadable Function: [<var>p</var>, <var>stats</var>] = <b>symamd</b> (<var>S, knobs</var>)<var><a name="index-symamd-2243"></a></var><br>
<blockquote>
        <p>For a symmetric positive definite matrix <var>S</var>, returns the permutation
vector p such that <var>S</var><code>(</code><var>p</var><code>, </code><var>p</var><code>)</code> tends to have a
sparser Cholesky&nbsp;factor than <var>S</var>.  Sometimes <code>symamd</code> works
well for symmetric indefinite matrices too.  The matrix <var>S</var> is assumed
to be symmetric; only the strictly lower triangular part is referenced. 
<var>S</var> must be square.

        <p><var>knobs</var> is an optional one- to two-element input vector.  If <var>S</var> is
n-by-n, then rows and columns with more than
<code>max(16,</code><var>knobs</var><code>(1)*sqrt(n))</code> entries are removed prior to ordering,
and ordered last in the output permutation <var>p</var>.  No rows/columns are
removed if <var>knobs</var><code>(1) &lt; 0</code>.  If <var>knobs</var><code> (2)</code> is nonzero,
<code>stats</code> and <var>knobs</var> are printed.  The default is <var>knobs</var><code>
= [10 0]</code>.  Note that <var>knobs</var> differs from earlier versions of symamd.

        <p><var>stats</var> is an optional 20-element output vector that provides data
about the ordering and the validity of the input matrix <var>S</var>.  Ordering
statistics are in <var>stats</var><code>(1:3)</code>.  <var>stats</var><code>(1) =
</code><var>stats</var><code>(2)</code> is the number of dense or empty rows and columns
ignored by SYMAMD and <var>stats</var><code>(3)</code> is the number of garbage
collections performed on the internal data structure used by SYMAMD
(roughly of size <code>8.4 * nnz (tril (</code><var>S</var><code>, -1)) + 9 * </code><var>n</var>
integers).

        <p>Octave built-in functions are intended to generate valid sparse matrices,
with no duplicate entries, with ascending row indices of the nonzeros
in each column, with a non-negative number of entries in each column (!) 
and so on.  If a matrix is invalid, then SYMAMD may or may not be able
to continue.  If there are duplicate entries (a row index appears two or
more times in the same column) or if the row indices in a column are out
of order, then SYMAMD can correct these errors by ignoring the duplicate
entries and sorting each column of its internal copy of the matrix S (the
input matrix S is not repaired, however).  If a matrix is invalid in
other ways then SYMAMD cannot continue, an error message is printed, and
no output arguments (<var>p</var> or <var>stats</var>) are returned.  SYMAMD is
thus a simple way to check a sparse matrix to see if it's valid.

        <p><var>stats</var><code>(4:7)</code> provide information if SYMAMD was able to
continue.  The matrix is OK if <var>stats</var><code> (4)</code> is zero, or 1
if invalid.  <var>stats</var><code>(5)</code> is the rightmost column index that
is unsorted or contains duplicate entries, or zero if no such column
exists.  <var>stats</var><code>(6)</code> is the last seen duplicate or out-of-order
row index in the column index given by <var>stats</var><code>(5)</code>, or zero
if no such row index exists.  <var>stats</var><code>(7)</code> is the number of
duplicate or out-of-order row indices.  <var>stats</var><code>(8:20)</code> is
always zero in the current version of SYMAMD (reserved for future use).

        <p>The ordering is followed by a column elimination tree post-ordering.

        <p>The authors of the code itself are Stefan I. Larimore and Timothy A. 
Davis <a href="mailto:davis@cise.ufl.edu">davis@cise.ufl.edu</a>, University of Florida.  The algorithm was
developed in collaboration with John Gilbert, Xerox PARC, and Esmond
Ng, Oak Ridge National Laboratory.  (see
<a href="http://www.cise.ufl.edu/research/sparse/colamd">http://www.cise.ufl.edu/research/sparse/colamd</a>)
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002dcolperm.html#doc_002dcolperm">colperm</a>, <a href="doc_002dcolamd.html#doc_002dcolamd">colamd</a>. 
</p></blockquote></div>

<!-- symrcm src/DLD-FUNCTIONS/symrcm.cc -->
   <p><a name="doc_002dsymrcm"></a>

<div class="defun">
&mdash; Loadable Function: <var>p</var> = <b>symrcm</b> (<var>S</var>)<var><a name="index-symrcm-2244"></a></var><br>
<blockquote><p>Return the symmetric reverse Cuthill-McKee permutation of <var>S</var>. 
<var>p</var> is a permutation vector such that
<var>S</var><code>(</code><var>p</var><code>, </code><var>p</var><code>)</code> tends to have its diagonal elements
closer to the diagonal than <var>S</var>.  This is a good preordering for LU
or Cholesky&nbsp;factorization of matrices that come from 'long, skinny'
problems.  It works for both symmetric and asymmetric <var>S</var>.

        <p>The algorithm represents a heuristic approach to the NP-complete
bandwidth minimization problem.  The implementation is based in the
descriptions found in

        <p>E. Cuthill, J. McKee. <cite>Reducing the Bandwidth of Sparse Symmetric
Matrices</cite>. Proceedings of the 24th ACM National Conference, 157&ndash;172
1969, Brandon Press, New Jersey.

        <p>A. George, J.W.H. Liu. <cite>Computer Solution of Large Sparse
Positive Definite Systems</cite>, Prentice Hall Series in Computational
Mathematics, ISBN 0-13-165274-5, 1981.

     <!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
     <!-- A simple blank line produces the correct behavior. -->
     <!-- @sp 1 -->
     <p class="noindent"><strong>See also:</strong> <a href="doc_002dcolperm.html#doc_002dcolperm">colperm</a>, <a href="doc_002dcolamd.html#doc_002dcolamd">colamd</a>, <a href="doc_002dsymamd.html#doc_002dsymamd">symamd</a>. 
</p></blockquote></div>

   </body></html>