sparse - Maple Help

The sparse Matrices

Description

 • A sparse matrix has the property that only nonzero elements are stored in the underlying data structure.
 • Sparse storage can be used to construct a Matrix, Vector, Array, or table. This page focuses on sparse rtables. For information on and examples of sparse tables, see indexfcn/sparse.
 • Ignoring semi-sparse rtable data structures like triangular[upper], and band, there are two sparse formats used by rtables.
 The first is identical to the table format (indexfcn/sparse), and is only used when the datatype is a non-hardware type.
 The second format is always used when the datatype is a hardware numeric type, and matches the format used by the NAG numerical algorithms.  The NAG sparse format has N index vectors and one data vector for a N-dimensional Matrix. Thus, a 2-D sparse rtable with datatype=float[8] will have two integer index vectors, v1, and v2, plus a vector of 64-bit hardware float data. If v1[0] = 1, and v2[0] = 2, then the index [1,2] will retrieve the element stored at the first position of the data vector.

Examples

 > $M≔\mathrm{Matrix}\left({2}^{30},{2}^{30},\mathrm{storage}=\mathrm{sparse}\right)$
 ${M}{≔}\begin{array}{c}\left[\begin{array}{ccccccccccc}{0}& {0}& {0}& {0}& {0}& {0}& {0}& {0}& {0}& {0}& {\dots }\\ {0}& {0}& {0}& {0}& {0}& {0}& {0}& {0}& {0}& {0}& {\dots }\\ {0}& {0}& {0}& {0}& {0}& {0}& {0}& {0}& {0}& {0}& {\dots }\\ {0}& {0}& {0}& {0}& {0}& {0}& {0}& {0}& {0}& {0}& {\dots }\\ {0}& {0}& {0}& {0}& {0}& {0}& {0}& {0}& {0}& {0}& {\dots }\\ {0}& {0}& {0}& {0}& {0}& {0}& {0}& {0}& {0}& {0}& {\dots }\\ {0}& {0}& {0}& {0}& {0}& {0}& {0}& {0}& {0}& {0}& {\dots }\\ {0}& {0}& {0}& {0}& {0}& {0}& {0}& {0}& {0}& {0}& {\dots }\\ {0}& {0}& {0}& {0}& {0}& {0}& {0}& {0}& {0}& {0}& {\dots }\\ {0}& {0}& {0}& {0}& {0}& {0}& {0}& {0}& {0}& {0}& {\dots }\\ {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {}\end{array}\right]\\ \hfill {\text{1073741824 × 1073741824 Matrix}}\end{array}$ (1)
 > $M\left[{2}^{30},{2}^{30}\right]$
 ${0}$ (2)