TBTK
|
Need a break? Support the development by playing Polarity Puzzles |
See more details about the Array in the API
A three-dimensional Array with the data type DataType can be created using
The number of arguments in the list can be changed to get an Array of different dimensionality.
By default, the Array is uninitialized after creation, but this can be changed by passing a second argument. For example, an Array with type double can be initialized to zero as follows.
The Array ranges and dimensionality can be retrieved using
It is also possible to access or assign values to individualt elements. Assuming the that the data type is double, we can use
Here 0 <= x < ranges[0], 0 <= y < ranges[1], and 0 <= z < ranges[2].
If the DataType supports it, the following operations are possible.
Addition
Subtraction
Multiplication
Here multiplier has the data type DataType.
Division
Here divisor has the the data type DataType.
A lower-dimensional subset of an Array can be extracted using
This extracts the subset of array for which the first entry is 'x'. The result is a two-dimensional Array from which we can access elements using