Home Online Manual
Top
Back: tensor
Forward: gauss_col
FastBack: Linear algebra
FastForward: linalg_lib
Up: matrix_lib
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

D.3.1.14 unitmat

Procedure from library matrix.lib (see matrix_lib).

Usage:
unitmat(n); n integer >= 0

Return:
nxn unit matrix

Note:
needs a basering, diagonal entries are numbers (=1) in the basering

Example:
 
LIB "matrix.lib";
ring r=32003,(x,y,z),lp;
print(xyz*unitmat(4));
==> xyz,0,  0,  0, 
==> 0,  xyz,0,  0, 
==> 0,  0,  xyz,0, 
==> 0,  0,  0,  xyz
print(unitmat(5));
==> 1,0,0,0,0,
==> 0,1,0,0,0,
==> 0,0,1,0,0,
==> 0,0,0,1,0,
==> 0,0,0,0,1