I haven't explicitly set the ring it's working over, but all the entries of 
the matrix are integral.

On Monday, 20 May 2013 20:37:55 UTC-4, William wrote:
>
> On Mon, May 20, 2013 at 2:19 PM, Theo Belaire 
> <[email protected] <javascript:>> 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. 
> > 
>
> Can you somehow give an example of the sort of polynomials you're 
> considering? 
>
> What's the base field?  RR, RealField(100), RDF, CDF, etc.? 
>
> For example: 
>
> R.<x> = RR['x'] 
> f = x^50 + 7*x + 5 
> %timeit f.roots() 
> 5 loops, best of 3: 97.6 ms per loop 
>
> versus 
>
> R.<x> = RDF['x'] 
> f = x^50 + 7*x + 5 
> %timeit f.roots() 
> 125 loops, best of 3: 5.74 ms per loop 
>
> > -- 
> > 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] <javascript:>. 
> > To post to this group, send email to 
> > [email protected]<javascript:>. 
>
> > Visit this group at http://groups.google.com/group/sage-support?hl=en. 
> > For more options, visit https://groups.google.com/groups/opt_out. 
> > 
> > 
>
>
>
> -- 
> William Stein 
> Professor of Mathematics 
> University of Washington 
> http://wstein.org 
>

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


Reply via email to