Skip to content

Instantly share code, notes, and snippets.

@aibrahim
Created September 19, 2016 12:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aibrahim/968b6b5ecd80c7289dfa209e0d5145d2 to your computer and use it in GitHub Desktop.
Save aibrahim/968b6b5ecd80c7289dfa209e0d5145d2 to your computer and use it in GitHub Desktop.
(defn trace-mat
[A]
(->> A
(cl/map-indexed (fn [i j e] (if (== i j ) e 0)))
(map #(apply + %))
(apply +)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment