Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Allocate vector of kdtrees

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Allocate vector of kdtrees


Chronological Thread 
  • From: Marc Glisse <>
  • To:
  • Subject: Re: [cgal-discuss] Allocate vector of kdtrees
  • Date: Wed, 26 Oct 2011 13:33:40 +0200 (CEST)

On Wed, 26 Oct 2011, Zohar wrote:

I'm trying to allocate a std::vector of kdtrees, but it complains about the
allocator:

Actually it complains because a kdtree cannot be copied, whereas std::vector requires that its elements can be copied. Maybe you can create each kdtree with new and only store pointers in the vector?

#include <CGAL/Simple_cartesian.h>
#include <CGAL/Orthogonal_k_neighbor_search.h>
#include <CGAL/Search_traits_2.h>

typedef CGAL::Simple_cartesian<double> K;
typedef K::Point_3 Point_d;
typedef CGAL::Search_traits_2<K> TreeTraits;
typedef CGAL::Orthogonal_k_neighbor_search<TreeTraits> Neighbor_search;
typedef Neighbor_search::Tree KdTree;

vector<KdTree> kdtree;
kdtree.resize(5);

--
Marc Glisse



Archive powered by MHonArc 2.6.16.

Top of Page