GPL + CeCILL Header change
[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  * Copyright (C) 2012 - 2016 - Scilab Enterprises
7  *
8  * This file is hereby licensed under the terms of the GNU GPL v2.0,
9  * pursuant to article 5.3.4 of the CeCILL v.2.1.
10  * This file was originally licensed under the terms of the CeCILL v2.1,
11  * and continues to be available under such terms.
12  * For more information, see the COPYING file which you should have received
13  * along with this program.
14  * === LICENSE_END ===
15  *
16  -->
17 <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">
18     <refnamediv>
19         <refname>det</refname>
20         <refpurpose>determinant</refpurpose>
21     </refnamediv>
22     <refsynopsisdiv>
23         <title>Calling Sequence</title>
24         <synopsis>det(X)
25             [e,m]=det(X)
26         </synopsis>
27     </refsynopsisdiv>
28     <refsection>
29         <title>Arguments</title>
30         <variablelist>
31             <varlistentry>
32                 <term>X</term>
33                 <listitem>
34                     <para>real or complex square matrix, polynomial or rational matrix.</para>
35                 </listitem>
36             </varlistentry>
37             <varlistentry>
38                 <term>m</term>
39                 <listitem>
40                     <para>real or complex number, the determinant base 10 mantissae</para>
41                 </listitem>
42             </varlistentry>
43             <varlistentry>
44                 <term>e</term>
45                 <listitem>
46                     <para>integer, the determinant base 10 exponent</para>
47                 </listitem>
48             </varlistentry>
49         </variablelist>
50     </refsection>
51     <refsection>
52         <title>Description</title>
53         <para>
54             <literal>det(X)</literal> ( <literal>m*10^e</literal> is the determinant of the square matrix <literal>X</literal>.
55         </para>
56         <para>
57             For polynomial matrix <literal>det(X)</literal> is equivalent to <literal>determ(X)</literal>.
58         </para>
59         <para>
60             For rational matrices <literal>det(X)</literal> is equivalent to <literal>detr(X)</literal>.
61         </para>
62         <para>
63             <important>
64                 The <literal>det</literal> and <literal>detr</literal> functions don't use the same algorithm. 
65                 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.
66                 <literal>detr()</literal> uses the Leverrier method.
67             </important>
68             <warning>
69                 Sometimes the <literal>det</literal> and <literal>detr</literal> functions may return different values for rational matrices.
70                 In such cases you should set rational simplification mode off by using <code>simp_mode(%f)</code> to get the same result.
71             </warning>
72         </para>
73     </refsection>
74     <refsection>
75         <title>References</title>
76         <para>
77             det computations are based on the Lapack routines
78             DGETRF for  real matrices and  ZGETRF for the complex case.
79         </para>
80         <para>
81             Concerning sparse matrices, the determinant is obtained from LU factorization of umfpack library.
82         </para>
83     </refsection>
84     <refsection>
85         <title>Examples</title>
86         <programlisting role="example"><![CDATA[
87 x=poly(0,'x');
88 det([x,1+x;2-x,x^2])
89 w=ssrand(2,2,4);roots(det(systmat(w))),trzeros(w)   //zeros of linear system
90 A=rand(3,3);
91 det(A), prod(spec(A))
92  ]]></programlisting>
93     </refsection>
94     <refsection role="see also">
95         <title>See Also</title>
96         <simplelist type="inline">
97             <member>
98                 <link linkend="detr">detr</link>
99             </member>
100             <member>
101                 <link linkend="determ">determ</link>
102             </member>
103             <member>
104                 <link linkend="simp_mode">simp_mode</link>
105             </member>
106         </simplelist>
107     </refsection>
108 </refentry>