Dimensions

Command: Dimensions


Synopsis
[array] Dimensions -> [d1 d2 ... dn]
Description

Dimensions corresponds to the Mathematica function of
the same name. It takes a sli array and returns a list with
dimensions [d1 d2 ... dn] where di gives the dimension of the
array at level i.
The length of the dimensions-list corresponds to the TensorRank of
the array.
File
lib/sli/mathematica.sli
Remarks
Dimensions assumes that the array is hyper-rectangular
(rectangle cuboid ...) i.e. all subarrays at a given level
have the same number of elements.
Dimensions does not check if the array really is hyper-rectangular. It
will not fail if this is not the case. Instead the dimensions
that are returned correspond to the number of elements of the
first subarray in each level.

Examples

SLI ] [1 2 3] Dimensions -> [3]
SLI ] [[1 2 3] [4 5 6]] Dimensions -> [2 3]
SLI ] [[[1 2][3 4]][[5 6][7 8]]] Dimensions -> [2 2 2]