Updates:
Status: Started
Owner: mattpap
Cc: -mattpap
Labels: Milestone-Release0.7.0
Comment #3 on issue 2031 by mattpap: Add field option to Poly.operation()
functions
http://code.google.com/p/sympy/issues/detail?id=2031
Lets consider the following scenario: by default we care to run our
algorithms in the most general setup, the user constructs two polynomials f
and g without setting the domain explicitly and he wants to compute
f.div(g). As we want to have the most generality, then auto=True, the user
didn't bother to set the domain, so he wants the default (most general)
behavior. The result is OK.
Now another user does the same computation, but he sets the domain
explicitly to ZZ. div() still cares about generality so auto=True by
default and the user gets invalid result from his point of view. A solution
is to set auto=False, but now he has to set both the domain and auto flag.
So, to make both users happy, auto should be an option to Poly (not a flag
to polynomial manipulation functions) dependent on domain option. If domain
wasn't set then auto=True, else auto=False.
Probably. If it's more efficient to work with a ring when we can, then we
should do that.
That's one thing. The other is that we shouldn't change types without an
explicit reason (if the input coefficients were integers and division
occurred over integers, however all computations were done with rational
coefficients (all q=1), then it's not a good reason to keep them rational).
Summing up, div(), quo() and rem() will get auto flag (True by default). If
the result can be retracted (coerced down) to the previous domain, then the
previous domain will be kept, otherwise a field associated with the
previous domain will be kept (gcdex() and friends will be updated to match
new behavior). Binding auto with domain I'm leaving for future (it's not
that important right now because we can always set auto=False).
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" 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/sympy-issues?hl=en.