[ILNumerics Core Module]
Assembly: ILNumerics.Core (in ILNumerics.Core.dll) Version: 184.108.40.206 (5.4.7431.3055)
public virtual T1 GetArrayForRead( StorageOrders order = StorageOrders.ColumnMajor )
Public Overridable Function GetArrayForRead ( Optional order As StorageOrders = StorageOrders.ColumnMajor ) As T1() Dim instance As ConcreteArray Dim order As StorageOrders Dim returnValue As T1() returnValue = instance.GetArrayForRead(order)
- order (Optional)
- Type: ILNumericsStorageOrders
[Optional] The order used for copying the elements into the returned System array. Default: ColumnMajor.
Return ValueType: T1
Managed System.Array with copies of the elements contained in this ILNumerics array.
|if order is none of column major or row major.|
|if this array is too large to fit into a managed array or if there is not enough memory currently available to allocate the return array.|
This method is provided for experts only! Use this array only for reading! Changes will not populate back to the internal array storage. Note the default element storage format: column major.
Keep in mind, the length of the array may exceeds the number of elements!
The range of elements addresses by this ILNumerics array starts with index 0 of the BaseOffset of this ILNumerics array is removed when copying the elements to the managed array. The internal elements will be read in order.returned. Any
The semantic of this method has changed with ILNumerics version 5. It now creates a copy of the internal elements in column major element storage order layout. The copy uses new memory from the regular, GC managed heap. This fact and the required memory copy introduce a computational effort which disqualifies this method for high performance algorithms.
The recommended way for experts to access internal elements directly, is now, to acquire a pointer to the memory and to use the pointer in your unsafe code.
In order to save the allocation of the managed array returned, consider using the method ExportValues(T1, StorageOrders).
This method is now partly obsolete but it will remain here since it serves its purpose still: by copying the elements one enables compatibility with other .NET APIs, at the same time it ensures that the values returned will still be around and will not be affected by the cleanup mechanisms all internal array storage is subject of. BUT: note the size limitation allin .NET undergo! Attempts to acquire the elements of such arrays which exceed the maximum sizes of .NET objects will trigger an exception.
The former versions (< 5) method 'GetArrayForWrite()' has been replaced by GetHostPointerForWrite(NullableStorageOrders).
[ILNumerics Core Module]