rtable_elems - Maple Help

rtable_elems

return the elements of an rtable

rtable_num_elems

return the number of elements in an rtable

 Calling Sequence rtable_elems(A) rtable_num_elems(A, opt)

Parameters

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

Description

 • The rtable_elems(A) function, where A is an Array, Matrix, or Vector, returns a set of equations of the form (indices)=value specifying the values of the elements in rtable A.
 Only the elements that explicitly need to be specified, taking into account storage, are returned.
 For Arrays, this function is equivalent to op(3, A). For Matrices and Vectors, this is equivalent to op(2, A).
 • The rtable_num_elems(A) function, where A is an Array, Matrix, or Vector, returns the number of elements actually stored in rtable A.
 This rtable_num_elems(A, opt) function performs in the same manner, except that one of the following options may be specified.

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

 • The rtable_num_elems command is thread-safe as of Maple 15.

Examples

 > $V≔\mathrm{Vector}\left(\left[x,y,z,0\right]\right)$
 ${V}{≔}\left[\begin{array}{c}{x}\\ {y}\\ {z}\\ {0}\end{array}\right]$ (1)
 > $\mathrm{rtable_elems}\left(V\right)$
 $\left\{{1}{=}{x}{,}{2}{=}{y}{,}{3}{=}{z}\right\}$ (2)
 > $\mathrm{rtable_num_elems}\left(V\right)$
 ${4}$ (3)
 > $\mathrm{rtable_num_elems}\left(V,\mathrm{NonZero}\right)$
 ${3}$ (4)
 > $\mathrm{rtable_num_elems}\left(V,\mathrm{Allocated}\right)$
 ${4}$ (5)
 > $M≔\mathrm{Matrix}\left(\left[\left[1,2,3\right],\left[0,0,1\right],\left[0,0,0\right]\right],\mathrm{shape}=\mathrm{triangular}\left[\mathrm{upper}\right]\right)$
 ${M}{≔}\left[\begin{array}{ccc}{1}& {2}& {3}\\ {0}& {0}& {1}\\ {0}& {0}& {0}\end{array}\right]$ (6)
 > $\mathrm{rtable_elems}\left(M\right)$
 $\left\{\left({1}{,}{1}\right){=}{1}{,}\left({1}{,}{2}\right){=}{2}{,}\left({1}{,}{3}\right){=}{3}{,}\left({2}{,}{3}\right){=}{1}\right\}$ (7)
 > $\mathrm{rtable_num_elems}\left(M,\mathrm{NonZero}\right)$
 ${4}$ (8)
 > $\mathrm{rtable_num_elems}\left(M,\mathrm{Allocated}\right)$
 ${6}$ (9)