In-Place Transposition of Rectangular Matrices

  • Fred G. Gustavson
  • Tadeusz Swirszcz
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4699)


We present a new Algorithm for In-Place Rectangular Transposition of an m by n matrix A that is efficient. In worst case it is O(N logN) where N = mn. It uses a bit-vector of size IWORK words to further increase its efficiency. When IWORK=0 no extra storage is used. We also review some of the other existing algorithms for this problem. These contributions were made by Gower, Windley, Knuth, Macleod, Laffin and Brebner (ACM Alg. 380), Brenner (ACM Alg. 467), and Cate and Twigg (ACM Alg. 513). Performance results are given and they are compared to an Out-of-Place Transposition algorithm as well as ACM Algorithm 467.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Berman, M.F.: A Method for Transposing a Matrix. J. Assoc. Comp. Mach. 5, 383–384 (1958)MATHGoogle Scholar
  2. 2.
    Windley, P.F.: Tranpsoing matrices in a digital computer. Comput. J. 2, 47–48 (1959)CrossRefMathSciNetMATHGoogle Scholar
  3. 3.
    Boothroyd, J.: Alg. 302: Transpose vector stored array. Comm. ACM 10(5), 292–293 (1967)CrossRefGoogle Scholar
  4. 4.
    Knuth, D.: In: The Art of Computer Programming (2nd printing), 1st edn., vol. 1, Addison-Wesley, Reading (1969) Problem 12, p. 180 and Solution to Problem 12. p. 517Google Scholar
  5. 5.
    Macleod, I.D.G.: An Algorithm For In-Situ Permutation. The Austrialian Computer Journal 2(1), 16–19 (1970)Google Scholar
  6. 6.
    Laflin, S., Brebner, M.A.: Alg. 380: In-situ transposition of a rectangular matrix. Comm. ACM 13, 324–326 (1970)CrossRefGoogle Scholar
  7. 7.
    Knuth, D.: Matematical Analysis of Algorithms, Information Processing 71, Invited Papers-Foundations. North-Holland Publishing Company (1972)Google Scholar
  8. 8.
    Brenner, N.: Matrix Transposition in Place. Comm. ACM 16(11), 692–694 (1973)CrossRefGoogle Scholar
  9. 9.
    Cate, E.G., Twigg, D.W.: Algorithm 513: Analysis of In-Situ Transposition. ACM TOMS 3(1), 104–110 (1977)CrossRefMathSciNetGoogle Scholar
  10. 10.
    Leathers, B.L.: Remark on Algorithm 513: Analysis of In-Situ Transposition. ACM TOMS 5(4), 520 (1979)CrossRefGoogle Scholar
  11. 11.
    Agarwal, R.C., Gustavson, F.G., Zubair, M.: Exploiting functional parallelism of POWER2 to design high-performance numerical algorithms. IBM Journal of Research and Development 38(5), 563–576 (1994)CrossRefGoogle Scholar
  12. 12.
    Fich, F.E., Munro, J.I., Poblete, P.V.: Permuting In Place. SIAM Journal of Computing 24(2), 266–278 (1995)MATHCrossRefMathSciNetGoogle Scholar
  13. 13.
    Knuth, D.: In: The Art of Computer Programming (4th printing), 3rd edn., vol. 1. Addison-Wesley, Reading Mass (1997) Problem 12, p. 182 and Solution to Problem 12. p. 523Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2007

Authors and Affiliations

  • Fred G. Gustavson
    • 1
  • Tadeusz Swirszcz
    • 2
  1. 1.IBM T. J. Watson Research Center, Yorktown Heights, NY 10598USA
  2. 2.Faculty of Mathematics and Information Science, Warsaw University of Technology, WarsawPoland

Personalised recommendations