dump_data(void)
{
/* The first three numbers add to the number of dimensions. */
- int t = get_u32();
- t += get_u32();
- match_u32_assert(n_dims - t);
+ int l = get_u32();
+ int r = get_u32();
+ int c = n_dims - l - r;
+ match_u32_assert(c);
/* The next n_dims numbers are a permutation of the dimension numbers. */
int a[n_dims];
for (int i = 0; i < n_dims; i++)
- a[i] = get_u32();
+ {
+ int dim = get_u32();
+ a[i] = dim;
+
+ const char *name = i < l ? "layer" : i < l + r ? "row" : "column";
+ printf ("<%s dimension=\"%d\"/>\n", name, dim);
+ }
check_permutation(a, n_dims, "dimensions");
int x = get_u32();
variable (e.g. in a frequency table or crosstabulation, a group of
values in a variable being tabulated) and i0 otherwise, but this might
be naive.
+
+@example
+data := int[layers] int[rows] int[columns] int*[n-dimensions]
+@end example
+
+The values of @code{layers}, @code{rows}, and @code{columns} each
+specifies the number of dimensions represented in layers or rows or
+columns, respectively, and their values sum to the number of
+dimensions.
+
+The @code{n-dimensions} integers are a permutation of the 0-based
+dimension numbers. The first @code{layers} of them specify each of
+the dimensions represented by layers, the next @code{rows} of them
+specify the dimensions represented by rows, and the final
+@code{columns} of them specify the dimensions represented by columns.
+When there is more than one dimension of a given kind, the inner
+dimensions are given first.