Blas中是否有任何功能可以执行偏斜的矩阵矢量产物?

发布于 2025-02-11 23:52:54 字数 178 浏览 0 评论 0 原文

我正在考虑使用Intel-MKL进行一些计算,特别是用于Fortran中程序的矩阵矢量稀疏BLAS函数。

矩阵表达我的计算,这些矩阵恰好是稀疏和偏斜的

我可以用我所看到的 ,稀疏的blas具有稀疏的一般和对称矩阵的功能,所以我想知道我是否有一种方法可以使用稀疏的偏斜工作 - 合成矩阵,因为我认为这会减少内存足迹。

I'm thinking of performing some calculations with Intel-MKL, specifically the matrix-vector Sparse BLAS functions for a program in Fortran.

I can express my calculations in matrices that happen to be sparse and skew-symmetric

From what I can see, Sparse BLAS has sparse functions for general and symmetric matrices, so I wanted to know if I there was a way to work with a sparse skew-symmetric matrix instead, because I imagine it would reduce memory footprint.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

遗弃M 2025-02-18 23:52:54

tldr; Mkl稀疏Blas可以用 mkl_scsrmv subroutine subroutine subroutine and subsing 'a'a'a'矩阵描述符阵列

好的,当我开始测试一般MKL稀疏Blas矩阵 - 矢量乘法CSR格式时,我设法找到了问题的答案( mkl_?csrmv ),

我了解到有一个字符数组用于描述输入矩阵( matdescra )。该数组中的第一个字符可以设置为'a',该字符导致子例程将输入矩阵解释为偏斜 - 对称。例如(不一定是一个好的),

给定矩阵,a和vector,x,:

A = [ 0  1  2      x = [ 1
     -1  0  3            2
     -2 -3  0 ]           3 ]

a 的上三角形可以

val = [1, 2, 3]
col = [2, 3, 3]
rowstart = [1, 3, 3]
rowend = [3 3 4]

用字符阵列 matdescra =表示为和 代表。 ['a','u','n','f']
矩阵向量产品是通过

call mkl_scsrmv('n', 3, 3, 1., matdescra, val, rowstart, rowend, x, 1., y

将输出(向量)添加到向量阵列的地方获得的, y

TLDR; MKL Sparse BLAS can do matrix-vector multiplications with a sparse matrix expressed as the upper/lower triangle by the mkl_scsrmv subroutine subroutine and supplying 'A' to the first element in the matrix descriptor array.

Ok I managed to find the answer to my question when I started testing the general MKL Sparse BLAS matrix-vector multiplication in CSR format (mkl_?csrmv)

I learnt that there is a character array that is used to describe the input matrix (matdescra). The first character in this array can be set to 'A' which causes the subroutine to interpret the input matrix as skew-symmetric. For example (not necessarily a good one),

Given a matrix, A, and and vector, x,:

A = [ 0  1  2      x = [ 1
     -1  0  3            2
     -2 -3  0 ]           3 ]

The upper-triangle of A can be represented as

val = [1, 2, 3]
col = [2, 3, 3]
rowstart = [1, 3, 3]
rowend = [3 3 4]

and with the character array matdescra = ['A', 'U', 'N', 'F'],
The matrix-vector product is obtained by

call mkl_scsrmv('n', 3, 3, 1., matdescra, val, rowstart, rowend, x, 1., y

where the output (a vector) is added to the vector-array, y.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文