<< Expand SYMSCI Toolbox Fraction >>

SYMSCI Toolbox >> SYMSCI Toolbox > Eye

Eye

symbolic identity matrix

Syntax

B = Eye( A, k = 0 )
B = Eye( r, c, k = 0 )

Arguments

A, B

symbolic matrix

k

integer

r, c

non-negative integer

Description

Eye( A )

Returns an identity matrix with the same dimensions as matrix A.

Eye( A, k )

Returns a matrix with the same dimensions as matrix A and ones on a lower (k < 0) or upper (k > 0) diagonal. For k = 0 the ones are located on the main diagonal (cf. above).

Eye( r, c )

Returns an identity matrix with r rows and c columns.

Eye( r, c, k )

Returns a matrix with r rows, c columns and ones on a lower (k < 0) or upper (k > 0) diagonal. For k = 0 the ones are located on the main diagonal (cf. above).

Examples

// create a matrix
A = Mat("a",3,3)

// identity matrix
Eye(A)

// a band (7,5)-matrix with ones
Eye(7,5,-1) + Eye(7,5) + Eye(7,5,1)

See Also

Authors

Bibliography

SymEngine: C++ library for fast symbolic manipulation.


Report an issue
<< Expand SYMSCI Toolbox Fraction >>