我正在考虑使用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.
发布评论
评论(1)
tldr; Mkl稀疏Blas可以用
mkl_scsrmv
subroutine subroutine subroutine and subsing'a'a'a'
在矩阵描述符阵列。好的,当我开始测试一般MKL稀疏Blas矩阵 - 矢量乘法CSR格式时,我设法找到了问题的答案(
mkl_?csrmv
),我了解到有一个字符数组用于描述输入矩阵(
matdescra
)。该数组中的第一个字符可以设置为'a'
,该字符导致子例程将输入矩阵解释为偏斜 - 对称。例如(不一定是一个好的),给定矩阵,a和vector,x,:
a
的上三角形可以用字符阵列
matdescra =表示为和 代表。 ['a','u','n','f']
,矩阵向量产品是通过
将输出(向量)添加到向量阵列的地方获得的,
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,:
The upper-triangle of
A
can be represented asand with the character array
matdescra = ['A', 'U', 'N', 'F']
,The matrix-vector product is obtained by
where the output (a vector) is added to the vector-array,
y
.