nonprivate lateinits are bitch

This commit is contained in:
Minjae Song
2018-12-11 16:39:27 +09:00
parent e0f72aafad
commit c7d7ae03c0
6 changed files with 23 additions and 20 deletions

View File

@@ -11,13 +11,13 @@ import net.torvald.dataclass.Float16Bits
open class MapLayerHalfFloat(val width: Int, val height: Int) : Iterable<Float16Bits> {
constructor(width: Int, height: Int, init: Float) : this(width, height) {
data = Array(height) { Array(width, { Float16.fromFloat(init) }) }
data = Array(height) { Array(width) { Float16.fromFloat(init) } }
}
internal @Volatile var data: Array<Array<Float16Bits>> // in parallel programming: do not trust your register; always read freshly from RAM!
init {
data = Array(height) { Array(width, { 0.toShort() }) }
data = Array(height) { Array(width) { 0.toShort() } }
}
/**