type/Vector - Maple Programming Help

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

type/Vector

check for a Vector (rtable-based)

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

Parameters

 expr - any expression R - Vector shape, any Vector option, or an expression sequence of these

Description

 • A Maple Vector is an rtable with subType option Vector.
 • The type(expr, Vector) function returns true if expr is a Maple Vector.
 • The type(expr, 'Vector'(R)) function returns true if expr is a Maple Vector with the shapes or options given in R (see Vector for permissible shapes and options).
 Note:  It is essential to quote the word Vector in this form of the calling sequence in order to avoid confusion with the Vector(..) constructor function.

Examples

 > $A≔\mathrm{Vector}\left(\left[1,2,3\right]\right)$
 ${A}{≔}\left[\begin{array}{r}{1}\\ {2}\\ {3}\end{array}\right]$ (1)
 > $\mathrm{type}\left(A,\mathrm{Vector}\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{type}\left(A,\mathrm{Vector}[\mathrm{column}]\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{type}\left(A,\mathrm{Vector}[\mathrm{row}]\right)$
 ${\mathrm{false}}$ (4)

Check the contents of the Vector.

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

Check the shape or options of the Vector.

 > $\mathrm{VectorOptions}\left(A\right)$
 ${\mathrm{shape}}{=}\left[{}\right]{,}{\mathrm{datatype}}{=}{\mathrm{anything}}{,}{\mathrm{orientation}}{=}{\mathrm{column}}{,}{\mathrm{storage}}{=}{\mathrm{rectangular}}{,}{\mathrm{order}}{=}{\mathrm{Fortran_order}}$ (6)
 > $\mathrm{type}\left(A,'\mathrm{Vector}'\left(\mathrm{datatype}=\mathrm{anything},\mathrm{subtype}=\mathrm{Vector}[\mathrm{column}],\mathrm{storage}=\mathrm{rectangular}\right)\right)$
 ${\mathrm{true}}$ (7)
 > $\mathrm{type}\left(A,'\mathrm{Vector}'\left(\mathrm{datatype}=\mathrm{integer}\right)\right)$
 ${\mathrm{false}}$ (8)