#5345: [with patch, needs work] Optimize transpose for dense matrices
----------------------------+-----------------------------------------------
Reporter: rbeezer | Owner: rbeezer
Type: enhancement | Status: new
Priority: major | Milestone: sage-3.4.1
Component: linear algebra | Keywords: transpose
----------------------------+-----------------------------------------------
Comment(by ylchapuy):
This transpose function has another problem, it copies the entries
multiple times which is very bad for memory usage. For example I can't
transpose a 5000x5000 matrix on my laptop.
I suggest something like this (but maybe I'm missing something here?)
{{{
(nc, nr) = (self.ncols(), self.nrows())
trans = self.new_matrix(nrows = nc, ncols = nr,
copy=False,
coerce=False)
for j in xrange(nc):
for i in xrange(nr):
trans[j,i]=self[i,j]
if self.subdivisions is not None:
row_divs, col_divs = self.get_subdivisions()
trans.subdivide(col_divs, row_divs)
return trans
}}}
(sorry, no time to do a proper patch right now)
PS: I also think that there should be an optimized version af transpose in
matrix_integer_dense.pyx, but it's probably for another ticket.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5345#comment:5>
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
-~----------~----~----~----~------~----~------~--~---