From cd46773f432d4e23a2b851ed857add1f65ab176b Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Tue, 24 Dec 2024 13:43:41 +0300 Subject: [PATCH] Fix EJML to properly treat vectors as columns --- .../kotlin/space/kscience/kmath/ejml/EjmlVectorTest.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kmath-ejml/src/jvmTest/kotlin/space/kscience/kmath/ejml/EjmlVectorTest.kt b/kmath-ejml/src/jvmTest/kotlin/space/kscience/kmath/ejml/EjmlVectorTest.kt index a19a3acc1..49e50ad8f 100644 --- a/kmath-ejml/src/jvmTest/kotlin/space/kscience/kmath/ejml/EjmlVectorTest.kt +++ b/kmath-ejml/src/jvmTest/kotlin/space/kscience/kmath/ejml/EjmlVectorTest.kt @@ -21,7 +21,7 @@ internal class EjmlVectorTest { private val randomMatrix: DMatrixRMaj get() { - val d = DMatrixRMaj(1, random.nextInt(2, 100)) + val d = DMatrixRMaj(random.nextInt(2, 100), 1) RandomMatrices_DDRM.fillUniform(d, random.asJavaRandom()) return d } @@ -30,7 +30,7 @@ internal class EjmlVectorTest { fun size() { val m = randomMatrix val w = EjmlDoubleVector(m) - assertEquals(m.numCols, w.size) + assertEquals(m.numRows, w.size) } @Test @@ -46,7 +46,7 @@ internal class EjmlVectorTest { val w = EjmlDoubleVector(m) assertEquals( - m.iterator(true, 0, 0, 0, m.numCols - 1).asSequence().toList(), + m.iterator(true, 0, 0, m.numRows - 1, 0).asSequence().toList(), w.iterator().asSequence().toList() ) }