当我打开libigl的MATLAB到libigl+Eigen转换表时,我正在阅读它的文档。在那里(第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();这会导致程序错误吗?
发布于 2021-06-10 14:43:05
https://stackoverflow.com/questions/67922783
复制相似问题