Construct sparse matrix from pointers |
- Parameters:
-
[in] | rows | Number of rows in the matrix |
[in] | cols | Number of columns in the Matrix |
[in] | nnz | Number of non zero elements |
[in] | values | Array containing nonzero values |
[in] | rowptr | Row indices in CSR format |
[in] | colind | Column indices in CSR format |
[in] | src | Specify if pointers are from Host (default) or device |
[in] | ngfor | The gfor tile size (default 0) |
- Returns:
- out A sparse array of size(m, n). out.dims(2) returns nnz;
|
array | sparse (int rows, int cols, int nnz, const float *values, const int *rowptr, const int *colind, af_source_t src=afHostPointer, unsigned ngfor=0) |
array | sparse (int rows, int cols, int nnz, const double *values, const int *rowptr, const int *colind, af_source_t src=afHostPointer, unsigned ngfor=0) |
array | sparse (int rows, int cols, int nnz, const cuComplex *values, const int *rowptr, const int *colind, af_source_t src=afHostPointer, unsigned ngfor=0) |
array | sparse (int rows, int cols, int nnz, const cuDComplex *values, const int *rowptr, const int *colind, af_source_t src=afHostPointer, unsigned ngfor=0) |
Construct sparse matrix from Dense |
- Parameters:
-
[in] | dense | Matrix stored as dense |
- Returns:
- out A sparse matrix stored in CSR format
|
array | sparse (array dense) |
Construct sparse matrix from arrays |
- Parameters:
-
[in] | I | Array containing row indices |
[in] | J | Array containing column indices |
[in] | val | Array containing non zero values |
[in] | rows | Number of rows (default -1. Uses max(I) for COO, I.elements() - 1 for CSR) |
[in] | cols | Number of columns (default -1. Uses max(J)) |
[in] | format | The format of I, J, val (default: COO) |
|
array | sparse (array &I, array &J, array &val, int rows=-1, int cols=-1, af_sparse_t format=AF_SP_COO) |