问题描述
当我打开他们的 libigl 时,我正在阅读 MATLAB to libigl+Eigen conversion table 的文档。在那里(第 17 行,或第一个红色行),它代表:
不要尝试在这样的表达式中组合 .transpose()
:
C = A + B.transpose();
相反,他们这样做:
SparseMatrixType BT = B.transpose();
SparseMatrixType C = A+BT;
这是为什么?我在 Eigen
的文档中找不到任何相关信息。
class Point {
public:
Point() : rot_matrix(Eigen::Matrix3d::Identity()),cm_set(Eigen::Vector3d::Zero()) {}
const Eigen::Matrix3d & rot_matrix() const { return rot_matrix; }
const Eigen::Matrix3d & cm_set() const { return cm_set; }
private:
Eigen::Matrix3d rot_matrix;
Eigen::Vector3d cm_set;
};
auto other = Point();
const Vector3d point = other.rot_matrix().transpose()*other_cm + other.cm_set();
这会导致程序错误吗?