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)