ArrayElems - Maple Programming Help

ArrayElems

return the elements of an Array

ArrayNumElems

return the number of elements in an Array

 Calling Sequence ArrayElems(A) ArrayNumElems(A, opt)

Parameters

 A - Array object opt - (optional) name; element status

Description

 • The ArrayElems(A) function returns a set of equations of the form (indices)=value specifying the values of the elements in Array A.
 Only the elements that explicitly need to be specified, taking into account storage, are returned.  In the case of scalar storage, the appropriate special initializer format is returned instead of a set of equations.
 This function is equivalent to op(3, A).
 • The ArrayNumElems(A) function returns the number of elements actually stored in Array A.
 This ArrayNumElems(A, opt) function performs in the same manner, except that one of the following options may be specified.

 opt result All size of the Array as specified by its bounds Stored number of entries actually stored NonZero number of nonzero elements of the Array NonZeroStored number of stored nonzero elements of the Array Bytes number of bytes of storage allocated for data in the Array Allocated number of elements for which storage has been allocated

Examples

 > $A≔\mathrm{Array}\left(\left[\left[0,1,1\right],\left[0,0,1\right],\left[0,0,0\right]\right]\right)$
 ${A}{≔}\left[\begin{array}{ccc}{0}& {1}& {1}\\ {0}& {0}& {1}\\ {0}& {0}& {0}\end{array}\right]$ (1)
 > $\mathrm{ArrayElems}\left(A\right)$
 $\left\{\left({1}{,}{2}\right){=}{1}{,}\left({1}{,}{3}\right){=}{1}{,}\left({2}{,}{3}\right){=}{1}\right\}$ (2)
 > $\mathrm{ArrayNumElems}\left(A\right)$
 ${9}$ (3)
 > $\mathrm{ArrayNumElems}\left(A,\mathrm{NonZero}\right)$
 ${3}$ (4)
 > $\mathrm{ArrayNumElems}\left(A,\mathrm{Allocated}\right)$
 ${9}$ (5)