A valarray generalized slice is specified by a starting index, a set of sizes, and a set of strides. It produces a multidimensional combination of slice selections, where:
The starting index (start) is the index of the first element in the selection.
The size (size) is the number of elements selected in each dimension.
The stride (stride) is the separation between the elements that are selected (the size of each dimension).
For example, a gslice with:
start = 1 size = {2, 3} stride = {7, 2}
would select:
[0][1][2][3][4][5][6][7][8][9][10][11][12][13]
start=1: *
|
size=2, stride=7: *--------------------*
| |
size=3, stride=2: *-----*-----* *------*------*
| | | | | |
gslice: * * * * * *
[0][1][2][3][4][5][6][7][8][9][10][11][12][13]
|
Members
| (constructor) | gslice constructor (public member function) |
| gslice::start | Return start of gslice (public member function) |
| gslice::size | Return sizes of gslice (public member function) |
| gslice::stride | Return strides of gslice (public member function) |
Example
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|
Output
gslice: 1 3 5 8 10 12 |
See also
| slice | Valarray slice selector (class) |
| gslice_array | Valarray gslice selection (class template) |
