Created
June 21, 2019 20:47
-
-
Save bitsnaps/8de516d8ee7c601bf003c0cf6debb230 to your computer and use it in GitHub Desktop.
Matrix manipulation with groovy by graxxia library
This file contains 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
@Grab('org.graxxia:graxxia:1.0.1') | |
import graxxia.* | |
def m = new Matrix([[3,4,5],[6,2,3]]) | |
println(m) | |
def m1 = [[1,2,3],[2,6,3],[7,4,2]] as Matrix | |
def m2 = [[2,6,4],[2,3,5],[7,6,5]] as Matrix | |
def m3 = [[2,3,4],[8,6,2],[10,4,3]] as Matrix | |
println(m1*2) | |
println(m1+m2) | |
def m4 = (m1+m2/m3) as Matrix | |
// you can try this on Groovy Notebook (beakerX hosted by mybinder.org) | |
//https://hub.gke.mybinder.org/user/twosigma-beakerx-t6rwva2p/notebooks/doc/groovy/Groovy.ipynb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment