On Sat, Aug 26, 2017 at 12:09 AM, Jonathan Taylor <jonathan.taylor@stanford.edu> wrote:
>
> Yes, it's a dense 2500x2000 matrix.
>
> Loaded strides: (8, 16000)
>
> Copied strides: (20000, 8)
>
> So, matvec is just slower because of strides and where numpy retrieves data? Is there a simple way to do this besides a copy? I can easily afford the copy, just wondering.

It's not simpler, but the most efficient and idiomatic way to ensure C-contiguity is to use np.ascontiguousarray(). This will make a copy only if necessary.

--
Robert Kern