* Bug #11606 fixed - exit() was too slow in nw mode when driver("png") was set.
+* Bug #11618 fixed - A(:) returned wrong values when A was a complex sparse matrix.
+
c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
c Copyright (C) INRIA
+c Copyright (C) 2012 - Scilab Enterprises - Adeline CARNIS
c
c This file must be used under the terms of the CeCILL.
c This source file is licensed as described in the file COPYING, which
call dspmat(m2,n2,stk(lr),nel2,istk(irc2),m2*n2
$ ,istk(ircr),istk(iw))
else
- call wspmat(m2,n2,stk(lr),stk(lr+mn2),nel2,istk(irc2)
- $ ,m2*n2,istk(ircr),istk(iw))
+
+ call wspmat(m2,n2,stk(lr),stk(lr+nel2),nel2,istk(irc2)
+ $ ,m2*n2,istk(ircr),istk(iw))
endif
call icopy(m2*n2+nel2,istk(ircr),1,istk(irc1),1)
call unsfdcopy(nel2*(it2+1),stk(lr),1,stk(l1),1)
--- /dev/null
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2012 - Scilab Enterprises - Adeline CARNIS
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- CLI SHELL MODE -->
+// <-- Non-regression test for bug 11618 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=11618
+//
+// <-- Short Description -->
+// if A is a complex sparse matrix, A(:) returned wrong values
+A = [0 %i;1 2]
+ A =
+
+ 0 i
+ 1. 2.
+A1 = sparse(A);
+assert_checkequal(full(A1(:)), A(:));
+A = [1 0; 3 %i];
+A1 = sparse(A);
+assert_checkequal(full(A1(:)), A(:));
+A = [%i 3; 0 1];
+A1 = sparse(A);
+assert_checkequal(full(A1(:)), A(:));
+A = [1 %i;%i 0];
+A1 = sparse(A);
+assert_checkequal(full(A1(:)), A(:));
--- /dev/null
+// =============================================================================\r
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab\r
+// Copyright (C) 2012 - Scilab Enterprises - Adeline CARNIS\r
+//\r
+// This file is distributed under the same license as the Scilab package.\r
+// =============================================================================\r
+\r
+// <-- CLI SHELL MODE -->\r
+\r
+// <-- Non-regression test for bug 11618 -->\r
+//\r
+// <-- Bugzilla URL -->\r
+// http://bugzilla.scilab.org/show_bug.cgi?id=11618\r
+//\r
+// <-- Short Description -->\r
+// if A is a complex sparse matrix, A(:) returned wrong values\r
+\r
+A = [0 %i;1 2]\r
+A1 = sparse(A);\r
+assert_checkequal(full(A1(:)), A(:));\r
+\r
+A = [1 0; 3 %i];\r
+A1 = sparse(A);\r
+assert_checkequal(full(A1(:)), A(:));\r
+\r
+A = [%i 3; 0 1];\r
+A1 = sparse(A);\r
+assert_checkequal(full(A1(:)), A(:));\r
+\r
+A = [1 %i;%i 0];\r
+A1 = sparse(A);\r
+assert_checkequal(full(A1(:)), A(:));\r\r