You are here: Start » Function Reference » All Functions » Array Composition » FlattenArray
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: | fil |
Module: | FoundationLite |
Receives an array of arrays, and creates a single one-dimensional array containing all individual elements.
Applications: E.g. when multiple points are detected within multiple regions we receive a Point2DArrayArray. This 2D data structure keeps track of which point comes from which region. We can flatten this structure to 1D array by using this filter.
Syntax
void fil::FlattenArray ( const ftl::Array<ftl::Array<Type> >& inArray, ftl::Array<Type>& outFlattenedArray )
Parameters
Name | Type | Default | Description | |
---|---|---|---|---|
![]() |
inArray | const Array<Array<Type> >& | Array to be flattened | |
![]() |
outFlattenedArray | Array<Type>& | Flattened array |
Description
The operation creates an one-dimensional array from all elements of an input two-dimensional array. Type of filter is defined on initialization by using type variable T. Input array of arrays size is not restricted.
Examples
![]() |
![]() |
inArray = { { 0 , 3 }, { 1 , 4 }, { 2 , 5 } } |
outFlattenedArray = { 0, 3, 1, 4, 2, 5 } |