- It can now sort any sparse 2D matrix, in all `g, r, c, lr, lc` methods, including sparse booleans and in multi-level mode. It was formerly limited to sparse real or complex vectors and only to the `g` mode.
- Any hypermatrix can be sorted along a dimension > 2.
* `unique` is enabled for any 2D sparse arrays, in simple, 'c' and 'r' modes.
+<<<<<<< HEAD
* `%chars` constant added, to easily access to some selected sets of unicode symbols.
* Lists are displayed in a more compact and comprehensive way.
* `interp1` is upgraded:
* `setdiff` now supports input booleans and sparse matrices (boolean or numeric).
* `intersect` is extended to any sparse boolean or numeric arrays, in all simple, 'c' or 'r' modes.
* `union` now support boolean, sparse boolean, and sparse numerical matrices.
+=======
+* `kron` and `.*.` are extended to boolean arrays.
+>>>>>>> 0e05946c3d7 (* Bug 16613 fixed: .*. and kron extended to booleans)
Help pages:
-----------
* [#16608](https://bugzilla.scilab.org/16608): `union` did not support input boolean, sparse boolean, nor sparse numerical matrices. The result of `union(complexA, complexB)` was wrongly conjugate.
* [#16609](https://bugzilla.scilab.org/16609): `bitcmp` needed to be upgraded for Scilab 6.
* [#16612](https://bugzilla.scilab.org/16612): Unlike the `.*.` operator, `kron()` was not defined for sparse numeric matrices.
+* [#16613](https://bugzilla.scilab.org/16613): Neither `.*.` nor `kron()` worked with boolean or sparse boolean matrices.
* [#16622](https://bugzilla.scilab.org/16622): `inv` could no longer be overloaded for hypermatrices of decimal or complex numbers.
* [#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.
* [#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.
// ============================================================================
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) 2012 - DIGITEO - Antoine ELIAS
-// Copyright (C) 2019 - Samuel GOUGEON
+// Copyright (C) 2019 - 2020 - Samuel GOUGEON
//
// This file is distributed under the same license as the Scilab package.
// ============================================================================
C = [1+2*%i,2+4*%i;3+6*%i,4+8*%i];
// double .*. double
-
-//r .*. r
assert_checkequal(r .*. r, 4);
-//r .*. c
assert_checkequal(r .*. c, 2+4*%i);
-//c .*. r
assert_checkequal(c .*. r, 2+4*%i);
-//c .*. c
assert_checkequal(c .*. c, -3+4*%i);
-
// double .*. DOUBLE
-
-//r .*. R
assert_checkequal(r .*. R, [2,4;6,8]);
-//r .*. C
assert_checkequal(r .*. C, [2+4*%i,4+8*%i;6+12*%i,8+16*%i]);
-//c .*. R
assert_checkequal(c .*. R, [1+2*%i,2+4*%i;3+6*%i,4+8*%i]);
-//c .*. C
assert_checkequal(c .*. C, [-3+4*%i,-6+8*%i;-9+12*%i,-12+16*%i]);
-
// DOUBLE .*. double
-
-//R .*. r
assert_checkequal(R .*.r, [2,4;6,8]);
-//R .*. c
assert_checkequal(R .*.c, [1+2*%i,2+4*%i;3+6*%i,4+8*%i]);
-//C .*. r
assert_checkequal(C .*.r, [2+4*%i,4+8*%i;6+12*%i,8+16*%i]);
-//C .*. c
assert_checkequal(C .*.c, [-3+4*%i,-6+8*%i;-9+12*%i,-12+16*%i]);
-
// DOUBLE .*. DOUBLE
-
-//R .*. R
assert_checkequal(R .*. R, [1,2,2,4;3,4,6,8;3,6,4,8;9,12,12,16]);
-//R .*. C
assert_checkequal(R .*. C, [1+2*%i,2+4*%i,2+4*%i,4+8*%i;3+6*%i,4+8*%i,6+12*%i,8+16*%i;3+6*%i,6+12*%i,4+8*%i,8+16*%i;9+18*%i,12+24*%i,12+24*%i,16+32*%i]);
-//C .*. R
assert_checkequal(C .*. R, [1+2*%i,2+4*%i,2+4*%i,4+8*%i;3+6*%i,4+8*%i,6+12*%i,8+16*%i;3+6*%i,6+12*%i,4+8*%i,8+16*%i;9+18*%i,12+24*%i,12+24*%i,16+32*%i]);
-//C .*. C
assert_checkequal(C .*. C, [-3+4*%i,-6+8*%i,-6+8*%i,-12+16*%i;-9+12*%i,-12+16*%i,-18+24*%i,-24+32*%i;-9+12*%i,-18+24*%i,-12+16*%i,-24+32*%i;-27+36*%i,-36+48*%i,-36+48*%i,-48+64*%i]);
assert_checkequal(ones(1,2,2).*.h, cat(3,[1 2 1 2],[3 4 3 4],[1 2 1 2],[3 4 3 4]));
assert_checkequal(size(rand(2,3,4,5).*.rand(3,1,1,1,1,7)), [6 3 4 5 1 7]);
+
+
+// BOOLEANS .*. BOOLEANS
+// ---------------------
+b = [%T %F %T]; spb = sparse([%F %T %T]');
+assert_checkequal(b.*.b', [1 0 1 ; 0 0 0 ; 1 0 1]);
+assert_checkequal(b.*.spb, sparse([0 0 0 ; 1 0 1 ; 1 0 1]));
+assert_checkequal(spb.*.b, sparse([0 0 0 ; 1 0 1 ; 1 0 1]));
+assert_checkequal(spb.*.spb', sparse([0 0 0 ; 0 1 1 ; 0 1 1]));
+
+assert_checkequal(kron(b, b'), [1 0 1 ; 0 0 0 ; 1 0 1]);
+assert_checkequal(kron(b, spb), sparse([0 0 0 ; 1 0 1 ; 1 0 1]));
+assert_checkequal(kron(spb, b), sparse([0 0 0 ; 1 0 1 ; 1 0 1]));
+assert_checkequal(kron(spb, spb'), sparse([0 0 0 ; 0 1 1 ; 0 1 1]));
+
+
+// BOOLEANS .*. DOUBLES
+// --------------------
+b = [%T %F %T]; spb = sparse([%F %T %T]');
+m = [-1 2 %inf]; sp = sparse(m');
+assert_checkequal(b .*. m', [-1 0 -1 ; 2 0 2 ; %inf %nan %inf]);
+assert_checkequal(b .*. sp, sparse([-1 0 -1 ; 2 0 2 ; %inf 0 %inf])); // 0 instead of %nan
+assert_checkequal(spb .*. m, sparse([0 0 0 ; -1 2 %inf ; -1 2 %inf]));
+assert_checkequal(spb .*. sp', sparse([0 0 0 ; -1 2 %inf ; -1 2 %inf]));
+
+assert_checkequal(kron(b, m'), [-1 0 -1 ; 2 0 2 ; %inf %nan %inf]);
+assert_checkequal(kron(b, sp), sparse([-1 0 -1 ; 2 0 2 ; %inf 0 %inf]));
+assert_checkequal(kron(spb, m), sparse([0 0 0 ; -1 2 %inf ; -1 2 %inf]));
+assert_checkequal(kron(spb, sp'), sparse([0 0 0 ; -1 2 %inf ; -1 2 %inf]));
+
+
+// DOUBLES .*. BOOLEANS
+// --------------------
+b = [%T %F %T]; spb = sparse([%F %T %T]');
+m = [-1 2 %inf]; sp = sparse(m');
+assert_checkequal(m .*. b', [-1 2 %inf ; 0 0 %nan ; -1 2 %inf]);
+assert_checkequal(m .*. spb, sparse([0 0 0 ; -1 2 %inf ; -1 2 %inf]));
+assert_checkequal(sp .*. b, sparse([-1 0 -1 ; 2 0 2 ; %inf 0 %inf]));
+assert_checkequal(sp .*. spb', sparse([0 -1 -1 ; 0 2 2 ; 0 %inf %inf]));
+
+assert_checkequal(kron(m, b'), [-1 2 %inf ; 0 0 %nan ; -1 2 %inf]);
+assert_checkequal(kron(m, spb), sparse([0 0 0 ; -1 2 %inf ; -1 2 %inf]));
+assert_checkequal(kron(sp, b), sparse([-1 0 -1 ; 2 0 2 ; %inf 0 %inf]));
+assert_checkequal(kron(sp, spb'), sparse([0 -1 -1 ; 0 2 2 ; 0 %inf %inf]));
+
+
+// BOOLEANS, INTEGERS
+// ------------------
+b = [%F %T %T]; i = int8([-2 1 3]');
+assert_checkequal(b .*. i, int8([0 -2 -2 ; 0 1 1 ; 0 3 3]));
+assert_checkequal(i' .*. b, int8([0 -2 -2 0 1 1 0 3 3]));
+assert_checkequal(kron(b, i), int8([0 -2 -2 ; 0 1 1 ; 0 3 3]));
+assert_checkequal(kron(i', b), int8([0 -2 -2 0 1 1 0 3 3]));
+
+// BOOLEANS, POLYNOMIALS
+// ---------------------
+s = %s; b = [%T %T %F]'; p = (1-s).^(0:2);
+Ref = [1,1-s,1-2*s+s^2 ; 1,1-s,1-2*s+s^2 ; 0, 0, 0];
+assert_checkequal(b .*. p, Ref);
+assert_checkequal(p .*. b, Ref);
+assert_checkequal(kron(b, p), Ref);
+assert_checkequal(kron(p, b), Ref);
+
+// BOOLEANS, RATIONALS
+// -------------------
+s = %s; b = [%T %F %T]'; r = (1-s).^(0:2)/s;
+Ref = [1,1-s,1-2*s+s^2 ; 0 0 0 ; 1,1-s,1-2*s+s^2]/s;
+assert_checkequal(b .*. r, Ref);
+assert_checkequal(r .*. b, Ref);
+assert_checkequal(kron(b, r), Ref);
+assert_checkequal(kron(r, b), Ref);
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) 2008 - INRIA
* Copyright (C) 2012 - 2016 - Scilab Enterprises
- * Copyright (C) 2014, 2019 - Samuel GOUGEON
+ * Copyright (C) 2014, 2019, 2020 - Samuel GOUGEON
*
* 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.
can't be an hypermatrix.
</para>
<para>
- Supported encodings and types: integer, real, complex, polynomial, rational,
- sparse.
+ Supported encodings and types: boolean, integer, real, complex, polynomial,
+ rational, sparse boolean, sparse real, sparse complex.
</para>
</listitem>
</varlistentry>
<revision>
<revnumber>5.5.1</revnumber>
<revdescription>
- <para>Extension to hypermatrices</para>
+ Extension to hypermatrices.
+ </revdescription>
+ </revision>
+ <revision>
+ <revnumber>6.1.1</revnumber>
+ <revdescription>
+ Extension to boolean and sparse boolean arrays.
</revdescription>
</revision>
</revhistory>
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) 2008 - INRIA
* Copyright (C) 2012 - 2016 - Scilab Enterprises
- * Copyright (C) 2014, 2019 - Samuel GOUGEON
+ * Copyright (C) 2014, 2019, 2020 - Samuel GOUGEON
*
* 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.
ne peut pas être une hypermatrice.
</para>
<para>
- Encodages et types admis : nombres entiers, nombres ou polynômes ou
- fractions rationnelles réels ou complexes, matrices creuses.
+ Encodages et types admis : booléens, nombres entiers, nombres ou polynômes
+ ou fractions rationnelles réels ou complexes, matrices creuses.
</para>
</listitem>
</varlistentry>
<revision>
<revnumber>5.5.1</revnumber>
<revdescription>
- <para>Extension aux hypermatrices</para>
+ Extension aux hypermatrices.
+ </revdescription>
+ </revision>
+ <revision>
+ <revnumber>6.1.1</revnumber>
+ <revdescription>
+ Extension aux tableaux booléens et booléens creux.
</revdescription>
</revision>
</revhistory>
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) 2008 - INRIA
* Copyright (C) 2012 - 2016 - Scilab Enterprises
- * Copyright (C) 2014, 2019 - Samuel GOUGEON
+ * Copyright (C) 2014, 2019, 2020 - Samuel GOUGEON
*
* 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.
can't be an hypermatrix.
</para>
<para>
- Supported encodings and types: integer, real, complex, polynomial, rational,
- sparse.
+ Supported encodings and types: boolean, integer, real, complex, polynomial,
+ rational, sparse boolean, sparse real, sparse complex.
</para>
</listitem>
</varlistentry>
<revision>
<revnumber>5.5.1</revnumber>
<revdescription>
- <para>Extension to hypermatrices</para>
+ Extension to hypermatrices.
+ </revdescription>
+ </revision>
+ <revision>
+ <revnumber>6.1.1</revnumber>
+ <revdescription>
+ Extension to boolean and sparse boolean arrays.
</revdescription>
</revision>
</revhistory>
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) 2008 - INRIA
* Copyright (C) 2012 - 2016 - Scilab Enterprises
- * Copyright (C) 2014, 2019 - Samuel GOUGEON
+ * Copyright (C) 2014, 2019, 2020 - Samuel GOUGEON
*
* 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.
can't be an hypermatrix.
</para>
<para>
- Supported encodings and types: integer, real, complex, polynomial, rational,
- sparse.
+ Supported encodings and types: boolean, integer, real, complex, polynomial,
+ rational, sparse boolean, sparse real, sparse complex.
</para>
</listitem>
</varlistentry>
<revision>
<revnumber>5.5.1</revnumber>
<revdescription>
- <para>Extensão ao hypermatrizes</para>
+ Extensão ao hypermatrizes.
+ </revdescription>
+ </revision>
+ <revision>
+ <revnumber>6.1.1</revnumber>
+ <revdescription>
+ Extension to boolean and sparse boolean arrays.
</revdescription>
</revision>
</revhistory>
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) 2008 - INRIA
* Copyright (C) 2012 - 2016 - Scilab Enterprises
- * Copyright (C) 2014, 2019 - Samuel GOUGEON
+ * Copyright (C) 2014, 2019, 2020 - Samuel GOUGEON
*
* 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.
<para>
Массивы размером <literal>(a1, a2, ..)</literal> и <literal>(b1, b2, ..)</literal>
с любым числом размерности. Если <varname>A</varname> или <varname>B</varname>
- являются разрежёнными, то другоо массив не может быть гиперматрицей.
+ являются разрежёнными, то другой массив не может быть гиперматрицей.
</para>
<para>
- Поддерживаемые кодируемые целые и типы: integer, real, complex, polynomial, rational,
- sparse.
+ Поддерживаемые кодируемые целые и типы: boolean, integer, real, complex,
+ polynomial, rational, sparse boolean, sparse real, sparse complex.
</para>
</listitem>
</varlistentry>
<title>Описание</title>
<para>
<literal>kron(A,B)</literal> или <literal>A.*.B</literal> возвращает результат
- Кронекеровского тензорного произведения двух матриц или гиперматрицам <literal>A</literal> и
- <literal>B</literal>. Матрица результата имеет следующую блочную форму:
+ Кронекеровского тензорного произведения двух матриц или гиперматриц <varname>A</varname> и
+ <varname>B</varname>. Матрица результата имеет следующую блочную форму:
<latex style="display" alt="
[ A(1,1).B .. A(1,n).B ] \n
A .✶. B = | ⋮ ⋮ ⋮ | \n
</latex>
</para>
<para>
- Если матрица <literal>A</literal> имеет размер <literal>m x n</literal>, а матрица
- <literal>B</literal> имеет размер <literal>p x q x r</literal>, то результат
+ Если матрица <varname>A</varname> имеет размер <literal>m x n</literal>, а матрица
+ <varname>B</varname> имеет размер <literal>p x q x r</literal>, то результат
<literal>A .*. B</literal> является матрицей размером <literal>(m*p) x (n*q) x (1xr)</literal>.
</para>
</refsection>
<revision>
<revnumber>5.5.1</revnumber>
<revdescription>
- <para>Расширение до гиперматриц</para>
+ Расширение до гиперматриц.
+ </revdescription>
+ </revision>
+ <revision>
+ <revnumber>6.1.1</revnumber>
+ <revdescription>
+ Расширение до логических и разрежённых логических массивов.
</revdescription>
</revision>
</revhistory>
--- /dev/null
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2020 - Samuel GOUGEON
+//
+// 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.
+
+function r = %b_k_b(b1, b2)
+ r = bool2s(b1) .*. bool2s(b2)
+endfunction
--- /dev/null
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2020 - Samuel GOUGEON
+//
+// 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.
+
+function r = %b_k_i(b, i)
+ r = bool2s(b) .*. i
+endfunction
--- /dev/null
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2020 - Samuel GOUGEON
+//
+// 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.
+
+function r = %b_k_p(b, p)
+ r = bool2s(b) .*. p
+endfunction
--- /dev/null
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2020 - Samuel GOUGEON
+//
+// 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.
+
+function r = %b_k_r(b, r)
+ r = bool2s(b) .*. r
+endfunction
--- /dev/null
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2020 - Samuel GOUGEON
+//
+// 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.
+
+function r = %b_k_s(b, s)
+ r = bool2s(b) .*. s
+endfunction
--- /dev/null
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2020 - Samuel GOUGEON
+//
+// 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.
+
+function r = %b_k_sp(b, sp)
+ r = bool2s(b) .*. sp
+endfunction
--- /dev/null
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2020 - Samuel GOUGEON
+//
+// 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.
+
+function r = %b_k_spb(b, spb)
+ r = bool2s(b) .*. bool2s(spb)
+endfunction
--- /dev/null
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2020 - Samuel GOUGEON
+//
+// 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.
+
+function r = %b_kron(b, op2)
+ r = bool2s(b) .*. op2
+endfunction
--- /dev/null
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2020 - Samuel GOUGEON
+//
+// 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.
+
+function r = %i_k_b(i, b)
+ r = i .*. bool2s(b)
+endfunction
--- /dev/null
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2020 - Samuel GOUGEON
+//
+// 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.
+
+function r = %p_k_b(p, b)
+ r = p .*. bool2s(b)
+endfunction
--- /dev/null
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2020 - Samuel GOUGEON
+//
+// 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.
+
+function r = %p_kron(p, op2)
+ r = p .*. op2
+endfunction
--- /dev/null
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2020 - Samuel GOUGEON
+//
+// 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.
+
+function r = %r_k_b(r, b)
+ r = r .*. bool2s(b)
+endfunction
--- /dev/null
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2020 - Samuel GOUGEON
+//
+// 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.
+
+function r = %r_kron(r, op2)
+ r = r .*. op2
+endfunction
rib = (ones(a).*.ib); // replicated indices in b
//
res = rlist(anum(ria)(:) .* bnum(rib)(:), aden(ria)(:) .* bden(rib)(:), dt);
+ if simp_mode()
+ res = simp(res)
+ end
end
// Final formatting
--- /dev/null
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2020 - Samuel GOUGEON
+//
+// 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.
+
+function r = %s_k_b(s, b)
+ r = s .*. bool2s(b)
+endfunction
--- /dev/null
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2020 - Samuel GOUGEON
+//
+// 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.
+
+function r = %s_k_spb(s, spb)
+ r = s .*. bool2s(spb)
+endfunction
--- /dev/null
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2020 - Samuel GOUGEON
+//
+// 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.
+
+function r = %sp_k_b(sp, b)
+ r = sp .*. bool2s(b)
+endfunction
--- /dev/null
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2020 - Samuel GOUGEON
+//
+// 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.
+
+function r = %sp_k_spb(sp, spb)
+ r = sp .*. bool2s(spb)
+endfunction
--- /dev/null
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2020 - Samuel GOUGEON
+//
+// 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.
+
+function r = %spb_k_b(spb, b)
+ r = bool2s(spb) .*. bool2s(b)
+endfunction
--- /dev/null
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2020 - Samuel GOUGEON
+//
+// 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.
+
+function r = %spb_k_s(spb, s)
+ r = bool2s(spb) .*. s
+endfunction
--- /dev/null
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2020 - Samuel GOUGEON
+//
+// 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.
+
+function r = %spb_k_sp(spb, sp)
+ r = bool2s(spb) .*. sp
+endfunction
--- /dev/null
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2020 - Samuel GOUGEON
+//
+// 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.
+
+function r = %spb_k_spb(spb1, spb2)
+ r = bool2s(spb1) .*. bool2s(spb2)
+endfunction
--- /dev/null
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2020 - Samuel GOUGEON
+//
+// 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.
+
+function r = %spb_kron(spb, op2)
+ r = bool2s(spb) .*. op2
+endfunction