Go to the first, previous, next, last section, table of contents.
The subscripts for the ith dimension are the integers running from 0 to dimi. If the user assigns to a subscripted variable before declaring the corresponding array, an undeclared array is set up. If the user has more than one array to be set up the same way, they may all be set up at the same time, by ARRAY([list-of-names],dim1, dim2, ..., dimk). Undeclared arrays, otherwise known as hashed arrays (because hash coding is done on the subscripts), are more general than declared arrays. The user does not declare their maximum size, and they grow dynamically by hashing as more elements are assigned values. The subscripts of undeclared arrays need not even be numbers. However, unless an array is rather sparse, it is probably more efficient to declare it when possible than to leave it undeclared. The ARRAY function can be used to transform an undeclared array into a declared array.
1) The art-q array (t in common lisp) which may have several dimensions indexed by integers, and may hold any lisp or macsyma object as an entry. To construct such an array, enter A:MAKE_ARRAY(ANY,3,4); then A will have as value, an array with twelve slots, and the indexing is zero based.
2) The Hash_table array which is the default type of array created if one does B[X+1]:Y^2 (and B is not already an array,a list, or a matrix-- if it were one of these an error would be caused since x+1 would not be a valid subscript for an art-q array,a list or a matrix ). Its indices (also known as keys) may be any object. It only takes ONE KEY at a time (B[X+1,U]:Y would ignore the u) Referencing is done by B[X+1]==> Y^2. Of course the key may be a list, eg B[[x+1,u]]:y would be valid. This is in- compatible with the old Macsyma hash arrays, but saves consing.
An advantage of storing the arrays as values of the symbol is that the usual conventions about local variables of a function apply to arrays as well. The Hash_table type also uses less consing and is more efficient than the old type of macsyma hashar. To obtain consistent behaviour in translated and compiled code set TRANSLATE_FAST_ARRAYS [TRUE] to be TRUE.
Go to the first, previous, next, last section, table of contents.