Subject: CGAL users discussion list
List archive
- From: "Sebastien Loriot (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] Is CGAL::Orthogonal_k_neighbor_search thread-safe?
- Date: Thu, 12 Feb 2015 14:54:44 +0100
- Organization: GeometryFactory
On 02/12/2015 02:53 PM, Antonio Carlos Pereira de Azambuja wrote:
Hi,
I am using CGAL to solve nearest neighbor search in 4 dimensional.
I would like to know if I can build a single kdtree object and perform
parallel searches in each thread of an OMP loop. Each thread has its own
search object. The problem could be illustrated by the draft code below:
int main(void)
{
// create a kdTree from a point cloud
CGAL::Orthogonal_k_neighbor_search<Traits>::Tree *kdTree;
kdTree = new CGAL::Orthogonal_k_neighbor_search<Traits>::Tree(
points.begin(), points.end() )
.
.
.
// perform several searches in an OMP loop
#pragma omp parallel .....
for (counter =0; ....)
{
.
.
CGAL::Cartesian_d<FT>::Point_d query(......); // define a query point
CGAL::Orthogonal_k_neighbor_search<Traits> search( *kdTree,
query, 1);
.
.
} //end for
}//end main
Thanks in advance for any help.
-- Antonio Azambuja
Yes it is.
Sebastien.
- [cgal-discuss] Is CGAL::Orthogonal_k_neighbor_search thread-safe?, Antonio Carlos Pereira de Azambuja, 02/12/2015
- Re: [cgal-discuss] Is CGAL::Orthogonal_k_neighbor_search thread-safe?, Sebastien Loriot (GeometryFactory), 02/12/2015
- Re: [cgal-discuss] Is CGAL::Orthogonal_k_neighbor_search thread-safe?, Antonio Carlos Pereira de Azambuja, 02/23/2015
- Re: [cgal-discuss] Is CGAL::Orthogonal_k_neighbor_search thread-safe?, Sebastien Loriot (GeometryFactory), 02/23/2015
- Re: [cgal-discuss] Is CGAL::Orthogonal_k_neighbor_search thread-safe?, Antonio Carlos Pereira de Azambuja, 02/23/2015
- Re: [cgal-discuss] Is CGAL::Orthogonal_k_neighbor_search thread-safe?, Sebastien Loriot (GeometryFactory), 02/23/2015
- Re: [cgal-discuss] Is CGAL::Orthogonal_k_neighbor_search thread-safe?, Antonio Carlos Pereira de Azambuja, 02/23/2015
- Re: [cgal-discuss] Is CGAL::Orthogonal_k_neighbor_search thread-safe?, Sebastien Loriot (GeometryFactory), 02/23/2015
- Re: [cgal-discuss] Is CGAL::Orthogonal_k_neighbor_search thread-safe?, Antonio Carlos Pereira de Azambuja, 02/23/2015
- Re: [cgal-discuss] Is CGAL::Orthogonal_k_neighbor_search thread-safe?, Sebastien Loriot (GeometryFactory), 02/12/2015
Archive powered by MHonArc 2.6.18.