Aug. 26, 2017
5:10 p.m.
On Sat, Aug 26, 2017 at 12:09 AM, Jonathan Taylor < jonathan.taylor@stanford.edu> wrote:
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.
No, the only way to change the strides of an array with the same data is to make a copy. Array operations will always be fastest when the smallest strides are along the axis iterated over in the inner-most (summed) loop. So this existing strides of your matrix are not sub-optimal in general, just for this specific operation. They would be suitable, for example, in a vector-matrix multiply.