sylm(a,b) fails when degree(a)==0 or degree(b)==0
Reported by Stéphane MOTTELET (@mottelet)
BUG DESCRIPTION:
----------------
sylm(a,b) fails when degree(a)==0 or degree(b)==0
moreover, there is no check that a and/or b are not equal to the null polynomial, although in these cases the Sylvester matrix is not defined (source: https://en.wikipedia.org/wiki/Sylvester_matrix)
ERROR LOG:
----------
HOW TO REPRODUCE THE BUG:
-------------------------
--> sylm(0*%s,0*%s)
at line 16 of function sylm ( /Users/mottelet/scilab/scilab-6.0.1/scilab-6.0.1.app/Contents/MacOS/share/scilab/modules/polynomials/macros/sylm.sci line 29 )
Submatrix incorrectly defined.
--> sylm(1+0*%s,1+0*%s)
at line 16 of function sylm ( /Users/mottelet/scilab/scilab-6.0.1/scilab-6.0.1.app/Contents/MacOS/share/scilab/modules/polynomials/macros/sylm.sci line 29 )
Submatrix incorrectly defined.
--> sylm(1,1+0*%s)
at line 16 of function sylm ( /Users/mottelet/scilab/scilab-6.0.1/scilab-6.0.1.app/Contents/MacOS/share/scilab/modules/polynomials/macros/sylm.sci line 29 )
Submatrix incorrectly defined.
OTHER INFORMATION:
------------------
at https://en.wikipedia.org/wiki/Sylvester_matrix, I can read:
If one of the degrees is zero (that is the corresponding polynomial is a nonzero constant), then there are zero rows consisting of coefficients of the other polynomial, and the Sylvester matrix is a diagonal matrix of dimension the degree of the non-constant polynomial, with the all diagonal coefficients equal to the constant polynomial. If m = n = 0, then the Sylvester matrix is the empty matrix with zero rows and zero columns.