Back to Adaptive Vision Library website
You are here: Start » Function Reference » Array Transforms » SwapArrayElements
This is Filter Equivalent. This function may be present in generated code, but should not be used in hand-written code.
Swaps two elements of an array.
Syntax
void avl::SwapArrayElements ( atl::Array<Type>& ioArray, const int inIndex1, const int inIndex2, bool inInverse )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
ioArray | Array<Type>& | ||||
inIndex1 | const int | 0 - | Index of the first element being swapped | ||
inIndex2 | const int | 0 - | Index of the second element being swapped | ||
inInverse | bool | False | Reversed order in the array |
Examples
inArray = {1,4,3,2,5} inIndex1 = 0 inIndex2 = 4 |
outArray = {5,4,3,2,1} |
Errors
Error type | Description |
---|---|
DomainError | Index out of range in SwapArrayElements. |
See Also
- ReverseArray – Creates an array of the input array elements in reversed order.
- RotateArray – Cyclically shifts the elements of an array.