kron() does not work with hypermatrices of polynomials or rationals. With matrices, it is unvectorized and slow.
Reported by Samuel GOUGEON (@sgougeon)
BUG DESCRIPTION:
----------------
As soon as a polynomial or a rational operand is involved in a kronecker product with one of the operands being an hypermatrix,
an error occurs or the result is truncated.
In addition, the existing code supporting matrices is not vectorized (double loop on rows and columns).
Finally, the existing overloads are very redundant.
Few examples:
============
r = 1/%z;
n = grand(3,4,2, "uin",0,2)
r .*. n
--> r .*. n
at line 22 of function %r_i_s ( SCI\modules\overloading\macros\%r_i_s.sci line 34 )
in builtin %r_k_s ( SCI\modules\overloading\macros\%r_k_s.sci line 11 )
Submatrix incorrectly defined.
----------------------------
r = [%z+1, 1/%z];
r2 = cat(3,r,r+%z^2);
r .*. r2
--> r .*. r2
at line 22 of function %r_i_s ( SCI\modules\overloading\macros\%r_i_s.sci line 34 )
in builtin %r_k_r ( SCI\modules\overloading\macros\%r_k_r.sci line 12 )
Submatrix incorrectly defined.
----------------------------
p = [%z, %z+%z];
p2 = cat(3,p,p);
p .*. p2
--> p .*. p2
at line 11 of function %p_k_p ( SCI\modules\overloading\macros\%p_k_p.sci line 23 )
Submatrix incorrectly defined.
----------------------------
p = [%z, 1+%z];
rand(2,2,2) .*. p
--> rand(2,2,2) .*. p // ==> BUG: missing page #2
ans =
0.3616361z 0.3616361 +0.3616361z 0.5664249z 0.5664249 +0.5664249z
0.2922267z 0.2922267 +0.2922267z 0.4826472z 0.4826472 +0.4826472z
etc.
ERROR LOG:
----------
See above
HOW TO REPRODUCE THE BUG:
-------------------------
See above
OTHER INFORMATION:
------------------
Tried on Scilab 6.0.1