我有一个下三角矩阵 M(严格,对角线上为 0)。我想有效地将其转换为对称矩阵。(例如我想做M<-M+M'
)。我正在使用本征。
我的问题,是我在做什么:
U=U+U.transpose();
但是阅读文档时,我觉得,也许,我应该利用一些功能,例如.noalias()
and/or .transposeInPlace()
,但明显的候选者:
U+=U.transposeInPlace();
给出一个错误。
编辑:
这是错误消息:
.cpp:210:24: note: candidates are:
/eigen/Eigen/src/Core/MatrixBase.h:183:14: note: template<class OtherDerived> Derived& Eigen::MatrixBase::operator+=(const Eigen::MatrixBase<OtherDerived>&) [with OtherDerived = OtherDerived, Derived = Eigen::Matrix<float, -0x00000000000000001, -0x00000000000000001>]
/eigen/Eigen/src/Core/MatrixBase.h:517:46: note: template<class OtherDerived> Derived& Eigen::MatrixBase::operator+=(const Eigen::ArrayBase<OtherDerived>&) [with OtherDerived = OtherDerived, Derived = Eigen::Matrix<float, -0x00000000000000001, -0x00000000000000001>]
/eigen/Eigen/src/Core/DenseBase.h:266:14: note: template<class OtherDerived> Derived& Eigen::DenseBase::operator+=(const Eigen::EigenBase<OtherDerived>&) [with OtherDerived = OtherDerived, Derived = Eigen::Matrix<float, -0x00000000000000001, -0x00000000000000001>]