[Numpy-discussion] Special matrices with structure?

Jaakko Luttinen jaakko.luttinen at aalto.fi
Thu Mar 1 05:23:13 EST 2012


On 02/23/2012 03:50 PM, Jaakko Luttinen wrote:
> Hi!
> 
> I was wondering whether it would be easy/possible/reasonable to have
> classes for arrays that have special structure in order to use less
> memory and speed up some computations?
> 
> For instance:
> - symmetric matrix could be stored in almost half the memory required by
> a non-symmetric matrix
> - diagonal matrix only needs to store the diagonal vector
> - Toeplitz matrix only needs to store one or two vectors
> - sparse matrix only needs to store non-zero elements (some
> implementations in scipy.sparse)
> - and so on

Note to self: BLAS has lots of functions for matrices having special
structure (symmetric, triangular, banded, ...), so I suppose it would
"only" require some Python class wrappers which are compatible with
ndarray/matrix. But I don't know how to make these classes compatible
with generic numpy functions such as numpy.multiply/numpy.dot/etc..
-Jaakko

> 
> If such classes were implemented, it would be nice if they worked with
> numpy functions (dot, diag, ...) and operations (+, *, +=, ...) easily.
> 
> I believe this has been discussed before but google didn't help a lot..
> 
> Regards,
> Jaakko
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion




More information about the NumPy-Discussion mailing list