#2512: implement condition number for matrices
--------------------------------------+-------------------------------------
 Reporter:  schilly                   |         Owner:  was         
     Type:  enhancement               |        Status:  closed      
 Priority:  major                     |     Milestone:  sage-4.7    
Component:  linear algebra            |    Resolution:  duplicate   
 Keywords:  matrix, condition number  |        Author:  Simon Spicer
 Upstream:  N/A                       |      Reviewer:              
   Merged:                            |   Work_issues:              
--------------------------------------+-------------------------------------
Changes (by spice):

  * status:  needs_review => closed
  * resolution:  => duplicate


Comment:

 Turns out Rob Beezer has implemented condition numbers by directly
 wrapping the NumPy cond() command in patch #10837.

 Some timings:

 Patch 2512:

 {{{
 sage: A = matrix([[1,2,4],[5,3,9],[7,8,6]])
 sage: timeit('A.condition_number(2)')
 125 loops, best of 3: 1.96 ms per loop
 sage: timeit('A.condition_number(Infinity)')
 625 loops, best of 3: 1.31 ms per loop
 sage: timeit('A.condition_number("frob")')
 625 loops, best of 3: 949 µs per loop

 sage: A = MatrixSpace(CC,50).random_element()
 sage: timeit('A.condition_number(2)')
 5 loops, best of 3: 389 ms per loop
 sage: timeit('A.condition_number(1)')
 5 loops, best of 3: 380 ms per loop
 sage: timeit('A.condition_number("frob")')
 5 loops, best of 3: 358 ms per loop
 }}}

 Patch 10837:

 {{{
 sage: A = matrix(RDF,[[1,2,4],[5,3,9],[7,8,6]])
 sage: timeit('A.condition(2)')
 625 loops, best of 3: 282 µs per loop
 sage: timeit('A.condition(Infinity)')
 625 loops, best of 3: 123 µs per loop
 sage: timeit('A.condition("frob")')
 625 loops, best of 3: 203 µs per loop

 sage: A = MatrixSpace(CDF,50).random_element()
 sage: timeit('A.condition(1)')
 625 loops, best of 3: 968 µs per loop
 sage: timeit('A.condition(2)')
 125 loops, best of 3: 2.97 ms per loop
 sage: timeit('A.condition("frob")')
 625 loops, best of 3: 942 µs per loop
 }}}

 I vote we go for Rob's patch.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/2512#comment:6>
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