e*******i 发帖数: 56 | 1 It is essentially to convert a C 2D array to a Fortran 2D array.
Hard to believe this method will be faster than in-place swapping method.
Its (N-1-k/N+k%N) index conversion and extra copy-back will kill performance.
DaNiuMen have any better solutions?
: the (i,j) entry is given by
: arr[i*N+j] (concatenating rows)
: or
: arr[i+j*N] (concatenating columns)
: suppose the given 2-D matrix is represented in the first form, you can
: generate a rotated matrix expressed in the second form:
: for(int... 阅读全帖 |
|