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?
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744662714a4586558.html
评论列表(0条)