Fix examples

This commit is contained in:
Roland Grinis 2021-04-30 15:25:45 +01:00
parent 42ddd2e569
commit 1695fc5075
2 changed files with 4 additions and 2 deletions

View File

@ -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(

View File

@ -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),