koblas

ScalarLayoutKernels

Independently callable scalar packing and layout reference. Copies preserve bits when scale is one; structural zeroes and all declared physical padding are positive zero. Aliases use one logical snapshot before any write. Nonalias calls into caller-owned storage allocate no scratch.

Kotlin callers choose packing layouts, allocate or reuse destination storage, and select source and destination windows. Native layout kernels may execute the selected bounded window; allocation and packing-strategy decisions remain in the shared Kotlin layer.

Functions

pack

fun pack(source: MatrixWindow, layout: PackedMatrixLayout, scale: Double = 1.0): PackedMatrix(source)

Allocates and packs a retained operand whose layout does not depend on the engine or current thread.

packInto

fun packInto(source: MatrixWindow, data: DoubleArray, layout: PackedMatrixLayout, offset: Int = 0, scale: Double = 1.0): PackedMatrix(source)

Packs into caller-owned storage, clearing the declared padding, and returns its retained descriptor. All validation and any alias snapshot finish before mutation. Scaling zero performs arithmetic on stored entries; this layout operation has no BLAS zero-alpha shortcut. Implicit triangular zeroes remain zero.

transpose

fun transpose(source: MatrixWindow, destination: MatrixWindow, output: BlockOutput = BlockOutput.Full)(source)

Transposes a general, symmetric, or triangular source into a general output window.

unpack

fun unpack(source: PackedMatrix, destination: MatrixWindow, transpose: Boolean = false, output: BlockOutput = BlockOutput.Full)(source)

Writes valid logical entries; physical padding is not read. Selected-output rules apply after transpose.