[SciPy-user] matrix multiplication efficiency

Conor Robinson conor.robinson at gmail.com
Thu Mar 27 17:10:08 EDT 2008


In my experience numpy can be _much_ faster than matlab.  Do you have
a code snippet?  Furthermore, did you compile numpy on your machine
and with what? Do you have a fortran compiler?  Something sounds fishy
because I've multiplied much larger matrices in no time at all eg.
your example x100.  You may have not linked the BLAS or ATLAS libs
during compile time. Even writing a raw python function to multiple
matrices of the size your dealing with should take less time.

1. Make sure you linked BLAS or ATLAS as well as compilers check the config file

2. A code snippet of how went about this would help.

3. Pick up a copy of the numpy manual.

HTH,
Conor

On Thu, Mar 27, 2008 at 10:32 AM, Chiara Caronna
<chiaracaronna at hotmail.com> wrote:
>
>  Hi,I hope this is the right mailing list.I need to perform matrix multiplication with big matrices and I realized that numpy is much slower with compared to matlab? does anyone know why?for example to multiply two perform this calculationa= matrix 2000x10000b= matrix 10000x2000c=a x b (c matrix 2000 x 2000)it takes roughly 100-300 sec, depending on the pc...while on matlab it is almost instantaneous...what can I do?This is my python installation:Python 2.5.1 (r251:54863, Mar  7 2008, 04:10:12)
>  [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
>  Type "help", "copyright", "credits" or "license" for more information.
>  >>> import numpy
>  >>> numpy.__version__
>  '1.0.3'
>  >>>
>
>  _________________________________________________________________
>  News, entertainment and everything you care about at Live.com. Get it now!
>  http://www.live.com/getstarted.aspx
>  _______________________________________________
>  SciPy-user mailing list
>  SciPy-user at scipy.org
>  http://projects.scipy.org/mailman/listinfo/scipy-user
>



More information about the SciPy-User mailing list