 <p>Youd need to pad your data with at least order n zeros; then you could set stride[n]==-stride[m] to achieve the intended effect, and avoid allocating order n*m zeros.</p> <p>But something tells me there must be a more elegant solution to your problem, if you take a bigger-picture view.</p>