Array


Array(I1, I2,.., In, A)

Assigns indexes «I1»...«In» to array «A».

It is bad practice to use Array to re-index an array. If an array, A, is indexed by I, and you wish to re-index it by another index, J, having the same number of elements (but possibly different values), instead of using Array(J, A), it is better to use A[@I = @J] (see Subscript-Slice Operator). The latter will work even if new dimensions are introduced into A later (through array abstraction), while Array(J, A) could very well break since the outer-dimension of A could change unexpectedly.

To create a constant vector along index I, use Array(I, x), where x is atomic (e.g., a scalar). For example, Array(I, 0) is a constant vector along I containing all zeros.

See Also

Comments


You are not allowed to post comments.