<identity-matrix> ( n -- matrix )
Matrix operations

Prev:<anti-diagonal-matrix> ( diagonal-seq -- matrix )
Next:<simple-eye> ( m n k -- matrix )


Vocabulary
math.matrices

Inputs
nan integer


Outputs
matrixa matrix


Word description
Creates an identity matrix of size n x n, where the diagonal values are all ones.

Examples
USING: math.matrices prettyprint ; 4 <identity-matrix> .
{ { 1 0 0 0 } { 0 1 0 0 } { 0 0 1 0 } { 0 0 0 1 } }


Definition