ILNumerics Ultimate VS

ILMathcell Method (InArrayInt64, IEnumerableBaseArray, StorageOrders)

ILNumerics Ultimate VS Documentation
ILNumerics - Technical Application Development
Creates new cell, initialize size and provide arrays for cell elements.

[ILNumerics Computing Engine]

Namespace:  ILNumerics
Assembly:  ILNumerics.Computing (in ILNumerics.Computing.dll) Version: 5.5.0.0 (5.5.7503.3146)
Syntax

public static RetCell cell(
	InArray<long> size = null,
	IEnumerable<BaseArray> arrays = null,
	StorageOrders order = StorageOrders.ColumnMajor
)

Parameters

size (Optional)
Type: ILNumericsInArrayInt64
[Optional] Size hint for the new cell array. Default: (null) Derive the size from arrays.
arrays (Optional)
Type: System.Collections.GenericIEnumerableBaseArray
[Optional] Enumerable of arrays for the cell elements, column major order. Default: (null) creates cell with all 'null' elements.
order (Optional)
Type: ILNumericsStorageOrders
[Optional] Storage order for the new cell. Default: ColumnMajor.

Return Value

Type: RetCell
Cell of specified size, initialized with given arrays.
Exceptions

ExceptionCondition
ArgumentException if size is not null and the number of elements found in arrays exceeds the expected number of elements as specified by size.
Remarks

If number of arrays given is smaller than the number of elements given by size then trailing elements in the cell returned are set to null.

If size is null a cell vector is produced with a length corresponding to the number of elements in arrays. Performance wise it is recommended to specify the size explicitly, though.

If arrays contains more elements than expected by size an error is generated.

The size(Int64, Int64, Int64, Int64) function or one of its overloads are convenient for the specification of dimensional size arguments.

Visit the online documentation for cell.

Note that when arrays is an ILNumerics array (as in the example where arrays was created by the vector``1(UMP, UMP, UMP, UMP) function) memory management is performed accordingly: arrays stored in the arrays object are released and the associated memory is released to the pool after the cell(InArrayInt64, IEnumerableBaseArray, StorageOrders) function returns. However, for arrays of other (non-ILNumerics) types proper memory management is not guaranteed. For example, when providing the target cell element values in a Array of BaseArray a copy of individual elements is made by the cell(InArrayInt64, IEnumerableBaseArray, StorageOrders) function before storing the new element into the cell object. The source object remains an element of the system array and is not released!

Therefore, in situations where performance is critical and inside loops use one of the ILNumerics array intialization functions for providing the arrays argument. Otherwise, temporary objects in the IEnumerableT may remain live and are left for the GC to clean up (which is fine, except for high performance demands).

[ILNumerics Computing Engine]

Examples

<code> Array<double> A = rand(10,20,30); Cell C = cell(size(3,2),vector<BaseArray>(A, A+1, zeros<float>(2,3), "4th element")); //Alternatives: //Cell C = cell(size(3,2),new [] { A, A+1, zeros(2,3) }); //Cell C = cell(size(3,2),row(A, A+1, zeros(2,3))); C >Cell [3,2] > [0]: > [1]: {<Double> [10,20,30]} {<String> [1,1]} > [2]: {<Double> [10,20,30]} {null} > [3]: {<Single> [2,3]} {null} </code>
See Also

Reference

MathInternal.cellv(BaseArray)
MathInternal.vector``1(UMP, UMP, UMP, UMP, UMP)