%s*eye()-A where A is a matrix of doubles produces an error. So eye() is replaced...
[scilab.git] / scilab / modules / linear_algebra / help / en_US / pencil / companion.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="companion">
14     <refnamediv>
15         <refname>companion</refname>
16         <refpurpose>companion matrix</refpurpose>
17     </refnamediv>
18     <refsynopsisdiv>
19         <title>Calling Sequence</title>
20         <synopsis>A=companion(p)</synopsis>
21     </refsynopsisdiv>
22     <refsection>
23         <title>Arguments</title>
24         <variablelist>
25             <varlistentry>
26                 <term>p</term>
27                 <listitem>
28                     <para>polynomial or vector of polynomials</para>
29                 </listitem>
30             </varlistentry>
31             <varlistentry>
32                 <term>A</term>
33                 <listitem>
34                     <para>square matrix</para>
35                 </listitem>
36             </varlistentry>
37         </variablelist>
38     </refsection>
39     <refsection>
40         <title>Description</title>
41         <para>
42             Returns a matrix <literal>A</literal> with characteristic polynomial equal
43             to <literal>p</literal> if <literal>p</literal> is monic. If <literal>p</literal> is not monic
44             the characteristic polynomial of <literal>A</literal> is equal to
45             <literal>p/c</literal> where <literal>c</literal> is the coefficient of largest degree
46             in <literal>p</literal>.
47         </para>
48         <para>
49             If <literal>p</literal> is a vector of monic polynomials, <literal>A</literal> is block diagonal,
50             and the characteristic polynomial of the ith block is <literal>p(i)</literal>.
51         </para>
52     </refsection>
53     <refsection>
54         <title>Examples</title>
55         <programlisting role="example"><![CDATA[ 
56 s=poly(0,'s');
57 p=poly([1,2,3,4,1],'s','c')
58 det(s*eye(4,4)-companion(p))
59 roots(p)
60 spec(companion(p))
61  ]]></programlisting>
62     </refsection>
63     <refsection role="see also">
64         <title>See Also</title>
65         <simplelist type="inline">
66             <member>
67                 <link linkend="spec">spec</link>
68             </member>
69             <member>
70                 <link linkend="poly">poly</link>
71             </member>
72             <member>
73                 <link linkend="randpencil">randpencil</link>
74             </member>
75         </simplelist>
76     </refsection>
77 </refentry>