[Numpy-discussion] dot product not behaving as expected

Robert Kern robert.kern@gmail....
Mon Oct 8 12:03:01 CDT 2007

Robin wrote:
>     It works for me with a recent SVN numpy on OS X. What version of
>     numpy are you
>     using? What platform are you on? Did you build with ATLAS or other
>     optimized
>     linear algebra library?
> I am on Ubuntu 7.04, gcc 4.1.2
> In [181]: numpy.__version__
> Out[181]: '1.0.4.dev4155'
> Built with ATLAS 3.7.37, Lapack 3.1.1
> It also occurs for me on Windows XP SP2 with 1.0.4dev4154 built with
> cygwin gcc 3.4.4 and atlas 3.7.37 and lapack 3.1.1.
> Actually I found that for me it also doesn't occur if I type them in
> like that. The problem comes when y is reverse with the [::-1] index. Is
> this the correct way to reverse a vector?

Aha. Yes, that is the correct way to do it. However, it appears that there is a
bug in how dot() is interpreting the non-contiguous array. In the meantime, you
can make a contiguous array with array(y2).

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco

More information about the Numpy-discussion mailing list