coerce to an Array - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Procedures and Functions : Parameters : Using Parameters within Procedures : Data Type Coercion : ~Array

~Array - coerce to an Array

~Matrix - coerce to a Matrix

~Vector - coerce to a Vector

Calling Sequence

~Array(a, options )

~Matrix(a, options )

~Vector(a, options )

~Vector[row](a, options )

~Vector[column](a, options )

Parameters

a

-

any expression

options

-

(optional) bounds, datatype, order, etc.

Description

• 

These functions accept any expression, a, and try to coerce it to the type implied by their base name and options. They are often used in conjunction with coercion, a part of procedure parameter processing, but can also be called directly.

• 

Coercion may succeed if a is any of the following types: list, listlist, Matrix, matrix, Vector, vector, Array.  If coercion succeeds, the result will look very much the same as the original input. If coercion fails, the result will be NULL.

• 

The result may be an alias of the input argument.  An alias is simply a different view of the same data.  This is memory efficient as no copy operation is involved.  It also means that modifying the result will change the input.  This is especially desirable when used in conjunction with parameter processing.

Thread Safety

• 

The ~Array, ~Matrix and ~Vector commands are thread-safe as of Maple 16.

• 

For more information on thread safety, see index/threadsafe.

Examples

`~Matrix`1,2,3,4

1234

(1)

v:=Vector1,2,3

v:=123

(2)

`~Matrix`v

123

(3)

`~Matrix`v,datatype=float

1.2.3.

(4)

A1:=1,2,3

A1:=123

(5)

A0:=`~Array`A1,0..

A0:=Array0..2,0=1,1=2,2=3,attributes=source_rtable=123

(6)

A00

1

(7)

A00:=5

A00:=5

(8)

A11

5

(9)

See Also

Array, coercion, Matrix, parameter, procedure, Vector


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