ALP User Documentation 0.7.alpha
Algebraic Programming User Documentation
|
This is the ALP implementation of a subset of the de-facto *_spblas.h Sparse BLAS standard. More...
Go to the source code of this file.
Functions | |
void | extspblas_dcsrmultsv (const char *trans, const int *request, const int *m, const int *n, const double *a, const int *ja, const int *ia, const extblas_sparse_vector x, extblas_sparse_vector y) |
Performs sparse matrix–sparse vector multiplication. | |
void | extspblas_free () |
An extension that frees any buffers the ALP/GraphBLAS-generated SparseBLAS library may have allocated. | |
void | spblas_dcsrgemv (const char *transa, const int *m, const double *a, const int *ia, const int *ja, const double *x, double *y) |
Performs sparse matrix–vector multiplication. | |
void | spblas_dcsrmm (const char *transa, const int *m, const int *n, const int *k, const double *alpha, const char *matdescra, const double *val, const int *indx, const int *pntrb, const int *pntre, const double *b, const int *ldb, const double *beta, double *c, const int *ldc) |
Computes a variant of \( C \to \alpha AB+\beta C \). | |
void | spblas_dcsrmultcsr (const char *trans, const int *request, const int *sort, const int *m, const int *n, const int *k, double *a, int *ja, int *ia, double *b, int *jb, int *ib, double *c, int *jc, int *ic, const int *nzmax, int *info) |
Computes \( C \to AB \) or \( C \to A^TB \), where all matrices are sparse and employ the Compressed Row Storage (CRS). | |
This is the ALP implementation of a subset of the de-facto *_spblas.h Sparse BLAS standard.
This implementation uses the spblas_ prefix; e.g., spblas_dcsrgemv.
All functions defined have void
return types. This implies two important factors:
void extspblas_dcsrmultsv | ( | const char * | trans, |
const int * | request, | ||
const int * | m, | ||
const int * | n, | ||
const double * | a, | ||
const int * | ja, | ||
const int * | ia, | ||
const extblas_sparse_vector | x, | ||
extblas_sparse_vector | y | ||
) |
Performs sparse matrix–sparse vector multiplication.
This extension performs one of
Here, \( A \) is assumed in Compressed Row Storage (CRS), while \( x \) and \( y \) are assumed to be using the extblas_sparse_vector extension.
This API follows loosely that of spblas_dcsrmultcsr.
[in] | trans | Either 'N' or 'T', indicating whether A is to be transposed. The Hermitian operator on A is currently not supported; if required, please submit a ticket. |
[in] | request | A pointer to an integer that reads either 0 or 1 0: the output vector is guaranteed to have sufficient capacity to hold the output of the computation. 1: a symbolic phase will be executed that only modifies the capacity of the output vector so that it is guaranteed to be able to hold the output of the requested computation. |
[in] | m,n | Pointers to integers equal to \( m, n \). |
[in] | a | The value array of the nonzeroes in \( A \). |
[in] | ja | The column indices of the nonzeroes in \( A \). |
[in] | ia | The row offset arrays of the nonzeroes in \( A \). |
[in] | x | The sparse input vector. |
[out] | y | The sparse output vector. |
This is an ALP implementation-specific extension.
void spblas_dcsrgemv | ( | const char * | transa, |
const int * | m, | ||
const double * | a, | ||
const int * | ia, | ||
const int * | ja, | ||
const double * | x, | ||
double * | y | ||
) |
Performs sparse matrix–vector multiplication.
This function computes one of
The matrix \( A \) is \( m \times n \) and holds \( k \) nonzeroes, and is assumed to be stored in Compressed Row Storage (CRS).
[in] | transa | Either 'N' or 'T' for transposed ('T') or not ('N'). |
[in] | m | The row size of \( A \). |
[in] | a | The nonzero value array of \( A \) of size \( k \). |
[in] | ia | The row offset array of \( A \) of size \( m+1 \). |
[in] | ja | The column indices of nonzeroes of \( A \). Must be of size \( k \). |
[in] | x | The dense input vector \( x \) of length \( n \). |
[out] | y | The dense output vector \( y \) of length \( m \). |
All memory regions must be pre-allocated and initialised.
void spblas_dcsrmm | ( | const char * | transa, |
const int * | m, | ||
const int * | n, | ||
const int * | k, | ||
const double * | alpha, | ||
const char * | matdescra, | ||
const double * | val, | ||
const int * | indx, | ||
const int * | pntrb, | ||
const int * | pntre, | ||
const double * | b, | ||
const int * | ldb, | ||
const double * | beta, | ||
double * | c, | ||
const int * | ldc | ||
) |
Computes a variant of \( C \to \alpha AB+\beta C \).
The matrix \( A \) is sparse and employs the Compressed Row Storage (CRS). The matrices \( B, C \) are dense. \( A \) has size \( m \times k \), \( B \) is \( k \times n \) and \( C \) is \( m \times n \).
[in] | transa | Either 'N' or 'T'. |
[in] | m,n,k | Pointers to integers that equal \( m, n, k \), resp. |
[in] | alpha | Pointer to the scalar \( \alpha \). |
[in] | matdescra | Has several entries. Going from first to last: Either 'G', 'S', 'H', 'T', 'A', or 'D' (similar to MatrixMarket) Either 'L' or 'U', in the case of 'T' (triangular) Either 'N' or 'U' for the diagonal type Either 'F' or 'C' (one or zero based indexing) |
[in] | val | The values of the nonzeroes in \( A \). |
[in] | indx | The column index of the nonzeroes in \( A \). |
[in] | pntrb | The Compressed Row Storage (CRS) row start array. |
[in] | pntre | The array pntrb shifted by one. |
[in] | b | Pointer to the values of \( B \). |
[in] | ldb | Leading dimension of b. If in row-major format, this should be \( n \). If in column-major format, this should be \( k \). |
[in] | beta | Pointer to the scalar \( \beta \). |
[in] | c | Pointer to the values of \( C \). |
[in] | ldc | Leading dimension of c. If in row-major format, this should be \( n \). If in column-major format, this should be \( m \). |
void spblas_dcsrmultcsr | ( | const char * | trans, |
const int * | request, | ||
const int * | sort, | ||
const int * | m, | ||
const int * | n, | ||
const int * | k, | ||
double * | a, | ||
int * | ja, | ||
int * | ia, | ||
double * | b, | ||
int * | jb, | ||
int * | ib, | ||
double * | c, | ||
int * | jc, | ||
int * | ic, | ||
const int * | nzmax, | ||
int * | info | ||
) |
Computes \( C \to AB \) or \( C \to A^TB \), where all matrices are sparse and employ the Compressed Row Storage (CRS).
The matrix \( C \) is \( m \times n \), the matrix \( A \) is \( m \times k \), and the matrix \( B \) is \( k \times n \).
[in] | trans | Either 'N' or 'T', indicating whether A is to be transposed. The Hermitian operator on A is currently not supported; if required, please submit a ticket. |
[in] | request | A pointer to an integer that reads either 0, 1, or 2. 0: the output memory area has been pre-allocated and is guaranteed sufficient for storing the output 1: a symbolic phase will be executed that only modifies the row offset array ic. This array must have been pre-allocated and of sufficient size ( \( m+1 \)). 2: assumes 1 has executed prior to this call and that the contents of the row offset arrays have not been modified. It also assumes that the column index and value arrays are (now) of sufficient size to hold the output. |
[in] | sort | A pointer to an integer value of 7. All other values are not supported by this interface. If you require it, please submit a ticket. |
[in] | m,n,k | Pointers to the integer sizes of A, B, and C. |
[in] | a | The value array of nonzeroes in A. |
[in] | ja | The column index array of nonzeroes in A. |
[in] | ia | The row offset array of nonzeroes in A. |
[in] | b,ib,jb | Similar for the nonzeroes in B. |
[out] | c,ic,jc | Similar for the nonzeroes in C. For these parameters depending on request there are various assumptions on capacity and, for ic, contents. |
[in] | nzmax | A pointer to an integer that holds the capacity of c and jc. |
[out] | info | The integer pointed to will be set to 0 if the call was successful, -1 if the routine only computed the required size of c and jc (stored in ic), and any positive integer when computation has proceeded successfully until (but not including) the returned integer. |