Oops, missend the previous email...

The check should not stop when "degree last Lin" is 0,
it should stop when "last Lin" is 0.

Another flaw in subresultantSequence is that it returns
nothing when p2 is degree 0, it should return
  [resultant(p1, p2)]
but it did't affect SturmHabichtSequence, so I won't fix
that, after all, this subresultantSequence should be replaced
by some function from prs.spad.

The patch is:

diff --git a/src/algebra/sturm.spad b/src/algebra/sturm.spad
index d52502d..2e67583 100644
--- a/src/algebra/sturm.spad
+++ b/src/algebra/sturm.spad
@@ -81,8 +81,10 @@ SturmHabichtPackage(R, UP) : T == C where

      subresultantSequenceInner(p1, p2) : L UP ==
          Lin : L UP := subresultantSequenceBegin(p1, p2)
-         while degree last Lin ~= 0 repeat
+         while last Lin ~= 0 repeat
+             -- break the loop until the last element is 0
              Lin := subresultantSequenceNext(Lin)
+         Lin := remove!(#Lin, Lin) -- remove the last 0
          -- It's possible that #Lin is larger than degree(p1)
          for j in #Lin..degree(p1) repeat
              Lin := append(Lin, [0])

-- 
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