我在CGAL (Segment_tree_d)中使用了一个多维段树,它有11个维度。我的目标是找到重叠的间隔,给定一个查询间隔(window_query)。我可以这样做,除非间隔大小为0。我展示了一个最小的例子,一个三维的树,产生同样的问题.这是一个基本的限制吗?是否有配置选项或可以使用的其他类?我的用例只有整数坐标,所以我可以通过在区间两边添加一个小部分来解决这个问题,但是如果有更好的解决方案,我不想这样做。
源代码
#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发布于 2017-05-22 06:49:39
从这里提取
一维段树也是二叉树,但以一维区间数据作为输入数据.一维区间数据是一对(即2元组) (a,b),其中a和b是同类型的一维点数据,a< b表示半开区间[a,b]。类似地,d维区间用一维区间的d元组表示.
https://stackoverflow.com/questions/44101684
复制相似问题