* Bug #12882 fixed - Some help pages were not clear.
[scilab.git] / scilab / modules / linear_algebra / help / en_US / matrix / det.xml
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.1-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" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="det">
14     <refnamediv>
15         <refname>det</refname>
16         <refpurpose>determinant</refpurpose>
17     </refnamediv>
18     <refsynopsisdiv>
19         <title>Calling Sequence</title>
20         <synopsis>det(X)
21             [e,m]=det(X)
22         </synopsis>
23     </refsynopsisdiv>
24     <refsection>
25         <title>Arguments</title>
26         <variablelist>
27             <varlistentry>
28                 <term>X</term>
29                 <listitem>
30                     <para>real or complex square matrix, polynomial or rational matrix.</para>
31                 </listitem>
32             </varlistentry>
33             <varlistentry>
34                 <term>m</term>
35                 <listitem>
36                     <para>real or complex number, the determinant base 10 mantissae</para>
37                 </listitem>
38             </varlistentry>
39             <varlistentry>
40                 <term>e</term>
41                 <listitem>
42                     <para>integer, the determinant base 10 exponent</para>
43                 </listitem>
44             </varlistentry>
45         </variablelist>
46     </refsection>
47     <refsection>
48         <title>Description</title>
49         <para>
50             <literal>det(X)</literal> ( <literal>m*10^e</literal> is the determinant of the square matrix <literal>X</literal>.
51         </para>
52         <para>
53             For polynomial matrix <literal>det(X)</literal> is equivalent to <literal>determ(X)</literal>.
54         </para>
55         <para>
56             For rational matrices <literal>det(X)</literal> is equivalent to <literal>detr(X)</literal>.
57         </para>
58         <para>
59             <important>
60                 The <literal>det</literal> and <literal>detr</literal> functions don't use the same algorithm. 
61                 For a rational fraction, <literal>det(X)</literal> is overloaded by <literal>%r_det(X)</literal> which is based on the <literal>determ</literal> function.
62                 <literal>detr()</literal> uses the Leverrier method.
63             </important>
64             <warning>
65                 Sometimes the <literal>det</literal> and <literal>detr</literal> functions may return different values for rational matrices.
66                 In such cases you should set rational simplification mode off by using <code>simp_mode(%f)</code> to get the same result.
67             </warning>
68         </para>
69     </refsection>
70     <refsection>
71         <title>References</title>
72         <para>
73             det computations are based on the Lapack routines
74             DGETRF for  real matrices and  ZGETRF for the complex case.
75         </para>
76         <para>
77             Concerning sparse matrices, the determinant is obtained from LU factorization of umfpack library.
78         </para>
79     </refsection>
80     <refsection>
81         <title>Examples</title>
82         <programlisting role="example"><![CDATA[
83 x=poly(0,'x');
84 det([x,1+x;2-x,x^2])
85 w=ssrand(2,2,4);roots(det(systmat(w))),trzeros(w)   //zeros of linear system
86 A=rand(3,3);
87 det(A), prod(spec(A))
88  ]]></programlisting>
89     </refsection>
90     <refsection role="see also">
91         <title>See Also</title>
92         <simplelist type="inline">
93             <member>
94                 <link linkend="detr">detr</link>
95             </member>
96             <member>
97                 <link linkend="determ">determ</link>
98             </member>
99             <member>
100                 <link linkend="simp_mode">simp_mode</link>
101             </member>
102         </simplelist>
103     </refsection>
104 </refentry>