[doc] clean() page improved / updated 86/20586/8
Samuel GOUGEON [Sat, 27 Oct 2018 00:41:06 +0000 (02:41 +0200)]
  Please merge https://codereview.scilab.org/20204 first.

Change-Id: I8a7bd116476ae355aadd8c5082f16a65fe1fdc07

scilab/modules/elementary_functions/help/en_US/floating_point/clean.xml
scilab/modules/elementary_functions/help/fr_FR/floating_point/clean.xml
scilab/modules/elementary_functions/help/ja_JP/floating_point/clean.xml
scilab/modules/elementary_functions/help/pt_BR/floating_point/clean.xml
scilab/modules/elementary_functions/help/ru_RU/floating_point/clean.xml

index f1b8403..d9dfbd3 100644 (file)
@@ -2,8 +2,8 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2006-2008 - INRIA
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2018 - Samuel GOUGEON
  *
  * 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.
  * 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="en" xml:id="clean">
+<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="clean">
     <refnamediv>
         <refname>clean</refname>
-        <refpurpose>cleans matrices (round to zero small entries)    </refpurpose>
+        <refpurpose>cleans matrices (round to zero small entries)</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Syntax</title>
-        <synopsis>B=clean(A [,epsa [,epsr]])</synopsis>
+        <synopsis>
+          B = clean(A)
+          B = clean(A, epsa)
+          B = clean(A, epsa, epsr)
+        </synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Arguments</title>
             <varlistentry>
                 <term>A</term>
                 <listitem>
-                    <para>a numerical matrix (scalar, polynomial, sparse, ...).</para>
+                    <para>
+                      scalar, vector, matrix or hypermatrix of decimal numbers or of
+                      complex numbers, in dense or sparse encoding, or of polynomials or
+                      rationals with real or complex coefficients.
+                    </para>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>epsa, epsr</term>
                 <listitem>
                     <para>
-                        real numbers. Cleaning tolerances (default values resp. <literal>1.d-10</literal> and <literal>1.d-10</literal>).
+                        positive real numbers: Cleaning tolerances. Both default values are
+                       10<superscript>-10</superscript>.
                     </para>
                 </listitem>
             </varlistentry>
     <refsection>
         <title>Description</title>
         <para>
-            This function eliminates (i.e. set to zero) all the coefficients
+            This function sets to 0 all the elements of <varname>A</varname>
             with absolute value &lt; <varname>epsa</varname> or relative value &lt; <varname>epsr</varname>
-            (relative means relative w.r.t. <literal>1-norm</literal> of coefficients)
-            in a polynomial (possibly matrix polynomial or rational
-            matrix).
-        </para>
-        <para>
-            Default  values are <varname>epsa</varname><literal>=1.d-10</literal> and <varname>epsr</varname><literal>=1.d-10;</literal>
+            (relative w.r.t. to max(abs(A)), ignoring %inf and %nan values of <varname>A</varname>).
         </para>
         <para>
-            For a constant (non-polynomial) matrix <code>clean(A,epsa)</code> sets to zero all
-            entries of <literal>A</literal> smaller than <varname>epsa</varname>.
+            For an array of polynomials or of rationals, clean() applies in the same way to the
+            whole set of their coefficients.
         </para>
     </refsection>
     <refsection>
         <title>Examples</title>
         <programlisting role="example"><![CDATA[
-x=poly(0,'x');
-w=[x,1,2+x;3+x,2-x,x^2;1,2,3+x]/3;
-w*inv(w)
-clean(w*inv(w))
- ]]></programlisting>
+m = grand(3,5,"uin",1,9) .* 10.^grand(3,5,"uin",-16,1)
+clean(m)
+clean(m, 1e-7)
+     ]]></programlisting>
+   <screen><![CDATA[
+--> m = grand(3,5,"uin",1,9) .* 10.^grand(3,5,"uin",-16,1)
+ m  =
+   5.000D-08   5.          0.8         7.000D-08   4.000D-11
+   0.00007     7.          4.000D-09   6.000D-13   2.000D-16
+   2.000D-08   1.000D-14   1.          8.          0.7
+
+--> clean(m)
+ ans  =
+   5.000D-08   5.   0.8         7.000D-08   0.
+   0.00007     7.   4.000D-09   0.          0.
+   2.000D-08   0.   1.          8.          0.7
+
+--> clean(m, 1e-7)
+ ans  =
+   0.        5.   0.8   0.   0.
+   0.00007   7.   0.    0.   0.
+   0.        0.   1.    8.   0.7
+]]></screen>
+        <para/>
+        <para>
+            <emphasis role="bold">For rationals:</emphasis>
+        </para>
+        <programlisting role="example"><![CDATA[
+x = poly(0,'x');
+w = [3+2*x, 2+x; 3+x, 2-x]/5
+r = w * inv(w)
+clean(r)
+     ]]></programlisting>
+   <screen><![CDATA[
+--> w = [3+2*x, 2+x; 3+x, 2-x]/5
+ w  =
+   0.6 +0.4x   0.4 +0.2x
+   0.6 +0.2x   0.4 -0.2x
+
+--> r = w * inv(w)
+ r  =
+                                                                2
+   -3.140D-16 + x                        -1.110D-15 + 3.331D-16x
+   ---------------                       ------------------------
+                                                           2
+         x                                   1.3333333x + x
+                                      2                             2
+   1.110D-15 - 2.220D-16x - 5.551D-17x   -1.110D-15 + 1.3333333x + x
+   ------------------------------------  ----------------------------
+                           2                                 2
+             1.3333333x + x                    1.3333333x + x
+
+--> clean(r)
+ ans  =
+   1   0
+   --  --
+   1   1
+
+   0   1
+   --  --
+   1   1
+]]></screen>
+    </refsection>
+    <refsection role="see also">
+        <title>See also</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="percenteps">%eps</link>
+            </member>
+            <member>
+                <link linkend="cond">cond</link>
+            </member>
+            <member>
+                <link linkend="nearfloat">nearfloat</link>
+            </member>
+            <member>
+                <link linkend="number_properties">number_properties</link>
+            </member>
+        </simplelist>
     </refsection>
 </refentry>
index 2b5573a..1016fd5 100644 (file)
@@ -1,27 +1,53 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<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="clean">
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2006-2008 - INRIA
+ * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2018 - Samuel GOUGEON
+ *
+ * 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="clean">
     <refnamediv>
         <refname>clean</refname>
-        <refpurpose>nettoie une matrice (arrondi à zéro des termes très petits)    </refpurpose>
+        <refpurpose>nettoie une matrice (arrondi à zéro des termes très petits)</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Séquence d'appel</title>
-        <synopsis>[B]=clean(A [,epsa [,epsr]])</synopsis>
+        <synopsis>
+          B = clean(A)
+          B = clean(A, epsa)
+          B = clean(A, epsa, epsr)
+        </synopsis>
     </refsynopsisdiv>
     <refsection>
-        <title>Paramètres</title>
+        <title>Arguments</title>
         <variablelist>
             <varlistentry>
                 <term>A  </term>
                 <listitem>
-                    <para>une matrice (scalaire, polynômes, creuse, ...)
+                    <para>
+                      scalaire, vecteur, matrice ou hypermatrice de nombres décimaux ou de nombres
+                      complexes (en encodage dense ou creux), ou de polynômes ou fractions
+                      rationnelles à coefficients réels ou complexes.
                     </para>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>epsa,epsr  </term>
                 <listitem>
-                    <para>nombres réels. Tolérances (valeurs par défaut resp. 1.d-10 et 1.d-10)
+                    <para>
+                        nombres réels positifs : tolérances.
+                        Par défaut = 10<superscript>-10</superscript> pour les deux.
                     </para>
                 </listitem>
             </varlistentry>
     <refsection>
         <title>Description</title>
         <para>
-            Cette fonction élimine (force à zéro) les coefficients
-            de valeur absolue &lt; <literal>epsa</literal> ou de valeur relative &lt; <literal>epsr</literal>
-            (relative par rapport à la  norme 1 des coefficients)
-            dans un polynôme (éventuellement matrice de polynôme ou rationnelle).
+            Cette fonction met à 0 les termes de <varname>A</varname>
+            de valeur absolue &lt; <literal>epsa</literal>, ou de valeur relative
+            &lt; <literal>epsr</literal> (par rapport à max(abs(A)), %inf et %nan exclus)
         </para>
         <para>
-            Les valeurs par défaut sont <literal>epsa=1.d-10</literal> et <literal>epsr=1.d-10</literal>.
-        </para>
-        <para>
-            Pour une matrice constante (non polynomiale) <literal>clean(A,epsa)</literal> force à zéro
-            les termes de <literal>A</literal> plus petits que <literal>epsa</literal>.
+            Pour des polynômes ou fractions rationnelles, clean() est appliquée de la même façon
+            à l'ensemble des coefficients de tous les éléments de <varname>A</varname>.
         </para>
     </refsection>
     <refsection>
         <title>Exemples</title>
         <programlisting role="example"><![CDATA[
-x=poly(0,'x');
-w=[x,1,2+x;3+x,2-x,x^2;1,2,3+x]/3;
-w*inv(w)
-clean(w*inv(w))
- ]]></programlisting>
+m = grand(3,5,"uin",1,9) .* 10.^grand(3,5,"uin",-16,1)
+clean(m)
+clean(m, 1e-7)
+     ]]></programlisting>
+   <screen><![CDATA[
+--> m = grand(3,5,"uin",1,9) .* 10.^grand(3,5,"uin",-16,1)
+ m  =
+   5.000D-08   5.          0.8         7.000D-08   4.000D-11
+   0.00007     7.          4.000D-09   6.000D-13   2.000D-16
+   2.000D-08   1.000D-14   1.          8.          0.7
+
+--> clean(m)
+ ans  =
+   5.000D-08   5.   0.8         7.000D-08   0.
+   0.00007     7.   4.000D-09   0.          0.
+   2.000D-08   0.   1.          8.          0.7
+
+--> clean(m, 1e-7)
+ ans  =
+   0.        5.   0.8   0.   0.
+   0.00007   7.   0.    0.   0.
+   0.        0.   1.    8.   0.7
+]]></screen>
+        <para/>
+        <para>
+            <emphasis role="bold">Pour des fractions rationnelles :</emphasis>
+        </para>
+        <programlisting role="example"><![CDATA[
+x = poly(0,'x');
+w = [3+2*x, 2+x; 3+x, 2-x]/5
+r = w * inv(w)
+clean(r)
+     ]]></programlisting>
+   <screen><![CDATA[
+--> w = [3+2*x, 2+x; 3+x, 2-x]/5
+ w  =
+   0.6 +0.4x   0.4 +0.2x
+   0.6 +0.2x   0.4 -0.2x
+
+--> r = w * inv(w)
+ r  =
+                                                                2
+   -3.140D-16 + x                        -1.110D-15 + 3.331D-16x
+   ---------------                       ------------------------
+                                                           2
+         x                                   1.3333333x + x
+                                      2                             2
+   1.110D-15 - 2.220D-16x - 5.551D-17x   -1.110D-15 + 1.3333333x + x
+   ------------------------------------  ----------------------------
+                           2                                 2
+             1.3333333x + x                    1.3333333x + x
+
+--> clean(r)
+ ans  =
+   1   0
+   --  --
+   1   1
+
+   0   1
+   --  --
+   1   1
+]]></screen>
+    </refsection>
+    <refsection role="see also">
+        <title>Voir aussi</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="percenteps">%eps</link>
+            </member>
+            <member>
+                <link linkend="cond">cond</link>
+            </member>
+            <member>
+                <link linkend="nearfloat">nearfloat</link>
+            </member>
+            <member>
+                <link linkend="number_properties">number_properties</link>
+            </member>
+        </simplelist>
     </refsection>
 </refentry>
index e8aefeb..ea122a1 100644 (file)
@@ -1,10 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2006-2008 - INRIA
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2018 - Samuel GOUGEON
  *
  * 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.
  * 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="ja" xml:id="clean">
-
+<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="ja" xml:id="clean">
     <refnamediv>
-
         <refname>clean</refname>
-
-        <refpurpose>行列を消去 (小さなエントリをゼロに丸める)    </refpurpose>
-
+        <refpurpose>行列を消去 (小さなエントリをゼロに丸める)</refpurpose>
     </refnamediv>
-
     <refsynopsisdiv>
-
         <title>呼び出し手順</title>
-
-        <synopsis>B=clean(A [,epsa [,epsr]])</synopsis>
-
+        <synopsis>
+          B = clean(A)
+          B = clean(A, epsa)
+          B = clean(A, epsa, epsr)
+        </synopsis>
     </refsynopsisdiv>
-
     <refsection>
-
         <title>引数</title>
-
         <variablelist>
-
             <varlistentry>
-
                 <term>A</term>
-
                 <listitem>
-
                     <para>数値行列(スカラー, 多項式, 疎行列...)</para>
-
                 </listitem>
-
             </varlistentry>
-
             <varlistentry>
-
                 <term>epsa,epsr</term>
-
                 <listitem>
-
                     <para>
-
                         実数. 消去の際の閾値 (デフォルト値はそれぞれ
-
-                        <literal>1.d-10</literal>および<literal>1.d-10</literal>)
-
+                        10<superscript>-10</superscript>および10<superscript>-10</superscript>)
                     </para>
-
                 </listitem>
-
             </varlistentry>
-
         </variablelist>
-
     </refsection>
-
     <refsection>
-
         <title>説明</title>
-
         <para>
-
             この関数は,
-
             多項式(もしくは多項式行列または有理行列)において
-
             絶対値&lt; <literal>epsa</literal>または
-
             相対値&lt; <literal>epsr</literal>の係数を全て消去(すなわち,ゼロに設定)します.
-
             (相対とは係数の1次ノルムに関する相対値を意味します)
-
-        </para>
-
-        <para>
-
-            デフォルト値は <varname>epsa</varname><literal>=1.d-10</literal> および
-
-            <varname>epsr</varname><literal>=1.d-10</literal>です.
-
         </para>
-
         <para>
-
             (多項式でない)定数行列の場合,<code>clean(A,epsa)</code>は
-
             <varname>epsa</varname>より小さな<literal>A</literal>のエントリを
-
             全てゼロに設定します.
-
         </para>
-
     </refsection>
-
     <refsection>
-
         <title>例</title>
-
         <programlisting role="example"><![CDATA[
-x=poly(0,'x');
-w=[x,1,2+x;3+x,2-x,x^2;1,2,3+x]/3;
-w*inv(w)
-clean(w*inv(w))
- ]]></programlisting>
-
+m = grand(3,5,"uin",1,9) .* 10.^grand(3,5,"uin",-16,1)
+clean(m)
+clean(m, 1e-7)
+     ]]></programlisting>
+   <screen><![CDATA[
+--> m = grand(3,5,"uin",1,9) .* 10.^grand(3,5,"uin",-16,1)
+ m  =
+   5.000D-08   5.          0.8         7.000D-08   4.000D-11
+   0.00007     7.          4.000D-09   6.000D-13   2.000D-16
+   2.000D-08   1.000D-14   1.          8.          0.7
+
+--> clean(m)
+ ans  =
+   5.000D-08   5.   0.8         7.000D-08   0.
+   0.00007     7.   4.000D-09   0.          0.
+   2.000D-08   0.   1.          8.          0.7
+
+--> clean(m, 1e-7)
+ ans  =
+   0.        5.   0.8   0.   0.
+   0.00007   7.   0.    0.   0.
+   0.        0.   1.    8.   0.7
+]]></screen>
+        <para/>
+        <para>
+            <emphasis role="bold">For rationals:</emphasis>
+        </para>
+        <programlisting role="example"><![CDATA[
+x = poly(0,'x');
+w = [3+2*x, 2+x; 3+x, 2-x]/5
+r = w * inv(w)
+clean(r)
+     ]]></programlisting>
+   <screen><![CDATA[
+--> w = [3+2*x, 2+x; 3+x, 2-x]/5
+ w  =
+   0.6 +0.4x   0.4 +0.2x
+   0.6 +0.2x   0.4 -0.2x
+
+--> r = w * inv(w)
+ r  =
+                                                                2
+   -3.140D-16 + x                        -1.110D-15 + 3.331D-16x
+   ---------------                       ------------------------
+                                                           2
+         x                                   1.3333333x + x
+                                      2                             2
+   1.110D-15 - 2.220D-16x - 5.551D-17x   -1.110D-15 + 1.3333333x + x
+   ------------------------------------  ----------------------------
+                           2                                 2
+             1.3333333x + x                    1.3333333x + x
+
+--> clean(r)
+ ans  =
+   1   0
+   --  --
+   1   1
+
+   0   1
+   --  --
+   1   1
+]]></screen>
     </refsection>
-
-</refentry>
-
+    <refsection role="see also">
+        <title>参照</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="percenteps">%eps</link>
+            </member>
+            <member>
+                <link linkend="cond">cond</link>
+            </member>
+            <member>
+                <link linkend="nearfloat">nearfloat</link>
+            </member>
+            <member>
+                <link linkend="number_properties">number_properties</link>
+            </member>
+        </simplelist>
+    </refsection>
+</refentry>
\ No newline at end of file
index 2d1e5a3..e697780 100644 (file)
@@ -1,9 +1,9 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2006-2008 - INRIA
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2018 - Samuel GOUGEON
  *
  * 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.
  * 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:ns3="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="clean" xml:lang="pt">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="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="clean" xml:lang="pt">
     <refnamediv>
         <refname>clean</refname>
         <refpurpose>limpa matrizes (arredonda para zero entradas pequenas)
         </refpurpose>
     </refnamediv>
     <refsynopsisdiv>
-        <title> Seqüência de Chamamento</title>
-        <synopsis>B=clean(A [,epsa [,epsr]])</synopsis>
+        <title> Seqüência de Chamamento</title>
+        <synopsis>
+          B = clean(A)
+          B = clean(A, epsa)
+          B = clean(A, epsa, epsr)
+        </synopsis>
     </refsynopsisdiv>
     <refsection>
-        <title>Parâmetros</title>
+        <title>Parâmetros</title>
         <variablelist>
             <varlistentry>
                 <term>A</term>
                 <listitem>
-                    <para>uma matriz numérica (de escalares, de polinômios, esparsa...)
+                    <para>
+                        número escalar, vetor, matriz ou hipermatriz de números decimais ou de
+                        números complexos, em codificação densa ou esparsa, ou de polinômios ou
+                        racionais com coeficientes reais ou complexos.
                     </para>
                 </listitem>
             </varlistentry>
             <varlistentry>
-                <term>epsa,epsr</term>
+                <term>epsa, epsr</term>
                 <listitem>
-                    <para>números reais (valores padrões respectivos: 1.d-10 e
-                        1.d-10)
+                    <para>
+                        números reais positivos: tolerâncias de limpeza. Ambos os valores padrão são
+                        10<superscript>-10</superscript>.
                     </para>
                 </listitem>
             </varlistentry>
         </variablelist>
     </refsection>
     <refsection>
-        <title>Descrição</title>
-        <para>Esta função elimina (i.e. ajusta para zero) todos os coeficientes
+        <title>Descrição</title>
+        <para>Esta função ajusta para zero todos os coeficientes
             com valores absolutos&lt; <literal>epsa</literal> e valores relativos&lt;
-            <literal>epsr</literal> (relativo siginifica "em relação à norma-1 de
-            coeficientes") em um polinômio (possivelmente uma matriz de polinômios ou
-            matriz de razões de polinômios).
-        </para>
-        <para>
-            Os valores padrões são <literal>epsa=1.d-10</literal> e
-            <literal>epsr=1.d-10;</literal>
+            <literal>epsr</literal> (relativo em relação ao max(A), ignorando %inf e %nan valores
+            de <varname>A</varname>) em um polinômio (possivelmente uma matriz de polinômios ou
+            matriz de razões de polinômios).
         </para>
         <para>
             Para uma matriz de constantes <literal>clean(A,epsa)</literal>
     <refsection>
         <title>Exemplos</title>
         <programlisting role="example"><![CDATA[
-x=poly(0,'x');
-w=[x,1,2+x;3+x,2-x,x^2;1,2,3+x]/3;
-w*inv(w)
-clean(w*inv(w))
- ]]></programlisting>
+m = grand(3,5,"uin",1,9) .* 10.^grand(3,5,"uin",-16,1)
+clean(m)
+clean(m, 1e-7)
+     ]]></programlisting>
+   <screen><![CDATA[
+--> m = grand(3,5,"uin",1,9) .* 10.^grand(3,5,"uin",-16,1)
+ m  =
+   5.000D-08   5.          0.8         7.000D-08   4.000D-11
+   0.00007     7.          4.000D-09   6.000D-13   2.000D-16
+   2.000D-08   1.000D-14   1.          8.          0.7
+
+--> clean(m)
+ ans  =
+   5.000D-08   5.   0.8         7.000D-08   0.
+   0.00007     7.   4.000D-09   0.          0.
+   2.000D-08   0.   1.          8.          0.7
+
+--> clean(m, 1e-7)
+ ans  =
+   0.        5.   0.8   0.   0.
+   0.00007   7.   0.    0.   0.
+   0.        0.   1.    8.   0.7
+]]></screen>
+        <para/>
+        <para>
+            <emphasis role="bold">For rationals:</emphasis>
+        </para>
+        <programlisting role="example"><![CDATA[
+x = poly(0,'x');
+w = [3+2*x, 2+x; 3+x, 2-x]/5
+r = w * inv(w)
+clean(r)
+     ]]></programlisting>
+   <screen><![CDATA[
+--> w = [3+2*x, 2+x; 3+x, 2-x]/5
+ w  =
+   0.6 +0.4x   0.4 +0.2x
+   0.6 +0.2x   0.4 -0.2x
+
+--> r = w * inv(w)
+ r  =
+                                                                2
+   -3.140D-16 + x                        -1.110D-15 + 3.331D-16x
+   ---------------                       ------------------------
+                                                           2
+         x                                   1.3333333x + x
+                                      2                             2
+   1.110D-15 - 2.220D-16x - 5.551D-17x   -1.110D-15 + 1.3333333x + x
+   ------------------------------------  ----------------------------
+                           2                                 2
+             1.3333333x + x                    1.3333333x + x
+
+--> clean(r)
+ ans  =
+   1   0
+   --  --
+   1   1
+
+   0   1
+   --  --
+   1   1
+]]></screen>
+    </refsection>
+    <refsection role="see also">
+        <title>Ver Também</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="percenteps">%eps</link>
+            </member>
+            <member>
+                <link linkend="cond">cond</link>
+            </member>
+            <member>
+                <link linkend="nearfloat">nearfloat</link>
+            </member>
+            <member>
+                <link linkend="number_properties">number_properties</link>
+            </member>
+        </simplelist>
     </refsection>
 </refentry>
index 7aae1ae..ecf23ae 100644 (file)
@@ -2,8 +2,8 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2006-2008 - INRIA
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2018 - Samuel GOUGEON
  *
  * 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.
  * 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="ru" xml:id="clean">
+<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="ru" xml:id="clean">
     <refnamediv>
         <refname>clean</refname>
         <refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Синтаксис</title>
-        <synopsis>B=clean(A [,epsa [,epsr]])</synopsis>
+        <synopsis>
+          B = clean(A)
+          B = clean(A, epsa)
+          B = clean(A, epsa, epsr)
+        </synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Аргументы</title>
             <varlistentry>
                 <term>A</term>
                 <listitem>
-                    <para>числовая матрица (скаляр, полином, разрежённая, ...).</para>
+                    <para>скалярное число, вектор, матрица или гиперматрица десятичных чисел или
+                        комплексные числа, в плотном или разреженном кодировании или полиномах или
+                        рациональных с действительными или комплексными коэффициентами.
+                    </para>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>epsa, epsr</term>
                 <listitem>
                     <para>
-                        вещественные числа. Допустимые отклонения для  очистки (значения по умолчанию соответственно <literal>1.d-10</literal> и <literal>1.d-10</literal>)
+                        вещественные числа. Допустимые отклонения для  очистки (значения по
+                        умолчанию соответственно 10<superscript>-10</superscript> и
+                        10<superscript>-10</superscript>)
                     </para>
                 </listitem>
             </varlistentry>
     <refsection>
         <title>Описание</title>
         <para>
-            Эта функция исключает (то есть устанавливает равными нулю) все коэффициенты с абсолютным значением &lt; <varname>epsa</varname> относительным значением &lt; <varname>epsr</varname>
-            ("относительное" значит относительно <literal>1-norm</literal> коэффициентов) в полиномах (матрицах полиномов или матрицах рациональных значений).
-        </para>
-        <para>
-            Значения по умолчанию:  <varname>epsa</varname><literal>=1.d-10</literal> и <varname>epsr</varname><literal>=1.d-10;</literal>
+            Эта функция исключает (то есть устанавливает равными нулю) все коэффициенты с
+            абсолютным значением &lt; <varname>epsa</varname> относительным значением
+            &lt; <varname>epsr</varname>
+            (относительно  <literal>max(abs(A))</literal>, игнорируя значения <literal>%inf</literal> и
+            <literal>%nan</literal> матрицы <varname>A</varname>).
         </para>
         <para>
-            Для матрицы констант (не полиномиальных значений) <code>clean(A,epsa)</code> устанавливает равными нулю все элементы <literal>A</literal> меньшие, чем <varname>epsa</varname>.
+          Для массива полиномов или рациональных дробей, <literal>clean()</literal> применяется одинаково ко всему
+            набору их коэффициентов.
         </para>
     </refsection>
     <refsection>
         <title>Примеры</title>
         <programlisting role="example"><![CDATA[
-x=poly(0,'x');
-w=[x,1,2+x;3+x,2-x,x^2;1,2,3+x]/3;
-w*inv(w)
-clean(w*inv(w))
- ]]></programlisting>
+m = grand(3,5,"uin",1,9) .* 10.^grand(3,5,"uin",-16,1)
+clean(m)
+clean(m, 1e-7)
+     ]]></programlisting>
+   <screen><![CDATA[
+--> m = grand(3,5,"uin",1,9) .* 10.^grand(3,5,"uin",-16,1)
+ m  =
+   5.000D-08   5.          0.8         7.000D-08   4.000D-11
+   0.00007     7.          4.000D-09   6.000D-13   2.000D-16
+   2.000D-08   1.000D-14   1.          8.          0.7
+
+--> clean(m)
+ ans  =
+   5.000D-08   5.   0.8         7.000D-08   0.
+   0.00007     7.   4.000D-09   0.          0.
+   2.000D-08   0.   1.          8.          0.7
+
+--> clean(m, 1e-7)
+ ans  =
+   0.        5.   0.8   0.   0.
+   0.00007   7.   0.    0.   0.
+   0.        0.   1.    8.   0.7
+]]></screen>
+        <para/>
+        <para>
+            <emphasis role="bold">Для рациональных чисел:</emphasis>
+        </para>
+        <programlisting role="example"><![CDATA[
+x = poly(0,'x');
+w = [3+2*x, 2+x; 3+x, 2-x]/5
+r = w * inv(w)
+clean(r)
+     ]]></programlisting>
+   <screen><![CDATA[
+--> w = [3+2*x, 2+x; 3+x, 2-x]/5
+ w  =
+   0.6 +0.4x   0.4 +0.2x
+   0.6 +0.2x   0.4 -0.2x
+
+--> r = w * inv(w)
+ r  =
+                                                                2
+   -3.140D-16 + x                        -1.110D-15 + 3.331D-16x
+   ---------------                       ------------------------
+                                                           2
+         x                                   1.3333333x + x
+                                      2                             2
+   1.110D-15 - 2.220D-16x - 5.551D-17x   -1.110D-15 + 1.3333333x + x
+   ------------------------------------  ----------------------------
+                           2                                 2
+             1.3333333x + x                    1.3333333x + x
+
+--> clean(r)
+ ans  =
+   1   0
+   --  --
+   1   1
+
+   0   1
+   --  --
+   1   1
+]]></screen>
+    </refsection>
+    <refsection role="see also">
+        <title>Смотрите также</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="percenteps">%eps</link>
+            </member>
+            <member>
+                <link linkend="cond">cond</link>
+            </member>
+            <member>
+                <link linkend="nearfloat">nearfloat</link>
+            </member>
+            <member>
+                <link linkend="number_properties">number_properties</link>
+            </member>
+        </simplelist>
     </refsection>
 </refentry>