koblas

MatrixWindow

Validated two-stride window. A(i, j) addresses offset + i * rowStride + j * columnStride. Negative strides are supported; distinct logical entries must address distinct storage. Structured windows start square; window can select rectangular panels. transposed records an already applied transpose; strides, dimensions and structure describe the resulting logical matrix. Storage is borrowed and mutations require synchronization by the caller.

Constructors

MatrixWindow

constructor(data: DoubleArray, rows: Int, columns: Int, offset: Int = 0, rowStride: Int = 1, columnStride: Int = maxOf(1, rows), structure: MatrixStructure = MatrixStructure.General, transposed: Boolean = false)(source)

Creates a full matrix window; structured inputs must be square before taking subwindows.

Properties

columns

open override val columns: Int(source)

Logical column count, after any baked transpose.

columnStride

Physical distance between adjacent columns.

data

Borrowed backing array.

diagonalOffset

Row origin minus column origin within the structured parent.

offset

First physical entry of the window.

rows

open override val rows: Int(source)

Logical row count, after any baked transpose.

rowStride

Physical distance between adjacent rows.

structure

Stored structure of the logical input.

transposed

Whether a transpose is already represented by this operand.

Functions

get

operator fun get(row: Int, column: Int): Double(source)

Reads one logical entry, applying the declared structure.

transpose

A zero-copy transpose, including reversal of the selected stored triangle.

window

fun window(row: Int, rows: Int, column: Int, columns: Int): MatrixWindow(source)

A zero-copy logical block. Structured blocks retain parent coordinates, so symmetric mirroring can read the corresponding stored entry outside the block while staying inside the validated parent allocation.