All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.org.danilopianini.symmetricmatrix.MutableFloatSymmetricMatrix.kt Maven / Gradle / Ivy

The newest version!
package org.danilopianini.symmetricmatrix

/**
 * A mutable symmetric matrix of floats.
 */
class MutableFloatSymmetricMatrix(
    override val size: Int,
) : AbstractSymmetricMatrix(),
    MutableSymmetricMatrix {
    private val data: FloatArray = FloatArray(size * (size + 1) / 2)

    override operator fun get(
        i: Int,
        j: Int,
    ): Float = data[indexOf(i, j)]

    override operator fun set(
        i: Int,
        j: Int,
        value: Float,
    ) {
        data[indexOf(i, j)] = value
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy