On 05/20/2013 05:19 PM, Theo Belaire wrote:
> I have a large computation where I need to compute the number of
> positive eigenvalues of a matrix. I am currently computing all the
> eigenvalues then counting how many are positive, but I see when
> profiling that "{method 'roots' of
> 'sage.rings.polynomial.polynomial_element.Polynomial' objects}" is
> taking up most of the time. Any way to just get sign? Or to use
> estimates to speed up most of the computation, and I can recompute
> any that have more than 1 positive eigenvalues exactly. I'd really
> like to avoid any false negatives though.
>
Singular (included in sage) has a library that can quickly count the
number of real roots in an interval:
http://mate.dm.uba.ar/~alidick/etobis/rrc.pdf
I don't see an easy way to interface with it, but you could probably
come up with something based on other code that uses singular.
This seems to do what you want:
sturmha(p, 0, maxabs(p))
--
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.