Back to Aurora Vision Library website

You are here: Start » Function Reference » All Functions » Array Composition » FlattenArray

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: avl
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 avl::FlattenArray
(
	const atl::Array<atl::Array<Type> >& inArray,
	atl::Array<Type>& outFlattenedArray
)

Parameters

Name Type Default Description
Input value inArray const Array<Array<Type> >& Array to be flattened
Output value 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 }