The sparse Matrices - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Linear Algebra : Indexing Functions : sparse

The sparse Matrices

 

Description

Examples

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, or Array, and the sparse indexing function can be used to construct a table or array(deprecated).

• 

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, 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.

• 

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.

Examples

MMatrix3,3,storage=sparse

M:=000000000

(1)

M1,1

0

(2)

Ttablesparse,A=a:

TA

a

(3)

TB

0

(4)

aarraysparse,1..2:

a1

0

(5)

aj

aj

(6)

See Also

Array

array(deprecated)

indexfcn

Matrix

RTableSparse

table

Vector

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam