From 84f7535fdd7d59103e2c846eb0413bb2bb482cb7 Mon Sep 17 00:00:00 2001 From: Iaroslav Postovalov Date: Mon, 12 Oct 2020 20:36:05 +0700 Subject: [PATCH] Add pow support --- .../main/kotlin/kscience/kmath/ast/kotlingrad/ScalarsAdapters.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/kmath-ast-kotlingrad/src/main/kotlin/kscience/kmath/ast/kotlingrad/ScalarsAdapters.kt b/kmath-ast-kotlingrad/src/main/kotlin/kscience/kmath/ast/kotlingrad/ScalarsAdapters.kt index 70c8c09f8..741a2534c 100644 --- a/kmath-ast-kotlingrad/src/main/kotlin/kscience/kmath/ast/kotlingrad/ScalarsAdapters.kt +++ b/kmath-ast-kotlingrad/src/main/kotlin/kscience/kmath/ast/kotlingrad/ScalarsAdapters.kt @@ -58,6 +58,7 @@ public fun > MST.sfun(proto: X): SFun { SpaceOperations.MINUS_OPERATION -> Sum(left.sfun(proto), Negative(right.sfun(proto))) RingOperations.TIMES_OPERATION -> Prod(left.sfun(proto), right.sfun(proto)) FieldOperations.DIV_OPERATION -> Prod(left.sfun(proto), Power(right.sfun(proto), Negative(One()))) + PowerOperations.POW_OPERATION -> Power(left.sfun(proto), SConst((right as MST.Numeric).value)) else -> error("Binary operation $operation not defined in $this") } }