From 1695fc5075712c1c89121c0860c7c1e985737dbf Mon Sep 17 00:00:00 2001 From: Roland Grinis Date: Fri, 30 Apr 2021 15:25:45 +0100 Subject: [PATCH] Fix examples --- .../space/kscience/kmath/tensors/LinearSystemSolvingWithLUP.kt | 3 ++- .../src/main/kotlin/space/kscience/kmath/tensors/OLSWithSVD.kt | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/src/main/kotlin/space/kscience/kmath/tensors/LinearSystemSolvingWithLUP.kt b/examples/src/main/kotlin/space/kscience/kmath/tensors/LinearSystemSolvingWithLUP.kt index 38d8c1437..a84224bcf 100644 --- a/examples/src/main/kotlin/space/kscience/kmath/tensors/LinearSystemSolvingWithLUP.kt +++ b/examples/src/main/kotlin/space/kscience/kmath/tensors/LinearSystemSolvingWithLUP.kt @@ -5,6 +5,7 @@ package space.kscience.kmath.tensors +import space.kscience.kmath.operations.invoke import space.kscience.kmath.tensors.core.DoubleTensor import space.kscience.kmath.tensors.core.algebras.DoubleLinearOpsTensorAlgebra @@ -13,7 +14,7 @@ import space.kscience.kmath.tensors.core.algebras.DoubleLinearOpsTensorAlgebra fun main () { // work in context with linear operations - DoubleLinearOpsTensorAlgebra { + DoubleLinearOpsTensorAlgebra.invoke { // set true value of x val trueX = fromArray( diff --git a/examples/src/main/kotlin/space/kscience/kmath/tensors/OLSWithSVD.kt b/examples/src/main/kotlin/space/kscience/kmath/tensors/OLSWithSVD.kt index 9318fe928..0408bba63 100644 --- a/examples/src/main/kotlin/space/kscience/kmath/tensors/OLSWithSVD.kt +++ b/examples/src/main/kotlin/space/kscience/kmath/tensors/OLSWithSVD.kt @@ -5,6 +5,7 @@ package space.kscience.kmath.tensors +import space.kscience.kmath.operations.invoke import space.kscience.kmath.tensors.core.DoubleTensor import space.kscience.kmath.tensors.core.algebras.DoubleAnalyticTensorAlgebra import space.kscience.kmath.tensors.core.algebras.DoubleLinearOpsTensorAlgebra @@ -18,7 +19,7 @@ fun main() { val randSeed = 100500L // work in context with linear operations - DoubleLinearOpsTensorAlgebra { + DoubleLinearOpsTensorAlgebra.invoke { // take coefficient vector from normal distribution val alpha = randNormal( intArrayOf(5),