The ILArray<> class

For ILNumerics.Net mathematical objects are represented by objects of type ILArray<>. Those objects may be of arbitrary dimensions and therefore reflect scalars, vectors, matrices and even n-dimensional arrays.

Other numerical libraries have dedicated classes for solid matrices or vectors. They sometimes even distinguish between row and column vectors. ILNumerics.Net has only one class for all shapes: ILArray<>

Basically all ILArray<T>'s have at least 2 dimensions. However 0..all of those dimensions may be singleton (i.e. 'of size 1'). Those dimensions do change the shape of the array without actually consuming memory. Therefore a scalar will really be a ILArray<T> of size [1 x 1] and a row vector of length 5 will have the size [1 x 5].

By using the generic feature of C#, an ILArray<> is able to hold elements of arbitrary inner type. This makes this class a flexible hence typesave container for all kinds of computations. The following table list some examples for common arrays and a way of creating it. We will discover those (and other) possibilities in more detail in the next paragraphs.

array... created by
matrix of size 4x3
element type: System.Double
ILArray<double>.zeros(4,3);
row vector of length 100
element type: System.Int16
ILArray<short>.zeros(1,100)
square matrix of size 10x10
element type: System.Single
element values: 1.0f
ILArray<float>.zeros(10,10) + 1.0f;
3-dimens.array of size 100x200x4
element type: double
values: all pi
ILArray<double>.zeros(100,200,4) + ILMath.pi;
4-dimens.array of size 5x4x3x4
element type: double
values counting from 1...240
ILMath.counter(5,4,3,4);
The inner type T for ILArray<T> does not necessarily has to be a numeric type. One may use ILArray<T> to hold arbitrary elements of any reference type and still profit from the ability to derive subarrays from it or use reshaping, replication and serialization to manage those objects. However, extended mathematical calculations are of course possible for numeric inner types only.

Read about the following topics:


Valid CSS! Valid XHTML 1.0 Transitional