* Bug #14297 fixed - Updated cumsum y=cumsum(x) description. It was just a copy-paste... 10/17910/7
Nicolas [Fri, 11 Mar 2016 10:45:32 +0000 (11:45 +0100)]
Bug Fix #14297 - Updated documentation of cumsum(x)

Change-Id: I7aeaad7f040e01c7809059f144f402c2e25744a8

13 files changed:
scilab/CHANGES
scilab/modules/elementary_functions/help/en_US/matrixoperations/cumsum.xml
scilab/modules/elementary_functions/help/fr_FR/matrixoperations/cumsum.xml
scilab/modules/elementary_functions/help/ja_JP/matrixoperations/cumsum.xml
scilab/modules/elementary_functions/help/pt_BR/matrixoperations/cumsum.xml
scilab/modules/elementary_functions/help/ru_RU/matrixoperations/cumsum.xml
scilab/modules/helptools/etc/images_md5.txt
scilab/modules/helptools/images/_LaTeX_cumsum.xml_1.png
scilab/modules/helptools/images/_LaTeX_cumsum.xml_2.png
scilab/modules/helptools/images/_LaTeX_cumsum.xml_3.png
scilab/modules/helptools/images/_LaTeX_cumsum.xml_4.png
scilab/modules/helptools/images/_LaTeX_cumsum.xml_5.png
scilab/modules/helptools/images/_LaTeX_cumsum.xml_6.png [new file with mode: 0644]

index 4db4a66..40f7acd 100644 (file)
@@ -399,6 +399,8 @@ In 6.0.0:
 
 * Bug #14271 fixed - conjgrad() displayed an incorrect error message about number of arguments.
 
+* Bug #14297 fixed - Updated cumsum y=cumsum(x) description. It was just a copy-paste of the help page "sum"
+
 * Bug #14347 fixed - plot2d crashed with multiple entries (non regression test).
 
 * Bug #14359 fixed - Black Hole demo updated. Stop and Clear buttons did not have priority tag set. Callback_type property has been added and set to 10.
index 1e56142..d5bdb9d 100644 (file)
     </refnamediv>
     <refsynopsisdiv>
         <title>Syntax</title>
-        <synopsis>y=cumsum(x)</synopsis>
-        <synopsis>y=cumsum(x,orientation)</synopsis>
-        <synopsis>y=cumsum(x,outtype)</synopsis>
-        <synopsis>y=cumsum(x,orientation,outtype)</synopsis>
+        <synopsis>y=cumsum(x)
+            y=cumsum(x,orientation)
+            y=cumsum(x,outtype)
+            y=cumsum(x,orientation,outtype)
+        </synopsis>
     </refsynopsisdiv>
-    <refsection>
+    
+    <refsection role="parameters">
         <title>Arguments</title>
         <variablelist>
             <varlistentry>
             </varlistentry>
         </variablelist>
     </refsection>
-    <refsection>
+    
+    <refsection role="description">
         <title>Description</title>
         <para>
-            For an array <literal>x</literal>, <literal>y=cumsum(x)</literal> returns in the scalar <literal>y</literal> the cumulative sum of all the elements of <literal>x</literal>.
+            Returns the cumulative sum of array elements.
+            For an array <term>x</term>, <literal>y=cumsum(x)</literal> a matrix <term>y</term> of the same size as <term>x</term>.
+            The value <literal>y(i)</literal> is the sum of all elements of <literal>x(1:i)</literal> <emphasis role="italic">i.e.</emphasis>:
         </para>
         <para>
-            <literal>y=cumsum(x,orientation)</literal> returns in <literal>y</literal> the cumulative sum of <literal>x</literal> along the dimension given by <literal>orientation</literal>: 
+            <latex><![CDATA[ y(i) = \sum_{k=1}^i x(k)]]></latex>
+        </para>
+        <para>
+            <literal>y=cumsum(x,orientation)</literal> returns in <term>y</term> the cumulative sum of <term>x</term> along the dimension given by <term>orientation</term>:
         </para>
         <itemizedlist>
             <listitem>
                 <para>
-                    if <literal>orientation</literal> is equal to 1 or "r" then: 
+                    if <term>orientation</term> is equal to 1 or "r" then:
                 </para>
                 <para>
                     <latex><![CDATA[ y(\mathbf{l},j) = \sum_{\mathbf{i}=1}^l x(\mathbf{i},j)]]></latex>
@@ -89,7 +97,7 @@
             </listitem>
             <listitem>
                 <para>
-                    if <literal>orientation</literal> is equal to 2 or "c" then: 
+                    if <term>orientation</term> is equal to 2 or "c" then:
                 </para>
                 <para>
                     <latex><![CDATA[ y(i,\mathbf{l}) = \sum_{\mathbf{j}=1}^l x(i,{\mathbf{j})]]></latex>
             </listitem>
             <listitem>
                 <para>
-                    if <literal>orientation</literal> is equal to n then: 
+                    if <term>orientation</term> is equal to n then:
                 </para>
                 <para>
                     <latex><![CDATA[ y(i_1,\ldots,i_{n-1},\mathbf{l},i_{n+1},\ldots) = \sum_{\mathbf{i_n}=1}^l x(i_1,\ldots,i_{n-1},\mathbf{i_n},i_{n+1},\ldots)]]></latex>
             </listitem>
             <listitem>
                 <para>
-                    <literal>y=cumsum(x,"m")</literal> is equivalent to <literal>y=cumsum(x,orientation)</literal> where <literal>orientation</literal> is the index of the first dimension of <literal>x</literal> that is greater than 1. This option is used for Matlab compatibility.
+                    <literal>y=cumsum(x,"m")</literal> is equivalent to <literal>y=cumsum(x,orientation)</literal> where <term>orientation</term> is the index of the first dimension of <term>x</term> that is greater than 1. This option is used for Matlab compatibility.
                 </para>
             </listitem>
         </itemizedlist>
         <para/>
         <para>
-            The <literal>outtype</literal> argument rules the way the summation is done: 
+            The <term>outtype</term> argument rules the way the summation is done:
         </para>
         <itemizedlist>
             <listitem>
             <listitem>
                 <para>For arrays of integers,</para>
                 <para>
-                    if <literal>outtype="native"</literal> the evaluation is done using integer computations (modulo 2^b, where b is the number of bits used), 
+                    if <literal>outtype="native"</literal> the evaluation is done using integer computations (modulo 2^b, where b is the number of bits used),
                 </para>
                 <para>
                     if <literal>outtype="double"</literal> the evaluation is done using floating point computations.
             <listitem>
                 <para>For arrays of booleans,</para>
                 <para>
-                    if <literal>outtype="native"</literal> the evaluation is done using boolean computations ( + is replaced by |), 
+                    if <literal>outtype="native"</literal> the evaluation is done using boolean computations ( + is replaced by |),
                 </para>
                 <para>
                     if <literal>outtype="double"</literal> the evaluation is done using floating point computations (%t values are replaced by 1 and %f values by 0).
             </listitem>
         </itemizedlist>
     </refsection>
-    <refsection>
+    
+    <refsection role="remark">
         <title>Remark</title>
         <para>
             This function applies, with identical rules to <link linkend="sparse">sparse matrices</link> and <link linkend="hypermat">hypermatrices</link>.
         </para>
     </refsection>
-    <refsection>
+    
+    <refsection role="examples">
         <title>Examples</title>
         <programlisting role="example"><![CDATA[
 A=[1,2;3,4];
@@ -182,6 +192,7 @@ cumsum(B) //evaluation in float
 cumsum(B,"native") //similar to or(B)
  ]]></programlisting>
     </refsection>
+    
     <refsection role="see also">
         <title>See Also</title>
         <simplelist type="inline">
index f9c3d1c..81b65de 100644 (file)
             y=cumsum(x,orientation,outtype)
         </synopsis>
     </refsynopsisdiv>
-    <refsection>
+    
+    <refsection role="parameters">
         <title>Paramètres</title>
         <variablelist>
             <varlistentry>
                 <term>x</term>
                 <listitem>
                     <para>un tableau de réels, de complexes, de booléens, de
-                        polynômes ou de fractions rationnelles. 
+                        polynômes ou de fractions rationnelles.
                     </para>
                 </listitem>
             </varlistentry>
@@ -41,7 +42,7 @@
                 <term>orientation</term>
                 <listitem>
                     <para>
-                        Cet argument peut être 
+                        Cet argument peut être
                     </para>
                     <itemizedlist>
                         <listitem>
@@ -61,7 +62,7 @@
                 <term>outtype</term>
                 <listitem>
                     <para>
-                        une chaîne de caractères pouvant prendre les valeurs <literal>"native"</literal> ou <literal>"double"</literal>. 
+                        une chaîne de caractères pouvant prendre les valeurs <literal>"native"</literal> ou <literal>"double"</literal>.
                     </para>
                 </listitem>
             </varlistentry>
     <refsection>
         <title>Description</title>
         <para>
-            Pour un tableau <literal>x</literal>,
-            <literal>y=cumsum(x)</literal> renvoie dans <literal>y</literal>
-            la somme cumulative de tous les éléments de
-            <literal>x</literal>. 
+            Renvoie la somme cumulée des éléments d'un tableau.
+            Pour un tableau <term>x</term>,
+            <literal>y=cumsum(x)</literal> renvoie une matrice <term>y</term>
+            de la même taille que <term>x</term>.
+            La valeur <literal>y(i)</literal> est la somme de tous les éléments de <literal>x(1:i)</literal>, <emphasis role="italic">i.e.</emphasis> :
+        </para>
+        <para>
+            <latex><![CDATA[ y(i) = \sum_{k=1}^i x(k)]]></latex>
         </para>
         <para>
             <literal>y=cumsum(x,orientation)</literal> retourne dans
-            <literal>y</literal> la somme cumulée des éléments de
-            <literal>x</literal> le long de la dimension donnée par le
-            paramètre <literal>orientation</literal>:
+            <term>y</term> la somme cumulée des éléments de
+            <term>x</term> le long de la dimension donnée par le
+            paramètre <term>orientation</term>:
         </para>
         <itemizedlist>
             <listitem>
                 <para>
-                    Si <literal>orientation</literal> est égal à 1 ou "r" alors : 
+                    Si <term>orientation</term> est égal à 1 ou "r" alors :
                 </para>
                 <para>
                     <latex><![CDATA[ y(\mathbf{l},j) = \sum_{\mathbf{i}=1}^l x(\mathbf{i},j)]]></latex>
             </listitem>
             <listitem>
                 <para>
-                    Si <literal>orientation</literal> est égal à 2 ou "c" alors : 
+                    Si <term>orientation</term> est égal à 2 ou "c" alors :
                 </para>
                 <para>
                     <latex><![CDATA[ y(i,\mathbf{l}) = \sum_{\mathbf{j}=1}^l x(i,{\mathbf{j})]]></latex>
             </listitem>
             <listitem>
                 <para>
-                    Si <literal>orientation</literal> est égal à n alors : 
+                    Si <term>orientation</term> est égal à n alors :
                 </para>
                 <para>
                     <latex><![CDATA[ y(i_1,\ldots,i_{n-1},\mathbf{l},i_{n+1},\ldots) = \sum_{\mathbf{i_n}=1}^l x(i_1,\ldots,i_{n-1},\mathbf{i_n},i_{n+1},\ldots)]]></latex>
             </listitem>
             <listitem>
                 <para>
-                    <literal>y=cumsum(x,"*")</literal> est équivalent à <literal>y=cumsum(x)</literal> 
+                    <literal>y=cumsum(x,"*")</literal> est équivalent à <literal>y=cumsum(x)</literal>
                 </para>
             </listitem>
             <listitem>
                 <para>
                     <literal>y=cumsum(x,"m")</literal> est équivalent à
                     <literal>y=cumsum(x,orientation)</literal> où
-                    <literal>orientation</literal> est l'index de la première
-                    dimension de <literal>x</literal> qui est plus grande que
-                    1. Cette option est utilisé pour la compatibilité avec Matlab. 
+                    <term>orientation</term> est l'index de la première
+                    dimension de <term>x</term> qui est plus grande que
+                    1. Cette option est utilisé pour la compatibilité avec Matlab.
                 </para>
             </listitem>
         </itemizedlist>
         <para>
-            L'argument <literal>outtype</literal> gère la façon dont le produit est réalisé :
+            L'argument <term>outtype</term> gère la façon dont le produit est réalisé :
         </para>
         <itemizedlist>
             <listitem>
-                <para>Pour les matrices de doubles, de polynômes, de fractions rationnelles, 
+                <para>Pour les matrices de doubles, de polynômes, de fractions rationnelles,
                     l'évaluation est toujours effetuée sur des nombres à virgule flottante.
-                    Les options <literal>"double"</literal> ou <literal>"native"</literal> sont équivalentes 
+                    Les options <literal>"double"</literal> ou <literal>"native"</literal> sont équivalentes
                     (par défaut, <literal>outtype = "double"</literal>).
                 </para>
             </listitem>
                     (modulo 2^b, où b est le nombre de bits utilisés).
                 </para>
                 <para>
-                    si <literal>outtype="double"</literal>, le calcul est effectué sur 
+                    si <literal>outtype="double"</literal>, le calcul est effectué sur
                     des nombres à virgule flottante.
                 </para>
                 <para>
             <listitem>
                 <para>Pour les tableaux de booléens,</para>
                 <para>
-                    si <literal>outtype="native"</literal>, le calcul est effectué sur des booléens 
+                    si <literal>outtype="native"</literal>, le calcul est effectué sur des booléens
                     (* est remplacée par &amp;),
                 </para>
                 <para>
-                    si <literal>outtype="double"</literal>, le calcul est effectué sur des nombres 
+                    si <literal>outtype="double"</literal>, le calcul est effectué sur des nombres
                     à virgule flottante (%t est remplacé par 1 et %f par 0).
                 </para>
                 <para>
     </refsection>
     <refsection>
         <title>Exemples</title>
-        <programlisting role="example"><![CDATA[ 
+        <programlisting role="example"><![CDATA[
 A=[1,2;3,4];
 cumsum(A)
 cumsum(A,1)
index a6e2855..ac3be44 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" xmlns:scilab="http://www.scilab.org" xml:id="cumsum" xml:lang="ja">
     
     <refnamediv>
-        
         <refname>cumsum</refname>
-        
         <refpurpose>配列要素の累積和</refpurpose>
-        
     </refnamediv>
     
     <refsynopsisdiv>
-        
         <title>呼び出し手順</title>
-        
-        <synopsis>y=cumsum(x)</synopsis>
-        
-        <synopsis>y=cumsum(x,orientation)</synopsis>
-        
-        <synopsis>y=cumsum(x,outtype)</synopsis>
-        
-        <synopsis>y=cumsum(x,orientation,outtype)</synopsis>
-        
+        <synopsis>
+            y=cumsum(x)
+            y=cumsum(x,orientation)
+            y=cumsum(x,outtype)
+            y=cumsum(x,orientation,outtype)
+        </synopsis>
     </refsynopsisdiv>
     
-    <refsection>
-        
+    <refsection role="parameters">
         <title>引数</title>
-        
         <variablelist>
-            
             <varlistentry>
-                
                 <term>x</term>
-                
                 <listitem>
-                    
                     <para>
-                        
                         実数,複素数,論理値,多項式または有理数の配列
-                        
                     </para>
-                    
                 </listitem>
-                
             </varlistentry>
-            
             <varlistentry>
-                
                 <term>orientation</term>
-                
                 <listitem>
-                    
                     <para>
-                        
                         以下のどちらかを指定します
-                        
                     </para>
-                    
                     <itemizedlist>
-                        
                         <listitem>
-                            
                             <para>
-                                
                                 文字列で,指定可能な値は
-                                
-                                <literal>"*"</literal>, <literal>"r"</literal>, 
-                                
+                                <literal>"*"</literal>, <literal>"r"</literal>,
                                 <literal>"c"</literal> または  <literal>"m"</literal>
-                                
                             </para>
-                            
                         </listitem>
-                        
                         <listitem>
-                            
                             <para>正の整数値</para>
-                            
                         </listitem>
-                        
                     </itemizedlist>
-                    
                 </listitem>
-                
             </varlistentry>
-            
             <varlistentry>
-                
                 <term>outtype</term>
-                
                 <listitem>
-                    
                     <para>
-                        
                         文字列で,指定可能な値は
-                        
                         <literal>"native"</literal> または
-                        
-                        <literal>"double"</literal>. 
-                        
+                        <literal>"double"</literal>.
                     </para>
-                    
                 </listitem>
-                
             </varlistentry>
-            
             <varlistentry>
-                
                 <term>y</term>
-                
                 <listitem>
-                    
                     <para>スカラーまたは配列</para>
-                    
                 </listitem>
-                
             </varlistentry>
-            
         </variablelist>
-        
     </refsection>
     
-    <refsection>
-        
+    <refsection role="description">
         <title>説明</title>
-        
         <para>
-            
-            <literal>x</literal>は配列の場合,<literal>y=cumsum(x)</literal> は,
-            
-            <literal>x</literal>の全要素の累積和を
-            
-            スカラー<literal>y</literal>に返します. 
-            
+            <term>x</term>は配列の場合,<literal>y=cumsum(x)</literal> は,
+            <term>x</term>の全要素の累積和を
+            スカラー<term>y</term>に返します:
         </para>
-        
         <para>
-            
             <literal>y=cumsum(x,orientation)</literal> は
-            
-            <literal>orientation</literal>により指定された次元方向の
-            
-            <literal>x</literal> の累積和を<literal>y</literal>に返します:
-            
+            <term>orientation</term>により指定された次元方向の
+            <term>x</term> の累積和を<term>y</term>に返します:
+        </para>
+        <para>
+            <latex><![CDATA[ y(i) = \sum_{k=1}^i x(k)]]></latex>
         </para>
-        
         <itemizedlist>
-            
             <listitem>
-                
                 <para>
-                    
-                    <literal>orientation</literal> が 1 または "r" の場合: 
-                    
+                    <term>orientation</term> が 1 または "r" の場合:
                 </para>
-                
                 <para>
-                    
                     <latex><![CDATA[ y(\mathbf{l},j) = \sum_{\mathbf{i}=1}^l x(\mathbf{i},j)]]></latex>
-                    
                 </para>
-                
                 <para>または </para>
-                
                 <para>
-                    
                     <latex><![CDATA[ y(\mathbf{l},j,k,\ldots) = \sum_{\mathbf{i}=1}^l x(\mathbf{i},j,k,\ldots)]]></latex>
-                    
                 </para>
-                
             </listitem>
-            
             <listitem>
-                
                 <para>
-                    
-                    <literal>orientation</literal> が 2 または "c" の場合: 
-                    
+                    <term>orientation</term> が 2 または "c" の場合:
                 </para>
-                
                 <para>
-                    
                     <latex><![CDATA[ y(i,\mathbf{l}) = \sum_{\mathbf{j}=1}^l x(i,{\mathbf{j})]]></latex>
-                    
                 </para>
-                
                 <para> または </para>
-                
                 <para>
-                    
                     <latex><![CDATA[ y(i,\mathbf{l},k,\ldots) = \sum_{\mathbf{j}=1}^l x(i,\mathbf{j},k,\ldots)]]></latex>
-                    
                 </para>
-                
             </listitem>
-            
             <listitem>
-                
                 <para>
-                    
-                    <literal>orientation</literal> が n の場合: 
-                    
+                    <term>orientation</term> が n の場合:
                 </para>
-                
                 <para>
-                    
                     <latex><![CDATA[ y(i_1,\ldots,i_{n-1},\mathbf{l},i_{n+1},\ldots) = \sum_{\mathbf{i_n}=1}^l x(i_1,\ldots,i_{n-1},\mathbf{i_n},i_{n+1},\ldots)]]></latex>
-                    
                 </para>
-                
             </listitem>
-            
             <listitem>
-                
                 <para>
-                    
                     <literal>y=cumsum(x,"*")</literal> は
-                    
                     <literal>y=cumsum(x)</literal>と等価です.
-                    
                 </para>
-                
             </listitem>
-            
             <listitem>
-                
                 <para>
-                    
                     <literal>y=cumsum(x,"m")</literal> は
-                    
                     <literal>y=cumsum(x,orientation)</literal> と等価です.
-                    
                     ただし, <literal>orientation</literal> は
-                    
-                    <literal>x</literal>の1より大きい最初の次元の添字です.
-                    
+                    <term>x</term>の1より大きい最初の次元の添字です.
                     このオプションはMatlabとの互換性のために使用されます.
-                    
                 </para>
-                
             </listitem>
-            
         </itemizedlist>
-        
         <para/>
-        
         <para>
-            
-            <literal>outtype</literal>引数は総和の動作を指定します:
-            
+            <term>outtype</term>引数は総和の動作を指定します:
         </para>
-        
         <itemizedlist>
-            
             <listitem>
-                
                 <para>
-                    
                     float, 多項式 有理数の配列の場合, 評価は浮動小数点演算により
-                    
                     行われます.
-                    
                     <literal>"double"</literal> または <literal>"native"</literal>
-                    
                     オプションは等価です.
-                    
                 </para>
-                
             </listitem>
-            
             <listitem>
-                
                 <para>整数の配列の場合,</para>
-                
                 <para>
-                    
                     <literal>outtype="native"</literal>の時,
-                    
                     評価は整数演算(モジュロ 2^b, ただし b は使用されるビット数)で行われます,
-                    
                 </para>
-                
                 <para>
-                    
                     <literal>outtype="double"</literal>の時,評価は浮動小数点演算により
-                    
                     行われます.
-                    
                 </para>
-                
                 <para>
-                    
                     デフォルト値は <literal>outtype="native"</literal>です.
-                    
                 </para>
-                
             </listitem>
-            
             <listitem>
-                
                 <para>論理値の配列の場合,</para>
-                
                 <para>
-                    
                     <literal>outtype="native"</literal>の時,評価は論理値演算
-                    
                     (+ は | で置換)により行われます,
-                    
                 </para>
-                
                 <para>
-                    
                     <literal>outtype="double"</literal>の時,評価は
-                    
                     浮動小数点演算(%t は 1, %f は 0で置換)により行われます.
-                    
                 </para>
-                
                 <para>
-                    
                     デフォルト値は<literal>outtype="double"</literal>です.
-                    
                 </para>
-                
             </listitem>
-            
         </itemizedlist>
-        
     </refsection>
     
-    <refsection>
-        
+    <refsection role="remark">
         <title>注意</title>
-        
         <para>
-            
             この関数には,
-            
             <link linkend="sparse">疎行列</link> および
-            
             <link linkend="hypermat">ハイパー行列</link>と
-            
             同じ規則が適用されます.
-            
         </para>
-        
     </refsection>
     
-    <refsection>
-        
+    <refsection role="examples">
         <title>例</title>
-        
         <programlisting role="example"><![CDATA[
 A=[1,2;3,4];
 cumsum(A)
 cumsum(A,1)
-
 I=uint8([2 95 103;254 9 0])
 cumsum(I) //native evaluation
 cumsum(I,"double")
 cumsum(I,2,"double")
-
 s=poly(0,"s");
 P=[s,%i+s;s^2,1];
 cumsum(P),
 cumsum(P,2)
-
 B=[%t %t %f %f];
 cumsum(B) //evaluation in float
 cumsum(B,"native") //similar to or(B)
  ]]></programlisting>
-        
     </refsection>
     
     <refsection role="see also">
-        
         <title>参照</title>
-        
         <simplelist type="inline">
-            
             <member>
-                
                 <link linkend="sum">sum</link>
-                
             </member>
-            
             <member>
-                
                 <link linkend="cumprod">cumprod</link>
-                
             </member>
-            
         </simplelist>
-        
     </refsection>
     
 </refentry>
-
index 8d09e7f..72f6107 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:ns4="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="cumsum" xml:lang="en">
+    
     <refnamediv>
         <refname>cumsum</refname>
         <refpurpose>soma cumulativa</refpurpose>
     </refnamediv>
+    
     <refsynopsisdiv>
         <title>Seqüência de Chamamento</title>
         <synopsis>y=cumsum(x)
@@ -25,7 +27,8 @@
             y=cumsum(x,'c') or y=cumsum(x,2)
         </synopsis>
     </refsynopsisdiv>
-    <refsection>
+    
+    <refsection role="parameters">
         <title>Parâmetros</title>
         <variablelist>
             <varlistentry>
             </varlistentry>
         </variablelist>
     </refsection>
-    <refsection>
+    
+    <refsection role="description">
         <title>Descrição</title>
         <para>
-            Para um vetor ou uma matriz <literal>x</literal>,
-            <literal>y=cumsum(x)</literal> retorna em <literal>y</literal> a soma
-            cumulativa de todas as entradas de <literal>x</literal> tomadas coluna a
+            Para um vetor ou uma matriz <term>x</term>,
+            <literal>y=cumsum(x)</literal> retorna em <term>y</term> a soma
+            cumulativa de todas as entradas de <term>x</term> tomadas coluna a
             coluna.
         </para>
         <para>
-            <literal>y=cumsum(x,'c')</literal> (ou, equivalentemente,
-            <literal>y=cumsum(x,2)</literal>) retorna em <literal>y</literal> a soma
-            cumulativa das colunas de <literal>x</literal>: <literal>
-                y(i,:)=cumsum(x(i,:))
-            </literal>
+            <latex><![CDATA[ y(i) = \sum_{k=1}^i x(k)]]></latex>
         </para>
         <para>
             <literal>y=cumsum(x,'r')</literal> (ou, equivalentemente,
             <literal>y=cumsum(x,1)</literal>) retorna em <literal>y</literal> a soma
-            cumulativa das linhas de <literal>x</literal>: <literal>
+            cumulativa das linhas de <term>x</term>: <literal>
                 y(:,i)=cumsum(x(:,i))
             </literal>
         </para>
         <para>
+            <latex><![CDATA[ y(\mathbf{l},j) = \sum_{\mathbf{i}=1}^l x(\mathbf{i},j)]]></latex>
+        </para>
+        <para>or </para>
+        <para>
+            <latex><![CDATA[ y(\mathbf{l},j,k,\ldots) = \sum_{\mathbf{i}=1}^l x(\mathbf{i},j,k,\ldots)]]></latex>
+        </para>
+        <para>
+            <literal>y=cumsum(x,'c')</literal> (ou, equivalentemente,
+            <literal>y=cumsum(x,2)</literal>) retorna em <term>y</term> a soma
+            cumulativa das colunas de <term>x</term>: <literal>
+                y(i,:)=cumsum(x(i,:))
+            </literal>
+        </para>
+        <para>
+            <latex><![CDATA[ y(i,\mathbf{l}) = \sum_{\mathbf{j}=1}^l x(i,{\mathbf{j})]]></latex>
+        </para>
+        <para> or </para>
+        <para>
+            <latex><![CDATA[ y(i,\mathbf{l},k,\ldots) = \sum_{\mathbf{j}=1}^l x(i,\mathbf{j},k,\ldots)]]></latex>
+        </para>
+        <para>
+            if <term>orientation</term> is equal to n then:
+        </para>
+        <para>
+            <latex><![CDATA[ y(i_1,\ldots,i_{n-1},\mathbf{l},i_{n+1},\ldots) = \sum_{\mathbf{i_n}=1}^l x(i_1,\ldots,i_{n-1},\mathbf{i_n},i_{n+1},\ldots)]]></latex>
+        </para>
+        <para>
+            <literal>y=cumsum(x,"*")</literal> is equivalent to <literal>y=cumsum(x)</literal>
+        </para>
+        <para>
             <literal>y=cumsum(x,'m')</literal> é a soma cumulativa ao longo da
-            primeira dimensão "não-singleton" de <literal>x</literal> (para
+            primeira dimensão "não-singleton" de <term>x</term> (para
             compatibilidade com o Matlab).
         </para>
+        <para>
+            The <term>outtype</term> argument rules the way the summation is done:
+        </para>
+        <itemizedlist>
+            <listitem>
+                <para>
+                    For arrays of floats, of polynomials, of rational fractions, the evaluation is always done using floating points computations. The <literal>"double"</literal> or <literal>"native"</literal> options are equivalent.
+                </para>
+            </listitem>
+            <listitem>
+                <para>For arrays of integers,</para>
+                <para>
+                    if <literal>outtype="native"</literal> the evaluation is done using integer computations (modulo 2^b, where b is the number of bits used),
+                </para>
+                <para>
+                    if <literal>outtype="double"</literal> the evaluation is done using floating point computations.
+                </para>
+                <para>
+                    The default value is <literal>outtype="native"</literal>.
+                </para>
+            </listitem>
+            <listitem>
+                <para>For arrays of booleans,</para>
+                <para>
+                    if <literal>outtype="native"</literal> the evaluation is done using boolean computations ( + is replaced by |),
+                </para>
+                <para>
+                    if <literal>outtype="double"</literal> the evaluation is done using floating point computations (%t values are replaced by 1 and %f values by 0).
+                </para>
+                <para>
+                    The default value is <literal>outtype="double"</literal>.
+                </para>
+            </listitem>
+        </itemizedlist>
+    </refsection>
+    
+    <refsection role="remark">
+        <title>Remark</title>
+        <para>
+            This function applies, with identical rules to <link linkend="sparse">sparse matrices</link> and <link linkend="hypermat">hypermatrices</link>.
+        </para>
     </refsection>
-    <refsection>
+    
+    <refsection role="examples">
         <title>Exemplos</title>
-        <programlisting role="example"><![CDATA[ 
+        <programlisting role="example"><![CDATA[
 A=[1,2;3,4];
 cumsum(A)
 cumsum(A,'r')
@@ -84,6 +156,7 @@ w(1,:)=a(1,:);
 for k=2:m;w(k,:)=w(k-1,:)+a(k,:);end;w-cumsum(a,'r')
  ]]></programlisting>
     </refsection>
+    
     <refsection role="see also">
         <title>Ver Também</title>
         <simplelist type="inline">
@@ -95,4 +168,5 @@ for k=2:m;w(k,:)=w(k-1,:)+a(k,:);end;w-cumsum(a,'r')
             </member>
         </simplelist>
     </refsection>
+    
 </refentry>
index 62a978f..fa4c4a9 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" xml:id="cumsum" xml:lang="ru">
+    
     <refnamediv>
         <refname>cumsum</refname>
         <refpurpose>суммирование элементов массива с накоплением</refpurpose>
     </refnamediv>
+    
     <refsynopsisdiv>
         <title>Последовательность вызова</title>
         <synopsis>y=cumsum(x)</synopsis>
         <synopsis>y=cumsum(x,outtype)</synopsis>
         <synopsis>y=cumsum(x,orientation,outtype)</synopsis>
     </refsynopsisdiv>
-    <refsection>
+    
+    <refsection role="parameters">
         <title>Аргументы</title>
         <variablelist>
             <varlistentry>
                 <term>x</term>
                 <listitem>
                     <para>
-                        массив вещественных, комплексных, логических значений, а также полиномов или 
+                        массив вещественных, комплексных, логических значений, а также полиномов или
                         рациональных дробей.
                     </para>
                 </listitem>
@@ -59,8 +62,8 @@
                 <term>outtype</term>
                 <listitem>
                     <para>
-                        тип на выходе: строка с возможными значениями: 
-                        <literal>"native"</literal> или <literal>"double"</literal>. 
+                        тип на выходе: строка с возможными значениями:
+                        <literal>"native"</literal> или <literal>"double"</literal>.
                     </para>
                 </listitem>
             </varlistentry>
             </varlistentry>
         </variablelist>
     </refsection>
-    <refsection>
+    
+    <refsection role="description">
         <title>Описание</title>
         <para>
-            Для массива <literal>x</literal>, <literal>y=cumsum(x)</literal> возвращает скаляр 
-            <literal>y</literal>, представляющий сумму всех элементов <literal>x</literal> с
+            Для массива <term>x</term>, <literal>y=cumsum(x)</literal> возвращает скаляр
+            <term>y</term>, представляющий сумму всех элементов <term>x</term> с
             накоплением.
         </para>
         <para>
-            <literal>y=cumsum(x,orientation)</literal> возвращает в <literal>y</literal>
-            сумму элементов <literal>x</literal> с накоплением по заданной размерности
-            <literal>orientation</literal>: 
+            <literal>y=cumsum(x,orientation)</literal> возвращает в <term>y</term>
+            сумму элементов <term>x</term> с накоплением по заданной размерности
+            <term>orientation</term>:
+        </para>
+        <para>
+            <latex><![CDATA[ y(i) = \sum_{k=1}^i x(k)]]></latex>
         </para>
         <itemizedlist>
             <listitem>
                 <para>
-                    если <literal>orientation</literal> равна 1 или "r", то: 
+                    если <term>orientation</term> равна 1 или "r", то:
                 </para>
                 <para>
                     <latex><![CDATA[ y(\mathbf{l},j) = \sum_{\mathbf{i}=1}^l x(\mathbf{i},j)]]></latex>
             </listitem>
             <listitem>
                 <para>
-                    если <literal>orientation</literal> равна 2 или "c", то: 
+                    если <term>orientation</term> равна 2 или "c", то:
                 </para>
                 <para>
                     <latex><![CDATA[ y(i,\mathbf{l}) = \sum_{\mathbf{j}=1}^l x(i,{\mathbf{j})]]></latex>
             </listitem>
             <listitem>
                 <para>
-                    если <literal>orientation</literal> равна n, то: 
+                    если <term>orientation</term> равна n, то:
                 </para>
                 <para>
                     <latex><![CDATA[ y(i_1,\ldots,i_{n-1},\mathbf{l},i_{n+1},\ldots) = \sum_{\mathbf{i_n}=1}^l x(i_1,\ldots,i_{n-1},\mathbf{i_n},i_{n+1},\ldots)]]></latex>
         </itemizedlist>
         <para/>
         <para>
-            Аргумент <literal>outtype</literal> управляет способом, которым производится суммирование: 
+            Аргумент <term>outtype</term> управляет способом, которым производится суммирование:
         </para>
         <itemizedlist>
             <listitem>
                 <para>
-                    Для массивов чисел с плавающей запятой, полиномов, рациональных дробей 
+                    Для массивов чисел с плавающей запятой, полиномов, рациональных дробей
                     вычисление всегда делается через вычисления с плавающей запятой.
-                    Опции <literal>"double"</literal> и <literal>"native"</literal> ("естественное") 
+                    Опции <literal>"double"</literal> и <literal>"native"</literal> ("естественное")
                     эквивалентны.
                 </para>
             </listitem>
                 <para>
                     если <literal>outtype="native"</literal> ("естественное"), то вычисление делается через целочисленные вычисления (по модулю 2^b, где b - число используемых битов);
                 </para>
-                <para> 
-                    если <literal>outtype="double"</literal>, то вычисление делается через вычисления 
+                <para>
+                    если <literal>outtype="double"</literal>, то вычисление делается через вычисления
                     с плавающей запятой.
                 </para>
                 <para>
             </listitem>
             <listitem>
                 <para>Для массивов логических значений:</para>
-                <para> 
-                    если <literal>outtype="native"</literal> ("естественное"), то вычисления делаются 
+                <para>
+                    если <literal>outtype="native"</literal> ("естественное"), то вычисления делаются
                     с помощью  булевой алгебры (+ заменяется на |),
                 </para>
-                <para> 
+                <para>
                     если <literal>outtype="double"</literal>, то вычисление  делается через вычисления
                     с плавающей запятой (значения %t заменяются на 1, а значения %f - на 0).
                 </para>
             </listitem>
         </itemizedlist>
     </refsection>
-    <refsection>
+    
+    <refsection role="remark">
         <title>Примечание</title>
         <para>
-            Эта функция применяется с аналогичными правилами к <link linkend="sparse">разряжённым 
+            Эта функция применяется с аналогичными правилами к <link linkend="sparse">разряжённым
                 матрицам
             </link>
             и <link linkend="hypermat">гиперматрицам</link>.
         </para>
     </refsection>
-    <refsection>
+    
+    <refsection role="examples">
         <title>Примеры</title>
         <programlisting role="example"><![CDATA[
 A=[1,2;3,4];
 cumsum(A)
 cumsum(A,1)
+
 I=uint8([2 95 103;254 9 0])
 cumsum(I) //естественное вычисление
 cumsum(I,"double")
 cumsum(I,2,"double")
+
 s=poly(0,"s");
 P=[s,%i+s;s^2,1];
 cumsum(P),
 cumsum(P,2)
+
 B=[%t %t %f %f];
 cumsum(B) //вычисление с плавающей запятой
 cumsum(B,"native") //аналогично or(B)
  ]]></programlisting>
     </refsection>
+    
     <refsection role="see also">
         <title>Смотрите также</title>
         <simplelist type="inline">
index 15ecaf2..7a1c67a 100644 (file)
@@ -429,11 +429,12 @@ _LaTeX_cumprod.xml_2.png=dce716c26ba9ee77970d59e48cbec6ea
 _LaTeX_cumprod.xml_3.png=dac1eef2ec85e26d497e63441494fb62
 _LaTeX_cumprod.xml_4.png=d82dfaf597c37928175acc260e516802
 _LaTeX_cumprod.xml_5.png=2557e0856332b1a8e4a4328a56e057fd
-_LaTeX_cumsum.xml_1.png=23dfe1e8f3cffd55bfcdf54e31c7c1cc
-_LaTeX_cumsum.xml_2.png=4c76951440e86518a6c419fb7c536c05
-_LaTeX_cumsum.xml_3.png=c9333b61aa171fd3a354f95f095d39eb
-_LaTeX_cumsum.xml_4.png=83945d3c6a18056a1fcd585d40e11705
-_LaTeX_cumsum.xml_5.png=1e00ceeb4652920c0f75ee7c5ee7f525
+_LaTeX_cumsum.xml_1.png=d3b46046b899184c069d6938b393faa2
+_LaTeX_cumsum.xml_2.png=23dfe1e8f3cffd55bfcdf54e31c7c1cc
+_LaTeX_cumsum.xml_3.png=4c76951440e86518a6c419fb7c536c05
+_LaTeX_cumsum.xml_4.png=c9333b61aa171fd3a354f95f095d39eb
+_LaTeX_cumsum.xml_5.png=83945d3c6a18056a1fcd585d40e11705
+_LaTeX_cumsum.xml_6.png=1e00ceeb4652920c0f75ee7c5ee7f525
 _LaTeX_damp.xml_1.png=f2c8fd47d5a080d24791f46bc185c706
 _LaTeX_damp.xml_2.png=195246810f9bfc228bca491859062b14
 _LaTeX_damp.xml_3.png=f2c8fd47d5a080d24791f46bc185c706
index 21524ef..db761db 100644 (file)
Binary files a/scilab/modules/helptools/images/_LaTeX_cumsum.xml_1.png and b/scilab/modules/helptools/images/_LaTeX_cumsum.xml_1.png differ
index 90e759c..ce074f5 100644 (file)
Binary files a/scilab/modules/helptools/images/_LaTeX_cumsum.xml_2.png and b/scilab/modules/helptools/images/_LaTeX_cumsum.xml_2.png differ
index 6f1603c..3436458 100644 (file)
Binary files a/scilab/modules/helptools/images/_LaTeX_cumsum.xml_3.png and b/scilab/modules/helptools/images/_LaTeX_cumsum.xml_3.png differ
index b977113..a436093 100644 (file)
Binary files a/scilab/modules/helptools/images/_LaTeX_cumsum.xml_4.png and b/scilab/modules/helptools/images/_LaTeX_cumsum.xml_4.png differ
index e10eef6..4a8a92f 100644 (file)
Binary files a/scilab/modules/helptools/images/_LaTeX_cumsum.xml_5.png and b/scilab/modules/helptools/images/_LaTeX_cumsum.xml_5.png differ
diff --git a/scilab/modules/helptools/images/_LaTeX_cumsum.xml_6.png b/scilab/modules/helptools/images/_LaTeX_cumsum.xml_6.png
new file mode 100644 (file)
index 0000000..3f5b5e3
Binary files /dev/null and b/scilab/modules/helptools/images/_LaTeX_cumsum.xml_6.png differ