CGAL 中的线段树,间隔大小为 0
Segment tree in CGAL with intervals of size 0
我在 CGAL (Segment_tree_d) 中使用多维线段树,有 11 个维度。我的 objective 是在给定查询间隔 (window_query) 的情况下查找重叠间隔。我能够做到这一点,除非间隔大小为 0。我正在展示最小的示例,使用 3 维树,它会产生相同的问题。这是基本限制吗?是否有我可以使用的配置选项或不同的 class?我的用例只有整数坐标,所以我可以通过在间隔的任一侧添加一小部分来解决这个问题,但如果有更好的解决方案,我不想这样做。
源代码
#include <CGAL/Cartesian.h>
#include <CGAL/Segment_tree_k.h>
#include <CGAL/Range_segment_tree_traits.h>
typedef CGAL::Cartesian<int> K;
typedef CGAL::Range_segment_tree_set_traits_3<K> Traits;
typedef CGAL::Segment_tree_3<Traits > Segment_tree_3_type;
int main()
{
typedef Traits::Interval Interval;
typedef Traits::Key Key;
std::list<Interval> InputList, OutputList;
InputList.push_back(Interval(Key(1,5,7), Key(1,5,7)));
Segment_tree_3_type Segment_tree_3(InputList.begin(),InputList.end());
Interval a(Key(3,6,5), Key(3,6,5));
Segment_tree_3.window_query(a,std::back_inserter(OutputList));
}
输出:
CGAL warning: check violation!
Expression : m_interface.comp(m_interface.get_left(*count), m_interface.get_right(*count))
File : /usr/include/CGAL/Segment_tree_d.h
Line : 542
Explanation: invalid segment ignored
Refer to the bug-reporting instructions at http://www.cgal.org/bug_report.html
CGAL warning: check violation!
Expression : m_interface.comp(m_interface.get_right_win(win), m_interface.get_left_win(win))
File : /usr/include/CGAL/Segment_tree_d.h
Line : 636
Explanation: invalid window -- query ignored
Refer to the bug-reporting instructions at http://www.cgal.org/bug_report.html
摘自here:
一维线段树也是二叉搜索树,只是输入数据是一维区间数据。一维区间数据是一对(即2元组)(a,b),其中a和b是同一类型的一维点数据,且a
我在 CGAL (Segment_tree_d) 中使用多维线段树,有 11 个维度。我的 objective 是在给定查询间隔 (window_query) 的情况下查找重叠间隔。我能够做到这一点,除非间隔大小为 0。我正在展示最小的示例,使用 3 维树,它会产生相同的问题。这是基本限制吗?是否有我可以使用的配置选项或不同的 class?我的用例只有整数坐标,所以我可以通过在间隔的任一侧添加一小部分来解决这个问题,但如果有更好的解决方案,我不想这样做。
源代码
#include <CGAL/Cartesian.h>
#include <CGAL/Segment_tree_k.h>
#include <CGAL/Range_segment_tree_traits.h>
typedef CGAL::Cartesian<int> K;
typedef CGAL::Range_segment_tree_set_traits_3<K> Traits;
typedef CGAL::Segment_tree_3<Traits > Segment_tree_3_type;
int main()
{
typedef Traits::Interval Interval;
typedef Traits::Key Key;
std::list<Interval> InputList, OutputList;
InputList.push_back(Interval(Key(1,5,7), Key(1,5,7)));
Segment_tree_3_type Segment_tree_3(InputList.begin(),InputList.end());
Interval a(Key(3,6,5), Key(3,6,5));
Segment_tree_3.window_query(a,std::back_inserter(OutputList));
}
输出:
CGAL warning: check violation!
Expression : m_interface.comp(m_interface.get_left(*count), m_interface.get_right(*count))
File : /usr/include/CGAL/Segment_tree_d.h
Line : 542
Explanation: invalid segment ignored
Refer to the bug-reporting instructions at http://www.cgal.org/bug_report.html
CGAL warning: check violation!
Expression : m_interface.comp(m_interface.get_right_win(win), m_interface.get_left_win(win))
File : /usr/include/CGAL/Segment_tree_d.h
Line : 636
Explanation: invalid window -- query ignored
Refer to the bug-reporting instructions at http://www.cgal.org/bug_report.html
摘自here:
一维线段树也是二叉搜索树,只是输入数据是一维区间数据。一维区间数据是一对(即2元组)(a,b),其中a和b是同一类型的一维点数据,且a