Updates:
        Cc: mattpap
        Labels: NeedsReview

Comment #1 on issue 1563 by asmeurer: re(RootOf) fails because Poly.has()  
fails
http://code.google.com/p/sympy/issues/detail?id=1563

I think the solution is to flatten the args and check to see if each item  
in args is an instance of Basic (Poly uses
Python ints) in Basic.has().  re(RootOf) now works, though it doesn't check  
at all to see if the RootOf actually has a
real part of not.  I don't even know if RootOf's even well-defined enough  
to do this.  I know Maple orders its
RootOf's.  From the Maple docs:
1) The equation expr is a polynomial in x whose coefficients can be  
numerically evaluated (see complexcons). The
RootOf represents the ith complex root (multiplicities taken into account)  
of the polynomial. The roots are ordered
counter-clockwise, with ties broken by increasing modulus. The first root  
is chosen as follows:
- roots with the smallest argument in absolute value are selected,
- roots with positive argument, if any, are then chosen,
- the root with the smallest modulus amongst the remaining roots is the  
root number 1.
See also http://www.maplesoft.com/support/help/view.aspx?path=RootOf/indexed

I included a patch that does this.  It passes all tests.  I also added some  
Poly().has() tests.

Attachments:
        0001-Changed-Basic.has-to-flatten-args-and-check-isinstan.patch  2.0 KB

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to