add examples about sparse functions 88/9788/2
Sylvestre Ledru [Sun, 25 Nov 2012 11:12:13 +0000 (12:12 +0100)]
Change-Id: Ica0d440f5fde3c00d7b0ef3d7d0e226a97a6de29

scilab/modules/sparse/help/en_US/chfact.xml
scilab/modules/sparse/help/en_US/chsolve.xml
scilab/modules/sparse/help/en_US/decomposition/ludel.xml
scilab/modules/sparse/help/en_US/decomposition/lusolve.xml

index 2156111..695b60e 100644 (file)
             <literal>spcho</literal>. This function is to be used with <literal>chsolve</literal>.
         </para>
     </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[ 
+A=sprand(20,20,0.1);
+A=A*A'+eye();  
+chfact(A)
+
+sol=(1:20)';
+rhs=A*sol;
+chfact(A)
+ ]]></programlisting>
+    </refsection>
+    
     <refsection role="see also">
         <title>See Also</title>
         <simplelist type="inline">
index 2886fad..bc63685 100644 (file)
@@ -52,7 +52,8 @@
 A=sprand(20,20,0.1);
 A=A*A'+eye();  
 spcho=chfact(A);
-sol=(1:20)';rhs=A*sol;
+sol=(1:20)';
+rhs=A*sol;
 spcho=chfact(A);
 chsolve(spcho,rhs)
  ]]></programlisting>
index 5dd9b1a..166e448 100644 (file)
             solves the sparse linear system  <literal>A*x = b</literal> and clears <literal>p</literal>.
         </para>
     </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[ 
+non_zeros=[1,2,3,4];
+rows_cols=[1,1;2,2;3,3;4,4];
+sp=sparse(rows_cols,non_zeros);
+[h,rk]=lufact(sp);
+x=lusolve(h,[1;1;1;1]);
+ludel(h)
+rk,sp*x
+ ]]></programlisting>
+    </refsection>
+    
     <refsection role="see also">
         <title>See Also</title>
         <simplelist type="inline">
index de4a6ff..5108a2a 100644 (file)
     <refsection>
         <title>Examples</title>
         <programlisting role="example"><![CDATA[ 
-non_zeros=[1,2,3,4];rows_cols=[1,1;2,2;3,3;4,4];
+non_zeros=[1,2,3,4];
+rows_cols=[1,1;2,2;3,3;4,4];
 sp=sparse(rows_cols,non_zeros);
-[h,rk]=lufact(sp);x=lusolve(h,[1;1;1;1]);ludel(h)
+[h,rk]=lufact(sp);
+x=lusolve(h,[1;1;1;1]);
+ludel(h)
 rk,sp*x
 
-non_zeros=[1,2,3,4];rows_cols=[1,1;2,2;3,3;4,4];
+non_zeros=[1,2,3,4];
+rows_cols=[1,1;2,2;3,3;4,4];
 sp=sparse(rows_cols,non_zeros);
 x=lusolve(sp,-ones(4,1));
 sp*x