From a046f5c060fc8f046c80ddf96a187e057a023d2b Mon Sep 17 00:00:00 2001 From: Iaroslav Date: Mon, 14 Sep 2020 20:02:53 +0700 Subject: [PATCH] Update features --- .../src/main/kotlin/scientifik/kmath/ejml/EjmlMatrix.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kmath-ejml/src/main/kotlin/scientifik/kmath/ejml/EjmlMatrix.kt b/kmath-ejml/src/main/kotlin/scientifik/kmath/ejml/EjmlMatrix.kt index 90f6e64cd..09b9c4fcd 100644 --- a/kmath-ejml/src/main/kotlin/scientifik/kmath/ejml/EjmlMatrix.kt +++ b/kmath-ejml/src/main/kotlin/scientifik/kmath/ejml/EjmlMatrix.kt @@ -24,12 +24,10 @@ class EjmlMatrix(val origin: SimpleMatrix, features: Set? = null) get() = intArrayOf(origin.numRows(), origin.numCols()) override val features: Set = hashSetOf( - object : DeterminantFeature { + object : LUPDecompositionFeature, DeterminantFeature { override val determinant: Double get() = origin.determinant() - }, - object : LUPDecompositionFeature { private val lup by lazy { val ludecompositionF64 = DecompositionFactory_DDRM.lu(origin.numRows(), origin.numCols()) .also { it.decompose(origin.ddrm.copy()) } @@ -50,7 +48,7 @@ class EjmlMatrix(val origin: SimpleMatrix, features: Set? = null) override val p: FeaturedMatrix get() = lup.first } - ).addAll(features) + ).addAll(features.orEmpty()) override fun suggestFeature(vararg features: MatrixFeature): FeaturedMatrix = EjmlMatrix(origin, this.features + features)