net.maizegenetics.util.ColumnMatrix.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tassel Show documentation
Show all versions of tassel Show documentation
TASSEL is a software package to evaluate traits associations, evolutionary patterns, and linkage
disequilibrium.
package net.maizegenetics.util
/**
* @author Terry Casstevens
* Created December 06, 2018
*
* This class optimizes read-only column access of a byte matrix.
*/
class ColumnMatrix private constructor(private val matrix: SuperByteMatrix) {
val numColumns = matrix.numRows
val numRows = matrix.numColumns
fun column(index: Int) = matrix.getAllColumns(index)
class Builder(numRows: Int, numColumns: Int) {
private val matrix = SuperByteMatrixBuilder.getInstance(numColumns, numRows)
fun set(row: Int, column: Int, value: Byte) = matrix.set(column, row, value)
fun build() = ColumnMatrix(matrix)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy