koblas

DenseMatrixRegion

sealed interface DenseMatrixRegion : Matrix(source)

Mutable column-major storage with unit row stride, shared by DenseMatrix and DenseMatrixView. Entry A(i, j) is at offset + i + j * leadingDimension in values.

com.eignex.koblas.dense.DenseBlas accepts regions for every dense matrix operation, as do mixed CSC products. A region is mutable through its buffer and set.

Inheritors

Properties

leadingDimension

abstract val leadingDimension: Int(source)

Distance between consecutive column starts.

offset

abstract val offset: Int(source)

Buffer index of the first entry, or an in-bounds buffer boundary for an empty region.

values

abstract val values: DoubleArray(source)

Shared column-major backing buffer, including entries outside this region.

Link copied to clipboard
abstract val cols: Int

Number of columns.

Link copied to clipboard
abstract val rows: Int

Number of rows.

Functions

set

abstract operator fun set(i: Int, j: Int, v: Double)(source)

Writes v to A(i, j), checking both logical indices.

view

open fun view(rowOffset: Int = 0, columnOffset: Int = 0, rows: Int = this.rows - rowOffset, cols: Int = this.cols - columnOffset): DenseMatrixView(source)

Borrows a rectangle without copying. Mutations through either reference are shared. Offsets and extents are relative to this region; a nested view retains the parent's leading dimension. Empty rectangles at either boundary are valid and access no entries.

Link copied to clipboard
abstract operator fun get(i: Int, j: Int): Double

The entry at row (i), column (j). Throws IndexOutOfBoundsException outside the shape, whatever the storage.

Link copied to clipboard
@JvmName(name = "multiplyMatrices")
operator fun Matrix.times(other: Matrix): Matrix

Allocating product through koblas: two sparse operands give CSC storage, any other pairing dense.

Link copied to clipboard
abstract fun toArray(): Array<DoubleArray>

Materialise into a fresh Array<DoubleArray> of rows, independent of the internal storage.