koblas

DenseMatrixView

A borrowed rectangle of a DoubleArray, with explicit offset and leadingDimension. No entries are copied or owned. The backing buffer can also be mutated by its owner or other views. Unlike DenseMatrix, values need not have exactly rows * cols entries. Views use reference equality.

Types

Link copied to clipboard
object Companion

Factories for borrowed matrix storage.

Properties

cols

open override val cols: Int(source)

Number of columns.

leadingDimension

open override val leadingDimension: Int(source)

Distance between consecutive column starts.

offset

open override val offset: Int(source)

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

rows

open override val rows: Int(source)

Number of rows.

values

open override val values: DoubleArray(source)

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

Functions

get

open operator override fun get(i: Int, j: Int): Double(source)

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

set

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

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

toArray

open override fun toArray(): Array<DoubleArray>(source)

Materialise into a fresh Array<DoubleArray> of rows, independent of the internal 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
open fun view(rowOffset: Int = 0, columnOffset: Int = 0, rows: Int = this.rows - rowOffset, cols: Int = this.cols - columnOffset): DenseMatrixView

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.