Skip to content

make identity matrix

Uri edited this page Aug 5, 2021 · 1 revision

How to make identity matrix:

> (import (otus algebra))
> (Index (Matrix 7 7) (lambda (x y) (if (= x y) 1 0)))
#(#(1 0 0 0 0 0 0) #(0 1 0 0 0 0 0) #(0 0 1 0 0 0 0) #(0 0 0 1 0 0 0) #(0 0 0 0 1 0 0) #(0 0 0 0 0 1 0) #(0 0 0 0 0 0 1))
Clone this wiki locally