Aurora Visio Studio TOP » Filter Reference » Array » Array Composition » AccumulateArray
Module: | FoundationLite |
---|
Joins arrays appearing in consecutive iterations.
Name | Type | Range | Description | |
---|---|---|---|---|
inArray | <T>Array | Array to be joined | ||
inMaxSize | Integer* | 0 - | Maximum number of last elements that are remembered | |
inReset | Bool | Reset accumulator state | ||
outArray | <T>Array | Joined array |
The type of this filter is defined using the type variable T which represents any valid type. Read more.
Examples
To implement basic example perform following steps:
outArray = [1, 2, 3]
k = 2
outArray = [1, 2, 3, 1, 2, 3]
k = 3
outArray = [1, 2, 3, 1, 2, 3, 1, 2, 3]
It is also possible to set maximum size of outArray. For above described example, when inMaxSize is set to 6, after second iteration new data will be appended to outArray while old data will be erased.
k = 1
outArray = [1, 2, 3]
k = 2
outArray = [1, 2, 3, 1, 2, 3]
k = 3
outArray = 1, 2, 3 [1, 2, 3, 1, 2, 3]
- Using CreateArray create 1x3 dimensional array [1, 2, 3]
- Place AccumulateArray inside the body of Loop (or any Enumerate* filter)
- Connect created vector to inArray input of the filter
- After k loop iterations, the output outArray will look like as follows:
outArray = [1, 2, 3]
k = 2
outArray = [1, 2, 3, 1, 2, 3]
k = 3
outArray = [1, 2, 3, 1, 2, 3, 1, 2, 3]
It is also possible to set maximum size of outArray. For above described example, when inMaxSize is set to 6, after second iteration new data will be appended to outArray while old data will be erased.
k = 1
outArray = [1, 2, 3]
k = 2
outArray = [1, 2, 3, 1, 2, 3]
k = 3
outArray = 1, 2, 3 [1, 2, 3, 1, 2, 3]
Errors
This filter can throw an exception to report error. Read how to deal with errors in Error Handling.
List of possible exceptions:
Error type | Description |
---|---|
DomainError | inMaxSize cannot be negative in AccumulateArray. |
Complexity Level
This filter is available on Basic Complexity Level.
See Also
- Loop – Generates a loop that ends at the first invocation with False on the input.