Subranges

Let's take another look at the example of the array section in figure
4.2. We can capture this section
in a named variable as follows

Now, what are the ranges of

In fact they are a different sort of range from any considered so
far--they are *subranges*. For completeness the HPJava language
provides a special syntax for constructing subranges directly.
Ranges equivalent to those of `c` can be created by

This syntax should look quite natural. It is modelled on the syntax for multiarray sections themselves.

The global indices associated with the subrange , for example,
are in the range
. A subrange inherits locations from
its parent range, but it specifically *does not* inherit global
indices from the parent.

A *non-trivial subrange* is one for which the lower bound is not
equal to zero, or the upper bound is not equal to
,
or the stride is not equal to 1.

A non-trivial subrange is never considered to have ghost extensions, even if its parent range does. This avoids various ambiguities that might otherwise crop up.

That covers the distributed ranges of sections.
What about the distribution groups of sections? Now
triplet subscripts don't cause problems--the distribution group
of `c` above can be defined to be the same as the distribution
group of the parent distributed array `a`. But the example of figure
4.1 is problematic. This was
constructed using a scalar subscript, effectively as follows:

The single range of

it is understood to be replicated over the first dimension of