ILNumerics - Technical Computing Tools

High Performance Framework for Visualization

and Computing in Industry and Science

 

tgt

ILMath Functions for Array Initialization

While most functions of the ILMath class at the end create arrays, we will deal with functions, specialized on initializing arrays from scratch.

 

Initialization with single value

The following table lists common creation functions which give all elements the same value. Code examples (as always inside the Core documentation) assume, that the code is defined in the context of a class, derived from ILNumerics.ILMath.

 

Create matrix, 5x4, double, 1.0 in ILNumerics:

 

Create row vector, 1x10, double, pi in ILNumerics:

 

Create column vector, 10x1, int32, -1 in ILNumerics:

 

Create array, 5x4x3, float, 0f in ILNumerics:

 

Create empty array, 0x1, double, {} in ILNumerics:

 

 

Initialization with multiple values

Create column vector, 4x1, values: 2.0, 4.0, 6.0, 8.0 in ILNumerics:

 

Create matrix, 2x3, values: 1.0  3.0  5.0  2.0  4.0  6.0 in ILNumerics:

 

Create array, 2x3x4, random numbers, uniform distr. in ILNumerics:

 

Create array, 2x3x4, random numbers, norm. distr. in ILNumerics:

 

Create identity matrix, 4x4, double in ILNumerics:

 

Create vector, 1x100, double, linearly spaced 0.0 -> 2pi in ILNumerics:

 

Create vector, 1x20, double, log. spaced 0.0 -> 1000.0 in ILNumerics:

 

Create array, 100x200, double, counting up, 1.0 -> 20000.0 in ILNumerics:

 

For more details on every function of the ILMath class consult the Class Documentation. The next section describes the options for Creating Arrays by Casting from System types.