Difference between revisions of "Array"
Line 10: | Line 10: | ||
==See Also== | ==See Also== | ||
+ | * [[AddIndex]] | ||
+ | * [[Index]] | ||
* [[Arrays and Indexes]] | * [[Arrays and Indexes]] | ||
− | |||
* [[Array Functions and Operators]] | * [[Array Functions and Operators]] | ||
* [[More Array Functions]] | * [[More Array Functions]] |
Revision as of 23:10, 19 January 2016
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
Enable comment auto-refresher