asa172, a C++ code which generates all multidimensional indices in a given range. simulating the behavior of an arbitrary number of nested loops, by OFlaherty and MacKenzie.
If the number of dimensions was known in advance, such an operation could be carried out by the corresponding set of nested loops. For example, in 3D:
for ( i = i1; i <= i2; i++ ) for ( j = j1: j <= j2; j2++ ) for ( k = k1; k <= k2; k++ ) (I,J,K) is an index in the range.One feature of this library, though, is that it can generate all such indexes for an arbitrary number of dimensions.
This is a version of Applied Statistics Algorithm 172.
The information on this web page is distributed under the MIT license.
asa172 is available in a C version and a C++ version and a Fortran90 version and a MATLAB version and an Octave version.
subset, a C++ code which enumerates combinations, partitions, subsets, index sets, trees, and other combinatorial objects.
Original Fortran77 version by M OFlaherty, G MacKenzie; This version by John Burkardt.