SplitForm - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


LinearAlgebra

  

SplitForm

  

compute split form of a sparse rtable

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

SplitForm(X, opts)

Parameters

X

-

sparse rtable with hardware data type

opts

-

optional equations controlling the details of the computation

Options

• 

sort = 0, 1, or 2

  

With sort = 1 (the default) or sort = 2, the nonzero entries of X are sorted by index before computing the split form. With sort = 1, they are sorted lexicographically by index: that is, sorted by the first index, ties (if any) being broken by the second index, further ties (if any) being broken by the third index, and so on. In other words, in the result, A1 will be sorted, and among entries with equal values for A1, the corresponding entries of A2 will be sorted.

  

The option sort = 2 can only be used if X is two-dimensional (a Matrix or a 2-dimensional Array). It sorts the entries by the second index, breaking ties using the first index. This groups entries in the same column together.

  

The option sort = 0 does not sort the entries; they are returned in the order in which they are stored in memory.

Description

• 

The SplitForm function computes the split form of the input rtable X, which needs to have one of the hardware data types. It thus performs the opposite function to FromSplitForm.

• 

The split form of an n-dimensional rtable X with k nonzero entries consists of n+1 Vectors, A1, A2, ..., An, and B, each with k entries: for every nonzero entry Xa1,a2,...,an=b, there is an index i such that A1i=a1, A2i=a2, ..., Ani=an, and Bi=b. (If X is a Vector, then n=1; if X is a Matrix, then n=2.)

• 

The Vectors Aj are of word-size integer data type; that is, on 32-bit platforms they will have data type integer4 and on 64-bit platforms data type integer8. The Vector B has the same data type as X.

• 

SplitForm returns a sequence of two objects; the first is the list A1,A2,...,An, and the second is B.

• 

The split form is most useful for sparse rtables. If X does not have sparse storage (as determined by rtable_optionX,storage being either sparse or sparseupper or sparselower), then a sparse storage copy is made before determining the split form.

• 

If X has any indexing functions (as determined by rtable_indfnsX), then these are bypassed when determining the split form: since SplitForm is a low-level command, Maple returns the split form of the stored entries only. For example, if a Matrix is defined with option shape=symmetric and storage=sparseupper, then only one of each pair of off-diagonal entries will be represented in the split form. However, if X has indexing functions but no sparse storage, then the copy made to give it sparse storage, as explained above, typically gets rid of the indexing function and stores all nonzero entries.

• 

The code for SplitForm relies on X being a NAG-sparse Matrix (potentially after copying it to give it sparse storage); that is, its datatype as returned by rtable_options needs to be one of these values:

  

sfloat,complexsfloat,integer1,integer2,integer4,integer8,float4,float8,complex8

Examples

withLinearAlgebra:

A basic example with a sparse Vector.

VVector10,datatype=float8,storage=sparse

V0.0.0.0.0.0.0.0.0.0.

(1)

V21.;V63.

V21.

V6−3.

(2)

SplitFormV

26,1.−3.

(3)

Notice below that the symmetric indexing function is ignored when constructing the split form.

MMatrix6,datatype=integer4,shape=symmetric,storage=sparseupper,i,j`if`iremi+j,2=1,absij,0

M010305101030010103301010030101503010

(4)

SplitFormM

111223345,246354656,135131311

(5)

The split form cannot be computed for rtables that don't have a suitable data type.

M2Matrix3,3,i,jij

M20−1−210−1210

(6)

SplitFormM2

Error, (in LinearAlgebra:-SplitForm) cannot compute split form of an rtable with non-hardware datatype anything

To make this work, we need to recreate M2 with, for example, option datatype=integer8.

M2MatrixM2,datatype=integer8

M20−1−210−1210

(7)

SplitFormM2,sort=2

231312,112233,12−11−2−1

(8)

Here is an example with a 4-dimensional Array that has a nonzero entry whenever the indices form a permutation of 1,2,3,4 that is not a derangement.

AArray1..4,1..4,1..4,1..4,datatype=integer1,storage=sparse

withGroupTheory:

permutationsElementsSymmetricGroup4

permutations2,4,3,1,3,4,1,4,2,3,2,4,3,4,,2,3,1,2,3,1,2,4,3,1,2,4,1,23,4,1,3,2,4,1,32,4,1,3,2,1,3,4,2,1,3,1,4,2,1,4,3,2,1,4,1,4,3,1,42,3,2,3,4,1,2,3,4,1,2

(9)

forperminpermutationsdolstconvertperm,permlist,4;Aoplst4numelemsPermSupportpermenddo:

interfacertablesize=15

10,10

(10)

SplitFormA

111111222333444,223344134122122,342423313214313,434232441441231,422112211121112

(11)

Compatibility

• 

The LinearAlgebra[SplitForm] command was introduced in Maple 17.

• 

For more information on Maple 17 changes, see Updates in Maple 17.

See Also

LinearAlgebra[CompressedSparseForm]

LinearAlgebra[FromCompressedSparseForm]

LinearAlgebra[FromSplitForm]

rtable_indfns

rtable_options