koblas

Companion

Factories for borrowed matrix storage.

Functions

wrap

fun wrap(rows: Int, cols: Int, values: DoubleArray, offset: Int = 0, leadingDimension: Int = rows): DenseMatrixView(source)

Borrows values without copying. All logical entries must fit, and leadingDimension must be at least rows. For an empty shape, offset can be any boundary in 0..values.size. Shape, spacing and buffer bounds are validated using overflow-safe arithmetic.