Back to Adaptive Vision Library website

You are here: Start » Function Reference » Array Transforms » SplitArray

SplitArray


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

Divides an array into two parts at the given index.

Syntax

void avl::SplitArray
(
	const atl::Array<Type>& inArray,
	const int inIndex,
	bool inInverse,
	atl::Array<Type>& outArray1,
	atl::Array<Type>& outArray2
)

Parameters

Name Type Range Default Description
inArray const Array<Type>& Input array
inIndex const int 0 - Index of the first element that is passed to the second of the output arrays
inInverse bool False Reversed order in the array
outArray1 Array<Type>& First output array
outArray2 Array<Type>& Second output array

Description

The operation divides the inArray into two parts. The elements on positions smaller than inIndex are passed to outArray1, while the remaining ones are passed to outArray2. The index numbering in Adaptive Vision Studio is zero-based.

Examples

inArray = {1,4,3,2,5}
inIndex = 3
outArray1 = {1,4,3}
outArray2 = {2,5}

Errors

List of possible exceptions:

Error type Description
DomainError Index out of range in SplitArray.

See Also

  • CropArray – Selects a continuous subsequence of array elements.