summaryrefslogtreecommitdiffstats
path: root/scilab
diff options
context:
space:
mode:
authorCedric Delamarre <cedric.delamarre@esi-group.com>2021-05-26 11:32:24 +0200
committerSt├ęphane MOTTELET <stephane.mottelet@utc.fr>2021-05-26 12:43:33 +0200
commitdc59e40ebf08b54c0495422fa522e050eb3521f5 (patch)
tree6ea6ca7b3579a700bee8b4bef12e788a347da4f4 /scilab
parenteede300463cf6367f65f83b3c72481f3d80c3c38 (diff)
downloadscilab-dc59e40ebf08b54c0495422fa522e050eb3521f5.zip
scilab-dc59e40ebf08b54c0495422fa522e050eb3521f5.tar.gz
dotdiv fixed
* restore overload for dotdiv between eye() and int * template fixed for linux See also http://bugzilla.scilab.org/show_bug.cgi?id=16667 Change-Id: Ie4f12cde19a9d6711e7233ef4cc3c1f2a17a04f7
Diffstat (limited to 'scilab')
-rw-r--r--scilab/modules/ast/includes/operations/types_dotdivide.hxx28
-rw-r--r--scilab/modules/integer/macros/%i_d_s.sci21
-rw-r--r--scilab/modules/integer/macros/%s_d_i.sci21
3 files changed, 56 insertions, 14 deletions
diff --git a/scilab/modules/ast/includes/operations/types_dotdivide.hxx b/scilab/modules/ast/includes/operations/types_dotdivide.hxx
index ee33d41..837c842 100644
--- a/scilab/modules/ast/includes/operations/types_dotdivide.hxx
+++ b/scilab/modules/ast/includes/operations/types_dotdivide.hxx
@@ -165,8 +165,8 @@ template<> inline void dotdiv<double, double, double>(double l, size_t size, dou
165//x1c ./ x1 165//x1c ./ x1
166template<typename T, typename U, typename O> inline static void dotdiv(T l, T lc, size_t size, U r, O* o, O* oc) 166template<typename T, typename U, typename O> inline static void dotdiv(T l, T lc, size_t size, U r, O* o, O* oc)
167{ 167{
168 dotdiv<T, U, O>(l, r, o); 168 dotdiv(l, r, o);
169 dotdiv<T, U, O>(lc, r, oc); 169 dotdiv(lc, r, oc);
170 //*o = (O)l / (O)r; 170 //*o = (O)l / (O)r;
171 //*oc = (O)lc / (O)r; 171 //*oc = (O)lc / (O)r;
172} 172}
@@ -227,7 +227,7 @@ template<typename T, typename U, typename O> inline static void dotdiv(T* l, siz
227 for (size_t i = 0; i < size ; ++i) 227 for (size_t i = 0; i < size ; ++i)
228 { 228 {
229 //dotdiv(T l, U r, O* o) 229 //dotdiv(T l, U r, O* o)
230 dotdiv<T, U, O>(l[i], r[i], &o[i]); 230 dotdiv(l[i], r[i], &o[i]);
231 //o[i] = (O)l[i] / (O)r[i]; 231 //o[i] = (O)l[i] / (O)r[i];
232 } 232 }
233} 233}
@@ -238,7 +238,7 @@ template<typename T, typename U, typename O> inline static void dotdiv(T* l, T*
238 for (size_t i = 0; i < size ; ++i) 238 for (size_t i = 0; i < size ; ++i)
239 { 239 {
240 //dotdiv(T l, T lc, size_t size, U r, O* o, O* oc) 240 //dotdiv(T l, T lc, size_t size, U r, O* o, O* oc)
241 dotdiv<T, U, O>(l[i], lc[i], (size_t)1, r[i], &o[i], &oc[i]); 241 dotdiv(l[i], lc[i], (size_t)1, r[i], &o[i], &oc[i]);
242 //o[i] = (O)l[i] / (O)r[i]; 242 //o[i] = (O)l[i] / (O)r[i];
243 //oc[i] = (O)lc[i] / (O)r[i]; 243 //oc[i] = (O)lc[i] / (O)r[i];
244 } 244 }
@@ -250,7 +250,7 @@ template<typename T, typename U, typename O> inline static void dotdiv(T* l, siz
250 for (size_t i = 0; i < size ; ++i) 250 for (size_t i = 0; i < size ; ++i)
251 { 251 {
252 //dotdiv(T l, size_t size, U r, U rc, O* o, O* oc) 252 //dotdiv(T l, size_t size, U r, U rc, O* o, O* oc)
253 dotdiv<T, U, O>(l[i], 1, r[i], rc[i], &o[i], &oc[i]); 253 dotdiv(l[i], 1, r[i], rc[i], &o[i], &oc[i]);
254 //o[i] = ((O)l[i] * (O)r[i]) / ((O)rc[i] * (O)rc[i] + (O)r[i] * (O)r[i]) ; 254 //o[i] = ((O)l[i] * (O)r[i]) / ((O)rc[i] * (O)rc[i] + (O)r[i] * (O)r[i]) ;
255 //oc[i] = ((O)l[i] * -(O)rc[i]) / ((O)rc[i] * (O)rc[i] + (O)r[i] * (O)r[i]) ; 255 //oc[i] = ((O)l[i] * -(O)rc[i]) / ((O)rc[i] * (O)rc[i] + (O)r[i] * (O)r[i]) ;
256 } 256 }
@@ -262,7 +262,7 @@ template<typename T, typename U, typename O> inline static void dotdiv(T* l, T*
262 for (size_t i = 0; i < size ; ++i) 262 for (size_t i = 0; i < size ; ++i)
263 { 263 {
264 //dotdiv(T l, T lc, size_t size, U r, U rc, O* o, O* oc) 264 //dotdiv(T l, T lc, size_t size, U r, U rc, O* o, O* oc)
265 dotdiv<T, U, O>(l[i], lc[i], 1, r[i], rc[i], &o[i], &oc[i]); 265 dotdiv(l[i], lc[i], 1, r[i], rc[i], &o[i], &oc[i]);
266 //o[i] = ((O)l[i] * (O)r[i] + (O)lc[i] * (O)rc[i] ) / ((O)rc[i] * (O)rc[i] + (O)r[i] * (O)r[i]) ; 266 //o[i] = ((O)l[i] * (O)r[i] + (O)lc[i] * (O)rc[i] ) / ((O)rc[i] * (O)rc[i] + (O)r[i] * (O)r[i]) ;
267 //oc[i] = ((O)r[i] * (O)lc[i] - (O)rc[i] * (O)l[i] ) / ((O)rc[i] * (O)rc[i] + (O)r[i] * (O)r[i]) ; 267 //oc[i] = ((O)r[i] * (O)lc[i] - (O)rc[i] * (O)l[i] ) / ((O)rc[i] * (O)rc[i] + (O)r[i] * (O)r[i]) ;
268 } 268 }
@@ -274,7 +274,7 @@ template<typename T, typename U, typename O> inline static void dotdiv(T* l, siz
274 for (size_t i = 0; i < size ; ++i) 274 for (size_t i = 0; i < size ; ++i)
275 { 275 {
276 //dotdiv(T l, U r, O* o) 276 //dotdiv(T l, U r, O* o)
277 dotdiv<T, U, O>(l[i], r, &o[i]); 277 dotdiv(l[i], r, &o[i]);
278 //o[i] = (O)l[i] / (O)r; 278 //o[i] = (O)l[i] / (O)r;
279 } 279 }
280} 280}
@@ -285,7 +285,7 @@ template<typename T, typename U, typename O> inline static void dotdiv(T l, size
285 for (size_t i = 0; i < size ; ++i) 285 for (size_t i = 0; i < size ; ++i)
286 { 286 {
287 //dotdiv(T l, U r, O* o) 287 //dotdiv(T l, U r, O* o)
288 dotdiv<T, U, O>(l, r[i], &o[i]); 288 dotdiv(l, r[i], &o[i]);
289 //o[i] = (O)l / (O)r[i]; 289 //o[i] = (O)l / (O)r[i];
290 } 290 }
291} 291}
@@ -298,7 +298,7 @@ template<typename T, typename U, typename O> inline static void dotdiv(T* l, siz
298 for (size_t i = 0; i < size ; ++i) 298 for (size_t i = 0; i < size ; ++i)
299 { 299 {
300 //dotdiv(T l, size_t size, U r, U rc, O* o, O* oc) 300 //dotdiv(T l, size_t size, U r, U rc, O* o, O* oc)
301 dotdiv<T, U, O >(l[i], (size_t)1, r, rc, &o[i], &oc[i]); 301 dotdiv(l[i], (size_t)1, r, rc, &o[i], &oc[i]);
302 //o[i] = ((O)l[i] * (O)r) / denum; 302 //o[i] = ((O)l[i] * (O)r) / denum;
303 //oc[i] = ((O)l[i] * -(O)rc) / denum; 303 //oc[i] = ((O)l[i] * -(O)rc) / denum;
304 } 304 }
@@ -310,7 +310,7 @@ template<typename T, typename U, typename O> inline static void dotdiv(T l, size
310 for (size_t i = 0; i < size ; ++i) 310 for (size_t i = 0; i < size ; ++i)
311 { 311 {
312 //dotdiv(T l, size_t size, U r, U rc, O* o, O* oc) 312 //dotdiv(T l, size_t size, U r, U rc, O* o, O* oc)
313 dotdiv<T, U, O>(l, (size_t)1, r[i], rc[i], &o[i], &oc[i]); 313 dotdiv(l, (size_t)1, r[i], rc[i], &o[i], &oc[i]);
314 //o[i] = ((O)l * (O)r[i]) / ((O)rc[i] * (O)rc[i] + (O)r[i] * (O)r[i]) ; 314 //o[i] = ((O)l * (O)r[i]) / ((O)rc[i] * (O)rc[i] + (O)r[i] * (O)r[i]) ;
315 //oc[i] = ((O)l * -(O)rc[i]) / ((O)rc[i] * (O)rc[i] + (O)r[i] * (O)r[i]) ; 315 //oc[i] = ((O)l * -(O)rc[i]) / ((O)rc[i] * (O)rc[i] + (O)r[i] * (O)r[i]) ;
316 } 316 }
@@ -322,7 +322,7 @@ template<typename T, typename U, typename O> inline static void dotdiv(T* l, T*
322 for (size_t i = 0; i < size ; ++i) 322 for (size_t i = 0; i < size ; ++i)
323 { 323 {
324 //dotdiv(T l, T lc, size_t size, U r, O* o, O* oc) 324 //dotdiv(T l, T lc, size_t size, U r, O* o, O* oc)
325 dotdiv<T, U, O>(l[i], lc[i], (size_t)1, r, &o[i], &oc[i]); 325 dotdiv(l[i], lc[i], (size_t)1, r, &o[i], &oc[i]);
326 //o[i] = (O)l[i] / (O)r; 326 //o[i] = (O)l[i] / (O)r;
327 //oc[i] = (O)lc[i] / (O)r; 327 //oc[i] = (O)lc[i] / (O)r;
328 } 328 }
@@ -334,7 +334,7 @@ template<typename T, typename U, typename O> inline static void dotdiv(T l, T lc
334 for (size_t i = 0; i < size ; ++i) 334 for (size_t i = 0; i < size ; ++i)
335 { 335 {
336 //dotdiv(T l, T lc, size_t size, U r, O* o, O* oc) 336 //dotdiv(T l, T lc, size_t size, U r, O* o, O* oc)
337 dotdiv<T, U, O>(l, lc, (size_t)1, r[i], &o[i], &oc[i]); 337 dotdiv(l, lc, (size_t)1, r[i], &o[i], &oc[i]);
338 //o[i] = (O)l / (O)r[i]; 338 //o[i] = (O)l / (O)r[i];
339 //oc[i] = (O)lc / (O)r[i]; 339 //oc[i] = (O)lc / (O)r[i];
340 } 340 }
@@ -348,7 +348,7 @@ template<typename T, typename U, typename O> inline static void dotdiv(T* l, T*
348 for (size_t i = 0; i < size ; ++i) 348 for (size_t i = 0; i < size ; ++i)
349 { 349 {
350 //dotdiv(T l, T lc, size_t size, U r, O* o, O* oc) 350 //dotdiv(T l, T lc, size_t size, U r, O* o, O* oc)
351 dotdiv<T, U, O>(l[i], lc[i], (size_t)1, r, rc, &o[i], &oc[i]); 351 dotdiv(l[i], lc[i], (size_t)1, r, rc, &o[i], &oc[i]);
352 //o[i] = ((O)l[i] * (O)r + (O)lc[i] * (O)rc) / denum; 352 //o[i] = ((O)l[i] * (O)r + (O)lc[i] * (O)rc) / denum;
353 //oc[i] = ((O)r * (O)lc[i] - (O)rc * (O)l[i] ) / denum ; 353 //oc[i] = ((O)r * (O)lc[i] - (O)rc * (O)l[i] ) / denum ;
354 } 354 }
@@ -360,7 +360,7 @@ template<typename T, typename U, typename O> inline static void dotdiv(T l, T lc
360 for (size_t i = 0; i < size ; ++i) 360 for (size_t i = 0; i < size ; ++i)
361 { 361 {
362 //dotdiv(T l, T lc, size_t size, U r, O* o, O* oc) 362 //dotdiv(T l, T lc, size_t size, U r, O* o, O* oc)
363 dotdiv<T, U, O>(l, lc, (size_t)1, r[i], rc[i], &o[i], &oc[i]); 363 dotdiv(l, lc, (size_t)1, r[i], rc[i], &o[i], &oc[i]);
364 //o[i] = ((O)l * (O)r[i] + (O)lc * (O)rc[i]) / ((O)rc[i] * (O)rc[i] + (O)r[i] * (O)r[i]); 364 //o[i] = ((O)l * (O)r[i] + (O)lc * (O)rc[i]) / ((O)rc[i] * (O)rc[i] + (O)r[i] * (O)r[i]);
365 //oc[i] = ((O)r[i] * (O)lc - (O)rc[i] * (O)l ) / ((O)rc[i] * (O)rc[i] + (O)r[i] * (O)r[i]) ; 365 //oc[i] = ((O)r[i] * (O)lc - (O)rc[i] * (O)l ) / ((O)rc[i] * (O)rc[i] + (O)r[i] * (O)r[i]) ;
366 } 366 }
diff --git a/scilab/modules/integer/macros/%i_d_s.sci b/scilab/modules/integer/macros/%i_d_s.sci
new file mode 100644
index 0000000..f2c1901
--- /dev/null
+++ b/scilab/modules/integer/macros/%i_d_s.sci
@@ -0,0 +1,21 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) INRIA -
3// Copyright (C) 2013 - Samuel GOUGEON : http://bugzilla.scilab.org/13000
4
5// Copyright (C) 2012 - 2016 - Scilab Enterprises
6//
7// This file is hereby licensed under the terms of the GNU GPL v2.0,
8// pursuant to article 5.3.4 of the CeCILL v.2.1.
9// This file was originally licensed under the terms of the CeCILL v2.1,
10// and continues to be available under such terms.
11// For more information, see the COPYING file which you should have received
12// along with this program.
13
14// used to manage int ./ eye()
15function r = %i_d_s(a,b)
16 if b==[] then
17 r = []
18 else
19 r = a./iconvert(b,inttype(a))
20 end
21endfunction \ No newline at end of file
diff --git a/scilab/modules/integer/macros/%s_d_i.sci b/scilab/modules/integer/macros/%s_d_i.sci
new file mode 100644
index 0000000..12ad73b
--- /dev/null
+++ b/scilab/modules/integer/macros/%s_d_i.sci
@@ -0,0 +1,21 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) INRIA -
3// Copyright (C) 2013 - Samuel GOUGEON : http://bugzilla.scilab.org/13000
4//
5// Copyright (C) 2012 - 2016 - Scilab Enterprises
6//
7// This file is hereby licensed under the terms of the GNU GPL v2.0,
8// pursuant to article 5.3.4 of the CeCILL v.2.1.
9// This file was originally licensed under the terms of the CeCILL v2.1,
10// and continues to be available under such terms.
11// For more information, see the COPYING file which you should have received
12// along with this program.
13
14// used to manage eye() ./ int
15function r = %s_d_i(a,b)
16 if a==[] then
17 r = []
18 else
19 r = iconvert(a,inttype(b))./b
20 end
21endfunction \ No newline at end of file