sparse_insert_entries_double(_:_:_:_:_:)
Inserts a list of scalar entries into a double-precision sparse matrix.
Declaration
func sparse_insert_entries_double(_ A: sparse_matrix_double!, _ N: sparse_dimension, _ val: UnsafePointer<Double>!, _ indx: UnsafePointer<sparse_index>!, _ jndx: UnsafePointer<sparse_index>!) -> sparse_statusParameters
- A:
The sparse matrix, A, which must have been created with Sparse_matrix_create_double(_:_:). Sparse_illegal_parameter is returned if not met.
- N:
The number of values to insert into
A. Each ofindx,jndxandvalare of sizeN. - val:
Pointer to list of scalar values to insert into
A. The value is inserted into the location specified by the corresponding indices inindxandjndx. Must holdNvalues. - indx:
An array of row indices that correspond to the values in
val. Must holdNvalues. - jndx:
An array of column indices that correspond to the values in
val. Must holdNvalues.
Discussion
Use to build a sparse matrix by providing a list of point entries. For each entry provided, update A[indx[i],jndx[i]] = val[i].
Note that matrix properties cannot be modified after value insertion begins. This includes properties such as specifying a triangular matrix.
Insertion can be expensive, generally speaking it is best to do a batch update. Inserted values may be temporarily held internally within the object and only inserted into the sparse format when a later computation triggers a need to insert.
Indices in indx and jndx an are assumed to be unique. Additionally, indices are assumed to be in the bounds of the matrix. Undefined behavior if any of these assumptions are not met.All indices are 0 based (the first element of a pointer is ptr[0]).
See Also
Matrix creation and population
sparse_matrix_create_double(_:_:)sparse_matrix_create_float(_:_:)sparse_insert_entry_double(_:_:_:_:)sparse_insert_entry_float(_:_:_:_:)sparse_insert_entries_float(_:_:_:_:_:)sparse_insert_col_double(_:_:_:_:_:)sparse_insert_col_float(_:_:_:_:_:)sparse_insert_row_double(_:_:_:_:_:)sparse_insert_row_float(_:_:_:_:_:)