Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

疑似BUG #58

Open
Nothand0212 opened this issue Jul 29, 2023 · 2 comments
Open

疑似BUG #58

Nothand0212 opened this issue Jul 29, 2023 · 2 comments

Comments

@Nothand0212
Copy link

eigen_types.h文件中,编译时下面这段代码有警告,我就进去看了一下

template <>
inline bool less_vec<3>::operator()( const Eigen::Matrix<int, 3, 1>& v1, const Eigen::Matrix<int, 3, 1>& v2 ) const
{
  return v1[ 0 ] < v2[ 0 ] || ( v1[ 0 ] == v2[ 0 ] && v1[ 1 ] < v2[ 1 ] ) && ( v1[ 0 ] == v2[ 0 ] && v1[ 1 ] == v2[ 1 ] && v1[ 2 ] < v2[ 2 ] );
}

按照前半段判断的逻辑推断,先比较两个向量的第1个元素,如果第1个元素相同,再对比第2个元素。按这种逻辑,后面应该是:如果第1和第2个元素都相同,则对比第3个元素吧?
是不是其实下面这样修改才是对的?

template <>
inline bool less_vec<3>::operator()( const Eigen::Matrix<int, 3, 1>& v1, const Eigen::Matrix<int, 3, 1>& v2 ) const
{
  return v1[ 0 ] < v2[ 0 ] || ( v1[ 0 ] == v2[ 0 ] && v1[ 1 ] < v2[ 1 ] ) || ( v1[ 0 ] == v2[ 0 ] && v1[ 1 ] == v2[ 1 ] && v1[ 2 ] < v2[ 2 ] );
}
@Nothand0212 Nothand0212 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 29, 2023
@Nothand0212 Nothand0212 reopened this Jul 29, 2023
@Nothand0212
Copy link
Author

还是说,如果第1个元素不符合,需要后面两个元素同时满足条件才为真?

@YZH-bot
Copy link

YZH-bot commented Dec 10, 2024

这里应该是高博笔误了,按理解以及高博自动驾驶的书里这三个运算最终结果都是或运算

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants