Revert "* Bug #13839 fixed - sign() could not be used with sparse matrices * sign... 15/17915/1
Pierre-Aime AGNEL [Fri, 11 Mar 2016 16:00:17 +0000 (17:00 +0100)]
This reverts commit 8ace9440383b7760fcb3c9ebcd26e7445d6237b3.

Change-Id: I03479e65a8a8ad5175afebef2e4a09ee0049f3a3

scilab/CHANGES
scilab/modules/elementary_functions/help/en_US/sign.xml
scilab/modules/elementary_functions/help/fr_FR/sign.xml
scilab/modules/elementary_functions/help/ja_JP/sign.xml
scilab/modules/elementary_functions/help/pt_BR/sign.xml
scilab/modules/elementary_functions/help/ru_RU/sign.xml
scilab/modules/elementary_functions/tests/nonreg_tests/bug_13839.dia.ref [deleted file]
scilab/modules/elementary_functions/tests/nonreg_tests/bug_13839.tst [deleted file]
scilab/modules/overloading/macros/%sp_sign.sci [deleted file]

index a29d086..b25b6c9 100644 (file)
@@ -109,7 +109,6 @@ Other feature additions
 
 * typeof(.., "overload") allows now to get the overloading type-code of an object
 
-* sign() can now handle a sparse matrix.
 
 Installation
 ============
@@ -318,8 +317,6 @@ In 6.0.0:
 
 * Bug #13810 fixed - householder(v, k*v) returned column of %nan. Input parameters were not checked. The Householder matrix could not be returned. Help pages were inaccurate and without examples. There was no householder() demo.
 
-* Bug #13839 fixed - sign() could not be used with sparse matrices
-
 * Bug #13869 fixed - bench_run with option nb_run=10 did not override the NB RUN tags
 
 * Bug #13965 fixed - The rendering of histograms with histplot() was poor
index 764207e..c62476e 100644 (file)
     </refnamediv>
     <refsynopsisdiv>
         <title>Syntax</title>
-        <synopsis>X = sign(A)</synopsis>
+        <synopsis>X=sign(A)</synopsis>
     </refsynopsisdiv>
-    <refsection role="parameters">
+    <refsection>
         <title>Arguments</title>
         <variablelist>
             <varlistentry>
                 <term>А</term>
                 <listitem>
-                    <para>real or complex matrix. <varname>A</varname> may be sparse.</para>
+                    <para>real or complex matrix</para>
                 </listitem>
             </varlistentry>
             <varlistentry>
             </varlistentry>
         </variablelist>
     </refsection>
-    <refsection role="description">
+    <refsection>
         <title>Description</title>
         <para>
-            <literal>X = sign(A)</literal> returns the matrix made of the signs of
+            <literal>X=sign(A)</literal> returns the matrix made of the signs of
             <literal>A(i,j)</literal>. For complex <literal>A</literal>,
             <literal>sign(A) = A./abs(A)</literal>.
         </para>
     </refsection>
-    <refsection role="examples">
+    <refsection>
         <title>Examples</title>
-        <programlisting role="example"><![CDATA[
+        <programlisting role="example"><![CDATA[ 
 sign(rand(2,3))
 sign(1+%i)
-sign(sprand(8,3,0.3,"normal"))
  ]]></programlisting>
     </refsection>
     <refsection role="see also">
@@ -69,14 +68,4 @@ sign(sprand(8,3,0.3,"normal"))
             </member>
         </simplelist>
     </refsection>
-    <refsection role="history">
-        <title>History</title>
-        <revhistory>
-            <revision>
-                <revnumber>6.0</revnumber>
-                <revdescription>Extension to sparse matrices
-                </revdescription>
-            </revision>
-        </revhistory>
-    </refsection>
 </refentry>
index 5ea3c50..d0bc9ef 100644 (file)
@@ -1,58 +1,22 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2008 - INRIA
- * Copyright (C) 2015 - 2016 - Samuel GOUGEON
- * Copyright (C) 2012 - 2016 - Scilab Enterprises
- *
- * This file is hereby licensed under the terms of the GNU GPL v2.0,
- * pursuant to article 5.3.4 of the CeCILL v.2.1.
- * This file was originally licensed under the terms of the CeCILL v2.1,
- * and continues to be available under such terms.
- * For more information, see the COPYING file which you should have received
- * along with this program.
- *
- -->
 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="sign" xml:lang="fr">
     <refnamediv>
         <refname>sign</refname>
         <refpurpose>fonction signe</refpurpose>
     </refnamediv>
-    <refsynopsisdiv>
-        <title>Syntaxe</title>
-        <synopsis>X = sign(A)</synopsis>
-    </refsynopsisdiv>
-    <refsection role="parameters">
-        <title>Paramètres</title>
-        <variablelist>
-            <varlistentry>
-                <term>А</term>
-                <listitem>
-                    <para>matrice de nombres réels ou complexes, d'encodage dense ou creux.</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>X</term>
-                <listitem>
-                    <para>matrice de nombres réels ou complexes.</para>
-                </listitem>
-            </varlistentry>
-        </variablelist>
-    </refsection>
-    <refsection role="description">
+    <refsection>
         <title>Description</title>
         <para>
-            <literal>X = sign(A)</literal> renvoie la matrice contenant les signes
-            de termes <literal>A(i,j)</literal>. Pour les matrices de nombres
-            complexes, <literal>sign(A) = A./abs(A)</literal>.
+            <literal>X=sign(A)</literal> renvoie la matrice contenant les signes
+            de termes <literal>A(i,j)</literal>. Pour les matrices complexes,
+            <literal>sign(A) = A./abs(A)</literal>.
         </para>
     </refsection>
-    <refsection role="examples">
+    <refsection>
         <title>Exemples</title>
-        <programlisting role="example"><![CDATA[
+        <programlisting role="example"><![CDATA[ 
 sign(rand(2,3))
 sign(1+%i)
-sign(sprand(8,3,0.3,"normal"))
  ]]></programlisting>
     </refsection>
     <refsection role="see also">
@@ -63,14 +27,4 @@ sign(sprand(8,3,0.3,"normal"))
             </member>
         </simplelist>
     </refsection>
-    <refsection role="history">
-        <title>Historique</title>
-        <revhistory>
-            <revision>
-                <revnumber>6.0</revnumber>
-                <revdescription>Extension aux matrices creuses
-                </revdescription>
-            </revision>
-        </revhistory>
-    </refsection>
 </refentry>
index 1318081..d512ac9 100644 (file)
@@ -3,7 +3,7 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2008 - INRIA
- * Copyright (C) 2015 - 2016 - Samuel GOUGEON
+ * 
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
  * along with this program.
  *
  -->
+
 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="sign" xml:lang="ja">
+    
     <refnamediv>
+        
         <refname>sign</refname>
+        
         <refpurpose>符号関数</refpurpose>
+        
     </refnamediv>
+    
     <refsynopsisdiv>
+        
         <title>呼び出し手順</title>
-        <synopsis>X = sign(A)</synopsis>
+        
+        <synopsis>X=sign(A)</synopsis>
+        
     </refsynopsisdiv>
-    <refsection role="parameters">
+    
+    <refsection>
+        
         <title>引数</title>
+        
         <variablelist>
+            
             <varlistentry>
+                
                 <term>A</term>
+                
                 <listitem>
-                    <para>実数または複素数の行列. <varname>A</varname> may be sparse.</para>
+                    
+                    <para>実数または複素数の行列</para>
+                    
                 </listitem>
+                
             </varlistentry>
+            
             <varlistentry>
+                
                 <term>X</term>
+                
                 <listitem>
+                    
                     <para>実数または複素数の行列</para>
+                    
                 </listitem>
+                
             </varlistentry>
+            
         </variablelist>
+        
     </refsection>
-    <refsection role="description">
+    
+    <refsection>
+        
         <title>説明</title>
+        
         <para>
-            <literal>X = sign(A)</literal> は
+            
+            <literal>X=sign(A)</literal> は
+            
             <literal>A(i,j)</literal>の符号からなる行列を返します.
-            <literal>A</literal>が複素数の場合,
+            
+            <literal>A</literal>が複素数の場合, 
+            
             <literal>sign(A) = A./abs(A)</literal> 関数となります.
+            
         </para>
+        
     </refsection>
-    <refsection role="examples">
+    
+    <refsection>
+        
         <title>例</title>
-        <programlisting role="example"><![CDATA[
+        
+        <programlisting role="example"><![CDATA[ 
 sign(rand(2,3))
 sign(1+%i)
-sign(sprand(8,3,0.3,"normal"))
  ]]></programlisting>
+        
     </refsection>
+    
     <refsection role="see also">
+        
         <title>参照</title>
+        
         <simplelist type="inline">
+            
             <member>
+                
                 <link linkend="abs">abs</link>
+                
             </member>
+            
             <member>
+                
                 <link linkend="csgn">csgn</link>
+                
             </member>
+            
             <member>
+                
                 <link linkend="signm">signm</link>
+                
             </member>
+            
         </simplelist>
+        
     </refsection>
-    <refsection role="history">
-        <title>履歴</title>
-        <revhistory>
-            <revision>
-                <revnumber>6.0</revnumber>
-                <revdescription>Extension to sparse matrices
-                </revdescription>
-            </revision>
-        </revhistory>
-    </refsection>
+    
 </refentry>
+
index 82095a6..2ac746d 100644 (file)
@@ -1,7 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="ISO-8859-1"?>
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2008 - INRIA
+ * 
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="sign" xml:lang="pt">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns: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="sign" xml:lang="en">
     <refnamediv>
         <refname>sign</refname>
-        <refpurpose>função de sinal</refpurpose>
+        <refpurpose>função de sinal</refpurpose>
     </refnamediv>
-    <refsynopsisdiv>
-        <title>Seqüência de Chamamento</title>
-        <synopsis>X = sign(A)</synopsis>
-    </refsynopsisdiv>
-    <refsection role="parameters">
-        <title>Parâmetros</title>
-        <variablelist>
-            <varlistentry>
-                <term>?</term>
-                <listitem>
-                    <para>real or complex matrix. <varname>A</varname> may be sparse.</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>X</term>
-                <listitem>
-                    <para>real or complex matrix</para>
-                </listitem>
-            </varlistentry>
-        </variablelist>
-    </refsection>
-    <refsection role="description">
-        <title>Descrição</title>
+    <refsection>
+        <title>Descrição</title>
         <para>
-            <literal>X = sign(A)</literal> retorna a matriz feita dos sinais de
+            <literal>X=sign(A)</literal> retorna a matriz feita dos sinais de
             <literal>A(i,j)</literal>. Para <literal>A</literal>, feita de complexos
             <literal>sign(A) = A./abs(A)</literal>.
         </para>
     </refsection>
-    <refsection role="examples">
+    <refsection>
         <title>Exemplos</title>
-        <programlisting role="example"><![CDATA[
+        <programlisting role="example"><![CDATA[ 
 sign(rand(2,3))
 sign(1+%i)
-sign(sprand(8,3,0.3,"normal"))
  ]]></programlisting>
     </refsection>
     <refsection role="see also">
-        <title>Ver Também</title>
+        <title>Ver Também</title>
         <simplelist type="inline">
             <member>
                 <link linkend="abs">abs</link>
             </member>
         </simplelist>
     </refsection>
-    <refsection role="history">
-        <title>Histórico</title>
-        <revhistory>
-            <revision>
-                <revnumber>6.0</revnumber>
-                <revdescription>Extension to sparse matrices
-                </revdescription>
-            </revision>
-        </revhistory>
-    </refsection>
 </refentry>
index ea02cc1..90bc95f 100644 (file)
@@ -2,7 +2,7 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2008 - INRIA
- *
+ * 
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
     </refnamediv>
     <refsynopsisdiv>
         <title>Последовательность вызова</title>
-        <synopsis>X = sign(A)</synopsis>
+        <synopsis>X=sign(A)</synopsis>
     </refsynopsisdiv>
-    <refsection role="parameters">
+    <refsection>
         <title>Аргументы</title>
         <variablelist>
             <varlistentry>
                 <term>А</term>
                 <listitem>
-                    <para>вещественная или комплексная матрица. <varname>A</varname> may be sparse.</para>
+                    <para>вещественная или комплексная матрица</para>
                 </listitem>
             </varlistentry>
             <varlistentry>
             </varlistentry>
         </variablelist>
     </refsection>
-    <refsection role="description">
+    <refsection>
         <title>Описание</title>
         <para>
-            <literal>X = sign(A)</literal> возвращает матрицу, созданную из знаков
+            <literal>X=sign(A)</literal> возвращает матрицу, созданную из знаков 
             <literal>A(i,j)</literal>. Для комплексной  <literal>A</literal>
             <literal>sign(A) = A./abs(A)</literal>.
         </para>
     </refsection>
-    <refsection role="examples">
+    <refsection>
         <title>Примеры</title>
-        <programlisting role="example"><![CDATA[
+        <programlisting role="example"><![CDATA[ 
 sign(rand(2,3))
 sign(1+%i)
-sign(sprand(8,3,0.3,"normal"))
  ]]></programlisting>
     </refsection>
     <refsection role="see also">
@@ -69,14 +68,4 @@ sign(sprand(8,3,0.3,"normal"))
             </member>
         </simplelist>
     </refsection>
-    <refsection role="history">
-        <title>История</title>
-        <revhistory>
-            <revision>
-                <revnumber>6.0</revnumber>
-                <revdescription>Extension to sparse matrices
-                </revdescription>
-            </revision>
-        </revhistory>
-    </refsection>
 </refentry>
diff --git a/scilab/modules/elementary_functions/tests/nonreg_tests/bug_13839.dia.ref b/scilab/modules/elementary_functions/tests/nonreg_tests/bug_13839.dia.ref
deleted file mode 100644 (file)
index 78aeb1a..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2016 - Samuel GOUGEON
-//
-//  This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- CLI SHELL MODE -->
-//
-// <-- Non-regression test for bug 13839 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=13839
-//
-// <-- Short Description -->
-//    sign() did not accept sparse matrices
-m = sprand(100,10,0.007);
-i = find(m~=0 & m<0.5);
-m(i) = m(i)-0.5;
-try
-    sign(m);
-catch
-    pause
-end
-try
-    sign(m+%i*m);
-catch
-    pause
-end
diff --git a/scilab/modules/elementary_functions/tests/nonreg_tests/bug_13839.tst b/scilab/modules/elementary_functions/tests/nonreg_tests/bug_13839.tst
deleted file mode 100644 (file)
index 78aeb1a..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2016 - Samuel GOUGEON
-//
-//  This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- CLI SHELL MODE -->
-//
-// <-- Non-regression test for bug 13839 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=13839
-//
-// <-- Short Description -->
-//    sign() did not accept sparse matrices
-m = sprand(100,10,0.007);
-i = find(m~=0 & m<0.5);
-m(i) = m(i)-0.5;
-try
-    sign(m);
-catch
-    pause
-end
-try
-    sign(m+%i*m);
-catch
-    pause
-end
diff --git a/scilab/modules/overloading/macros/%sp_sign.sci b/scilab/modules/overloading/macros/%sp_sign.sci
deleted file mode 100644 (file)
index 83aca2d..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2015 - 2016 - Samuel GOUGEON
-// Copyright (C) 2012 - 2016 - Scilab Enterprises
-//
-// This file is hereby licensed under the terms of the GNU GPL v2.0,
-// pursuant to article 5.3.4 of the CeCILL v.2.1.
-// This file was originally licensed under the terms of the CeCILL v2.1,
-// and continues to be available under such terms.
-// For more information, see the COPYING file which you should have received
-// along with this program.
-
-// Beware about the bug http://bugzilla.scilab.org/14460
-
-function r = %sp_sign(m)
-    r = m
-    c = find(imag(m)~=0)
-    if c~=[] then
-        r(c) = m(c) ./ abs(m(c))
-    end
-
-    re = real(m)
-    im = imag(m)
-    r(find(im==0 & re>0)) = 1
-    r(find(im==0 & re<0)) = -1
-endfunction