identity-matrix

Source

(def identity-matrix (memoize (fn [size] (vec (for [row (->range size) col (->range size)] (if (= row col) 1 0))))))