summaryrefslogtreecommitdiffstats
path: root/scilab
diff options
context:
space:
mode:
authormottelet <stephane.mottelet@utc.fr>2021-01-21 19:35:47 +0100
committerClément David <clement.david@esi-group.com>2021-01-21 20:39:28 +0100
commit0f28a68b9bb978e54ef93eb55c10a4eade943f65 (patch)
tree0ccb277e3004239b189d51994d375ab4382d5ffd /scilab
parent136c7fe92085dd1b983997fda3b170a0f5d98660 (diff)
downloadscilab-0f28a68b9bb978e54ef93eb55c10a4eade943f65.zip
scilab-0f28a68b9bb978e54ef93eb55c10a4eade943f65.tar.gz
* Bug 16623 fixed: now rand(2,2,2)^2 triggers the %s_p_s overload
http://bugzilla.scilab.org/show_bug.cgi?id=16623 Change-Id: I73013af673a644025b56c5422fea304e4aea8fe0
Diffstat (limited to 'scilab')
-rw-r--r--scilab/CHANGES.md1
-rw-r--r--scilab/modules/ast/src/cpp/operations/types_power.cpp2
-rw-r--r--scilab/modules/ast/tests/nonreg_tests/bug_16623.tst19
3 files changed, 21 insertions, 1 deletions
diff --git a/scilab/CHANGES.md b/scilab/CHANGES.md
index 2fd4a24..28937f0 100644
--- a/scilab/CHANGES.md
+++ b/scilab/CHANGES.md
@@ -349,6 +349,7 @@ Bug Fixes
349* [#16553](https://bugzilla.scilab.org/16553): `unique(["" ""])` returned `["" ""]`. 349* [#16553](https://bugzilla.scilab.org/16553): `unique(["" ""])` returned `["" ""]`.
350* [#16557](https://bugzilla.scilab.org/16557): `macr2tree` + `tree2code` translated `e={2}` into `"e=1"` and `e={2,"ab"}` into `"e=[2,"ab"]"`. 350* [#16557](https://bugzilla.scilab.org/16557): `macr2tree` + `tree2code` translated `e={2}` into `"e=1"` and `e={2,"ab"}` into `"e=[2,"ab"]"`.
351* [#16559](https://bugzilla.scilab.org/16553): `isempty(A)` was true for sparse matrix of dimension 2^16 or larger. 351* [#16559](https://bugzilla.scilab.org/16553): `isempty(A)` was true for sparse matrix of dimension 2^16 or larger.
352* [#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.
352 353
353 354
354### Bugs fixed in 6.1.0: 355### Bugs fixed in 6.1.0:
diff --git a/scilab/modules/ast/src/cpp/operations/types_power.cpp b/scilab/modules/ast/src/cpp/operations/types_power.cpp
index 7e9c020..4128790 100644
--- a/scilab/modules/ast/src/cpp/operations/types_power.cpp
+++ b/scilab/modules/ast/src/cpp/operations/types_power.cpp
@@ -300,7 +300,7 @@ int PowerDoubleByDouble(Double* _pDouble1, Double* _pDouble2, Double** _pDoubleO
300 300
301 return 0; 301 return 0;
302 } 302 }
303 else if (_pDouble1->getRows() == _pDouble1->getCols()) 303 else if (_pDouble1->getRows() == _pDouble1->getCols() && _pDouble1->getDims() == 2)
304 { 304 {
305 //power of a square matrix by a scalar exponent. 305 //power of a square matrix by a scalar exponent.
306 int iRet = 0; 306 int iRet = 0;
diff --git a/scilab/modules/ast/tests/nonreg_tests/bug_16623.tst b/scilab/modules/ast/tests/nonreg_tests/bug_16623.tst
new file mode 100644
index 0000000..a87d1e6
--- /dev/null
+++ b/scilab/modules/ast/tests/nonreg_tests/bug_16623.tst
@@ -0,0 +1,19 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2021 - Stéphane MOTTELET
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7//
8// <-- CLI SHELL MODE -->
9// <-- NO CHECK REF -->
10//
11// <-- Non-regression test for bug 16623 -->
12//
13// <-- Bugzilla URL -->
14// http://bugzilla.scilab.org/16483
15//
16// <-- Short Description -->
17// rand(2,2,2) ^ 2 now yields a wrong result instead of trying to call the %s_p_s overload for input hypermatrices
18
19assert_checkerror("rand(2,2,2)^2",_(["Undefined operation for the given operands.";"check or define function %s_t for overloading."]"))