最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

c++ - How to efficiently multiply a vector by a transposed sparse matrix in Eigen? - Stack Overflow

programmeradmin2浏览0评论

I have with a sparse matrix A and a vector x in Eigen, and I need to perform the following transposed matrix × matrix × vector operation: ATAx. This can be decomposed into two matrix-vector multiplications: y=Ax followed by ATy. The first one is simple, but I don't know how to do the second one without the explicit construction of AT. I can write something as:

y = A.transpose() * A * x;

However, it seems that A.transpose() explicitly constructs AT in memory, which would not be efficient for large matrices.

Another option might be to work with a sparse ATA, but in our case, this is a much more dense matrix than A itself.

Question: Is there any way how to multiply a vector by a transposed sparse matrix in Eigen without explicit construction of AT or ATA?

发布评论

评论列表(0)

  1. 暂无评论