Functions
ofColumns
ofTriplets
fun ofTriplets(rows: Int, cols: Int, rowIdx: IntArray, colIdx: IntArray, values: DoubleArray): F64SparseMatrix(source)
Builds a CSC matrix from parallel coordinate (triplet) arrays, where entry k is values(k) at (rowIdx(k), colIdx(k)). Any order, duplicate positions summed, inputs copied. O(nnz + rows + cols).
wrap
fun wrap(rows: Int, cols: Int, colPtr: IntArray, rowIdx: IntArray, values: DoubleArray): F64SparseMatrix(source)
Wraps arrays already in CSC form without copying; the caller relinquishes ownership. Validates the invariants rather than repairing them, so use ofColumns or ofTriplets when they do not hold. The structural arrays cannot be recovered for mutation afterwards.