array - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


type/array

check for an array

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

type(A, array)

type(A, 'array'(t))

type(A, 'array'(n))

type(A, 'array'(x_1, x_2, ...))

Parameters

A

-

any expression

x_i

-

(optional) integer, range, type, or name

Description

• 

The call type(A, array) checks to see if A is an array.  It will return true if A is an array, and false otherwise.  It does not check the entries of A. See the information under array for a description of the array data structure and how to create arrays.

• 

The optional argument(s) must be either integers, ranges, names or a type.  They are used to specify the kind of array and the type of the entries of the array.

• 

If x_i is an integer it specifies the number of dimensions of the array A.  For example, 'array'(2) would specify a 2-D array.

• 

If x1,x2,...,xn are ranges, they specify the array bounds (and implicitly the dimension) of the array A.  For example, 'array'(1..2,1..posint) would specify a 2-D array with exactly two rows and one or more columns.

• 

If x1,...,xn are names of indexing functions, they specify the kind of array.  For example, 'array'(symmetric) specifies a symmetric array, that is, an array with the symmetric indexing function.

• 

If x is a type, it specifies the type of the entries of the array. For example, 'array'(numeric) specifies an array with numerical entries. See the information under type for a description of available types in Maple.  Note, if any entries of A are undefined, then their type will not be checked.  Thus if A is an array which has no defined elements, then type(A, 'array'(x)) will always return true.

• 

It is necessary to surround the word array with quotes (') when using this function in the second form.  This prevents invocation of the array function, which is used to create arrays.

• 

Note: The array command has been superseded by Array.

Examples

> 

A≔array⁡1..2,1..2,1,3,12,5

A≔13125

(1)
> 

type⁡A,array⁡rational

true

(2)
> 

type⁡A,array⁡integer

false

(3)
> 

type⁡A,array⁡2

true

(4)
> 

type⁡A,array⁡1..2,1..2

true

(5)
> 

type⁡A,array⁡1..2

false

(6)
> 

B≔array⁡1..3,x2+5,x3−x,x+1

B≔x2+5x3−xx+1

(7)
> 

type⁡B,array⁡polynom

true

(8)
> 

type⁡B,array⁡polynom⁡integer,x

true

(9)
> 

C≔array⁡0..2,2..4,symmetric

C≔array⁡symmetric,0..2,2..4,0,2=`?`0,2,0,3=`?`0,3,0,4=`?`0,4,1,2=`?`1,2,1,3=`?`1,3,1,4=`?`1,4,2,2=`?`2,2,2,3=`?`2,3,2,4=`?`2,4

(10)
> 

type⁡C,array⁡2,symmetric

true

(11)
> 

type⁡C,array⁡1..2,1..2

false

(12)
> 

type⁡C,array⁡0..posint,integer..integer,symmetric

true

(13)

See Also

array(deprecated)

type

type/Array

type/matrix

type/table