Research Article
ScalaLab and GroovyLab: Comparing Scala and Groovy for Scientific Computing
// define the operation: Number + double , | // at the MetaClass of the Number’s class | Number.metaClass.plus = | { | // the double m array denotes the input parameter | double m -> | // call a Java routine for the operation | res = | groovySci.math.LinearAlgebra.LinearAlgebra.plus(delegate, m) // calls Java code | res | } |
|