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

Online Help

All Products    Maple    MapleSim


LinearAlgebra

  

FromSplitForm

  

translate split form to native Maple form

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

FromSplitForm(Ai, B, opts)

Parameters

Ai

-

list of integer index Vectors

B

-

data Vector

opts

-

optional equations controlling the details of the computation

Options

• 

dimensions = [d1, ..., dn]

  

This option controls the dimensions of X. Its value needs to be a list of n positive integers, giving the dimensions of X. For example, when constructing a sparse Vector, the value should be a list containing a single positive integer, and for a Matrix it should be a list of two positive integers. If the option is not specified, Maple uses the maximal value in the ith index vector Ai as the ith dimension.

• 

scan = true or scan = false

  

This option determines whether or not B is scanned for zeroes. If scan = true, the default, then B is scanned to test if it contains any entries that are equal to 0. If this is the case, the operation is aborted with an error message: such entries are not allowed. If you are certain that there are no entries equal to 0, you can save a little bit of processing time by disabling this scan by passing scan = false to the procedure. Use this option with extreme caution.

Description

• 

The FromSplitForm function constructs a sparse rtable X from its split form, performing the opposite function to SplitForm.

• 

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 need to be 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 needs to have a data type compatible with NAG-sparse rtables; that is, the datatype of B as returned by rtable_options needs to be one of these values:

  

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

Examples

withLinearAlgebra:

Let us examine the split form of an arbitrary matrix.

mMatrix5,6,1,2=81,2,3=55,2,4=15,3,1=46,3,3=17,3,4=99,3,5=61,4,2=18,4,5=78,5,6=22,datatype=integer4

m0−81000000−55−1500−460−1799−61001800−7800000022

(1)

ai,bSplitFormm

ai,b1223333445,2341345256,−81−55−15−46−1799−6118−7822

(2)

FromSplitFormai,b

0−81000000−55−1500−460−1799−61001800−7800000022

(3)

FromSplitFormai2,ai1,b

00−4600−81001800−55−17000−15990000−61−780000022

(4)

If X has a dimension d such that all entries where index d is at its maximal value, are zero, then these are not reflected in the split form. For example, if the last entry in a sparse Vector is zero, or the last row or column of a Matrix.

m1Matrix0,1,0,2,0,0,3,0,4,datatype=float

m10.1.0.2.0.0.3.0.4.

(5)

m2Matrix0,1,0,2,0,0,3,0,4,0,0,0,datatype=float

m20.1.0.2.0.0.3.0.4.0.0.0.

(6)

ai1,b1SplitFormm1

ai1,b11233,2113,1.2.3.4.

(7)

ai2,b2SplitFormm2

ai2,b21233,2113,1.2.3.4.

(8)

Therefore, to recover the original rtable, you may need to use the dimensions option.

FromSplitFormai2,b2

0.1.0.2.0.0.3.0.4.

(9)

FromSplitFormai2,b2,dimensions=4,3

0.1.0.2.0.0.3.0.4.0.0.0.

(10)

To construct the Vectors Ai from scratch in a cross-platform way, one can use kernelopts to find the right integer data type.

dtintegerkerneloptswordsize8

dtinteger8

(11)

A1Vector5,4,3,2,1,datatype=dt

A154321

(12)

A2Vector3,2,1,2,3,datatype=dt

A232123

(13)

A3Vector2,1,5,4,3,datatype=dt

A321543

(14)

BVectorI,2+I,I3,2I,I,datatype=complex8

B0.+I2.+I−3.+I−2.I0.I

(15)

FromSplitFormA1,A2,A3,B

Compatibility

• 

The LinearAlgebra[FromSplitForm] 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[SplitForm]