LinearAlgebra
FromSplitForm
translate split form to native Maple form
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
FromSplitForm(Ai, B, opts)
Ai
-
list of integer index Vectors
B
data Vector
opts
optional equations controlling the details of the computation
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.
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,complex⁡sfloat,integer1,integer2,integer4,integer8,float4,float8,complex8
with⁡LinearAlgebra:
Let us examine the split form of an arbitrary matrix.
m≔Matrix⁡5,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
m≔0−81000000−55−1500−460−1799−61001800−7800000022
ai,b≔SplitForm⁡m
ai,b≔1223333445,2341345256,−81−55−15−46−1799−6118−7822
FromSplitForm⁡ai,b
0−81000000−55−1500−460−1799−61001800−7800000022
FromSplitForm⁡ai2,ai1,b
00−4600−81001800−55−17000−15990000−61−780000022
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.
m1≔Matrix⁡0,1,0,2,0,0,3,0,4,datatype=float
m1≔0.1.0.2.0.0.3.0.4.
m2≔Matrix⁡0,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.
ai1,b1≔SplitForm⁡m1
ai1,b1≔1233,2113,1.2.3.4.
ai2,b2≔SplitForm⁡m2
ai2,b2≔1233,2113,1.2.3.4.
Therefore, to recover the original rtable, you may need to use the dimensions option.
FromSplitForm⁡ai2,b2
0.1.0.2.0.0.3.0.4.
FromSplitForm⁡ai2,b2,dimensions=4,3
0.1.0.2.0.0.3.0.4.0.0.0.
To construct the Vectors Ai from scratch in a cross-platform way, one can use kernelopts to find the right integer data type.
dt≔integerkernelopts⁡wordsize8
dt≔integer8
A1≔Vector⁡5,4,3,2,1,datatype=dt
A1≔54321
A2≔Vector⁡3,2,1,2,3,datatype=dt
A2≔32123
A3≔Vector⁡2,1,5,4,3,datatype=dt
A3≔21543
B≔Vector⁡I,2+I,I−3,−2−I,−I,datatype=complex8
B≔0.+I2.+I−3.+I−2.−I0.−I
FromSplitForm⁡A1,A2,A3,B
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