[Numpy-discussion] Sparse matrices in NumPy?

Charles G Waldman cgw at fnal.gov
Mon Jun 5 13:22:20 EDT 2000


Paul Gettings writes:
 > 
 > >  > However, the matrix is empty except for the main diagonal. 
 > > Multiplying by a diagonalized matrix is just vectorized multiplication:
 > > a 0 0 
 > > 0 b 0   .  <x, y, z> = <az, by, cz>
 > > 0 0 c
 > My mistake - I need to multiply the 7731x7731 by a 7731x220 element matrix -
 > square matrix times rectangular matrix, not just 2 diagonal matrices.
 > Otherwise, the problem wouldn't be so hard. :)

Still it's not so bad, you just need to break the 7731x220 matrix into
220 vectors of length 7731 and multiply each of them by the diagonal
"matrix", one at a time, and glue the results back together.  The
7731x220 matrix should weigh in at about 6MB, hopefully you have
enough memory for this...




More information about the NumPy-Discussion mailing list