NAME

stride - return the number of elements between each dimension of an array

SYNOPSIS

arr.stride()

DESCRIPTION

Returns a PackInt vector containing, for each dimension of the array, the size of the sub-array to the "right" of that dimension. This is useful in conjunction with the flattened array indexing operators #[ ] and #[ = ] .

RETURN VALUE

A PackInt vector containing the size of each sub-array

ERRORS

TypeCheck if arr is not an array.

EXAMPLE

    a = [2,3,4].iterate()
    a.stride()
12 4 1

    a[0].sizeof()
12

    a[0,0].sizeof()
4

    a[0,0,0].sizeof()
1

SEE ALSO

shape
rank
length
width
sizeof