[Numpy-discussion] Numpy matrix and Blitz Matrix

Paolo Tenconi ptenconi at eco.uninsubria.it
Thu Nov 22 09:13:08 EST 2007

Hi Everyone,

*) numpy arrays are automatically converted to blitz arrays. That's fine.

*) I need to work with blitz Matrix objects, but I noticed that
    numpy matrix objects are not converted to them and I get a
    compilation error too

3) Does someone on the list succeeded doing that?
    Or is there a workaround to create quickly a blitz matrix object
    from a numpy 2D array or numpy-matrix without wasting time
    in casting operations?

It would be nice having an automatic translation of numpy.matrix to
blitz Matrix as matrices are used frequently in scientific computing.

Any suggestion or help would be very glad.

#------------------  EXAMPLE CODE -----------------------------------

import numpy
import scipy

#Dot product with arrays (it works)

#Matrix multiplication with matrix (gives compilation error)
X=numpy.matlib.mat('1 2; 3 4')


More information about the NumPy-Discussion mailing list