error in gsort documentation. 53/8553/2
Cedric Delamarre [Mon, 6 Aug 2012 08:23:44 +0000 (10:23 +0200)]
Change-Id: Id78d31b10abdd4e0e9bd60fb334554e6064f8db5

scilab/modules/elementary_functions/help/en_US/searchandsort/gsort.xml
scilab/modules/elementary_functions/help/fr_FR/searchandsort/gsort.xml
scilab/modules/elementary_functions/help/ja_JP/searchandsort/gsort.xml
scilab/modules/elementary_functions/help/pt_BR/searchandsort/gsort.xml
scilab/modules/elementary_functions/help/ru_RU/searchandsort/gsort.xml

index 9961386..2b4edda 100644 (file)
  *
  -->
 <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" version="5.0-subset Scilab" xml:id="gsort" xml:lang="en">
-  <refnamediv>
-    <refname>gsort</refname>
-    <refpurpose>sorting by quick sort agorithm</refpurpose>
-  </refnamediv>
-  <refsynopsisdiv>
-    <title>Calling Sequence</title>
-    <synopsis>[B [,k]]=gsort(A)
-      [B [,k]]=gsort(A,option)
-      [B [,k]]=gsort(A,option,direction)
-    </synopsis>
-  </refsynopsisdiv>
-  <refsection>
-    <title>Arguments</title>
-    <variablelist>
-      <varlistentry>
-        <term>A</term>
-        <listitem>
-          <para>a real,an integer or a character string vector/matrix or a
-            sparse vector.
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>option</term>
-        <listitem>
-          <para>a character string. It gives the type of sort to
-            perform:
-          </para>
-          <itemizedlist>
-            <listitem>
-              <para>
-                'r' : each column of <literal>A</literal> is sorted
-              </para>
-            </listitem>
-            <listitem>
-              <para>
-                'c': each row of <literal>A</literal> is sorted
-              </para>
-            </listitem>
+    <refnamediv>
+        <refname>gsort</refname>
+        <refpurpose>sorting by quick sort agorithm</refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Calling Sequence</title>
+        <synopsis>[B [,k]]=gsort(A)
+            [B [,k]]=gsort(A,option)
+            [B [,k]]=gsort(A,option,direction)
+        </synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Arguments</title>
+        <variablelist>
+            <varlistentry>
+                <term>A</term>
+                <listitem>
+                    <para>a real,an integer or a character string vector/matrix or a
+                        sparse vector.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>option</term>
+                <listitem>
+                    <para>a character string. It gives the type of sort to
+                        perform:
+                    </para>
+                    <itemizedlist>
+                        <listitem>
+                            <para>
+                                'r' : each column of <literal>A</literal> is sorted
+                            </para>
+                        </listitem>
+                        <listitem>
+                            <para>
+                                'c': each row of <literal>A</literal> is sorted
+                            </para>
+                        </listitem>
+                        <listitem>
+                            <para>
+                                'g': all elements of <literal>A</literal> are sorted. It
+                                is the default value.
+                            </para>
+                        </listitem>
+                        <listitem>
+                            <para>'lr': lexicographic sort of the rows of
+                                <literal>A</literal>
+                            </para>
+                        </listitem>
+                        <listitem>
+                            <para>'lc': lexicographic sort of the columns of
+                                <literal>A</literal>
+                            </para>
+                        </listitem>
+                    </itemizedlist>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>direction</term>
+                <listitem>
+                    <para>a character string. It gives the ordering direction:
+                        <literal>'i'</literal> stand for increasing and
+                        <literal>'d'</literal> for decreasing order (default).
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>B</term>
+                <listitem>
+                    <para>an array with same type and dimensions as
+                        <literal>A</literal>.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>k</term>
+                <listitem>
+                    <para>a real array with integer values and same dimensions as
+                        <literal>A</literal>. Contains the origin indices.
+                    </para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Description</title>
+        <para>
+            <literal>gsort</literal> implements a "quick sort" algorithm for
+            various data types.
+        </para>
+        <itemizedlist>
             <listitem>
-              <para>
-                'g': all elements of <literal>A</literal> are sorted. It
-                is the default value.
-              </para>
+                <para>
+                    <literal>B=gsort(A,'g')</literal>,
+                    <literal>B=gsort(A,'g','d')</literal> and
+                    <literal>B=gsort(A)</literal> sort the elements of the array
+                    <literal>A</literal>, seen as <literal>A(:)</literal> in a decreasing
+                    order.
+                </para>
+                <para>
+                    <literal>B=gsort(A,'g','i')</literal> sort the elements of the
+                    array <literal>A</literal> in the increasing order.
+                </para>
             </listitem>
             <listitem>
-              <para>'lr': lexicographic sort of the rows of
-                <literal>A</literal>
-              </para>
+                <para>
+                    <literal>B=gsort(A,'lr')</literal> sorts the rows of
+                    <literal>A</literal> in lexical decreasing order. <literal>B</literal>
+                    is obtained by a permutation of the rows of matrix
+                    <literal>A</literal> in such a way that the rows of
+                    <literal>B</literal> verify <literal>B(i,:)&gt;=B(j,:)</literal> if
+                    <literal>i&lt;j</literal>.
+                </para>
+                <para>
+                    <literal>B=gsort(A,'lr','i')</literal> works similarily for
+                    increasing lexical order.
+                </para>
             </listitem>
             <listitem>
-              <para>'lc': lexicographic sort of the columns of
-                <literal>A</literal>
-              </para>
+                <para>
+                    <literal>B=gsort(A,'lc')</literal> sorts the columns of
+                    <literal>A</literal> in lexical decreasing order. <literal>B</literal>
+                    is obtained by a permutation of the columns of matrix
+                    <literal>A</literal> in such a way that the columns of
+                    <literal>B</literal> verify <literal>B(:,i)&gt;=B(:,j)</literal> if
+                    <literal>i&lt;j</literal>.
+                </para>
+                <para>
+                    <literal>B=gsort(A,'lc','i')</literal> works similarily for
+                    increasing lexical order.
+                </para>
             </listitem>
-          </itemizedlist>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>direction</term>
-        <listitem>
-          <para>a character string. It gives the ordering direction:
-            <literal>'i'</literal> stand for increasing and
-            <literal>'d'</literal> for decreasing order (default).
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>B</term>
-        <listitem>
-          <para>an array with same type and dimensions as
-            <literal>A</literal>.
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>k</term>
-        <listitem>
-          <para>a real array with integer values and same dimensions as
-            <literal>A</literal>. Contains the origin indices.
-          </para>
-        </listitem>
-      </varlistentry>
-    </variablelist>
-  </refsection>
-  <refsection>
-    <title>Description</title>
-    <para>
-      <literal>gsort</literal> implements a "quick sort" algorithm for
-      various data types.
-    </para>
-    <itemizedlist>
-      <listitem>
+        </itemizedlist>
         <para>
-          <literal>B=gsort(A,'g')</literal>,
-          <literal>B=gsort(A,'g','d')</literal> and
-          <literal>B=gsort(A)</literal> sort the elements of the array
-          <literal>A</literal>, seen as <literal>A(:)</literal> in a decreasing
-          order.
+            If required the second return argument <literal>k</literal> contains
+            the indices of the sorted values in <literal>A</literal>. If
+            <literal>[B,k]=gsort(A,'g')</literal> one has <literal>B==A(k)</literal>.
+            <emphasis role="bold">The algorithme preserve the relative order of
+                records with equal values. 
+            </emphasis>
         </para>
         <para>
-          <literal>B=gsort(A,'g','i')</literal> sort the elements of the
-          array <literal>A</literal> in the increasing order.
+            When <literal>v</literal> is complex, the elements are sorted by
+            magnitude, i.e., abs(<literal>v</literal>) . Only <literal>'g'</literal>
+            as second argument is managed with complex.
         </para>
-      </listitem>
-      <listitem>
         <para>
-          <literal>B=gsort(A,'lr')</literal> sorts the rows of
-          <literal>A</literal> in lexical decreasing order. <literal>B</literal>
-          is obtained by a permutation of the rows of matrix
-          <literal>A</literal> in such a way that the rows of
-          <literal>B</literal> verify <literal>B(i,:)&gt;=B(j,:)</literal> if
-          <literal>i&lt;j</literal>.
+            With complex numbers, <literal>gsort</literal> can be overloaded
         </para>
-        <para>
-          <literal>B=gsort(A,'lr','i')</literal> works similarily for
-          increasing lexical order.
+        <para>see macro:
+            SCI/modules/elementary_functions/macros/%_gsort.sci
         </para>
-      </listitem>
-      <listitem>
-        <para>
-          <literal>B=gsort(A,'lc')</literal> sorts the columns of
-          <literal>A</literal> in lexical decreasing order. <literal>B</literal>
-          is obtained by a permutation of the columns of matrix
-          <literal>A</literal> in such a way that the columns of
-          <literal>B</literal> verify <literal>B(:,i)&gt;=B(:,j)</literal> if
-          <literal>i&lt;j</literal>.
+        <para>Overloading for not managed type (others than a real, an integer or a character
+            string vector/matrix or a sparse vector.) is allowed.
         </para>
         <para>
-          <literal>B=gsort(A,'lc','i')</literal> works similarily for
-          increasing lexical order.
+            if <literal>v</literal> have <literal>%nan</literal> or
+            <literal>%inf</literal> as elements. gsort places these at the beginning
+            with <literal>'d'</literal> or at the end with <literal>'i'</literal>
+            argument.
+        </para>
+    </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"> 
+            alr=[1,2,2;
+            1,2,1;
+            1,1,2;
+            1,1,1];
+            [alr1,k]=gsort(alr,'lr','i')
+            [alr1,k]=gsort(alr,'lc','i')
+            
+            v=int32(alr)
+            
+            gsort(v)
+            gsort(v,'lr','i')
+            gsort(v,'lc','i')
+            
+            v=['Scilab' '2.6'
+            'Scilab' '2.7'
+            'xcos' '2.7'
+            'Scilab' '3.1'
+            'xcos' '3.1'
+            'xcos' '4.0'
+            'Scilab' '4.0']
+            
+            gsort(v,'lr','i')
+            gsort(v,'lc','i')
+        </programlisting>
+    </refsection>
+    <refsection role="see also">
+        <title>See Also</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="find">find</link>
+            </member>
+        </simplelist>
+        <simplelist type="inline">
+            <member>
+                <link linkend="overloading">overloading</link>
+            </member>
+        </simplelist>
+    </refsection>
+    <refsection>
+        <title>Bibliography</title>
+        <para>Quick sort algorithm from Bentley &amp; McIlroy's "Engineering a
+            Sort Function". Software---Practice and Experience,
+            23(11):1249-1265
         </para>
-      </listitem>
-    </itemizedlist>
-    <para>
-      If required the second return argument <literal>k</literal> contains
-      the indices of the sorted values in <literal>A</literal>. If
-      <literal>[B,k]=gsort(A,'g')</literal> one has <literal>B==A(k)</literal>.
-      <emphasis role="bold">The algorithme preserve the relative order of
-        records with equal values. 
-      </emphasis>
-    </para>
-    <para>
-      When <literal>v</literal> is complex, the elements are sorted by
-      magnitude, i.e., abs(<literal>v</literal>) . Only <literal>'g'</literal>
-      as second argument is managed with complex.
-    </para>
-    <para>
-      With complex numbers, <literal>gsort</literal> can be overloaded
-    </para>
-    <para>see macro:
-      SCI/modules/elementary_functions/macros/%_gsort.sci
-    </para>
-    <para>Overloading for not managed type (others than a real, an integer or a character
-      string vector/matrix or a sparse vector.) is allowed.
-    </para>
-    <para>
-      if <literal>v</literal> have <literal>%nan</literal> or
-      <literal>%inf</literal> as elements. gsort places these at the beginning
-      with <literal>'i'</literal> or at the end with <literal>'d'</literal>
-      argument.
-    </para>
-  </refsection>
-  <refsection>
-    <title>Examples</title>
-    <programlisting role="example"> 
-      alr=[1,2,2;
-      1,2,1;
-      1,1,2;
-      1,1,1];
-      [alr1,k]=gsort(alr,'lr','i')
-      [alr1,k]=gsort(alr,'lc','i')
-      
-      v=int32(alr)
-      
-      gsort(v)
-      gsort(v,'lr','i')
-      gsort(v,'lc','i')
-      
-      v=['Scilab' '2.6'
-      'Scilab' '2.7'
-      'xcos' '2.7'
-      'Scilab' '3.1'
-      'xcos' '3.1'
-      'xcos' '4.0'
-      'Scilab' '4.0']
-      
-      gsort(v,'lr','i')
-      gsort(v,'lc','i')
-    </programlisting>
-  </refsection>
-  <refsection role="see also">
-    <title>See Also</title>
-    <simplelist type="inline">
-      <member>
-        <link linkend="find">find</link>
-      </member>
-    </simplelist>
-    <simplelist type="inline">
-      <member>
-        <link linkend="overloading">overloading</link>
-      </member>
-    </simplelist>
-  </refsection>
-  <refsection>
-    <title>Bibliography</title>
-    <para>Quick sort algorithm from Bentley &amp; McIlroy's "Engineering a
-      Sort Function". Software---Practice and Experience,
-      23(11):1249-1265
-    </para>
-  </refsection>
-  <refsection>
-    <title>History</title>
-    <revhistory>
-      <revision>
-        <revnumber>5.4.0</revnumber>
-        <revremark>This function allows overloading for unmanaged type (others than a real, an integer or a character string vector/matrix or a sparse vector).</revremark>
-      </revision>
-    </revhistory>
-  </refsection>
+    </refsection>
+    <refsection>
+        <title>History</title>
+        <revhistory>
+            <revision>
+                <revnumber>5.4.0</revnumber>
+                <revremark>This function allows overloading for unmanaged type (others than a real, an integer or a character string vector/matrix or a sparse vector).</revremark>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
index c353e7d..dcadf66 100644 (file)
 <?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:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="gsort" xml:lang="fr">
-  <refnamediv>
-    <refname>gsort</refname>
-    <refpurpose>tri par l'algorithme "quick sort"</refpurpose>
-  </refnamediv>
-  <refsynopsisdiv>
-    <title>Séquence d'appel</title>
-    <synopsis>[B [,k]]=gsort(A )
-      [B [,k]]=gsort(A,option)
-      [B [,k]]=gsort(A,option,direction)
-    </synopsis>
-  </refsynopsisdiv>
-  <refsection>
-    <title>Paramètres</title>
-    <variablelist>
-      <varlistentry>
-        <term>A</term>
-        <listitem>
-          <para>vecteur ou matrice de nombres réels, entiers ou de chaînes de
-            caractères ou vecteur creux.
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>option</term>
-        <listitem>
-          <para>une chaîne de caractères, définissant le type de tri à
-            réaliser:
-          </para>
-          <itemizedlist>
-            <listitem>
-              <para>'r' : trie chaque colonne de la matrice
-                <literal>A</literal>
-              </para>
-            </listitem>
-            <listitem>
-              <para>'c': trie chaque ligne de la matrice
-                <literal>A</literal>
-              </para>
-            </listitem>
+    <refnamediv>
+        <refname>gsort</refname>
+        <refpurpose>tri par l'algorithme "quick sort"</refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Séquence d'appel</title>
+        <synopsis>[B [,k]]=gsort(A )
+            [B [,k]]=gsort(A,option)
+            [B [,k]]=gsort(A,option,direction)
+        </synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Paramètres</title>
+        <variablelist>
+            <varlistentry>
+                <term>A</term>
+                <listitem>
+                    <para>vecteur ou matrice de nombres réels, entiers ou de chaînes de
+                        caractères ou vecteur creux.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>option</term>
+                <listitem>
+                    <para>une chaîne de caractères, définissant le type de tri à
+                        réaliser:
+                    </para>
+                    <itemizedlist>
+                        <listitem>
+                            <para>'r' : trie chaque colonne de la matrice
+                                <literal>A</literal>
+                            </para>
+                        </listitem>
+                        <listitem>
+                            <para>'c': trie chaque ligne de la matrice
+                                <literal>A</literal>
+                            </para>
+                        </listitem>
+                        <listitem>
+                            <para>'g': trie tous les éléments de A(:). C'est la valeur par
+                                défaut.
+                            </para>
+                        </listitem>
+                        <listitem>
+                            <para>'lr': tri lexicographique des lignes de
+                                <literal>A</literal>
+                            </para>
+                        </listitem>
+                        <listitem>
+                            <para>'lc': tri lexicographique des colonnes de
+                                <literal>A</literal>
+                            </para>
+                        </listitem>
+                    </itemizedlist>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>direction</term>
+                <listitem>
+                    <para>Une chaîne de caractères définissant si le tri doit se faire
+                        dans l'ordre croissant <literal>('i')</literal> ou décroissant
+                        <literal>('d')</literal>. La valeur par défaut est
+                        <literal>('d')</literal>.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>B</term>
+                <listitem>
+                    <para>vecteur ou matrice de même type et même dimensions que
+                        <literal>A</literal>.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>k</term>
+                <listitem>
+                    <para>vecteur ou matrice de nombres entiers de même taille que
+                        <literal>A</literal> contenant les index d'origine.
+                    </para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Description</title>
+        <para>
+            <literal>gsort</literal> est basé sur l'algorithme de tri rapide
+            "quick sort" modifié pour maintenir l'ordre relatif des éléments ayant des
+            valeurs égales lorsque l'index de tri est demandé.
+        </para>
+        <itemizedlist>
             <listitem>
-              <para>'g': trie tous les éléments de A(:). C'est la valeur par
-                défaut.
-              </para>
+                <para>
+                    <literal>B=gsort(A,'g')</literal> et
+                    <literal>B=gsort(A,'g','d')</literal> produisent le même résultat que
+                    <literal>B=gsort(A)</literal>. Ces instructions produisent un tri de
+                    la matrice <literal>A</literal>, vue comme le vecteur
+                    <literal>A(:)</literal>.
+                </para>
+                <para>
+                    <literal>B=gsort(A,'g','i')</literal> fonctionne de la même
+                    manière pour l'ordre croissant.
+                </para>
             </listitem>
             <listitem>
-              <para>'lr': tri lexicographique des lignes de
-                <literal>A</literal>
-              </para>
+                <para>
+                    <literal>B=gsort(A,'lr')</literal> trie les lignes de la matrice
+                    <literal>A</literal> dans l'ordre lexical décroissant.
+                    <literal>B</literal> est obtenue par une permutation des lignes de la
+                    matrice <literal>A</literal> de telle manière que les lignes de
+                    <literal>B</literal> vérifient <literal>B(i,:)&gt;=B(j,:)</literal> si
+                    <literal>i&lt;j</literal>.
+                </para>
+                <para>
+                    <literal>B=gsort(A,'lr','i')</literal> fonctionne de la même
+                    manière pour l'ordre lexical croissant.
+                </para>
             </listitem>
             <listitem>
-              <para>'lc': tri lexicographique des colonnes de
-                <literal>A</literal>
-              </para>
+                <para>
+                    <literal>B=gsort(A,'lc')</literal> trie les colonnes de la
+                    matrice <literal>A</literal> dans l'ordre lexical décroissant.
+                    <literal>B</literal> est obtenue par une permutation des colonnes de
+                    la matrice <literal>A</literal> de telle manière que les colonnes de
+                    <literal>B</literal> vérifient <literal>B(:,i)&gt;=B(:,j)</literal> si
+                    <literal>i&lt;j</literal>. <literal/>
+                </para>
+                <para>
+                    <literal>B=gsort(A,'lc','i')</literal> fonctionne de la même
+                    manière pour l'ordre lexical croissant.
+                </para>
             </listitem>
-          </itemizedlist>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>direction</term>
-        <listitem>
-          <para>Une chaîne de caractères définissant si le tri doit se faire
-            dans l'ordre croissant <literal>('i')</literal> ou décroissant
-            <literal>('d')</literal>. La valeur par défaut est
-            <literal>('d')</literal>.
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>B</term>
-        <listitem>
-          <para>vecteur ou matrice de même type et même dimensions que
-            <literal>A</literal>.
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>k</term>
-        <listitem>
-          <para>vecteur ou matrice de nombres entiers de même taille que
-            <literal>A</literal> contenant les index d'origine.
-          </para>
-        </listitem>
-      </varlistentry>
-    </variablelist>
-  </refsection>
-  <refsection>
-    <title>Description</title>
-    <para>
-      <literal>gsort</literal> est basé sur l'algorithme de tri rapide
-      "quick sort" modifié pour maintenir l'ordre relatif des éléments ayant des
-      valeurs égales lorsque l'index de tri est demandé.
-    </para>
-    <itemizedlist>
-      <listitem>
-        <para>
-          <literal>B=gsort(A,'g')</literal> et
-          <literal>B=gsort(A,'g','d')</literal> produisent le même résultat que
-          <literal>B=gsort(A)</literal>. Ces instructions produisent un tri de
-          la matrice <literal>A</literal>, vue comme le vecteur
-          <literal>A(:)</literal>.
+        </itemizedlist>
+        <para>Si le second argument de retour k est demandé, il contient les
+            indices des valeurs triées dans le tableau d'origine. Si
+            <literal>[B,k]=gsort(A,'g')</literal> on a <literal>B==A(k)</literal>.
+            <emphasis role="bold">L'algorithme préserve l'ordre relatif des éléments
+                ayant des valeurs égales.
+            </emphasis>
         </para>
-        <para>
-          <literal>B=gsort(A,'g','i')</literal> fonctionne de la même
-          manière pour l'ordre croissant.
+        <para>Les matrices ou vecteurs complexes sont triés par rapport au module
+            complexe. Seule l'option <literal>'g'</literal> est accessible avec des
+            nombres complexes.
         </para>
-      </listitem>
-      <listitem>
         <para>
-          <literal>B=gsort(A,'lr')</literal> trie les lignes de la matrice
-          <literal>A</literal> dans l'ordre lexical décroissant.
-          <literal>B</literal> est obtenue par une permutation des lignes de la
-          matrice <literal>A</literal> de telle manière que les lignes de
-          <literal>B</literal> vérifient <literal>B(i,:)&gt;=B(j,:)</literal> si
-          <literal>i&lt;j</literal>.
+            Pour les nombres complexes, <literal>gsort</literal> peut être
+            surchargé. 
         </para>
-        <para>
-          <literal>B=gsort(A,'lr','i')</literal> fonctionne de la même
-          manière pour l'ordre lexical croissant.
+        <para>voir la macro:
+            SCI/modules/elementary_functions/macros/%_gsort.sci
         </para>
-      </listitem>
-      <listitem>
-        <para>
-          <literal>B=gsort(A,'lc')</literal> trie les colonnes de la
-          matrice <literal>A</literal> dans l'ordre lexical décroissant.
-          <literal>B</literal> est obtenue par une permutation des colonnes de
-          la matrice <literal>A</literal> de telle manière que les colonnes de
-          <literal>B</literal> vérifient <literal>B(:,i)&gt;=B(:,j)</literal> si
-          <literal>i&lt;j</literal>. <literal/>
+        <para>La surcharge pour les types autres que vecteur ou matrice de nombres réels,
+            entiers ou de chaînes de caractères ou vecteur creux est possible.
         </para>
         <para>
-          <literal>B=gsort(A,'lc','i')</literal> fonctionne de la même
-          manière pour l'ordre lexical croissant.
+            Si <literal>A</literal> contient des <literal>%nan</literal> ou des
+            <literal>%inf</literal> ceux ci seront placés en début avec l'argument
+            <literal>'d'</literal> ou à la fin avec l'argument
+            <literal>'i'</literal>.
+        </para>
+    </refsection>
+    <refsection>
+        <title>Exemples</title>
+        <programlisting role="example"> 
+            alr=[1,2,2;
+            1,2,1;
+            1,1,2;
+            1,1,1];
+            [alr1,k]=gsort(alr,'lr','i')
+            [alr1,k]=gsort(alr,'lc','i')
+            
+            A=int32(alr)
+            
+            gsort(A)
+            gsort(A,'lr','i')
+            gsort(A,'lc','i')
+            
+            A=['Scilab' '2.6'
+            'Scilab' '2.7'
+            'xcos' '2.7'
+            'Scilab' '3.1'
+            'xcos' '3.1'
+            'xcos' '4.0'
+            'Scilab' '4.0']
+            
+            gsort(A,'lr','i')
+            gsort(A,'lc','i')
+        </programlisting>
+    </refsection>
+    <refsection role="see also">
+        <title>Voir aussi</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="find">find</link>
+            </member>
+        </simplelist>
+        <simplelist type="inline">
+            <member>
+                <link linkend="overloading">overloading</link>
+            </member>
+        </simplelist>
+    </refsection>
+    <refsection>
+        <title>Bibliographie</title>
+        <para>Quick sort algorithm from Bentley &amp; McIlroy's "Engineering a
+            Sort Function". Software---Practice and Experience,
+            23(11):1249-1265
         </para>
-      </listitem>
-    </itemizedlist>
-    <para>Si le second argument de retour k est demandé, il contient les
-      indices des valeurs triées dans le tableau d'origine. Si
-      <literal>[B,k]=gsort(A,'g')</literal> on a <literal>B==A(k)</literal>.
-      <emphasis role="bold">L'algorithme préserve l'ordre relatif des éléments
-        ayant des valeurs égales.
-      </emphasis>
-    </para>
-    <para>Les matrices ou vecteurs complexes sont triés par rapport au module
-      complexe. Seule l'option <literal>'g'</literal> est accessible avec des
-      nombres complexes.
-    </para>
-    <para>
-      Pour les nombres complexes, <literal>gsort</literal> peut être
-      surchargé. 
-    </para>
-    <para>voir la macro:
-      SCI/modules/elementary_functions/macros/%_gsort.sci
-    </para>
-    <para>La surcharge pour les types autres que vecteur ou matrice de nombres réels,
-      entiers ou de chaînes de caractères ou vecteur creux est possible.
-    </para>
-    <para>
-      Si <literal>A</literal> contient des <literal>%nan</literal> ou des
-      <literal>%inf</literal> ceux ci seront placés en début avec l'argument
-      <literal>'i'</literal> ou à la fin avec l'argument
-      <literal>'d'</literal>.
-    </para>
-  </refsection>
-  <refsection>
-    <title>Exemples</title>
-    <programlisting role="example"> 
-      alr=[1,2,2;
-      1,2,1;
-      1,1,2;
-      1,1,1];
-      [alr1,k]=gsort(alr,'lr','i')
-      [alr1,k]=gsort(alr,'lc','i')
-      
-      A=int32(alr)
-      
-      gsort(A)
-      gsort(A,'lr','i')
-      gsort(A,'lc','i')
-      
-      A=['Scilab' '2.6'
-      'Scilab' '2.7'
-      'xcos' '2.7'
-      'Scilab' '3.1'
-      'xcos' '3.1'
-      'xcos' '4.0'
-      'Scilab' '4.0']
-      
-      gsort(A,'lr','i')
-      gsort(A,'lc','i')
-    </programlisting>
-  </refsection>
-  <refsection role="see also">
-    <title>Voir aussi</title>
-    <simplelist type="inline">
-      <member>
-        <link linkend="find">find</link>
-      </member>
-    </simplelist>
-    <simplelist type="inline">
-      <member>
-        <link linkend="overloading">overloading</link>
-      </member>
-    </simplelist>
-  </refsection>
-  <refsection>
-    <title>Bibliographie</title>
-    <para>Quick sort algorithm from Bentley &amp; McIlroy's "Engineering a
-      Sort Function". Software---Practice and Experience,
-      23(11):1249-1265
-    </para>
-  </refsection>
-  <refsection>
-    <title>History</title>
-    <revhistory>
-      <revision>
-        <revnumber>5.4.0</revnumber>
-        <revremark>Cette fonction permet la surcharge pour les types non gérés (autres que vecteur ou matrice de nombres réels, entiers ou de chaînes de caractères ou vecteur creux).</revremark>
-      </revision>
-    </revhistory>
-  </refsection>
+    </refsection>
+    <refsection>
+        <title>History</title>
+        <revhistory>
+            <revision>
+                <revnumber>5.4.0</revnumber>
+                <revremark>Cette fonction permet la surcharge pour les types non gérés (autres que vecteur ou matrice de nombres réels, entiers ou de chaînes de caractères ou vecteur creux).</revremark>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
index 3d59c8b..b2e2203 100644 (file)
  *
  -->
 <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" version="5.0-subset Scilab" xml:id="gsort" xml:lang="ja">
-  <refnamediv>
-    <refname>gsort</refname>
-    <refpurpose>クイックソートアルゴリズムによるソート</refpurpose>
-  </refnamediv>
-  <refsynopsisdiv>
-    <title>呼び出し手順</title>
-    <synopsis>[B [,k]]=gsort(A)
-      [B [,k]]=gsort(A,option)
-      [B [,k]]=gsort(A,option,direction)
-    </synopsis>
-  </refsynopsisdiv>
-  <refsection>
-    <title>パラメータ</title>
-    <variablelist>
-      <varlistentry>
-        <term>A</term>
-        <listitem>
-          <para>実数,整数または文字列のベクトル/行列または疎ベクトル.</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>option</term>
-        <listitem>
-          <para>文字列. ソートの種類(下記)を指定します:</para>
-          <itemizedlist>
-            <listitem>
-              <para>
-                'r' : <literal>A</literal> の各列がソートされます
-              </para>
-            </listitem>
-            <listitem>
-              <para>
-                'c': <literal>A</literal> の各行がソートされます
-              </para>
-            </listitem>
+    <refnamediv>
+        <refname>gsort</refname>
+        <refpurpose>クイックソートアルゴリズムによるソート</refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>呼び出し手順</title>
+        <synopsis>[B [,k]]=gsort(A)
+            [B [,k]]=gsort(A,option)
+            [B [,k]]=gsort(A,option,direction)
+        </synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>パラメータ</title>
+        <variablelist>
+            <varlistentry>
+                <term>A</term>
+                <listitem>
+                    <para>実数,整数または文字列のベクトル/行列または疎ベクトル.</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>option</term>
+                <listitem>
+                    <para>文字列. ソートの種類(下記)を指定します:</para>
+                    <itemizedlist>
+                        <listitem>
+                            <para>
+                                'r' : <literal>A</literal> の各列がソートされます
+                            </para>
+                        </listitem>
+                        <listitem>
+                            <para>
+                                'c': <literal>A</literal> の各行がソートされます
+                            </para>
+                        </listitem>
+                        <listitem>
+                            <para>
+                                'g': <literal>A</literal> の全要素がソートされます. 
+                                デフォルト値です.
+                            </para>
+                        </listitem>
+                        <listitem>
+                            <para>
+                                'lr': <literal>A</literal>の列の辞書式ソート
+                            </para>
+                        </listitem>
+                        <listitem>
+                            <para>
+                                'lc': <literal>A</literal>のの行の辞書式ソート
+                            </para>
+                        </listitem>
+                    </itemizedlist>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>direction</term>
+                <listitem>
+                    <para>文字列. ソートの方向を指定します:
+                        <literal>'i'</literal> は昇順,
+                        <literal>'d'</literal> は降順 (デフォルト)を意味します.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>B</term>
+                <listitem>
+                    <para>
+                        <literal>A</literal>と同じ型と次元の配列.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>k</term>
+                <listitem>
+                    <para>
+                        整数値を有し,<literal>A</literal>と同じ次元の実数配列.
+                        元の添え字を有します.
+                    </para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>説明</title>
+        <para>
+            <literal>gsort</literal> は種々のデータ型に関する
+            "クイックソート" アルゴリズムです.
+        </para>
+        <itemizedlist>
             <listitem>
-              <para>
-                'g': <literal>A</literal> の全要素がソートされます. 
-                デフォルト値です.
-              </para>
+                <para>
+                    <literal>B=gsort(A,'g')</literal>,
+                    <literal>B=gsort(A,'g','d')</literal> および
+                    <literal>B=gsort(A)</literal> は
+                    配列  <literal>A</literal>の要素を<literal>A(:)</literal>として
+                    降順にソートします.
+                </para>
+                <para>
+                    <literal>B=gsort(A,'g','i')</literal> は
+                    <literal>A</literal>の要素を昇順にソートします.
+                </para>
             </listitem>
             <listitem>
-              <para>
-                'lr': <literal>A</literal>の列の辞書式ソート
-              </para>
+                <para>
+                    <literal>B=gsort(A,'lr')</literal> は<literal>A</literal>
+                    の行を辞書的に降順にソートします.
+                    <literal>B</literal>は,
+                    <literal>B</literal>の各行が<literal>B(i,:)&gt;=B(j,:)</literal>
+                    (ただし,<literal>i&lt;j</literal>)となるように,
+                    行列<literal>A</literal>の行を並び替えることにより
+                    得られます.
+                </para>
+                <para>
+                    <literal>B=gsort(A,'lr','i')</literal> は
+                    昇順の辞書的ソートについても同様に動作します.
+                </para>
             </listitem>
             <listitem>
-              <para>
-                'lc': <literal>A</literal>のの行の辞書式ソート
-              </para>
+                <para>
+                    <literal>B=gsort(A,'lc')</literal> 
+                    の列を辞書的に降順にソートします.
+                    <literal>B</literal>は,
+                    <literal>B</literal>の各列が<literal>B(:,i)&gt;=B(:,j)</literal>
+                    (ただし,<literal>i&lt;j</literal>となるように,
+                    行列<literal>A</literal>の列を並び替えることにより
+                    得られます.
+                </para>
+                <para>
+                    <literal>B=gsort(A,'lc','i')</literal> は
+                    昇順の辞書的ソートについても同様に動作します.
+                </para>
             </listitem>
-          </itemizedlist>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>direction</term>
-        <listitem>
-          <para>文字列. ソートの方向を指定します:
-            <literal>'i'</literal> は昇順,
-            <literal>'d'</literal> は降順 (デフォルト)を意味します.
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>B</term>
-        <listitem>
-          <para>
-            <literal>A</literal>と同じ型と次元の配列.
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>k</term>
-        <listitem>
-          <para>
-            整数値を有し,<literal>A</literal>と同じ次元の実数配列.
-            元の添え字を有します.
-          </para>
-        </listitem>
-      </varlistentry>
-    </variablelist>
-  </refsection>
-  <refsection>
-    <title>説明</title>
-    <para>
-      <literal>gsort</literal> は種々のデータ型に関する
-      "クイックソート" アルゴリズムです.
-    </para>
-    <itemizedlist>
-      <listitem>
-        <para>
-          <literal>B=gsort(A,'g')</literal>,
-          <literal>B=gsort(A,'g','d')</literal> および
-          <literal>B=gsort(A)</literal> は
-          配列  <literal>A</literal>の要素を<literal>A(:)</literal>として
-          降順にソートします.
-        </para>
-        <para>
-          <literal>B=gsort(A,'g','i')</literal> は
-          <literal>A</literal>の要素を昇順にソートします.
+        </itemizedlist>
+        <para>二番目の戻り値引数が指定された場合, 
+            <literal>k</literal>に<literal>A</literal>のソートされた値の添え字が
+            代入されます.
+            <literal>[B,k]=gsort(A,'g')</literal>の場合,
+            <literal>B==A(k)</literal>となります.
+            <emphasis role="bold">このアルゴリズムは,等しい値を有する
+                レコードの相対的な順序を保持します.
+            </emphasis>
         </para>
-      </listitem>
-      <listitem>
         <para>
-          <literal>B=gsort(A,'lr')</literal> は<literal>A</literal>
-          の行を辞書的に降順にソートします.
-          <literal>B</literal>は,
-          <literal>B</literal>の各行が<literal>B(i,:)&gt;=B(j,:)</literal>
-          (ただし,<literal>i&lt;j</literal>)となるように,
-          行列<literal>A</literal>の行を並び替えることにより
-          得られます.
+            <literal>v</literal> が複素数の場合, その要素は
+            大きさ,すなわち, abs(<literal>v</literal>) によりソートされます,
+            2番目の引数としては<literal>'g'</literal>のみが複素数で使用可能です.
         </para>
         <para>
-          <literal>B=gsort(A,'lr','i')</literal> は
-          昇順の辞書的ソートについても同様に動作します.
+            <literal>v</literal> が <literal>%nan</literal> または
+            <literal>%inf</literal> を要素として有する場合, gsort は
+            これらを <literal>'d'</literal> の場合は先頭,
+            <literal>'i'</literal>の場合は末尾に置きます.
         </para>
-      </listitem>
-      <listitem>
-        <para>
-          <literal>B=gsort(A,'lc')</literal> 
-          の列を辞書的に降順にソートします.
-          <literal>B</literal>は,
-          <literal>B</literal>の各列が<literal>B(:,i)&gt;=B(:,j)</literal>
-          (ただし,<literal>i&lt;j</literal>となるように,
-          行列<literal>A</literal>の列を並び替えることにより
-          得られます.
-        </para>
-        <para>
-          <literal>B=gsort(A,'lc','i')</literal> は
-          昇順の辞書的ソートについても同様に動作します.
+    </refsection>
+    <refsection>
+        <title>例</title>
+        <programlisting role="example"> 
+            alr=[1,2,2;
+            1,2,1;
+            1,1,2;
+            1,1,1];
+            [alr1,k]=gsort(alr,'lr','i')
+            [alr1,k]=gsort(alr,'lc','i')
+            
+            v=int32(alr)
+            
+            gsort(v)
+            gsort(v,'lr','i')
+            gsort(v,'lc','i')
+            
+            v=['Scilab' '2.6'
+            'Scilab' '2.7'
+            'xcos' '2.7'
+            'Scilab' '3.1'
+            'xcos' '3.1'
+            'xcos' '4.0'
+            'Scilab' '4.0']
+            
+            gsort(v,'lr','i')
+            gsort(v,'lc','i')
+        </programlisting>
+    </refsection>
+    <refsection role="see also">
+        <title>参照</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="find">find</link>
+            </member>
+        </simplelist>
+    </refsection>
+    <refsection>
+        <title>参考文献</title>
+        <para>Quick sort algorithm from Bentley &amp; McIlroy's "Engineering a
+            Sort Function". Software---Practice and Experience,
+            23(11):1249-1265
         </para>
-      </listitem>
-    </itemizedlist>
-    <para>二番目の戻り値引数が指定された場合, 
-      <literal>k</literal>に<literal>A</literal>のソートされた値の添え字が
-      代入されます.
-      <literal>[B,k]=gsort(A,'g')</literal>の場合,
-      <literal>B==A(k)</literal>となります.
-      <emphasis role="bold">このアルゴリズムは,等しい値を有する
-        レコードの相対的な順序を保持します.
-      </emphasis>
-    </para>
-    <para>
-      <literal>v</literal> が複素数の場合, その要素は
-      大きさ,すなわち, abs(<literal>v</literal>) によりソートされます,
-      2番目の引数としては<literal>'g'</literal>のみが複素数で使用可能です.
-    </para>
-    <para>
-      <literal>v</literal> が <literal>%nan</literal> または
-      <literal>%inf</literal> を要素として有する場合, gsort は
-      これらを <literal>'i'</literal> の場合は先頭,
-      <literal>'d'</literal>の場合は末尾に置きます.
-    </para>
-  </refsection>
-  <refsection>
-    <title>例</title>
-    <programlisting role="example"> 
-      alr=[1,2,2;
-      1,2,1;
-      1,1,2;
-      1,1,1];
-      [alr1,k]=gsort(alr,'lr','i')
-      [alr1,k]=gsort(alr,'lc','i')
-      
-      v=int32(alr)
-      
-      gsort(v)
-      gsort(v,'lr','i')
-      gsort(v,'lc','i')
-      
-      v=['Scilab' '2.6'
-      'Scilab' '2.7'
-      'xcos' '2.7'
-      'Scilab' '3.1'
-      'xcos' '3.1'
-      'xcos' '4.0'
-      'Scilab' '4.0']
-      
-      gsort(v,'lr','i')
-      gsort(v,'lc','i')
-    </programlisting>
-  </refsection>
-  <refsection role="see also">
-    <title>参照</title>
-    <simplelist type="inline">
-      <member>
-        <link linkend="find">find</link>
-      </member>
-    </simplelist>
-  </refsection>
-  <refsection>
-    <title>参考文献</title>
-    <para>Quick sort algorithm from Bentley &amp; McIlroy's "Engineering a
-      Sort Function". Software---Practice and Experience,
-      23(11):1249-1265
-    </para>
-  </refsection>
+    </refsection>
 </refentry>
index a7fa0cd..65d67b8 100644 (file)
  *
  -->
 <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" version="5.0-subset Scilab" xml:id="gsort" xml:lang="en">
-  <refnamediv>
-    <refname>gsort</refname>
-    <refpurpose>ordenação decrescente</refpurpose>
-  </refnamediv>
-  <refsynopsisdiv>
-    <title>Seqüência de Chamamento</title>
-    <synopsis>[s, [k]]=gsort(v )
-      [s, [k]]=gsort(v,flag1)
-      [s, [k]]=gsort(v,flag1,flag2)
-    </synopsis>
-  </refsynopsisdiv>
-  <refsection>
-    <title>Parâmetros</title>
-    <variablelist>
-      <varlistentry>
-        <term>v,s</term>
-        <listitem>
-          <para>vetor ou matriz de reais, inteiros ou strings ou sparse
-            vector
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>flag1</term>
-        <listitem>
-          <para>
-            um string <literal>'r'</literal>,
-            <literal>'c'</literal>,<literal>'g'</literal>,<literal>'lr'</literal>
-            ou <literal>'lc'</literal>.
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>flag2</term>
-        <listitem>
-          <para>
-            um string <literal>'i'</literal> para ordem crescente ou
-            <literal>'d'</literal> para ordem decrescente. k : vetor ou matriz
-            de inteiros
-          </para>
-        </listitem>
-      </varlistentry>
-    </variablelist>
-  </refsection>
-  <refsection>
-    <title>Descrição</title>
-    <para>
-      <literal>gsort</literal> é semelhante a <literal>sort</literal> com
-      propriedades adicionais. O terceiro argumento pode ser usado para escolher
-      ordem crescente ou decrescente. O segundo argumento podem ser usado para
-      ordens léxicas.
-    </para>
-    <para>
-      <literal>[s,k]=gsort(a,'g')</literal> e
-      <literal>[s,k]=gsort(a,'g','d')</literal> são o mesmo que
-      <literal>[s,k]=gsort(a)</literal>. Eles realizam uma ordenação das
-      entradas da matriz <literal>a</literal>, <literal>a</literal> sendo vista
-      como vetor de pilhas <literal>a(:)</literal> (coluna a coluna).
-      <literal>[s,k]=gsort(a,'g','i')</literal> realiza a mesma operação, mas em
-      ordem crescente.
-    </para>
-    <para>
-      <literal>[s,k]=gsort(a,'lr')</literal> ordena as linhas da matriz
-      <literal>a</literal> em ordem léxica decrescente. <literal>s</literal> é
-      obtida por uma permutação das linhas da matriz <literal>a</literal> dada
-      pelo vetor coluna <literal>k</literal>) de tal modo que as linhas de
-      <literal>s</literal> verificam <literal>s(i,:) &gt; s(j,:)</literal> se
-      <literal>i&lt;j</literal>. <literal>[s,k]=gsort(a,'lr','i')</literal>
-      realiza a mesma operação, mas em ordem léxica crescente.
-    </para>
-    <para>
-      <literal>[s,k]=gsort(a,'lc')</literal> ordena as colunas da matriz
-      <literal>a</literal> em ordem léxica decrescente. <literal>s</literal> é
-      obtida por uma permutação das colunas da matriz <literal>int(a)</literal>
-      (ou <literal>a</literal>) dada pelo vetor linha <literal>k</literal>) ide
-      tal modo que as colunas de <literal>s</literal> verificam <literal>s(:,i)
-        &gt; s(:,j)
-      </literal>
-      se <literal>i&lt;j</literal>.
-      <literal>[s,k]=gsort(a,'lc','i')</literal> realiza a mesma operação, mas
-      em ordem léxica crescente.
-    </para>
-    <para>
-      Quando <literal>v</literal> é complexo, os elementos são ordenados
-      pela magnitude, i.e., abs(<literal>v</literal>) . Apenas 'g' como segundo
-      argumento funciona com complexos.
-    </para>
-    <para>
-      Se <literal>v</literal> tem elementos <literal>%nan</literal> ou
-      <literal>%inf</literal> . gsort coloca esses elementos no início com o
-      argumento <literal>'i'</literal> ou ao fim com o argumento
-      <literal>'d'</literal>.
-    </para>
-  </refsection>
-  <refsection>
-    <title>Exemplos</title>
-    <programlisting role="example"> 
-      alr=[1,2,2;
-      1,2,1;
-      1,1,2;
-      1,1,1];
-      [alr1,k]=gsort(alr,'lr','i')
-      [alr1,k]=gsort(alr,'lc','i')
-      
-      v=int32(alr)
-      
-      gsort(v)
-      gsort(v,'lr','i')
-      gsort(v,'lc','i')
-      
-      v=['Scilab' '2.6'
-      'Scilab' '2.7'
-      'Scicos' '2.7'
-      'Scilab' '3.1'
-      'Scicos' '3.1'
-      'Scicos' '4.0'
-      'Scilab' '4.0']
-      
-      gsort(v,'lr','i')
-      gsort(v,'lc','i')
-    </programlisting>
-  </refsection>
-  <refsection>
-    <title>Ver Também</title>
-    <simplelist type="inline">
-      <member>
-        <link linkend="find">find</link>
-      </member>
-    </simplelist>
-  </refsection>
-  <refsection>
-    <title>Bibliografia</title>
-    <para>Algoritmo Quicksort.</para>
-  </refsection>
+    <refnamediv>
+        <refname>gsort</refname>
+        <refpurpose>ordenação decrescente</refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Seqüência de Chamamento</title>
+        <synopsis>[s, [k]]=gsort(v )
+            [s, [k]]=gsort(v,flag1)
+            [s, [k]]=gsort(v,flag1,flag2)
+        </synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Parâmetros</title>
+        <variablelist>
+            <varlistentry>
+                <term>v,s</term>
+                <listitem>
+                    <para>vetor ou matriz de reais, inteiros ou strings ou sparse
+                        vector
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>flag1</term>
+                <listitem>
+                    <para>
+                        um string <literal>'r'</literal>,
+                        <literal>'c'</literal>,<literal>'g'</literal>,<literal>'lr'</literal>
+                        ou <literal>'lc'</literal>.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>flag2</term>
+                <listitem>
+                    <para>
+                        um string <literal>'i'</literal> para ordem crescente ou
+                        <literal>'d'</literal> para ordem decrescente. k : vetor ou matriz
+                        de inteiros
+                    </para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Descrição</title>
+        <para>
+            <literal>gsort</literal> é semelhante a <literal>sort</literal> com
+            propriedades adicionais. O terceiro argumento pode ser usado para escolher
+            ordem crescente ou decrescente. O segundo argumento podem ser usado para
+            ordens léxicas.
+        </para>
+        <para>
+            <literal>[s,k]=gsort(a,'g')</literal> e
+            <literal>[s,k]=gsort(a,'g','d')</literal> são o mesmo que
+            <literal>[s,k]=gsort(a)</literal>. Eles realizam uma ordenação das
+            entradas da matriz <literal>a</literal>, <literal>a</literal> sendo vista
+            como vetor de pilhas <literal>a(:)</literal> (coluna a coluna).
+            <literal>[s,k]=gsort(a,'g','i')</literal> realiza a mesma operação, mas em
+            ordem crescente.
+        </para>
+        <para>
+            <literal>[s,k]=gsort(a,'lr')</literal> ordena as linhas da matriz
+            <literal>a</literal> em ordem léxica decrescente. <literal>s</literal> é
+            obtida por uma permutação das linhas da matriz <literal>a</literal> dada
+            pelo vetor coluna <literal>k</literal>) de tal modo que as linhas de
+            <literal>s</literal> verificam <literal>s(i,:) &gt; s(j,:)</literal> se
+            <literal>i&lt;j</literal>. <literal>[s,k]=gsort(a,'lr','i')</literal>
+            realiza a mesma operação, mas em ordem léxica crescente.
+        </para>
+        <para>
+            <literal>[s,k]=gsort(a,'lc')</literal> ordena as colunas da matriz
+            <literal>a</literal> em ordem léxica decrescente. <literal>s</literal> é
+            obtida por uma permutação das colunas da matriz <literal>int(a)</literal>
+            (ou <literal>a</literal>) dada pelo vetor linha <literal>k</literal>) ide
+            tal modo que as colunas de <literal>s</literal> verificam <literal>s(:,i)
+                &gt; s(:,j)
+            </literal>
+            se <literal>i&lt;j</literal>.
+            <literal>[s,k]=gsort(a,'lc','i')</literal> realiza a mesma operação, mas
+            em ordem léxica crescente.
+        </para>
+        <para>
+            Quando <literal>v</literal> é complexo, os elementos são ordenados
+            pela magnitude, i.e., abs(<literal>v</literal>) . Apenas 'g' como segundo
+            argumento funciona com complexos.
+        </para>
+        <para>
+            Se <literal>v</literal> tem elementos <literal>%nan</literal> ou
+            <literal>%inf</literal> . gsort coloca esses elementos no início com o
+            argumento <literal>'d'</literal> ou ao fim com o argumento
+            <literal>'i'</literal>.
+        </para>
+    </refsection>
+    <refsection>
+        <title>Exemplos</title>
+        <programlisting role="example"> 
+            alr=[1,2,2;
+            1,2,1;
+            1,1,2;
+            1,1,1];
+            [alr1,k]=gsort(alr,'lr','i')
+            [alr1,k]=gsort(alr,'lc','i')
+            
+            v=int32(alr)
+            
+            gsort(v)
+            gsort(v,'lr','i')
+            gsort(v,'lc','i')
+            
+            v=['Scilab' '2.6'
+            'Scilab' '2.7'
+            'Scicos' '2.7'
+            'Scilab' '3.1'
+            'Scicos' '3.1'
+            'Scicos' '4.0'
+            'Scilab' '4.0']
+            
+            gsort(v,'lr','i')
+            gsort(v,'lc','i')
+        </programlisting>
+    </refsection>
+    <refsection>
+        <title>Ver Também</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="find">find</link>
+            </member>
+        </simplelist>
+    </refsection>
+    <refsection>
+        <title>Bibliografia</title>
+        <para>Algoritmo Quicksort.</para>
+    </refsection>
 </refentry>
index 34bb7c3..d8f9d03 100644 (file)
  *
  -->
 <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" version="5.0-subset Scilab" xml:id="gsort" xml:lang="ru">
-  <refnamediv>
-    <refname>gsort</refname>
-    <refpurpose>сортировка по алгоритму быстрой сортировки</refpurpose>
-  </refnamediv>
-  <refsynopsisdiv>
-    <title>Последовательность вызова</title>
-    <synopsis>[B [,k]]=gsort(A)
-      [B [,k]]=gsort(A,option)
-      [B [,k]]=gsort(A,option,direction)
-    </synopsis>
-  </refsynopsisdiv>
-  <refsection>
-    <title>Аргументы</title>
-    <variablelist>
-      <varlistentry>
-        <term>A</term>
-        <listitem>
-          <para>вещественный, целочисленный или строковый вектор.матрица, либо разрежённый вектор.
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>option</term>
-        <listitem>
-          <para>символьная строка. Она задаёт тип требуемой сортировки:
-          </para>
-          <itemizedlist>
-            <listitem>
-              <para>
-                'r' : сортируется каждый столбец <literal>A</literal>
-              </para>
-            </listitem>
-            <listitem>
-              <para>
-                'c': сортируется каждая строка <literal>A</literal>
-              </para>
-            </listitem>
+    <refnamediv>
+        <refname>gsort</refname>
+        <refpurpose>сортировка по алгоритму быстрой сортировки</refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Последовательность вызова</title>
+        <synopsis>[B [,k]]=gsort(A)
+            [B [,k]]=gsort(A,option)
+            [B [,k]]=gsort(A,option,direction)
+        </synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Аргументы</title>
+        <variablelist>
+            <varlistentry>
+                <term>A</term>
+                <listitem>
+                    <para>вещественный, целочисленный или строковый вектор.матрица, либо разрежённый вектор.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>option</term>
+                <listitem>
+                    <para>символьная строка. Она задаёт тип требуемой сортировки:
+                    </para>
+                    <itemizedlist>
+                        <listitem>
+                            <para>
+                                'r' : сортируется каждый столбец <literal>A</literal>
+                            </para>
+                        </listitem>
+                        <listitem>
+                            <para>
+                                'c': сортируется каждая строка <literal>A</literal>
+                            </para>
+                        </listitem>
+                        <listitem>
+                            <para>
+                                'g': сортируются все элементы <literal>A</literal>. Это значение по умолчанию.
+                            </para>
+                        </listitem>
+                        <listitem>
+                            <para>'lr': лексикографическая сортировка строк 
+                                <literal>A</literal>
+                            </para>
+                        </listitem>
+                        <listitem>
+                            <para>'lc': лексикографическая сортировка столбцов 
+                                <literal>A</literal>
+                            </para>
+                        </listitem>
+                    </itemizedlist>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>direction</term>
+                <listitem>
+                    <para>символьная строка. Она задаёт направление сортировки:
+                        <literal>'i'</literal> устанавливает порядок возрастания, а 
+                        <literal>'d'</literal> устанавливает порядок убывания (по умолчанию).
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>B</term>
+                <listitem>
+                    <para>
+                        массив того же типа и размеров, что и <literal>A</literal>.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>k</term>
+                <listitem>
+                    <para>вещественный массив целочисленных значений тех же размеров, что и 
+                        <literal>A</literal>. Содержит исходные индексы.
+                    </para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Описание</title>
+        <para>
+            <literal>gsort</literal> использует алгоритм "быстрой сортировки" для различных типов данных.
+        </para>
+        <itemizedlist>
             <listitem>
-              <para>
-                'g': сортируются все элементы <literal>A</literal>. Это значение по умолчанию.
-              </para>
+                <para>
+                    <literal>B=gsort(A,'g')</literal>,
+                    <literal>B=gsort(A,'g','d')</literal> и
+                    <literal>B=gsort(A)</literal> сортируют элементы массива
+                    <literal>A</literal>, который рассматривается как <literal>A(:)</literal> в порядке убывания.
+                </para>
+                <para>
+                    <literal>B=gsort(A,'g','i')</literal> сортирует элементы массива <literal>A</literal> в порядке возрастания.
+                </para>
             </listitem>
             <listitem>
-              <para>'lr': лексикографическая сортировка строк 
-                <literal>A</literal>
-              </para>
+                <para>
+                    <literal>B=gsort(A,'lr')</literal> сортирует строки
+                    <literal>A</literal> в лексическом порядке убывания. <literal>B</literal>
+                    получается перестановкой строк матрицы <literal>A</literal> таким образом, чтобы строки <literal>B</literal> удовлетворяли <literal>B(i,:)&gt;=B(j,:)</literal>, если <literal>i&lt;j</literal>.
+                </para>
+                <para>
+                    <literal>B=gsort(A,'lr','i')</literal> работает аналогично для лексического порядка возрастания.
+                </para>
             </listitem>
             <listitem>
-              <para>'lc': лексикографическая сортировка столбцов 
-                <literal>A</literal>
-              </para>
+                <para>
+                    <literal>B=gsort(A,'lc')</literal> сортирует столбцы <literal>A</literal> в лексическом порядке убывания. <literal>B</literal> получается перестановкой столбцов матрицы <literal>A</literal> таким образом, чтобы столбцы           <literal>B</literal> удовлетворяли <literal>B(:,i)&gt;=B(:,j)</literal>, если
+                    <literal>i&lt;j</literal>.
+                </para>
+                <para>
+                    <literal>B=gsort(A,'lc','i')</literal> работает аналогично для лексического порядка возрастания.
+                </para>
             </listitem>
-          </itemizedlist>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>direction</term>
-        <listitem>
-          <para>символьная строка. Она задаёт направление сортировки:
-            <literal>'i'</literal> устанавливает порядок возрастания, а 
-            <literal>'d'</literal> устанавливает порядок убывания (по умолчанию).
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>B</term>
-        <listitem>
-          <para>
-            массив того же типа и размеров, что и <literal>A</literal>.
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>k</term>
-        <listitem>
-          <para>вещественный массив целочисленных значений тех же размеров, что и 
-            <literal>A</literal>. Содержит исходные индексы.
-          </para>
-        </listitem>
-      </varlistentry>
-    </variablelist>
-  </refsection>
-  <refsection>
-    <title>Описание</title>
-    <para>
-      <literal>gsort</literal> использует алгоритм "быстрой сортировки" для различных типов данных.
-    </para>
-    <itemizedlist>
-      <listitem>
+        </itemizedlist>
         <para>
-          <literal>B=gsort(A,'g')</literal>,
-          <literal>B=gsort(A,'g','d')</literal> и
-          <literal>B=gsort(A)</literal> сортируют элементы массива
-          <literal>A</literal>, который рассматривается как <literal>A(:)</literal> в порядке убывания.
+            Если требуется, то второй возвращаемый аргумент <literal>k</literal> содержит индексы отсортированных значений в <literal>A</literal>. Если <literal>[B,k]=gsort(A,'g')</literal>, то  <literal>B==A(k)</literal>.
+            <emphasis role="bold">
+                Алгоритм сохраняет относительный порядок записей с одинаковыми значениями. 
+            </emphasis>
         </para>
         <para>
-          <literal>B=gsort(A,'g','i')</literal> сортирует элементы массива <literal>A</literal> в порядке возрастания.
+            Когда <literal>v</literal> является комплексным, элементы сортируются по амплитуде, т. е. abs(<literal>v</literal>). Только <literal>'g'</literal> в качестве второго аргумента работает с комплексными значениями.
         </para>
-      </listitem>
-      <listitem>
         <para>
-          <literal>B=gsort(A,'lr')</literal> сортирует строки
-          <literal>A</literal> в лексическом порядке убывания. <literal>B</literal>
-          получается перестановкой строк матрицы <literal>A</literal> таким образом, чтобы строки <literal>B</literal> удовлетворяли <literal>B(i,:)&gt;=B(j,:)</literal>, если <literal>i&lt;j</literal>.
+            С комплексными числами <literal>gsort</literal> может быть перегружена
         </para>
-        <para>
-          <literal>B=gsort(A,'lr','i')</literal> работает аналогично для лексического порядка возрастания.
+        <para>смотрите макрос:
+            SCI/modules/elementary_functions/macros/%_gsort.sci
         </para>
-      </listitem>
-      <listitem>
         <para>
-          <literal>B=gsort(A,'lc')</literal> сортирует столбцы <literal>A</literal> в лексическом порядке убывания. <literal>B</literal> получается перестановкой столбцов матрицы <literal>A</literal> таким образом, чтобы столбцы           <literal>B</literal> удовлетворяли <literal>B(:,i)&gt;=B(:,j)</literal>, если
-          <literal>i&lt;j</literal>.
+            Можно делать перегрузку для типов, которые не управляются (отличные от матриц/векторов вещественных, целочисленных или символьных значений, либо разрежённого вектора).
         </para>
         <para>
-          <literal>B=gsort(A,'lc','i')</literal> работает аналогично для лексического порядка возрастания.
+            Если <literal>v</literal> содержит элементы <literal>%nan</literal> или
+            <literal>%inf</literal>, то <literal>gsort</literal> помещает их в начало с аргументом <literal>'d'</literal>, либо в конец с аргументом <literal>'i'</literal>.
+        </para>
+    </refsection>
+    <refsection>
+        <title>Примеры</title>
+        <programlisting role="example"> 
+            alr=[1,2,2;
+            1,2,1;
+            1,1,2;
+            1,1,1];
+            [alr1,k]=gsort(alr,'lr','i')
+            [alr1,k]=gsort(alr,'lc','i')
+            
+            v=int32(alr)
+            
+            gsort(v)
+            gsort(v,'lr','i')
+            gsort(v,'lc','i')
+            
+            v=['Scilab' '2.6'
+            'Scilab' '2.7'
+            'xcos' '2.7'
+            'Scilab' '3.1'
+            'xcos' '3.1'
+            'xcos' '4.0'
+            'Scilab' '4.0']
+            
+            gsort(v,'lr','i')
+            gsort(v,'lc','i')
+        </programlisting>
+    </refsection>
+    <refsection role="see also">
+        <title>Смотрите также</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="find">find</link>
+            </member>
+        </simplelist>
+        <simplelist type="inline">
+            <member>
+                <link linkend="overloading">overloading</link>
+            </member>
+        </simplelist>
+    </refsection>
+    <refsection>
+        <title>Литература</title>
+        <para>Quick sort algorithm from Bentley &amp; McIlroy's "Engineering a
+            Sort Function". Software---Practice and Experience,
+            23(11):1249-1265
         </para>
-      </listitem>
-    </itemizedlist>
-    <para>
-      Если требуется, то второй возвращаемый аргумент <literal>k</literal> содержит индексы отсортированных значений в <literal>A</literal>. Если <literal>[B,k]=gsort(A,'g')</literal>, то  <literal>B==A(k)</literal>.
-      <emphasis role="bold">
-        Алгоритм сохраняет относительный порядок записей с одинаковыми значениями. 
-      </emphasis>
-    </para>
-    <para>
-      Когда <literal>v</literal> является комплексным, элементы сортируются по амплитуде, т. е. abs(<literal>v</literal>). Только <literal>'g'</literal> в качестве второго аргумента работает с комплексными значениями.
-    </para>
-    <para>
-      С комплексными числами <literal>gsort</literal> может быть перегружена
-    </para>
-    <para>смотрите макрос:
-      SCI/modules/elementary_functions/macros/%_gsort.sci
-    </para>
-    <para>
-      Можно делать перегрузку для типов, которые не управляются (отличные от матриц/векторов вещественных, целочисленных или символьных значений, либо разрежённого вектора).
-    </para>
-    <para>
-      Если <literal>v</literal> содержит элементы <literal>%nan</literal> или
-      <literal>%inf</literal>, то <literal>gsort</literal> помещает их в начало с аргументом <literal>'i'</literal>, либо в конец с аргументом <literal>'d'</literal>.
-    </para>
-  </refsection>
-  <refsection>
-    <title>Примеры</title>
-    <programlisting role="example"> 
-      alr=[1,2,2;
-      1,2,1;
-      1,1,2;
-      1,1,1];
-      [alr1,k]=gsort(alr,'lr','i')
-      [alr1,k]=gsort(alr,'lc','i')
-      
-      v=int32(alr)
-      
-      gsort(v)
-      gsort(v,'lr','i')
-      gsort(v,'lc','i')
-      
-      v=['Scilab' '2.6'
-      'Scilab' '2.7'
-      'xcos' '2.7'
-      'Scilab' '3.1'
-      'xcos' '3.1'
-      'xcos' '4.0'
-      'Scilab' '4.0']
-      
-      gsort(v,'lr','i')
-      gsort(v,'lc','i')
-    </programlisting>
-  </refsection>
-  <refsection role="see also">
-    <title>Смотрите также</title>
-    <simplelist type="inline">
-      <member>
-        <link linkend="find">find</link>
-      </member>
-    </simplelist>
-    <simplelist type="inline">
-      <member>
-        <link linkend="overloading">overloading</link>
-      </member>
-    </simplelist>
-  </refsection>
-  <refsection>
-    <title>Литература</title>
-    <para>Quick sort algorithm from Bentley &amp; McIlroy's "Engineering a
-      Sort Function". Software---Practice and Experience,
-      23(11):1249-1265
-    </para>
-  </refsection>
-  <refsection>
-    <title>История</title>
-    <revhistory>
-      <revision>
-        <revnumber>5.4.0</revnumber>
-        <revremark> 
-          Эта функция позволяет делать перегрузку для типов, которые не управляются (отличные от матриц/векторов вещественных, целочисленных или символьных значений, либо разрежённого вектора).
-        </revremark>
-      </revision>
-    </revhistory>
-  </refsection>
+    </refsection>
+    <refsection>
+        <title>История</title>
+        <revhistory>
+            <revision>
+                <revnumber>5.4.0</revnumber>
+                <revremark> 
+                    Эта функция позволяет делать перегрузку для типов, которые не управляются (отличные от матриц/векторов вещественных, целочисленных или символьных значений, либо разрежённого вектора).
+                </revremark>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>