An O(1) Space Algorithm for N-Dimensional Tensor Rotation: A Generalization of the Reversal Method
Dexin Chen

TL;DR
This paper generalizes the three-reversal in-place array rotation algorithm to N-dimensional tensors, enabling efficient, O(1) space rotation with linear time complexity for high-dimensional data structures.
Contribution
It introduces the $2^n+1$ reversal algorithm, extending in-place rotation techniques to N-dimensional tensors with formal proofs of correctness.
Findings
Achieves in-place tensor rotation with O(1) auxiliary space.
Provides a formal proof of the algorithm's correctness.
Demonstrates the pattern of reversals for any number of dimensions.
Abstract
The rotation of multi-dimensional arrays, or tensors, is a fundamental operation in computer science with applications ranging from data processing to scientific computing. While various methods exist, achieving this rotation in-place (i.e., with O(1) auxiliary space) presents a significant algorithmic challenge. The elegant three-reversal algorithm provides a well-known O(1) space solution for one-dimensional arrays. This paper introduces a generalization of this method to N dimensions, resulting in the " reversal algorithm". This algorithm achieves in-place tensor rotation with O(1) auxiliary space and a time complexity linear in the number of elements. We provide a formal definition for N-dimensional tensor reversal, present the algorithm with detailed pseudocode, and offer a rigorous proof of its correctness, demonstrating that the pattern observed in one dimension (…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsTensor decomposition and applications · Computational Geometry and Mesh Generation · Interconnection Networks and Systems
