From b51427d2abb401d1402eebd7bf61e93bca47f3a2 Mon Sep 17 00:00:00 2001 From: Roland Grinis Date: Fri, 9 Apr 2021 12:26:03 +0100 Subject: [PATCH] test to fix determinant --- .../tensors/core/TestDoubleLinearOpsAlgebra.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/kmath-tensors/src/commonTest/kotlin/space/kscience/kmath/tensors/core/TestDoubleLinearOpsAlgebra.kt b/kmath-tensors/src/commonTest/kotlin/space/kscience/kmath/tensors/core/TestDoubleLinearOpsAlgebra.kt index 2914b216b..37caf88fe 100644 --- a/kmath-tensors/src/commonTest/kotlin/space/kscience/kmath/tensors/core/TestDoubleLinearOpsAlgebra.kt +++ b/kmath-tensors/src/commonTest/kotlin/space/kscience/kmath/tensors/core/TestDoubleLinearOpsAlgebra.kt @@ -34,6 +34,19 @@ class TestDoubleLinearOpsTensorAlgebra { } + @Test + fun testDet() = DoubleLinearOpsTensorAlgebra { + val m = fromArray( + intArrayOf(3, 3), doubleArrayOf( + 2.1843, 1.4391, -0.4845, + 1.4391, 1.7772, 0.4055, + -0.4845, 0.4055, 0.7519 + ) + ) + println(m.det().value()) + println(0.0197) //expected value + } + @Test fun testInvLU() = DoubleLinearOpsTensorAlgebra { val tensor = fromArray(