Dear all,
I have a Boolean polynomial f with huge degree & variables.
Also it has huge number of monomials.
I want to delete all monomials from f with degree greater
than 20. For that I have written the following approach.
V=BooleanPolynomialRing(4,['r%d'%(i) for i in range(4)])
V.inject_variables()
f=r0+r1*r2+r1*r2*r3
print f.degree()
A=f.monomials()
g=0
for i in range(Set(A).cardinality()):
if((A[i]).degree()>=2):
g=g+V(A[i])
f=f+g
print f
But observed that for my actual case, it is very slow. Will you
kindly give any better idea?
--
You received this message because you are subscribed to the Google Groups
"sage-support" 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 http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.