chickadee » matrix-utils » make-matrix-eye

make-matrix-eye:procedure

Given procedures MAKE-VECTOR and FILL-MATRIX!, returns a procedure EYE of the form EYE:: M * N [* ORDER] -> I

Where procedure EYE returns an identity matrix of size M x N. Optional argument ORDER specifies the matrix layout: ColMajor or RowMajor, default is RowMajor.

MAKE-VECTOR is one of the homogeneous vector creation procedures from SRFI-4, and FILL-MATRIX! is a procedure created by MAKE-FILL-MATRIX, above. FILL-MATRIX! must operate on the same type of vector as MAKE-VECTOR.