Back to Aurora Vision Library Lite website

You are here: Start » All Functions » Array Transforms » RotateArray

RotateArray


This is Filter Equivalent. This function may be present in generated code, but should not be used in hand-written code.

Header: STD.h
Namespace: avl

Cyclically shifts the elements of an array.

Syntax

void avl::RotateArray
(
	const atl::Array<Type>& inArray,
	int inShift,
	const bool inInverse,
	atl::Array<Type>& outArray
)

Parameters

Name Type Default Description
Input value inArray const Array<Type>& Input array
Input value inShift int Input the number of positions each element should be shifted by
Input value inInverse const bool Determines if the indices are counted from beginning or from end of the input array
Output value outArray Array<Type>& Cyclically shifted array

Description

The operation moves each of the inArray elements forward by inShift positions. Whenever the resulting index exceeds the size of the array, it cycles back to the beginning of the array.

Examples

inArray = {1,2,3,4,5,6,7}
inShift = 2
outArray = {6,7,1,2,3,4,5}

See Also

  • SlideArray – Creates two copies of the input array - one with elements removed at the beginning, the other with elements removed at the end.
  • ReverseArray – Creates an array of the input array elements in reversed order.