Dear Gap Forum,
Someone called `Anvita' wrote:
If the function "CoefficientsOfUnivariatePolynomial" is applied
to the
unit polynomial, the result is [ 1 ], as expected:
...
For the zero polynomial, however, it returns an empty set:
Yes. the zero polynomial is stored by an empty coefficient list, as
there are no nonzero coefficients.
If the zero polynomial is stored as an empty list then why does the
function
"UnivariatePolynomial" return an error with an empty list as the
second
argument?
That is an oversight. (The conditions on coefficients is to be a list
of ring elements, the empty list does not qualify and needs to be
treated specially.) Thank you for spotting this. It will be corrected
in a future release.
As a workaround you can issue the command:
InstallOtherMethod( UnivariatePolynomial, "ring,empty cof",true,
[ IsRing, IsEmpty ], 0,
function( ring, cofs )
return LaurentPolynomialByCoefficients( ElementsFamily(FamilyObj
(ring)),cofs, 0, 1 );
end );
Best wishes,
Alexander Hulpke
_______________________________________________
Forum mailing list
[email protected]
http://mail.gap-system.org/mailman/listinfo/forum