csr 矩阵 编码_CSR矩阵 - 矩阵乘法

本文探讨了如何计算CSR矩阵与密集矩阵的乘积。提供了Python代码示例来实现这一操作,并建议在实际应用中使用如Boost ublas或Eigen等库,以获取更多功能和更好的优化。
摘要由CSDN通过智能技术生成

I have two square matrices A and B

I must convert B to CSR Format and determine the product C

A * B_csr = C

I have found a lot of information online regarding CSR Matrix - Vector multiplication. The algorithm is:

for (k = 0; k < N; k = k + 1)

result[i] = 0;

for (i = 0; i < N; i = i + 1)

{

for (k = RowPtr[i]; k < RowPtr[i+1]; k = k + 1)

{

result[i] = result[i] + Val[k]*d[Col[k]];

}

}

However, I require Matrix - Matrix multiplication.

Further, it seems that most algorithms apply A_csr - vector multiplication where I require A * B_csr. My solution is to transpose the two matrices before converting then transpose the final product.

Can someone explain how to compute a Matrix - CSR Matrix product an

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值