com.komputation.cpu.functions.RowSplit.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of komputation Show documentation
Show all versions of komputation Show documentation
Komputation is a neural network framework for the JVM written in the Kotlin programming language.
package com.komputation.cpu.functions
fun splitRows(numberRows : Int, numberColumns : Int, entries : FloatArray, heights : IntArray, numberBlocks: Int, result : Array) {
var runningHeight = 0
for (indexBlock in 0 until numberBlocks) {
val height = heights[indexBlock]
val block = result[indexBlock]
for (indexColumn in 0 until numberColumns) {
for (indexRow in 0 until height) {
block[indexColumn * height + indexRow] = entries[indexColumn * numberRows + (runningHeight + indexRow)]
}
}
runningHeight += height
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy