type/Array - Maple Programming Help

Home : Support : Online Help : Programming : Data Types : Type Checking : Types : type/Array

type/Array

check for a Array (rtable-based)

 Calling Sequence type(expr, Array) type(expr, 'Array'(R))

Parameters

 expr - any expression R - Array indexing function, any Array option, name square, or an expression sequence of these

Description

 • A Maple Array is an rtable with subtype option Array.
 • The type(expr, Array) function returns true if expr is a Maple Array.
 • The type(expr, 'Array'(R)) function returns true if expr is a Maple Array with the indexing functions or options given in R (see Array for permissible options).
 • If R includes the name 'square', the dimensions of the Array are checked to see if they are all the same size (they do not have to have the same start and end values).
 Note:  It is essential to quote the word Array in this form of the calling sequence in order to avoid confusion with the Array(..) constructor function.

Examples

 > $A≔\mathrm{Array}\left(\left[\left[1,2,3\right],\left[4,5,6\right],\left[7,8,9\right]\right]\right)$
 ${A}{≔}\left[\begin{array}{rrr}{1}& {2}& {3}\\ {4}& {5}& {6}\\ {7}& {8}& {9}\end{array}\right]$ (1)
 > $\mathrm{type}\left(A,\mathrm{Array}\right)$
 ${\mathrm{true}}$ (2)

Check the contents of the Array.

 > $\mathrm{type}\left(A,'\mathrm{Array}'\left(\mathrm{numeric}\right)\right)$
 ${\mathrm{true}}$ (3)

Check the shape or options of the Array.

 > $\mathrm{rtable_options}\left(A\right)$
 ${\mathrm{datatype}}{=}{\mathrm{anything}}{,}{\mathrm{subtype}}{=}{\mathrm{Array}}{,}{\mathrm{storage}}{=}{\mathrm{rectangular}}{,}{\mathrm{order}}{=}{\mathrm{Fortran_order}}$ (4)
 > $\mathrm{type}\left(A,'\mathrm{Array}'\left(\mathrm{square},\mathrm{datatype}=\mathrm{anything},\mathrm{order}=\mathrm{Fortran_order}\right)\right)$
 ${\mathrm{true}}$ (5)
 > $\mathrm{type}\left(A,'\mathrm{Array}'\left(\mathrm{datatype}=\mathrm{integer}\right)\right)$
 ${\mathrm{false}}$ (6)