summaryrefslogtreecommitdiffstats
path: root/scilab
diff options
context:
space:
mode:
authorSamuel GOUGEON <sgougeon@free.fr>2020-11-12 23:36:00 +0100
committerClément David <clement.david@esi-group.com>2021-03-17 10:40:56 +0100
commit7955c23a7e7973c6bbce84192592125288ec0bfd (patch)
tree8c92ebeb4d0a4653644a98ee4530a8032f161b3a /scilab
parent0a949bc9b44ef5c94b21fb51f146ecaa14c9c867 (diff)
downloadscilab-7955c23a7e7973c6bbce84192592125288ec0bfd.zip
scilab-7955c23a7e7973c6bbce84192592125288ec0bfd.tar.gz
* Bug 16596 : [int , sparse] and [int ; sparse] now possible
http://bugzilla.scilab.org/16596 Change-Id: I7b3bf094aa07b8814acbcf9030e9fca591a6f310
Diffstat (limited to 'scilab')
-rw-r--r--scilab/CHANGES.md6
-rw-r--r--scilab/modules/overloading/macros/%i_c_sp.sci14
-rw-r--r--scilab/modules/overloading/macros/%i_f_sp.sci14
-rw-r--r--scilab/modules/overloading/macros/%sp_c_i.sci14
-rw-r--r--scilab/modules/overloading/macros/%sp_f_i.sci14
-rw-r--r--scilab/modules/overloading/tests/unit_tests/concatenations_mixed.tst13
6 files changed, 71 insertions, 4 deletions
diff --git a/scilab/CHANGES.md b/scilab/CHANGES.md
index 136da4a..5fdac88 100644
--- a/scilab/CHANGES.md
+++ b/scilab/CHANGES.md
@@ -357,14 +357,12 @@ Bug Fixes
357* [#16553](https://bugzilla.scilab.org/16553): `unique(["" ""])` returned `["" ""]`. 357* [#16553](https://bugzilla.scilab.org/16553): `unique(["" ""])` returned `["" ""]`.
358* [#16557](https://bugzilla.scilab.org/16557): `macr2tree` + `tree2code` translated `e={2}` into `"e=1"` and `e={2,"ab"}` into `"e=[2,"ab"]"`. 358* [#16557](https://bugzilla.scilab.org/16557): `macr2tree` + `tree2code` translated `e={2}` into `"e=1"` and `e={2,"ab"}` into `"e=[2,"ab"]"`.
359* [#16559](https://bugzilla.scilab.org/16553): `isempty(A)` was true for sparse matrix of dimension 2^16 or larger. 359* [#16559](https://bugzilla.scilab.org/16553): `isempty(A)` was true for sparse matrix of dimension 2^16 or larger.
360<<<<<<< HEAD 360* [#16596](https://bugzilla.scilab.org/16596): Concatenating encoded integers with sparse numeric data was not possible.
361* [#16622](https://bugzilla.scilab.org/16622): `inv` could no longer be overloaded for hypermatrices of decimal or complex numbers. 361* [#16622](https://bugzilla.scilab.org/16622): `inv` could no longer be overloaded for hypermatrices of decimal or complex numbers.
362* [#16623](https://bugzilla.scilab.org/16623): `rand(2,2,2)^2` yielded a wrong result instead of trying to call the `%s_p_s` overload for input hypermatrices. 362* [#16623](https://bugzilla.scilab.org/16623): `rand(2,2,2)^2` yielded a wrong result instead of trying to call the `%s_p_s` overload for input hypermatrices.
363* [#16629](https://bugzilla.scilab.org/16629): `interp1`'s documentation did not tell the spline edges conditions ; extrapolation modes were poorly explained. ; the description of the result's size was completely wrong ; x as an option was not documented. A wrong extrapolation value could silently return a wrong result. There was some dead code like `if varargin(5)==%nan`. A bugged error message yielded its own error. When x is implicit, the argument index in error messages could be wrong. `periodic` and `edgevalue` extrapolation modes were not available. `linear` extrapolation was not available for splines. When `xp` is an hypermatrix with `size(xp,1)==1`, the size of the result was irregular/wrong.
363* [#16644](https://bugzilla.scilab.org/16644): `input("message:")` yielded a wrong error message about `mprintf` in case of non-interpretable input. 364* [#16644](https://bugzilla.scilab.org/16644): `input("message:")` yielded a wrong error message about `mprintf` in case of non-interpretable input.
364* [#16654](https://bugzilla.scilab.org/16654): `interp` was leaking memory. 365* [#16654](https://bugzilla.scilab.org/16654): `interp` was leaking memory.
365=======
366* [#16629](https://bugzilla.scilab.org/16629): `interp1`'s documentation did not tell the spline edges conditions ; extrapolation modes were poorly explained ; the description of the result's size was completely wrong ; x as an option was not documented. A wrong extrapolation value could silently return a wrong result. There was some dead code like `if varargin(5)==%nan`. A bugged error message yielded its own error. When x is implicit, the argument index in error messages could be wrong. `periodic` and `edgevalue` extrapolation modes were not available. `linear` extrapolation was not available for splines. When `xp` is an hypermatrix with `size(xp,1)==1`, the size of the result was irregular/wrong.
367>>>>>>> ae66d0ee461... * Bug 16629 fixed: interp1() fixed + complex + extended extrapolations
368 366
369 367
370### Bugs fixed in 6.1.0: 368### Bugs fixed in 6.1.0:
diff --git a/scilab/modules/overloading/macros/%i_c_sp.sci b/scilab/modules/overloading/macros/%i_c_sp.sci
new file mode 100644
index 0000000..d8130cf
--- /dev/null
+++ b/scilab/modules/overloading/macros/%i_c_sp.sci
@@ -0,0 +1,14 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2020 - Samuel GOUGEON
3//
4// This file is hereby licensed under the terms of the GNU GPL v2.0,
5// pursuant to article 5.3.4 of the CeCILL v.2.1.
6// This file was originally licensed under the terms of the CeCILL v2.1,
7// and continues to be available under such terms.
8// For more information, see the COPYING file which you should have received
9// along with this program.
10
11function r = %i_c_sp(a, b)
12 // Horizontal concatenation [encoded_integer , sparse]
13 r = [double(a) , b]
14endfunction
diff --git a/scilab/modules/overloading/macros/%i_f_sp.sci b/scilab/modules/overloading/macros/%i_f_sp.sci
new file mode 100644
index 0000000..590c92b
--- /dev/null
+++ b/scilab/modules/overloading/macros/%i_f_sp.sci
@@ -0,0 +1,14 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2020 - Samuel GOUGEON
3//
4// This file is hereby licensed under the terms of the GNU GPL v2.0,
5// pursuant to article 5.3.4 of the CeCILL v.2.1.
6// This file was originally licensed under the terms of the CeCILL v2.1,
7// and continues to be available under such terms.
8// For more information, see the COPYING file which you should have received
9// along with this program.
10
11function r = %i_f_sp(a, b)
12 // Vertical concatenation [encoded_integer ; sparse]
13 r = [double(a) ; b]
14endfunction
diff --git a/scilab/modules/overloading/macros/%sp_c_i.sci b/scilab/modules/overloading/macros/%sp_c_i.sci
new file mode 100644
index 0000000..57aaebc
--- /dev/null
+++ b/scilab/modules/overloading/macros/%sp_c_i.sci
@@ -0,0 +1,14 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2020 - Samuel GOUGEON
3//
4// This file is hereby licensed under the terms of the GNU GPL v2.0,
5// pursuant to article 5.3.4 of the CeCILL v.2.1.
6// This file was originally licensed under the terms of the CeCILL v2.1,
7// and continues to be available under such terms.
8// For more information, see the COPYING file which you should have received
9// along with this program.
10
11function r = %sp_c_i(a, b)
12 // Horizontal concatenation [sparse ; encoded_integer]
13 r = [a, double(b)]
14endfunction
diff --git a/scilab/modules/overloading/macros/%sp_f_i.sci b/scilab/modules/overloading/macros/%sp_f_i.sci
new file mode 100644
index 0000000..5548d84
--- /dev/null
+++ b/scilab/modules/overloading/macros/%sp_f_i.sci
@@ -0,0 +1,14 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2020 - Samuel GOUGEON
3//
4// This file is hereby licensed under the terms of the GNU GPL v2.0,
5// pursuant to article 5.3.4 of the CeCILL v.2.1.
6// This file was originally licensed under the terms of the CeCILL v2.1,
7// and continues to be available under such terms.
8// For more information, see the COPYING file which you should have received
9// along with this program.
10
11function r = %sp_f_i(a, b)
12 // Vertical concatenation [sparse ; encoded_integer]
13 r = [a ; double(b)]
14endfunction
diff --git a/scilab/modules/overloading/tests/unit_tests/concatenations_mixed.tst b/scilab/modules/overloading/tests/unit_tests/concatenations_mixed.tst
index 29af0de..f4c6d17 100644
--- a/scilab/modules/overloading/tests/unit_tests/concatenations_mixed.tst
+++ b/scilab/modules/overloading/tests/unit_tests/concatenations_mixed.tst
@@ -40,6 +40,19 @@ for it = [1 2 4 8 11 12 14 18] // Loop on integer types
40 end 40 end
41end 41end
42 42
43// -----------------------------------
44// Sparse numeric and encoded integers
45// -----------------------------------
46D = list(2, [3 7], [3 ; 7], [1 2 3 ; 4 5 6]);
47for it = [1 2 4 8 11 12 14 18] // Loop on integer types
48 for d = D
49 assert_checkequal([sparse(d), iconvert(d,it)], sparse([d d]));
50 assert_checkequal([iconvert(d,it), sparse(d)], sparse([d d]));
51 assert_checkequal([sparse(d) ; iconvert(d,it)], sparse([d ; d]));
52 assert_checkequal([iconvert(d,it) ; sparse(d)], sparse([d ; d]));
53 end
54end
55
43// ------------------------------------------------- 56// -------------------------------------------------
44// A boolean and a double, at least one being sparse 57// A boolean and a double, at least one being sparse
45// ------------------------------------------------- 58// -------------------------------------------------