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
Allocates and packs a retained operand whose layout does not depend on the engine or current thread.
packInto
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
Transposes a general, symmetric, or triangular source into a general output window.
unpack
Writes valid logical entries; physical padding is not read. Selected-output rules apply after transpose.