diff --git a/kmath-gsl/src/nativeMain/kotlin/kscience/kmath/gsl/GslMatrix.kt b/kmath-gsl/src/nativeMain/kotlin/kscience/kmath/gsl/GslMatrix.kt index c28236a67..fe8aea577 100644 --- a/kmath-gsl/src/nativeMain/kotlin/kscience/kmath/gsl/GslMatrix.kt +++ b/kmath-gsl/src/nativeMain/kotlin/kscience/kmath/gsl/GslMatrix.kt @@ -10,7 +10,7 @@ import kscience.kmath.structures.asSequence * Wraps gsl_matrix_* objects from GSL. */ public abstract class GslMatrix internal constructor(scope: AutofreeScope) : - GslMemoryHolder(scope), Matrix { + GslObject(scope), Matrix { internal abstract operator fun set(i: Int, j: Int, value: T) internal abstract fun copy(): GslMatrix diff --git a/kmath-gsl/src/nativeMain/kotlin/kscience/kmath/gsl/GslMemoryHolder.kt b/kmath-gsl/src/nativeMain/kotlin/kscience/kmath/gsl/GslObject.kt similarity index 89% rename from kmath-gsl/src/nativeMain/kotlin/kscience/kmath/gsl/GslMemoryHolder.kt rename to kmath-gsl/src/nativeMain/kotlin/kscience/kmath/gsl/GslObject.kt index 46d1ba60b..8c771a183 100644 --- a/kmath-gsl/src/nativeMain/kotlin/kscience/kmath/gsl/GslMemoryHolder.kt +++ b/kmath-gsl/src/nativeMain/kotlin/kscience/kmath/gsl/GslObject.kt @@ -13,7 +13,7 @@ import kotlinx.cinterop.DeferScope * * @param scope the scope where this object is declared. */ -public abstract class GslMemoryHolder internal constructor(internal val scope: AutofreeScope) { +public abstract class GslObject internal constructor(internal val scope: AutofreeScope) { internal abstract val rawNativeHandle: CPointer private var isClosed: Boolean = false diff --git a/kmath-gsl/src/nativeMain/kotlin/kscience/kmath/gsl/GslPermutation.kt b/kmath-gsl/src/nativeMain/kotlin/kscience/kmath/gsl/GslPermutation.kt index 3d5c4a3a4..49baceb6b 100644 --- a/kmath-gsl/src/nativeMain/kotlin/kscience/kmath/gsl/GslPermutation.kt +++ b/kmath-gsl/src/nativeMain/kotlin/kscience/kmath/gsl/GslPermutation.kt @@ -8,7 +8,7 @@ import org.gnu.gsl.gsl_permutation_free import org.gnu.gsl.gsl_permutation_get internal class GslPermutation(override val rawNativeHandle: CPointer, scope: AutofreeScope) : - GslMemoryHolder(scope) { + GslObject(scope) { val size get() = nativeHandle.pointed.size.toInt() operator fun get(i: Int) = gsl_permutation_get(nativeHandle, i.toULong()).toInt() diff --git a/kmath-gsl/src/nativeMain/kotlin/kscience/kmath/gsl/GslVector.kt b/kmath-gsl/src/nativeMain/kotlin/kscience/kmath/gsl/GslVector.kt index 8bc1240b4..fb8ba53d7 100644 --- a/kmath-gsl/src/nativeMain/kotlin/kscience/kmath/gsl/GslVector.kt +++ b/kmath-gsl/src/nativeMain/kotlin/kscience/kmath/gsl/GslVector.kt @@ -8,7 +8,7 @@ import kscience.kmath.linear.Point * Wraps gsl_vector_* objects from GSL. */ public abstract class GslVector internal constructor(scope: AutofreeScope) : - GslMemoryHolder(scope), Point { + GslObject(scope), Point { internal abstract operator fun set(index: Int, value: T) internal abstract fun copy(): GslVector