LinearAlgebra - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Linear Algebra : LinearAlgebra Package : Solvers : LinearAlgebra/SplitForm

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 will be sorted by index before computing the split form. With sort = 1, they will be 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 integer[4] and on 64-bit platforms data type integer[8]. 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,integer[1],integer[2],integer[4],integer[8],float[4],float[8],complex[8]

Examples

withLinearAlgebra:

A basic example with a sparse Vector.

VVector10,datatype=float[8],storage=sparse

V:=0.0.0.0.0.0.0.0.0.0.

(1)

V21.;V63.

V2:=1.

V6:=3.

(2)

SplitFormV

26,1.3.

(3)

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

MMatrix6,datatype=integer[4],shape=symmetric,storage=sparseupper,i,j→`if`iremi+j,2=1,ij,0

M:=010305101030010103301010030101503010

(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,j→ij

M2:=012101210

(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=integer[8].

M2MatrixM2,'datatype=integer[8]'

M2:=012101210

(7)

SplitFormM2,'sort=2'

231312,112233,121121

(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=integer[1]','storage=sparse'

A:= 1..4 x 1..4 x 1..4 x 1..4 ArrayData Type: integer1Storage: sparseOrder: Fortran_order

(9)

withGroupTheory:

permutationsElementsSymmetricGroup4

permutations:=,1,2,1,3,1,4,2,3,2,4,3,4,1,2,3,1,2,4,1,3,2,1,3,4,1,4,2,1,4,3,2,3,4,2,4,3,1,2,3,4,1,2,4,3,1,3,2,4,1,3,4,2,1,4,2,3,1,4,3,2,1,23,4,1,32,4,1,42,3

(10)

forperminpermutationsdolstconvertperm,'permlist',4;Aoplst4numelemsPermSupportpermend do:

interfacertablesize=15

10

(11)

SplitFormA

111111222333444,223344134122122,342423313214313,434232441441231,422112211121112

(12)

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

 


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