
commonMain.org.danilopianini.symmetricmatrix.MutableULongSymmetricMatrix.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-symmetric-matrix-jvm Show documentation
Show all versions of kotlin-symmetric-matrix-jvm Show documentation
A template repository for Kotlin Multiplatform projects
The newest version!
package org.danilopianini.symmetricmatrix
/**
* A mutable symmetric matrix of unsigned longs.
*/
class MutableULongSymmetricMatrix(
override val size: Int,
) : AbstractSymmetricMatrix(),
MutableSymmetricMatrix {
@OptIn(ExperimentalUnsignedTypes::class)
private val data: ULongArray = ULongArray(size * (size + 1) / 2)
@OptIn(ExperimentalUnsignedTypes::class)
override operator fun get(
i: Int,
j: Int,
): ULong = data[indexOf(i, j)]
@OptIn(ExperimentalUnsignedTypes::class)
override operator fun set(
i: Int,
j: Int,
value: ULong,
) {
data[indexOf(i, j)] = value
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy