#5144: [with patch, needs review] speed up right_nullity for matrices
----------------------------+-----------------------------------------------
 Reporter:  jhpalmieri      |       Owner:  was          
     Type:  defect          |      Status:  new          
 Priority:  minor           |   Milestone:  sage-3.3     
Component:  linear algebra  |    Keywords:  right_nullity
----------------------------+-----------------------------------------------
 left_nullity currently functions by computing the difference between
 self.nrows() and self.rank().

 right_nullity currently functions by calling left_nullity on the transpose
 of the matrix, and so it can be sped up if it instead computes
 self.ncols() - self.rank().  The attached patch does this.

 To see the effect, try timing some things with
 {{{
 sage: m = random_matrix(ZZ, 50, x=2^16)
 }}}
 On my machine, I get
 {{{
 sage: timeit('m.left_nullity()')
 625 loops, best of 3: 2.29 µs per loop
 timeit('m.transpose()')
 125 loops, best of 3: 1.72 ms per loop
 }}}
 so the transpose operation is really slow.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5144>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
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