Rename GslMemoryHolder to GslObject

This commit is contained in:
Iaroslav Postovalov 2021-01-24 16:13:30 +07:00
parent c50fab027a
commit d36da01833
No known key found for this signature in database
GPG Key ID: 46E15E4A31B3BCD7
4 changed files with 4 additions and 4 deletions

View File

@ -10,7 +10,7 @@ import kscience.kmath.structures.asSequence
* Wraps gsl_matrix_* objects from GSL.
*/
public abstract class GslMatrix<T : Any, H : CStructVar> internal constructor(scope: AutofreeScope) :
GslMemoryHolder<H>(scope), Matrix<T> {
GslObject<H>(scope), Matrix<T> {
internal abstract operator fun set(i: Int, j: Int, value: T)
internal abstract fun copy(): GslMatrix<T, H>

View File

@ -13,7 +13,7 @@ import kotlinx.cinterop.DeferScope
*
* @param scope the scope where this object is declared.
*/
public abstract class GslMemoryHolder<H : CStructVar> internal constructor(internal val scope: AutofreeScope) {
public abstract class GslObject<H : CStructVar> internal constructor(internal val scope: AutofreeScope) {
internal abstract val rawNativeHandle: CPointer<H>
private var isClosed: Boolean = false

View File

@ -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<gsl_permutation>, scope: AutofreeScope) :
GslMemoryHolder<gsl_permutation>(scope) {
GslObject<gsl_permutation>(scope) {
val size get() = nativeHandle.pointed.size.toInt()
operator fun get(i: Int) = gsl_permutation_get(nativeHandle, i.toULong()).toInt()

View File

@ -8,7 +8,7 @@ import kscience.kmath.linear.Point
* Wraps gsl_vector_* objects from GSL.
*/
public abstract class GslVector<T, H : CStructVar> internal constructor(scope: AutofreeScope) :
GslMemoryHolder<H>(scope), Point<T> {
GslObject<H>(scope), Point<T> {
internal abstract operator fun set(index: Int, value: T)
internal abstract fun copy(): GslVector<T, H>