construct a unit Vector - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Linear Algebra : LinearAlgebra Package : Constructors : LinearAlgebra/UnitVector

LinearAlgebra[UnitVector] - construct a unit Vector

Calling Sequence

UnitVector[o](i, d, cpt, options)

Parameters

i

-

positive integer; index of the non-zero entry

d

-

positive integer; dimension of the resulting Vector

cpt

-

(optional) BooleanOpt(compact); selects the compact form of the output

options

-

(optional); constructor options for the result object

[o]

-

(optional) use either [row] or [column] to specify the orientation of the resulting Vector

Description

• 

The UnitVector(i, d) function returns a d-dimensional Vector in which the ith entry is one and all other entries are zero.

• 

The UnitVector[row](i, d) function acts like UnitVector(i, d) except that a row Vector is returned.  If the orientation option is omitted or if UnitVector[column](i, d) is used, a column Vector is returned.

• 

If the compact option (cpt) is omitted, or, if it is included in the calling sequence as just the symbol compact or in the form compact=true, then the result is built by using a shape function designed to minimize storage. If the option is entered as compact=false, a full rectangular object is constructed.

• 

The constructor options provide additional information (readonly, shape, storage, order, datatype, and attributes) to the Vector constructor that builds the result. These options may also be provided in the form outputoptions=[...], where [...] represents a Maple list.  If a constructor option is provided in both the calling sequence directly and in an outputoptions option, the latter takes precedence (regardless of the order).

• 

This function is part of the LinearAlgebra package, and so it can be used in the form UnitVector(..) only after executing the command with(LinearAlgebra). However, it can always be accessed through the long form of the command by using LinearAlgebra[UnitVector](..).

Examples

withLinearAlgebra:

v1:=UnitVector4,5

v1:=00010

(1)

VectorOptionsv1,shape

unit4

(2)

v2:=UnitVectorrow1,3,compact=false

v2:=100

(3)

VectorOptionsv2,shape

(4)

See Also

LinearAlgebra[ScalarVector], 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