I am trying to write a function which would create an s polynomial when provided with two polynomials :
Here it is :
sPolynomial := function(p1, p2, order) local lcm, res; lcm := Lcm(LeadingMonomialOfPolynomial(p1, order), LeadingMonomialOfPolynomial(p1, order)); res := (lcm*p1)/LeadingTermOfPolynomial(p1,order) - (lcm*p2)/LeadingTermOfPolynomial(p2,order); return res; end;
Then here is what I am trying to do:
gap> x := Indeterminate(FLOAT_PSEUDOFIELD,"x"); x gap> y := Indeterminate(FLOAT_PSEUDOFIELD, "y"); y gap> l:=[x^3-2*x*y,(x^2)*y-2*y^2+x,-x^2,-2*x*y,-2*y^2+x]; gap> lexord:=MonomialLexOrdering(); gap> Read("SPolynomial.txt"); gap> sPolynomial(l, l, lexord); Error, no method found! For debugging hints type ?Recovery from NoMethodFound Error, no 1st choice method found for `IsFiniteDimensional' on 1 arguments at /proc/cygdrive/C/gap-4.9.1/lib/methsel2.g:250 called from IsFiniteDimensional( V ) at /proc/cygdrive/C/gap-4.9.1/lib/modfree.gi:120 called from IsFinite( r ) at /proc/cygdrive/C/gap-4.9.1/lib/ringpoly.gi:172 called from PolynomialRing( DefaultField( cfs ), ind ) at /proc/cygdrive/C/gap-4.9.1/lib/ringpoly.gi:579 called from DefaultRingByGenerators( arg ) at /proc/cygdrive/C/gap-4.9.1/lib/ring.gi:396 called from DefaultRing( arg ) at /proc/cygdrive/C/gap-4.9.1/lib/ring.gi:1373 called from ... at *stdin*:19 you can 'quit;' to quit to outer loop, or you can 'return;' to continue brk> quit;
How could it be that the method was not found? I checked that it is situated in the needed directory.
What am I doing wrong in the case? Will be grateful for any help provided.