Shifts the elements of all vectors along a given dimension of an array. The shift is end-off; that is, elements shifted off one end are lost, and copies of boundary elements are shifted in at the other end.
Class
Transformational function
Result Value
The result is an array with the same shape and data type as ARRAY.
The absolute value of SHIFT determines the amount of shift. The sign of SHIFT determines the direction of the shift:
Result Value
If BOUNDARY is a scalar value, this value is used in all shifts.
If BOUNDARY is an array of values, the values of the array elements of BOUNDARY with subscripts (s1, s2, ..., s(DIM-1), s(DIM+1), ..., sn) are used for that dimension.
If BOUNDARY is not specified, the following default values are used, depending on the data type of ARRAY:
Examples
! A is | 1.1 4.4 7.7 |, SHIFT is S=(/0, -1, 1/),
! | 2.2 5.5 8.8 |
! | 3.3 6.6 9.9 |
! and BOUNDARY is the array B=(/-0.1, -0.2, -0.3/).
! Leave the first column alone, shift the second
! column down one, and shift the third column up one.
RES = EOSHIFT (A, SHIFT = S, BOUNDARY = B, DIM = 1)
! The result is | 1.1 -0.2 8.8 |
! | 2.2 4.4 9.9 |
! | 3.3 5.5 -0.3 |
! Do the same shifts as before, but on the
! rows instead of the columns.
RES = EOSHIFT (A, SHIFT = S, BOUNDARY = B, DIM = 2)
! The result is | 1.1 4.4 7.7 |
! | -0.2 2.2 5.5 |
! | 6.6 9.9 -0.3 |