Factor Documentation
|
Home
|
Glossary
|
Search
factorcode.org
identity-matrix ( n -- matrix )
Vocabulary
math.matrices
Inputs and outputs
n
an
integer
matrix
a
sequence
Word description
Creates an identity matrix of size
n x n
, where the diagonal values are all ones.
Definition
USING:
sequences
;
IN:
math.matrices
:
identity-matrix
( n -- matrix )
1
<repetition>
diagonal-matrix
;
inline