diff --git a/examples/src/benchmarks/kotlin/kscience/kmath/benchmarks/BufferBenchmark.kt b/examples/src/benchmarks/kotlin/kscience/kmath/benchmarks/BufferBenchmark.kt index 4c64517f1..42a03bc53 100644 --- a/examples/src/benchmarks/kotlin/kscience/kmath/benchmarks/BufferBenchmark.kt +++ b/examples/src/benchmarks/kotlin/kscience/kmath/benchmarks/BufferBenchmark.kt @@ -31,4 +31,4 @@ internal class BufferBenchmark { companion object { const val size: Int = 100 } -} \ No newline at end of file +} diff --git a/examples/src/benchmarks/kotlin/kscience/kmath/benchmarks/DotBenchmark.kt b/examples/src/benchmarks/kotlin/kscience/kmath/benchmarks/DotBenchmark.kt index 2256a3e02..48be30cef 100644 --- a/examples/src/benchmarks/kotlin/kscience/kmath/benchmarks/DotBenchmark.kt +++ b/examples/src/benchmarks/kotlin/kscience/kmath/benchmarks/DotBenchmark.kt @@ -14,7 +14,7 @@ import org.openjdk.jmh.annotations.State import kotlin.random.Random @State(Scope.Benchmark) -class DotBenchmark { +internal class DotBenchmark { companion object { val random = Random(12224) val dim = 1000 @@ -64,4 +64,4 @@ class DotBenchmark { matrix1 dot matrix2 } } -} \ No newline at end of file +} diff --git a/examples/src/benchmarks/kotlin/kscience/kmath/ast/ExpressionsInterpretersBenchmark.kt b/examples/src/benchmarks/kotlin/kscience/kmath/benchmarks/ExpressionsInterpretersBenchmark.kt similarity index 85% rename from examples/src/benchmarks/kotlin/kscience/kmath/ast/ExpressionsInterpretersBenchmark.kt rename to examples/src/benchmarks/kotlin/kscience/kmath/benchmarks/ExpressionsInterpretersBenchmark.kt index c5edcdedf..1a358da12 100644 --- a/examples/src/benchmarks/kotlin/kscience/kmath/ast/ExpressionsInterpretersBenchmark.kt +++ b/examples/src/benchmarks/kotlin/kscience/kmath/benchmarks/ExpressionsInterpretersBenchmark.kt @@ -1,6 +1,8 @@ -package kscience.kmath.ast +package kscience.kmath.benchmarks import kscience.kmath.asm.compile +import kscience.kmath.ast.MstField +import kscience.kmath.ast.mstInField import kscience.kmath.expressions.Expression import kscience.kmath.expressions.expressionInField import kscience.kmath.expressions.invoke @@ -28,7 +30,7 @@ internal class ExpressionsInterpretersBenchmark { @Benchmark fun mstExpression() { val expr = algebra.mstInField { - symbol("x") * 2.0 + 2.0 / symbol("x") - 16.0 + MstField.symbol("x") * 2.0 + 2.0 / MstField.symbol("x") - 16.0 } invokeAndSum(expr) @@ -37,7 +39,7 @@ internal class ExpressionsInterpretersBenchmark { @Benchmark fun asmExpression() { val expr = algebra.mstInField { - symbol("x") * 2.0 + 2.0 / symbol("x") - 16.0 + MstField.symbol("x") * 2.0 + 2.0 / MstField.symbol("x") - 16.0 }.compile() invokeAndSum(expr) @@ -60,4 +62,4 @@ internal class ExpressionsInterpretersBenchmark { println(sum) } -} +} \ No newline at end of file diff --git a/examples/src/benchmarks/kotlin/kscience/kmath/benchmarks/LinearAlgebraBenchmark.kt b/examples/src/benchmarks/kotlin/kscience/kmath/benchmarks/LinearAlgebraBenchmark.kt index 283210174..b54cff926 100644 --- a/examples/src/benchmarks/kotlin/kscience/kmath/benchmarks/LinearAlgebraBenchmark.kt +++ b/examples/src/benchmarks/kotlin/kscience/kmath/benchmarks/LinearAlgebraBenchmark.kt @@ -1,5 +1,4 @@ -package kscience.kmath.linear - +package kscience.kmath.benchmarks import kotlinx.benchmark.Benchmark import kscience.kmath.commons.linear.CMMatrixContext @@ -7,14 +6,17 @@ import kscience.kmath.commons.linear.CMMatrixContext.dot import kscience.kmath.commons.linear.inverse import kscience.kmath.ejml.EjmlMatrixContext import kscience.kmath.ejml.inverse +import kscience.kmath.linear.Matrix +import kscience.kmath.linear.MatrixContext +import kscience.kmath.linear.inverseWithLup +import kscience.kmath.linear.real import kscience.kmath.operations.invoke -import kscience.kmath.structures.Matrix import org.openjdk.jmh.annotations.Scope import org.openjdk.jmh.annotations.State import kotlin.random.Random @State(Scope.Benchmark) -class LinearAlgebraBenchmark { +internal class LinearAlgebraBenchmark { companion object { val random = Random(1224) val dim = 100 @@ -43,4 +45,4 @@ class LinearAlgebraBenchmark { inverse(matrix) } } -} \ No newline at end of file +} diff --git a/examples/src/benchmarks/kotlin/kscience/kmath/benchmarks/NDFieldBenchmark.kt b/examples/src/benchmarks/kotlin/kscience/kmath/benchmarks/NDFieldBenchmark.kt index e465403ad..5f7559d02 100644 --- a/examples/src/benchmarks/kotlin/kscience/kmath/benchmarks/NDFieldBenchmark.kt +++ b/examples/src/benchmarks/kotlin/kscience/kmath/benchmarks/NDFieldBenchmark.kt @@ -42,4 +42,4 @@ internal class NDFieldBenchmark { val specializedField: RealNDField = NDAlgebra.real(dim, dim) val genericField = NDAlgebra.field(RealField, Buffer.Companion::boxing, dim, dim) } -} \ No newline at end of file +} diff --git a/examples/src/benchmarks/kotlin/kscience/kmath/benchmarks/ViktorBenchmark.kt b/examples/src/benchmarks/kotlin/kscience/kmath/benchmarks/ViktorBenchmark.kt index e246936f0..5cf6c2ab8 100644 --- a/examples/src/benchmarks/kotlin/kscience/kmath/benchmarks/ViktorBenchmark.kt +++ b/examples/src/benchmarks/kotlin/kscience/kmath/benchmarks/ViktorBenchmark.kt @@ -49,4 +49,4 @@ internal class ViktorBenchmark { var res = one repeat(n) { res = res + one } } -} \ No newline at end of file +} diff --git a/examples/src/benchmarks/kotlin/kscience/kmath/benchmarks/ViktorLogBenchmark.kt b/examples/src/benchmarks/kotlin/kscience/kmath/benchmarks/ViktorLogBenchmark.kt index b9c39b088..914584b8e 100644 --- a/examples/src/benchmarks/kotlin/kscience/kmath/benchmarks/ViktorLogBenchmark.kt +++ b/examples/src/benchmarks/kotlin/kscience/kmath/benchmarks/ViktorLogBenchmark.kt @@ -46,4 +46,4 @@ internal class ViktorLogBenchmark { res = fortyTwo.log() } } -} \ No newline at end of file +}