# [SciPy-user] matrix-vector multiplication errors

Sat Feb 2 09:54:38 CST 2008

```Matthieu

We are using real data and are comparing it with results from a C++ implementation and hence know that the results from the matrix operations 1. and 2. are incorrect.  The values of b after the A*x operation are all "-1#IND" for both 1. and 2.

Any ideas?

Dinesh

--------------------------------------------------------------------------------
Message: 6
Date: Fri, 1 Feb 2008 23:24:35 +0100
From: "Matthieu Brucher" <matthieu.brucher@gmail.com>
Subject: Re: [SciPy-user] matrix-vector multiplication errors
To: "SciPy Users List" <scipy-user@scipy.org>
Message-ID:
<e76aa17f0802011424u103f3f72hcdbc2dfe3126f2e0@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi,

Try with some values so that the results can be reproduced (or first some
real random values and not garbage). In your case, all that can be said is
that some values in A and x must be indeterminated or NaN.

Matthieu

>
>  I'm performing a standard Scipy matrix* vector multiplication, b=Ax ,
> (but not using the sparse module) with different sizes of A as follows:
>
> Assuming 8 bytes per float, then:
> 1. matrix A with M=10,000 and N=15,000 is of approximate size: 1.2Gb
> 2. matrix A with M=10,000 and N=5,000 is of approximate size: 390Mb
> 3. matrix A with M=10,000 and N=1,000 is of approximate size: 78Mb
>
> The Python/Scipy matrix initialization statements are:
> > A = scipy.asmatrix(scipy.empty((I,J), dtype=int))
> > x = scipy.asmatrix(scipy.empty((J,1), dtype=float))
> > b = scipy.asmatrix(scipy.empty((I,1), dtype=float))
>
> I'm using a Windows XP SP2 PC with 2Gb RAM.
>
> Both matrices 1. and 2. fail with INDeterminate values in b.  Matrix 3.
> works perfectly.  As I have 2Gb of RAM why are matrices 1. and 2. failing?
>
> The odd thing is that Python doesn't return any error messages with 1. and
> 2. but we know the results are garbage (literally!)
>
> Cheers!
>
> Dinesh
>
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user@scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-user/attachments/20080202/34e0af26/attachment.html
```