gpt4 book ai didi

c++ - 具有特征类的不合格 ID

转载 作者:行者123 更新时间:2023-11-30 03:34:49 25 4
gpt4 key购买 nike

下面的代码好像有问题。我收到错误消息

error: expected unqualified-id before numeric constant

Eigen::Matrix M_inv1_abc = pose_l.block<3, 3>(0, 0).inverse(); This is a code sample:

template<typename T> 
Eigen::Matrix<T, 4, 1> Function(Eigen::Matrix<T, 3, 4> pose_l)
{

// fails here
Eigen::Matrix<T, 3, 3> M_inv1 = pose_l.block<3, 3>(0, 0).inverse();

// this works, sample is from https://eigen.tuxfamily.org/dox/group__TutorialMatrixClass.html
Eigen::MatrixXf m(4,4);
Eigen::MatrixXf y(2,2);
m << 1, 2, 3, 4,
5, 6, 7, 8,
9,10,11,12,
13,14,15,16;
y = m.block<2,2>(1,1);

}

对于示例 MatrixXf,我不使用我的模板...

我重命名了pose_l和M_inv1;在其他帖子中,例如 Expected unqualified-id before numeric constant for defining a number重新定义有所帮助,但对我而言不是。

我错过了什么?

最佳马努克劳斯

最佳答案

pose_l.template block<3, 3>(0, 0).inverse();

具体可以引用c++如何推导变量类型

关于c++ - 具有特征类的不合格 ID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41743850/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com