EOSHIFT

Platform

x64, Win32, .NET

Purpose

Perform an end-off shift on an array expression.

Class

Transformational function.

Syntax

FUNCTION EOSHIFT(ARRAY, SHIFT [, BOUNDARY, DIM])
INTEGER SHIFT
INTEGER DIM

Description

Perform an end-off shift on an array expression of rank one or perform end-off shifts on all the complete rank one sections along a given dimension of an array expression of rank two or greater. Elements are shifted off at one end of a section and copies of a boundary value are shifted in at the other end. Different sections may have different boundary values and may be shifted by different amounts and in different directions.

BOUNDARY is optional and takes the following default values depending in its type:

Integer
Real
Complex
Logical
Character

0
0.0
(0.0, 0.0)
false
filled with blanks

 

DIM is optional and is a value in the range 1 < DIM < n where n is the rank (i.e. the number of dimensions) of ARRAY. The default value of DIM is 1.

Return value

The result has the same type, type parameters and shape as ARRAY.

Example

If A = [1, 2, 3, 4, 5] then EOSHIFT(A, 2) (i.e. shifted to the left) gives [3, 4, 5, 0, 0], and EOSHIFT(A, -2, 6) gives [6, 6, 1, 2, 3].

If A = then EOSHIFT(A, 1, DIM=2) gives .

If S = [1, 0, 2] and B = [10, 0, 0] then
EOSHIFT(A, S, BOUNDARY=B, DIM=2) gives .

 

 

Basket
Empty
 
Copyright © 1999-2024 Silverfrost Limited