To: J3 J3/20-125
From: Van Snyder
Subject: Rank-agnostic array element and section denotation, Edits
Date: 2020-February-27
Reference: 19-150 20-113
[Introduction Data usage and computation]
"o An array can be used to specify a sequence of subscripts. Arrays
can be used to specify a sequence of subscripts and strides in
subscript triplets."
[125:3-4 9.4.2 Structure components] Replace constraint C913 with:
"C913 (R912) If appears, the sum of the rank of
, the sizes of the arrays in each multiple subscript,
and the number of s, shall be equal to the rank of
."
[125:15-16 Structure components p2] Replace the second sentence (they
both begin "The rank of ...):
"If appears, the rank of is the sum
of the number of subscript triplets, the number of vector subscripts,
and the size of one of the arrays in each multiple section subscript."
{Don't count size(lower bound) + size (upper bound) + size(stride).}
[127:23+ 9.5.3.1 Syntax in 9.5.3 Array Elements and Sections R919+]
Insert a syntax rule:
"R919a <> @ "
[127:24+ 9.5.3.1 Syntax in 9.5.3 Array Elements and Sections R920]
Insert an alternative after <> :
" <> "
[127:24+ 9.5.3.1 Syntax in 9.5.3 Array Elements and Sections R920]
Insert an alternative after <> :
" <> "
[127:27+ 9.5.3.1 Syntax in 9.5.3 Array Elements and Sections R921+]
Insert a syntax rule:
"R921a <>
@ [ ] : ] : [ ]"
[127:29+ 9.5.3.1 Syntax in 9.5.3 Array Elements and Sections] Insert
constraints:
"C926a (R919a) shall be an array of rank one.
"C926b (R921a) At least one that is an array of rank one
shall appear in a . The s
shall be conformable."
[128:3+ 9.5.3.1 Syntax in 9.5.3 Array Elements and Sections] Insert
new constraint:
"C928a (R921a) If is the last
in , the second
shall appear."
[128:7- 9.5.3.2 Array element order-] Between NOTE 3 and the subclause
heading 9.5.3.2 Array element order insert
"NOTE 4
Examples of references to parts of arrays using one-dimensional
arrays to specify sequences of subscripts or sequences of subscript
section boundaries or strides, assuming V1, V2, and V3 are rank-one
arrays are:
A(@V1, :, @V2 ) ! Section of A, whose rank is size(V1) + 1 +
! size(V2). The rank of is one.
B(@V1, :, @V2: ) ! Section of B, whose rank is size(V1) + 1 +
! size(V2). The rank of is 1 +
! size(V2).
C(@V1, :, @::V3 ) ! Section of C, whose rank is size(V1) + 1 +
! size(V3). The rank of is 1 +
! size(V3).
"
[128:7- 9.5.3.2 Array element order-] Before subclause 9.5.3.2 Array
element order, insert a subclause:
"9.5.3.1a Sequences of subscripts and subscript triplets
A specifies a sequence of subscripts, the number of
which is equal to the size of . The effect is as if
the array elements were specified individually as subscripts of
consecutive dimensions (not preceded by @).
In a , if the first does not
appear, the effect is as if it were a one-dimensional array whose
element values are the lower bounds of the corresponding dimensions. If
the second does not appear, the effect is as if it were a
one-dimensional array whose element values are the upper bounds of the
corresponding dimensions. If the third does not appear, the
effect is as if it appeared with the value one.
A specifies a sequence of subscript
triplets, the number of which is equal to the size of an that
is an array. If any is a scalar, the effect is as if it were
broadcast to the shape of one that is an array. An element of the first
array acts as if it were the first in a triplet;
an element of the second array acts as if it were the second
; an element of the third array acts as if it were the
.
[129:3 9.5.3.3.1 Section subscript lists, p1] Replace
" by "subscript triplet".
[129:16 9.5.3.3.2 Subscript triplet, p1] Replace "" by "stride".