Construct CSR-format sparse matrix from pointers |
- Parameters:
-
| [in] | row_idx | Row indices in CSR format |
| [in] | col_idx | Column indices in CSR format |
| [in] | values | Array containing nonzero values |
| [in] | nrows | Number of rows in the matrix |
| [in] | ncols | Number of columns in the Matrix |
| [in] | nonzero | Number of non zero elements |
| [in] | src | Specify if pointers are from Host (default) or device |
| [in] | ngfor | The gfor tile size (default 0) |
- Returns:
- sparse
nrows-by-ncols array in AF_SP_CSR format
|
| AFAPI array | sparse (const int *row_idx, const int *col_idx, const float *values, int nrows, int ncols, int nonzero, af_source_t src=afHost, unsigned ngfor=0) |
| AFAPI array | sparse (const int *row_idx, const int *col_idx, const double *values, int nrows, int ncols, int nonzero, af_source_t src=afHost, unsigned ngfor=0) |
| AFAPI array | sparse (const int *row_idx, const int *col_idx, const cuComplex *values, int nrows, int ncols, int nonzero, af_source_t src=afHost, unsigned ngfor=0) |
| AFAPI array | sparse (const int *row_idx, const int *col_idx, const cuDComplex *values, int nrows, int ncols, int nonzero, af_source_t src=afHost, unsigned ngfor=0) |
Construct sparse matrix from Dense |
- Parameters:
-
| [in] | dense | Matrix stored as dense |
- Returns:
- out A sparse matrix stored in CSR format
|
| AFAPI array | sparse (array dense) |
Construct sparse matrix from arrays |
- Parameters:
-
| [in] | row_idx | row indices |
| [in] | col_idx | column indices |
| [in] | values | nonzero values |
| [in] | nrows | Number of rows (default -1 uses max(row_idx) for COO, row_idx.elements()-1 for CSR) |
| [in] | ncols | Number of columns (default -1 uses max(J)) |
| [in] | format | sparse format (default: AF_SP_COO) |
- Returns:
- sparse
nrows-by-ncols array
|
| AFAPI array | sparse (array &row_idx, array &col_idx, array &values, int nrows=-1, int ncols=-1, af_sparse_t format=AF_SP_COO) |