sparse.h File Reference

(2013-12-19 20:31:57 -0500, (build a6fe8a5))

#include <af/array.h>
#include <af/exception.h>

Go to the source code of this file.

Namespaces

 af
 

Macros

#define SPARSE(ty)
 

Enumerations

enum  af_sparse_t { af_csr, af_csc, af_coo }
 Specify which sparse storage type. More...
 

Functions

AFAPI array getrow (int nrows, int *rows_idx, array sp)
 
AFAPI array getcol (int ncols, int *cols_idx, array sp)
 
Construct CSR-format sparse matrix from pointers
Parameters
[in]row_idxRow indices in CSR format
[in]col_idxColumn indices in CSR format
[in]valuesArray containing nonzero values
[in]nrowsNumber of rows in the matrix
[in]ncolsNumber of columns in the Matrix
[in]nonzeroNumber of non zero elements
[in]srcSpecify if pointers are from Host (default) or device
[in]ngforThe gfor tile size (default 0)
Returns
sparse nrows-by-ncols array in af_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 cfloat *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 cdouble *values, int nrows, int ncols, int nonzero, af_source_t src=afHost, unsigned ngfor=0)
 
Construct sparse matrix from Dense
Parameters
[in]denseMatrix 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_idxrow indices
[in]col_idxcolumn indices
[in]valuesnonzero values
[in]nrowsNumber of rows (default -1 uses max(row_idx) for COO, row_idx.elements()-1 for CSR)
[in]ncolsNumber of columns (default -1 uses max(J))
[in]formatsparse format (default: af_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_coo)
 
Create dense matrix from sparse matrix
Parameters
[in]sparseSparse matrix generated by ArrayFire
Returns
dense matrix
AFAPI array dense (array sparse)
 
Parameters
[in]spThe sparse matrix
[in]formatThe required output format
[out]IThe row indices
[out]JThe column indices
[out]ValThe non zero values
AFAPI afError where (array &I, array &J, array &Val, array sp, af_sparse_t format=af_coo)
 

Macro Definition Documentation

#define SPARSE (   ty)