Bill Page wrote:
> Waldek,
>
> I have a few more patches that I would like to get into FriCAS before
> the next release but really none of them are "critical". Here's one
> for XPOLY. It adds a couple of missing functions. I first mentioned
> this patch here:
>
> http://lists.gnu.org/archive/html/axiom-math/2006-03/msg00003.html
>
> Index: src/algebra/xpoly.spad.pamphlet
> ===================================================================
> --- src/algebra/xpoly.spad.pamphlet (revision 684)
> +++ src/algebra/xpoly.spad.pamphlet (working copy)
> @@ -116,6 +116,27 @@
> (r := lquo (u,l)) case "failed" => "failed"
> reverse_! (r::%)
>
> + -- Inserted by Bill Page, based on 'divide' from 'FreeMonoid'
> + (lar:% div a:%) ==
> + (a = 1) => [lar, 1]
> + Na : Integer := #(la := listOfMonoms(a)$Rep)
> + Nlar : Integer := #(llar := listOfMonoms(lar)$Rep)
> + l:List(REC) := empty()
> + while Na <= Nlar repeat
> + if llar.first.gen = la.first.gen and
> + llar.first.exp >= la.first.exp then
> + -- Can match a portion of this lar factor.
> + -- Now match tail.
> + (q:=lquo(makeMulti rest llar,makeMulti rest la))case $ =>
> + if llar.first.exp > la.first.exp then
> + l := concat_!(l, [la.first.gen,
> + (llar.first.exp - la.first.exp)::NNI])
> + return [makeMulti l, q::%]
> + l := concat_!(l, first llar)
> + llar := rest llar
> + Nlar := Nlar - 1
> + "failed"
> +
It seemse that we could just use divide as name of operation.
Then we will re-use implementation from FreeMonoid.
> length x == reduce("+" ,[f.exp for f in listOfMonoms x], 0)
>
> varList x ==
> @@ -517,6 +538,8 @@
>
> -- definitions
>
> + monom(w, r) == [[w,r]]
> + coerce(x:WORD):% == monom(x,1$R)
> mindegTerm p == last(p)$Rep
>
> if R has CommutativeRing then
>
This is OK.
--
Waldek Hebisch
[email protected]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/fricas-devel?hl=en
-~----------~----~----~----~------~----~------~--~---