Back to Aurora Vision Library website

You are here: Start » Function Reference » All Functions » 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
Module: FoundationLite

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
Input value inArray const Array<Type>& Input array
Input value inIndex const int 0 - Index of the first element that is passed to the second of the output arrays
Input value inInverse bool False Determines if the indices are counted from beginning or from end of the input array
Output value outArray1 Array<Type>& First output array
Output value 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 Aurora 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.