Skip to Main Content
The purpose of this paper is to present an algorithm for transposing large rectangular matrices. This is basically a generalization of Eklundh's algorithm. Eklundh's method is designed to handle arrays in place of using powers-of-2 approach wherein partitions of the matrix have dimensions which are powers of 2. The algorithm presented here does not have this restriction. The choice of partitions is posed as an optimal control problem amenable to solution using Bellman's principle of optimality. The optimal partitioning of the matrix can be determined depending on the computer configuration (i.e., core size, whether moving-head or fixed-head disk drives are used, number of words per track, etc.) and the matrix dimensions. Simple modifications are noted for transposing complex/double precision and packed integer matrices. Experimental results are presented comparing the times needed for transposition using optimal partitioning and powers-of-2 partitioning. It is found in the cases tested that a speed gain of up to 5.55 is obtained by optimizing the partition sizes.