LinearAlgebra - Maple Programming Help

Online Help

All Products    Maple    MapleSim


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

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 integer[4] and on 64-bit platforms data type integer[8]. 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,integer[1],integer[2],integer[4],integer[8],float[4],float[8],complex[8]

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=integer[4]

m:=0810000005515004601799610018007800000022

(1)

ai,bSplitFormm

ai,b:=1223333445,2341345256,81551546179961187822

(2)

FromSplitFormai,b

0810000005515004601799610018007800000022

(3)

FromSplitFormai2,ai1,b

0046008100180055170001599000061780000022

(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'

m1:=0.1.0.2.0.0.3.0.4.

(5)

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

m2:=0.1.0.2.0.0.3.0.4.0.0.0.

(6)

ai1,b1SplitFormm1

ai1,b1:=1233,2113,1.2.3.4.

(7)

ai2,b2SplitFormm2

ai2,b2:=1233,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.

dt'integer'kernelopts'wordsize'8

dt:=integer8

(11)

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

A1:=54321

(12)

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

A2:=32123

(13)

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

A3:=21543

(14)

BVectorI,2+I,I3,2I,I,'datatype'='complex[8]'

B:=0.+1.I2.+1.I3.+1.I2.1.I0.1.I

(15)

FromSplitFormA1,A2,A3,B

1..5 x 1..3 x 1..5 ArrayData Type: complex8Storage: sparseOrder: Fortran_order

(16)

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]

 


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