diff --git a/kmath-gsl/src/nativeMain/kotlin/kscience/kmath/gsl/GslMatrixContext.kt b/kmath-gsl/src/nativeMain/kotlin/kscience/kmath/gsl/GslMatrixContext.kt index 762cf1252..de7e4868e 100644 --- a/kmath-gsl/src/nativeMain/kotlin/kscience/kmath/gsl/GslMatrixContext.kt +++ b/kmath-gsl/src/nativeMain/kotlin/kscience/kmath/gsl/GslMatrixContext.kt @@ -19,10 +19,9 @@ internal inline fun GslMatrix.fill(initializer: internal inline fun GslVector.fill(initializer: (Int) -> T): GslVector = apply { (0 until size).forEach { index -> this[index] = initializer(index) } } -public abstract class GslMatrixContext< - T : Any, - H1 : CStructVar, - H2 : CStructVar> internal constructor(internal val scope: DeferScope) : MatrixContext { +public abstract class GslMatrixContext internal constructor( + internal val scope: DeferScope +) : MatrixContext> { init { ensureHasGslErrorHandler() } @@ -46,7 +45,10 @@ public abstract class GslMatrixContext< public class GslRealMatrixContext(scope: DeferScope) : GslMatrixContext(scope) { override fun produceDirtyMatrix(rows: Int, columns: Int): GslMatrix = - GslRealMatrix(nativeHandle = requireNotNull(gsl_matrix_alloc(rows.toULong(), columns.toULong())), scope = scope) + GslRealMatrix( + nativeHandle = requireNotNull(gsl_matrix_alloc(rows.toULong(), columns.toULong())), + scope = scope + ) override fun produceDirtyVector(size: Int): GslVector = GslRealVector(nativeHandle = requireNotNull(gsl_vector_alloc(size.toULong())), scope = scope) @@ -131,10 +133,11 @@ public class GslFloatMatrixContext(scope: DeferScope) : public class GslComplexMatrixContext(scope: DeferScope) : GslMatrixContext(scope) { - override fun produceDirtyMatrix(rows: Int, columns: Int): GslMatrix = GslComplexMatrix( - nativeHandle = requireNotNull(gsl_matrix_complex_alloc(rows.toULong(), columns.toULong())), - scope = scope - ) + override fun produceDirtyMatrix(rows: Int, columns: Int): GslMatrix = + GslComplexMatrix( + nativeHandle = requireNotNull(gsl_matrix_complex_alloc(rows.toULong(), columns.toULong())), + scope = scope + ) override fun produceDirtyVector(size: Int): GslVector = GslComplexVector(requireNotNull(gsl_vector_complex_alloc(size.toULong())), scope)