forked from kscience/kmath
commit
42259e3eb9
@ -19,7 +19,7 @@ allprojects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "space.kscience"
|
group = "space.kscience"
|
||||||
version = "0.3.0-dev-16"
|
version = "0.3.0-dev-17"
|
||||||
}
|
}
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
|
@ -5,20 +5,14 @@
|
|||||||
|
|
||||||
package space.kscience.kmath.tensors
|
package space.kscience.kmath.tensors
|
||||||
|
|
||||||
import edu.mcgill.kaliningraph.power
|
|
||||||
import org.jetbrains.kotlinx.multik.api.Multik
|
import org.jetbrains.kotlinx.multik.api.Multik
|
||||||
import org.jetbrains.kotlinx.multik.api.linalg.dot
|
|
||||||
import org.jetbrains.kotlinx.multik.api.math.exp
|
|
||||||
import org.jetbrains.kotlinx.multik.api.ndarray
|
import org.jetbrains.kotlinx.multik.api.ndarray
|
||||||
import org.jetbrains.kotlinx.multik.ndarray.operations.minus
|
|
||||||
import org.jetbrains.kotlinx.multik.ndarray.operations.plus
|
|
||||||
import org.jetbrains.kotlinx.multik.ndarray.operations.unaryMinus
|
|
||||||
import space.kscience.kmath.multik.multikND
|
import space.kscience.kmath.multik.multikND
|
||||||
import space.kscience.kmath.nd.one
|
import space.kscience.kmath.nd.one
|
||||||
import space.kscience.kmath.operations.DoubleField
|
import space.kscience.kmath.operations.DoubleField
|
||||||
|
|
||||||
fun main(): Unit = with(DoubleField.multikND) {
|
fun main(): Unit = with(DoubleField.multikND) {
|
||||||
val a = Multik.ndarray(intArrayOf(1, 2, 3)).asType<Double>().wrap()
|
val a = Multik.ndarray(intArrayOf(1, 2, 3)).asType<Double>().wrap()
|
||||||
val b = Multik.ndarray(doubleArrayOf(1.0, 2.0, 3.0))
|
val b = Multik.ndarray(doubleArrayOf(1.0, 2.0, 3.0)).wrap()
|
||||||
one(a.shape) - a
|
one(a.shape) - a + b * 3
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user