>> Should sylvesterMatrix be defined for non-zero
>> degree 0 polynomials? Should it give an error if
>> one argument is zero?
>
> I am not sure.  Probably yes if second argument is
> nonzero.

For consistency, resultant(p,q)=determinant sylvesterMatrix(p,q),
sylvesterMatrix should not be defined for zero argument.
And that's what Wikipedia and Bronstein's book says.

diff --git a/src/algebra/bezout.spad b/src/algebra/bezout.spad
index 16d3ed50..9f808600 100644
--- a/src/algebra/bezout.spad
+++ b/src/algebra/bezout.spad
@@ -32,7 +32,7 @@
   Exports ==> with
     sylvesterMatrix : (UP, UP) -> M
       ++ sylvesterMatrix(p, q) returns the Sylvester matrix for the two
-      ++ polynomials p and q.
+      ++ nonzero polynomials p and q.

     subSylvesterMatrix : (M, NNI) -> M
         ++ subSylvesterMatrix(S, j) returns the jth sub-Sylvester matrix
@@ -66,6 +66,7 @@
   Implementation ==> add

     sylvesterMatrix(p, q) ==
+      if p = 0 or q = 0 then error "sylvesterMatrix: argument is zero"
       n1 := degree p; n2 := degree q; n := n1 + n2
       sylmat : M := new(n, n, 0)
       minR := minRowIndex sylmat; minC := minColIndex sylmat

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to