From 1c495759cd23d7e4f3ea826715d179c9713d6447 Mon Sep 17 00:00:00 2001 From: Iaroslav Date: Mon, 14 Sep 2020 19:53:31 +0700 Subject: [PATCH] Replace ?: with set merging --- .../src/main/kotlin/scientifik/kmath/ejml/EjmlMatrix.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 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 a53856af0..90f6e64cd 100644 --- a/kmath-ejml/src/main/kotlin/scientifik/kmath/ejml/EjmlMatrix.kt +++ b/kmath-ejml/src/main/kotlin/scientifik/kmath/ejml/EjmlMatrix.kt @@ -23,7 +23,7 @@ class EjmlMatrix(val origin: SimpleMatrix, features: Set? = null) override val shape: IntArray get() = intArrayOf(origin.numRows(), origin.numCols()) - override val features: Set = features ?: hashSetOf( + override val features: Set = hashSetOf( object : DeterminantFeature { override val determinant: Double get() = origin.determinant() @@ -50,7 +50,7 @@ class EjmlMatrix(val origin: SimpleMatrix, features: Set? = null) override val p: FeaturedMatrix get() = lup.first } - ) + ).addAll(features) override fun suggestFeature(vararg features: MatrixFeature): FeaturedMatrix = EjmlMatrix(origin, this.features + features)