Array

Revision as of 22:12, 31 January 2007 by Lchrisman (talk | contribs) (fixed extra colon in category)


Declaration

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

Notes

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]. 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.

Comments


You are not allowed to post comments.