koblas

Companion

Factories for dense matrices.

Functions

diagonal

Create a square identity matrix of the given size, scaled by diagonal.


Create the square matrix whose diagonal is values.

ofColumns

Copy an Array<DoubleArray> of columns into a fresh dense matrix, so columns(j) is column j.

ofRows

Copy an Array<DoubleArray> of rows into a fresh dense matrix, so rows(i) is row i.

wrap

fun wrap(rows: Int, cols: Int, data: DoubleArray): DenseMatrix(source)

Wrap an existing flat DoubleArray without copying; mutations remain visible through both references.

zero

fun zero(rows: Int, cols: Int = rows): DenseMatrix(source)

Create a zero matrix of shape rows x cols, square when cols is omitted.