v0.2.0 #206
@ -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>
|
||||
|
||||
|
@ -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
|
||||
|
@ -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()
|
||||
|
@ -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>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user