Created
December 29, 2014 10:15
-
-
Save kurogelee/1985327c7db47b5dfa3d to your computer and use it in GitHub Desktop.
clojure.core.matrixのお試しサンプル ref: http://qiita.com/kurogelee/items/67656a04fe9a2374da0d
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[net.mikera/core.matrix "0.32.1"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def d (m/diagonal-matrix [1 2])) | |
(def e (m/broadcast [1 5 7] [3 3])) | |
d | |
e | |
(m/sqrt d) | |
(m/esum d) | |
(m/emax e) | |
(m/emap #(* 2 %) e) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[1 0.0] [0.0 2]] | |
[[1 5 7] [1 5 7] [1 5 7]] | |
[[1.0 0.0] [0.0 1.4142135623730951]] | |
3.0 | |
7 | |
[[2 10 14] [2 10 14] [2 10 14]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment