An algorithm to compute all full-span sub arrays of a regular array

  • Authors:
  • Ronald I. Frank

  • Affiliations:
  • Pace University, Pleasantville, NY

  • Venue:
  • Proceedings of the 2003 conference on APL: stretching the mind
  • Year:
  • 2003

Quantified Score

Hi-index 0.00

Visualization

Abstract

We present an algorithm that explicitly generates all full-span regular sub arrays of a given N dimensional regular array. By explicit, we mean that we generate the N-dimensional indexes of the j-dimensional sub array cells that make up each j-dimensional sub array. The algorithm can be viewed as generating all j-dimensional full span sub arrays for fixed j, for j = 0 to j = N. We first list some lemmas and definitions, and then give the algorithm that is based upon the knowledge gained from a new expansion [1] and [2]. There is an alternate combinatorial argument yielding the same algorithm.First we give an heuristic summary and then a more detailed example use. In the algorithm, we use APL-C-Java order in the indexes, i.e., right-to-left (RTL). However, essentially the same algorithm (except for transpositions) holds for left-to-right (LTR) order as used in FORTRAN. In the exposition, we use mathematical notation, which is LTR.There is a Java 1.4 code and an APL WS available. The Java code requires an interactive input of the dimension of the original array and its shape vector. The APL WS contains FNS that work the same way, and others that can be used as callable sub FNS. An appendix exhibits the APL code that computes this algorithm for a given j.