Function arrayfire::sparse_from_host [] [src]

pub fn sparse_from_host<T: HasAfEnum>(
    rows: u64,
    cols: u64,
    nzz: u64,
    values: &[T],
    row_indices: &[i32],
    col_indices: &[i32],
    format: SparseFormat
) -> Array

Create sprase matrix from data on host memory

This function converts host array values into sparse array of format sparse format using host arrays row_indices and col_indices.

Parameters

  • rows is the number of rows in the dense matrix
  • cols is the number of columns in the dense matrix
  • nzz is the number of non zero elements in the dense matrix
  • values is the \ref af::array containing the non-zero elements `of the matrix
  • row_indices is the row indices for the sparse array
  • col_indices is the column indices for the sparse array
  • format is the storage format of the sparse array

Return Values

Array with data in given sparse format

Note

The rules for deep copy/shallow copy/reference are the same as for creating a regular Array.