Registered Member
|
Hi,
I would like to perform operations of the form A = B*B.transpose(); Since A is symmetric, I tried using something like A.triangularView<Eigen::Lower>().noalias() = B*B_transpose(); But this fails at compilation, since views cannot be used with noalias, as it seems. What would be the correct way of writing the above expression to be able to use both the fact that no aliasing happens, and that the result is symmetric? In a related question, I also need to write expressions of the form C = C - D*D.transpose(); If I write it as C.selfadjointView<Eigen::Lower>().rankUpdate(D,-1.0); does rankUpdate assume that no aliasing happens? Thank you! Plato |
Moderator
|
Yes rankUpdate assumes no aliasing by default. So you can also implement the first case as:
A.setZero(); A.selfadjointView<Eigen::Lower>().rankUpdate(B); |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]