diff --git a/kmath-core/src/commonMain/kotlin/scientifik/kmath/linear/Matrix.kt b/kmath-core/src/commonMain/kotlin/scientifik/kmath/linear/Matrix.kt index 7ec3a95f4..646cbb5c1 100644 --- a/kmath-core/src/commonMain/kotlin/scientifik/kmath/linear/Matrix.kt +++ b/kmath-core/src/commonMain/kotlin/scientifik/kmath/linear/Matrix.kt @@ -175,7 +175,7 @@ class MatrixBuilder(val rows: Int, val columns: Int) { /** * Check if matrix has the given feature class */ -inline fun Matrix<*>.hasFeature(): Boolean = features.find { T::class.isInstance(it) } != null +inline fun Matrix<*>.hasFeature(): Boolean = features.find { it is T } != null /** * Get the first feature matching given class. Does not guarantee that matrix has only one feature matching the criteria @@ -195,9 +195,7 @@ fun > GenericMatrixContext.one(rows: Int, columns: In * A virtual matrix of zeroes */ fun > GenericMatrixContext.zero(rows: Int, columns: Int): Matrix = - VirtualMatrix(rows, columns) { i, j -> - elementContext.zero - } + VirtualMatrix(rows, columns) { _, _ -> elementContext.zero } class TransposedFeature(val original: Matrix) : MatrixFeature