#20243: Count real roots of polynomials using Sturm sequences
-------------------------------------+-------------------------------------
Reporter: kedlaya | Owner: kedlaya
Type: enhancement | Status: needs_work
Priority: minor | Milestone: sage-7.2
Component: algebra | Resolution:
Keywords: polynomials, | Merged in:
root-counting, days71 | Reviewers:
Authors: Kiran Kedlaya | Work issues:
Report Upstream: N/A | Commit:
Branch: | 716f4650f5288e639823caa5ec07da14751d094c
u/kedlaya/count_real_roots_of_polynomials_using_sturm_sequences| Stopgaps:
Dependencies: #20256 |
-------------------------------------+-------------------------------------
Comment (by kedlaya):
Replying to [comment:33 jdemeyer]:
> Replying to [comment:32 kedlaya]:
> > Here is a better solution: make the function work on complex inputs!
Now I first attempt a conversion to RR, and if no exception is raised I
pass the (unconverted) input directly to PARI; that way, exact inputs stay
exact. If that fails, I convert to CC (allowing an exception through if it
occurs), and take the GCD of the polynomial with its conjugate (and strip
off the leading coefficient) to get a polynomial with real coefficients
and all the same real roots as before.
>
> Can you document the stuff you wrote here in the code?
>
> I don't see why you need to convert to `CC`. Just conjugate without
conversion. That way, you support much more base fields, in particular
`QQbar`.
Done. I also took out the conversion to RR, since anyway Pari will return
an error if it doesn't like the input.
--
Ticket URL: <http://trac.sagemath.org/ticket/20243#comment:35>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" 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 https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.