# Shift Array (G Dataflow)

Version:

Shifts the elements in an array by a specified number of shifts.

This node does not rotate the elements in the array. This node disposes of the elements of the input sequence shifted outside the range. You cannot recover those elements by shifting the array in the opposite direction.

## input array

Input array to shift.

## number of shifts

Direction and number of shifts to apply to the input array. This node shifts the input array to the right if number of shifts is positive and to the left if number of shifts is negative.

The absolute value of number of shifts must be less than the number of elements in input array. If the absolute value of number of shifts is greater than or equal to the number of elements in input array, this node sets shifted array to 0 and returns an error.

Default: 0

## error in

Error conditions that occur before this node runs. The node responds to this input according to standard error behavior.

Default: No error

## shifted array

Output sequence.

## error out

Error information. The node produces this output according to standard error behavior.

## Algorithm for Shifting Arrays

Let the sequence Y represent the output sequence shifted array. Then the elements of Y are related to the elements of X by the following equation:

${Y}_{i}=\left\{\begin{array}{cc}{X}_{i-\mathrm{shifts}}& \mathrm{if}\text{\hspace{0.17em}}0\le i-\mathrm{shifts}

for i = 0, 1, ..., n - 1,

where n is the number of elements in input array.

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported