Registered Member
|
Is there a more efficient way to calculate A * A.transpose(), where A is a Eigen matrix?
|
Moderator
|
You can use a SelfAdjointView to compute only half of the product. This will provide gain only if A is not too small:
res.setZero(n,n); res.selfadjointView<Lower>.rankUpdate(A); This will compute only the lower half. This is enough for solving with Cholesky or applying products trough the selfadjointView. To get a full matrix: res.triangularView<StrictUpper>() = res.adjoint().triangularView<StrictUpper>(); |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]