Back to Adaptive Vision Library website

You are here: Start » Function Reference » 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.

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
inArray const Array<Type>& Input array
inShift int Input the number of positions each element should be shifted by
inInverse const bool Reversed direction of shift
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