Overview of the ArrayTools Package
Calling Sequence
Description
List of ArrayTools Package Commands
Examples
ArrayTools:-command(arguments)
command(arguments)
The ArrayTools package is an efficient set of programmer tools used for low level manipulation of rectangular storage Matrices, Vectors, and Arrays.
Note: This package contains tools for storage manipulation only. For mathematical operations on Matrices and Vectors, see the LinearAlgebra and VectorCalculus packages.
As a programmer package, the key focus is on efficient computation. Use of the package requires a fair understanding of internal representation of Matrix and Array data structures. For information on internal storage of Matrices and Arrays, see C_order and Fortran_order.
The package is primarily external (compiled code), and contains highly efficient functions for common Array related programming tasks. Some of these tasks would be impossible to program at the Maple level (for example, ComplexAsFloat), while others would be merely time consuming (for example, Fill) or require additional storage allocation (for example, DataTranspose).
At this time, all functions are restricted to rectangular storage Array objects.
Most functions in the package work for Matrices of any data type, and exceptions are noted on a by command basis.
Each command in the ArrayTools package can be accessed by using either the long form or the short form of the command name in the command calling sequence.
The long form, ArrayTools:-command, is always available. The short form can be used after loading the package.
The following is a list of available commands.
Constructing Arrays
Alias
CircularShift
ComplexAsFloat
Compress
Concatenate
Diagonal
FlipDimension
LowerTriangle
Partition
Permute
PermuteInverse
RandomArray
RegularArray
Remove
RemoveSingletonDimensions
Replicate
Reshape
Reverse
SuggestedDatatype
SuggestedOrder
SuggestedSubtype
Uncompress
UpperTriangle
Querying Array Properties
AllNonZero
AnyNonZeros
Dimensions
HasNonZero
HasZero
IsEqual
IsMonotonic
IsSubsequence
IsZero
Lookup
NumElems
SearchArray
Size
Modifying Arrays
Append
BlockCopy
Copy
DataTranspose
Extend
Fill
Insert
SortBy
Computing with Arrays
AddAlongDimension
ElementDivide
ElementMultiply
ElementPower
GeneralInnerProduct
GeneralOuterProduct
MultiplyAlongDimension
ReduceAlongDimension
ScanAlongDimension
To display the help page for a particular ArrayTools command, see Getting Help with a Command in a Package.
Vector example
with⁡ArrayTools
AddAlongDimension,Alias,AllNonZero,AnyNonZeros,Append,BlockCopy,CircularShift,ComplexAsFloat,Compress,Concatenate,Copy,DataTranspose,Diagonal,Dimensions,ElementDivide,ElementMultiply,ElementPower,Extend,Fill,FlipDimension,GeneralInnerProduct,GeneralOuterProduct,HasNonZero,HasZero,Insert,IsEqual,IsMonotonic,IsSubsequence,IsZero,Lookup,LowerTriangle,MultiplyAlongDimension,NumElems,Partition,Permute,PermuteInverse,RandomArray,ReduceAlongDimension,RegularArray,Remove,RemoveSingletonDimensions,Replicate,Reshape,Reverse,ScanAlongDimension,SearchArray,Size,SortBy,SuggestedDatatype,SuggestedOrder,SuggestedSubtype,Uncompress,UpperTriangle
M≔Vectorrow⁡10,i↦i
M≔12345678910
Duplicate first 5 entries in last 5
Copy⁡5,M,M,5,M
1234512345
Clear every second entry
Fill⁡0,M,1,2,M
1030502040
Alias as a 2 x 5 Matrix
Alias⁡M,2,5,C_order
Complex-valued example
M≔Matrix⁡2,3,i,j↦i+I⋅j,datatype=complex8,order=C_order
M≔1.+I1.+2.⁢I1.+3.⁢I2.+I2.+2.⁢I2.+3.⁢I
View Matrix as a double-size real Matrix, type float[8]
Mr≔ComplexAsFloat⁡M
Mr≔1.1.1.2.1.3.2.1.2.2.2.3.
Clear the real part only using the view Mr
Fill⁡0,Mr,0,2,M
0.+I0.+2.⁢I0.+3.⁢I0.+I0.+2.⁢I0.+3.⁢I
See Also
Fortran_order
LinearAlgebra
Matrix
module
Vector
VectorCalculus
with
Download Help Document