#12292: charpoly is recomputed when called with a different variable
------------------------------+---------------------------------------------
   Reporter:  zimmerma        |          Owner:  jason, was
       Type:  enhancement     |         Status:  new       
   Priority:  minor           |      Milestone:  sage-5.0  
  Component:  linear algebra  |       Keywords:  sd35.5    
Work_issues:                  |       Upstream:  N/A       
   Reviewer:                  |         Author:            
     Merged:                  |   Dependencies:            
------------------------------+---------------------------------------------
 When the characteristic polynomial of a given matrix is computed for
 two different variables, the computation is done once again:
 {{{
 sage: A=random_matrix(ZZ,100)
 sage: time p1=A.charpoly('x')
 Time: CPU 0.25 s, Wall: 0.28 s
 sage: time p2=A.charpoly('x')
 Time: CPU 0.00 s, Wall: 0.00 s
 sage: time p3=A.charpoly('y')
 Time: CPU 0.25 s, Wall: 0.29 s
 sage: p1.subs(x=y) - p3
 0
 }}}
 We see that the computation of p2 is immediate since it was cached
 for the variable x, but that of p3 is not, since the code searches for a
 cached charpoly with the variable y! It would suffice to search a cached
 charpoly for any variable, and substitute that variable.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12292>
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 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/sage-trac?hl=en.

Reply via email to