~ubuntu-branches/ubuntu/raring/scilab/raring-proposed

« back to all changes in this revision

Viewing changes to modules/linear_algebra/help/en_US/linsolve.xml

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2012-08-30 14:42:38 UTC
  • mfrom: (1.4.7)
  • Revision ID: package-import@ubuntu.com-20120830144238-c1y2og7dbm7m9nig
Tags: 5.4.0-beta-3-1~exp1
* New upstream release
* Update the scirenderer dep
* Get ride of libjhdf5-java dependency

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?xml version="1.0" encoding="UTF-8"?>
2
 
<!--
3
 
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4
 
 * Copyright (C) 2008 - INRIA
5
 
 * 
6
 
 * This file must be used under the terms of the CeCILL.
7
 
 * This source file is licensed as described in the file COPYING, which
8
 
 * you should have received as part of this distribution.  The terms
9
 
 * are also available at    
10
 
 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
11
 
 *
12
 
 -->
13
 
<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" version="5.0-subset Scilab" xml:lang="en" xml:id="linsolve">
14
 
  <refnamediv>
15
 
    <refname>linsolve</refname>
16
 
    <refpurpose> linear equation solver</refpurpose>
17
 
  </refnamediv>
18
 
  <refsynopsisdiv>
19
 
    <title>Calling Sequence</title>
20
 
    <synopsis>[x0,kerA]=linsolve(A,b [,x0])</synopsis>
21
 
  </refsynopsisdiv>
22
 
  <refsection>
23
 
    <title>Arguments</title>
24
 
    <variablelist>
25
 
      <varlistentry>
26
 
        <term>A</term>
27
 
        <listitem>
28
 
          <para>
29
 
            a <literal>na x ma</literal> real matrix (possibly sparse)
30
 
          </para>
31
 
        </listitem>
32
 
      </varlistentry>
33
 
      <varlistentry>
34
 
        <term>b</term>
35
 
        <listitem>
36
 
          <para>
37
 
            a <literal>na x 1</literal> vector (same row dimension as <literal>A</literal>)
38
 
          </para>
39
 
        </listitem>
40
 
      </varlistentry>
41
 
      <varlistentry>
42
 
        <term>x0</term>
43
 
        <listitem>
44
 
          <para>a real vector</para>
45
 
        </listitem>
46
 
      </varlistentry>
47
 
      <varlistentry>
48
 
        <term>kerA</term>
49
 
        <listitem>
50
 
          <para>
51
 
            a <literal>ma x k</literal> real matrix
52
 
          </para>
53
 
        </listitem>
54
 
      </varlistentry>
55
 
    </variablelist>
56
 
  </refsection>
57
 
  <refsection>
58
 
    <title>Description</title>
59
 
    <para>
60
 
      <literal>linsolve</literal>  computes all the solutions to <literal> A*x+b=0</literal>.
61
 
    </para>
62
 
    <para>
63
 
      <literal>x0</literal> is a particular solution (if any) and <literal> kerA= </literal>nullspace
64
 
      of <literal>A</literal>. Any <literal>x=x0+kerA*w</literal> with arbitrary <literal>w</literal> satisfies
65
 
      <literal> A*x+b=0</literal>.
66
 
    </para>
67
 
    <para>
68
 
      If compatible <literal>x0</literal> is given on entry, <literal>x0</literal> is returned. If not
69
 
      a compatible <literal>x0</literal>, if any, is returned.
70
 
    </para>
71
 
  </refsection>
72
 
  <refsection>
73
 
    <title>Examples</title>
74
 
    <programlisting role="example"><![CDATA[ 
75
 
A=rand(5,3)*rand(3,8);
76
 
b=A*ones(8,1);[x,kerA]=linsolve(A,b);A*x+b   //compatible b
77
 
b=ones(5,1);[x,kerA]=linsolve(A,b);A*x+b   //uncompatible b
78
 
A=rand(5,5);[x,kerA]=linsolve(A,b), -inv(A)*b  //x is unique
79
 
 
80
 
// Benchmark with other linear sparse solver:
81
 
[A,descr,ref,mtype] = ReadHBSparse(SCI+"/modules/umfpack/examples/bcsstk24.rsa"); 
82
 
 
83
 
b = zeros(size(A,1),1);
84
 
 
85
 
tic();
86
 
res = umfpack(A,'\',b);
87
 
mprintf('\ntime needed to solve the system with umfpack: %.3f\n',toc());
88
 
 
89
 
tic();
90
 
res = linsolve(A,b);
91
 
mprintf('\ntime needed to solve the system with linsolve: %.3f\n',toc());
92
 
 
93
 
tic();
94
 
res = A\b;
95
 
mprintf('\ntime needed to solve the system with the backslash operator: %.3f\n',toc());
96
 
 ]]></programlisting>
97
 
  </refsection>
98
 
  <refsection role="see also">
99
 
    <title>See Also</title>
100
 
    <simplelist type="inline">
101
 
      <member>
102
 
        <link linkend="inv">inv</link>
103
 
      </member>
104
 
      <member>
105
 
        <link linkend="pinv">pinv</link>
106
 
      </member>
107
 
      <member>
108
 
        <link linkend="colcomp">colcomp</link>
109
 
      </member>
110
 
      <member>
111
 
        <link linkend="im_inv">im_inv</link>
112
 
      </member>
113
 
      <member>
114
 
        <link linkend="umfpack">umfpack</link>
115
 
      </member>
116
 
      <member>
117
 
        <link linkend="backslash">backslash</link>
118
 
      </member>
119
 
    </simplelist>
120
 
  </refsection>
121
 
</refentry>