The diagonal Indexing Function - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Data Types : Tables, lists, and sets : indexing functions : indexfcn/diagonal

The diagonal Indexing Function

 

Description

Examples

Description

• 

The diagonal indexing function can be used to construct tables and rtable objects of type Array or Matrix.

• 

The diagonal indexing function returns 0 as the value for all components whose indices are not identical.

• 

In the construction of an m x n diagonal Matrix (rtable-based), if the initializer parameter is a Vector, then the entries of this Vector are placed along the main diagonal of the constructed Matrix, starting at position (1, 1).

• 

Under normal circumstances, Maple only stores the diagonal elements.

• 

If an object is defined by using the diagonal indexing function,  the elements located off the diagonal cannot be reassigned.

  

In the case of a table, if you know that the elements may be reassigned, use the sparse indexing function instead.

Examples

VVector1,2,3

V123

(1)

MMatrix1..4,1..4,V,shape=diagonal

M1000020000300000

(2)

See Also

identity

indexfcn

Matrix

rtable

rtable_indexfcn

sparse

table