Industrial Data Science
in C# and .NET:
Simple. Fast. Reliable.
 
 

ILNumerics - Technical Computing

Modern High Performance Tools for Technical

Computing and Visualization in Industry and Science

tgt

Importing & Exporting Array Data

This section deals with functions for importing data into and exporting data from ILNumerics arrays. Import and export of array elements is important for convenient creation of arrays and for interacting with external, managed and unmanged APIs.

Importing System.Array, T[]

In order to import data from system arrays T[] the creation function Math.vector(T[]) is used. Alternatively, the T[] array can simply be assigned to ILNumerics array variables and used as parameters in function expecting ILNumerics arrays.

Note that ILNumerics will make a copy of the values from the System.Array provided and will not reference the original elements afterwards.

Exporting System.Array, T[]

The array member function ExportValues(ref T[]) is used to copy all element values from the ILNumerics array into the system array. If the provided system array is of sufficient length it is filled with a shallow copy of the elements. Otherwise, a new system array is allocated from the managed heap and filled with shallow copies of the elements:

The ExportValues(ref T[], StorageOrders order) overload allows to control the order of the elements for export. 

Data Exchange File Formats

ILNumerics offers many ways to exchange data with other applications and APIs. Next to the common options provided by the .NET framework (text / csv, XML, binary streams, etc.) ILNumerics provides the following options to read/write numeric data:

The Data I/O section details these options.

Further readings: