<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) 2008 - INRIA
 *
 * Copyright (C) 2012 - 2016 - Scilab Enterprises
 *
 * This file is hereby licensed under the terms of the GNU GPL v2.0,
 * pursuant to article 5.3.4 of the CeCILL v.2.1.
 * This file was originally licensed under the terms of the CeCILL v2.1,
 * and continues to be available under such terms.
 * For more information, see the COPYING file which you should have received
 * along with this program.
 *
 -->
<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="fr" xml:id="companion">
    <refnamediv>
        <refname>companion</refname>
        <refpurpose>matrice compagnon  </refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Séquence d'appel</title>
        <synopsis>A=companion(p)</synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Paramètres</title>
        <variablelist>
            <varlistentry>
                <term>p  </term>
                <listitem>
                    <para>polynôme ou vecteur de polynômes
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>A  </term>
                <listitem>
                    <para>matrice carrée
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>
            Renvoie une matrice <literal>A</literal> dont le polynôme caractéristique est
            <literal>p</literal> si <literal>p</literal> est unitaire (le coefficient de plus haut degré est égal à un). Si <literal>p</literal> n'est pas unitaire
            le polynôme caractéristique de <literal>A</literal> est égal à
            <literal>p/c</literal> où <literal>c</literal> est le coefficient de plus haut degré de <literal>p</literal>.
        </para>
        <para>
            Si <literal>p</literal> est un vecteur de polynômes unitaires, <literal>A</literal> est bloc-diagonale,
            et le polynôme caractéristique du i-ème bloc est égal à <literal>p(i)</literal>.
        </para>
    </refsection>
    <refsection>
        <title>Exemples</title>
        <programlisting role="example"><![CDATA[
s=poly(0,'s');
p=poly([1,2,3,4,1],'s','c')
det(s*eye(4,4)-companion(p))
roots(p)
spec(companion(p))
 ]]></programlisting>
    </refsection>
    <refsection role="see also">
        <title>Voir aussi</title>
        <simplelist type="inline">
            <member>
                <link linkend="spec">spec</link>
            </member>
            <member>
                <link linkend="poly">poly</link>
            </member>
            <member>
                <link linkend="randpencil">randpencil</link>
            </member>
        </simplelist>
    </refsection>
</refentry>
