help pages: toeplitz overhauled. diag, sparse, speye improved
[scilab.git] / scilab / modules / sparse / help / en_US / sparseconvert / sparse.xml
index bb44224..3243824 100644 (file)
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="sparse">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+        xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
+        xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
+        xml:lang="en" xml:id="sparse">
     <refnamediv>
         <refname>sparse</refname>
         <refpurpose>sparse matrix definition</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Syntax</title>
-        <synopsis>sp=sparse(X)
-            sp=sparse(ij,v [,mn])
+        <synopsis>
+            sp = sparse(X)
+            sp = sparse(ij, v)
+            sp = sparse(ij, v, mn)
         </synopsis>
     </refsynopsisdiv>
     <refsection>
     <refsection>
         <title>Examples</title>
         <programlisting role="example"><![CDATA[
-sp=sparse([1,2;4,5;3,10],[1,2,3])
+sp = sparse([1,2;4,5;3,10],[1,2,3])
 size(sp)
-x=rand(2,2);abs(x)-full(abs(sparse(x)))
+
+x = rand(2,2);
+abs(x) - full(abs(sparse(x)))
+
 // sparse constructor taking a single dense matrix
 // removes the zeros.
-dense=[0., 1., 0., 0., 0.,
+dense = [0., 1., 0., 0., 0.,
 1., 0., 2., 0., 0.
 0., 0., 0., 0., 0.
 0., 0., 0., 0., -0.5];
-sp=sparse(dense)
+sp = sparse(dense)
+
 // complex matrices are also supported
-sp=sparse(dense*(1+2*%i))
+sp = sparse(dense*(1+2*%i))
+
 // for boolean matrices, the boolean sparse matrix
 // only stores true values (and removes false values).
-dense=[%F, %F, %T, %F, %F
+dense = [%F, %F, %T, %F, %F
 %T, %F, %F, %F, %F
 %F, %F, %F, %F, %F
 %F, %F, %F, %F, %T];
-sp=sparse(dense)
-
- ]]></programlisting>
+sp = sparse(dense)
+]]></programlisting>
     </refsection>
     <refsection role="see also">
         <title>See also</title>
@@ -139,7 +148,10 @@ sp=sparse(dense)
                 <link linkend="speye">speye</link>
             </member>
             <member>
-                <link linkend="lufact">lufact</link>
+                <link linkend="diag">diag</link>
+            </member>
+            <member>
+                <link linkend="toeplitz">toeplitz</link>
             </member>
         </simplelist>
     </refsection>