[−][src]Function arrayfire::sparse
pub fn sparse<T>(
rows: u64,
cols: u64,
values: &Array<T>,
row_indices: &Array<i32>,
col_indices: &Array<i32>,
format: SparseFormat
) -> Array<T> where
T: HasAfEnum + FloatingPoint,
Create sprase matrix from arrays
This function converts Array of values into sparse array
of format sparse format using arrays row_indices and col_indices.
Parameters
rowsis the number of rows in the dense matrixcolsis the number of columns in the dense matrixvaluesis the \ref af::array containing the non-zero elements `of the matrixrow_indicesis the row indices for the sparse arraycol_indicesis the column indices for the sparse arrayformatis the storage format of the sparse array
Return Values
Array with data in given sparse format
Note
This function only uses references of the input arrays to create the sparse data structure and does not perform deep copies.