<?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:ns5="http://www.w3.org/1999/xhtml"
          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
          xmlns:scilab="http://www.scilab.org" xml:id="norm" xml:lang="fr">
    <refnamediv>
        <refname>norm</refname>
        <refpurpose>normes d'un vecteur ou d'une matrice</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Séquence d'appel</title>
        <synopsis>
        y = norm(x)
        y = norm(x, normType)
        </synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Paramètres</title>
        <variablelist>
            <varlistentry>
                <term>x</term>
                <listitem>
                    <para>vecteur ou matrice (réelle ou complexe, pleine ou creuse)
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>normType</term>
                <listitem>
                    <para>
                        <itemizedlist>
                            <listitem>
                                Matrice <literal>x</literal>: un nombre parmi
                                <literal>1, 2, %inf, -%inf</literal>, ou un mot parmi
                                <literal>"inf"</literal> (ou <literal>"i"</literal>) ou
                                <literal>"fro"</literal> (ou <literal>"f"</literal>).
                            </listitem>
                            <listitem>
                                Vecteur <literal>x</literal>: un nombre réel quelconque ou
                                <literal>%inf</literal>,
                                <literal>-%inf</literal>; ou mot <literal>"inf"</literal>
                                (<literal>"i"</literal>), <literal>"fro"</literal>
                                (<literal>"f"</literal>).
                            </listitem>
                        </itemizedlist>
                    </para>
                    Valeur par défaut : 2.
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>y</term>
                <listitem>
                    <para>
                        norme : nombre réel positif unique.
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>Pour les matrices</para>
        <variablelist>
            <varlistentry>
                <term>norm(x)</term>
                <listitem>
                    <para>
                        où <literal>norm(x,2)</literal> est la plus grande valeur
                        singulière de <literal>x</literal>
                        (<literal>max(svd(x))</literal>).
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>norm(x,1) renvoie</term>
                <listitem>
                    <para>
                        la norme l_1 de <literal>x</literal> (la plus grande somme
                        suivant les colonnes : <literal>max(sum(abs(x),'r'))</literal>
                        ).
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>norm(x,'inf'),norm(x,%inf)</term>
                <listitem>
                    <para>
                        la norme infinie de <literal>x</literal> (la plus grande somme
                        suivant les lignes : <literal>max(sum(abs(x),'c'))</literal>
                        ).
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>norm(x,'fro')</term>
                <listitem>
                    <para>
                        la norme de Frobenius de <literal>x</literal> c'est à dire
                        <literal>sqrt(sum(diag(x'*x)))</literal>
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
        <para>Pour les vecteurs</para>
        <variablelist>
            <varlistentry>
                <term>norm(v,p)</term>
                <listitem>
                    <para>
                        norme l_p <literal>sum(abs(v(i))^p)^(1/p)</literal> .
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>norm(v)</term>
                <listitem>
                    <para>
                        <literal>=norm(v,2)</literal> : norme euclidienne
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>norm(v,'inf')</term>
                <listitem>
                    <para>
                        <literal>max(abs(v(i)))</literal>.
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Remarque</title>
      <para>
        <literal>norm([])</literal> et <literal>norm([],p)</literal> valent 0.
      </para>
      <para><literal>norm(x)</literal> et <literal>norm(x,p)</literal> valent NaN si x contient des NaNs.</para>
    </refsection>
    <refsection>
        <title>Exemples</title>
        <programlisting role="example"><![CDATA[
A = [1,2,3];
norm(A,1)
norm(A,'inf')
A = [1,2;3,4]
max(svd(A)) - norm(A)

A = sparse([1 0 0 33 -1])
norm(A)
 ]]></programlisting>
    </refsection>
    <refsection role="see also">
        <title>Voir aussi</title>
        <simplelist type="inline">
            <member>
                <link linkend="h_norm">h_norm</link>
            </member>
            <member>
                <link linkend="dhnorm">dhnorm</link>
            </member>
            <member>
                <link linkend="h2norm">h2norm</link>
            </member>
            <member>
                <link linkend="abs">abs</link>
            </member>
        </simplelist>
    </refsection>
</refentry>
