GSL中稀疏BLAS支持

稀疏BLAS支持

稀疏基本线性代数子程序(BLAS)定义了向量和稀疏矩阵的一组基本操作,可用于创建优化的高级线性代数功能。GSL为稀疏矩阵支持有限数量的BLAS操作。

头文件gsl_spblas.h包含稀疏BLAS函数的原型和相关声明。

44.1 稀疏BLAS操作

int gsl_spblas_dgemv(const CBLAS_TRANSPOSE_t TransA, const double alpha,

const gsl_spmatrix * A, const gsl_vector * x, const double beta,

gsl_vector * y)

    本函数计算矩阵向量乘积和yαop(A)x+βy,其中op(A)=AAT表示TransA = CblasNoTrans, cblastans。不支持计算,因此x和y必须是不同的向量。矩阵A可以是三元组或压缩格式。

int gsl_spblas_dgemm(const double alpha, const gsl_spmatrix * A,

const gsl_spmatrix * B, gsl_spmatrix * C)

    本函数计算稀疏矩阵-矩阵乘积C=αAB。矩阵必须是压缩格式的。

44.2 参考文献和深入阅读

这些函数使用的算法,可以在以下来源找到描述:

• Davis, T. A., Direct Methods for Sparse Linear Systems, SIAM, 2006.

• CSparse software library, https://www.cise.ufl.edu/research/sparse/CSparse

猜你喜欢

转载自blog.csdn.net/yxmlhc/article/details/120600693