Functions
ofColumns
ofTriplets
fun ofTriplets(rows: Int, cols: Int, rowIndices: IntArray, colIndices: IntArray, values: DoubleArray): SparseMatrix(source)
Builds a CSC matrix from parallel coordinate (triplet) arrays, where entry k is values(k) at (rowIndices(k), colIndices(k)). Any order, duplicate positions summed in input order, inputs copied. Uses O(nnz + cols) storage. Construction is O(nnz + rows + cols) when rows <= nnz, otherwise O(nnz log nnz + cols) without scanning the row domain.
wrap
fun wrap(rows: Int, cols: Int, colPointers: IntArray, rowIndices: IntArray, values: DoubleArray): SparseMatrix(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.