v0.2.0 #206

Merged
altavir merged 210 commits from dev into master 2021-02-21 16:33:25 +03:00
4 changed files with 4 additions and 4 deletions
Showing only changes of commit d36da01833 - Show all commits

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>