首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >大小为0的CGAL中的段树

大小为0的CGAL中的段树
EN

Stack Overflow用户
提问于 2017-05-21 20:53:36
回答 1查看 45关注 0票数 0

我在CGAL (Segment_tree_d)中使用了一个多维段树,它有11个维度。我的目标是找到重叠的间隔,给定一个查询间隔(window_query)。我可以这样做,除非间隔大小为0。我展示了一个最小的例子,一个三维的树,产生同样的问题.这是一个基本的限制吗?是否有配置选项或可以使用的其他类?我的用例只有整数坐标,所以我可以通过在区间两边添加一个小部分来解决这个问题,但是如果有更好的解决方案,我不想这样做。

源代码

代码语言:javascript
复制
#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));
}

输出:

代码语言:javascript
复制
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
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-05-22 06:49:39

这里提取

一维段树也是二叉树,但以一维区间数据作为输入数据.一维区间数据是一对(即2元组) (a,b),其中a和b是同类型的一维点数据,a< b表示半开区间[a,b]。类似地,d维区间用一维区间的d元组表示.

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44101684

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档