An ArrayShape has the following syntax diagram:
Rank is an unsigned integer (stored in compressed form, see §II.23.2) that specifies the number of dimensions in the array (shall be 1 or more).
NumSizes is a compressed unsigned integer that says how many dimensions have specified sizes (it shall be 0 or more).
Size is a compressed unsigned integer specifying the size of that dimension – the sequence starts at the first dimension, and goes on for a total of NumSizes items.
Similarly, NumLoBounds is a compressed unsigned integer that says how many dimensions have specified lower bounds (it shall be 0 or more).
And LoBound is a compressed signed integer specifying the lower bound of that dimension – the sequence starts at the first dimension, and goes on for a total of NumLoBounds items.
None of the dimensions in these two sequences can be skipped, but the number of specified dimensions can be less than Rank.
Here are a few examples, all for element type int32
:
Type | Rank | NumSizes | Size | NumLoBounds | LoBound | |
---|---|---|---|---|---|---|
[0...2] |
I4 |
1 |
1 |
3 |
0 |
|
[,,,,,,] | I4 |
7 |
0 |
0 |
||
[0...3, 0...2,,,,] |
I4 |
6 |
2 |
4 3 |
2 |
0 0 |
[1...2, 6...8] |
I4 |
2 |
2 |
2 3 |
2 |
1 6 |
[5, 3...5, , ] |
I4 |
4 |
2 |
5 3 |
2 |
0 3 |
[Note: definitions can nest, since the Type can itself be an array. end note]