sparse
The Sparse Indexing Function
Calling Sequence
Description
Examples
Compatibility
table(sparse, ...)
table(sparse=XXX, ...)
array(sparse, ...)
The sparse indexing function is used to create a table or an array with a sparse representation, meaning that only nonzero elements are stored in the underlying data structure.
The sparse indexing function specifies that unassigned entries of a table or an array have the value 0. For example, array(sparse, 1..2, 1..2) is a zero matrix.
If T is a table and j is an unevaluated name, then T[j] returns unevaluated. However, if j evaluates to an integer, then T[j] returns either the value of T[j] or 0 if T[j] has no assigned value.
A default value other than zero can be used when constructing a sparse table. The command, table(sparse=XXX), creates a table filled with XXXs at each entry. This option is only available for tables.
Note: The command array has been superseded by Array.
T≔table⁡sparse,A=a:
TA
a
TB
0
a≔array⁡sparse,1..2:
a1
aj
T≔table⁡sparse=undefined,1=1,2=2:
T1
1
T100
undefined
The sparse indexing function was updated in Maple 2019.
The sparse=XXX option was updated in Maple 2019.
See Also
indexfcn
Download Help Document