1 #include <Eigen/StdVector>
2 #include <unsupported/Eigen/BVH>
27 typedef std::vector<Vector2d, aligned_allocator<Vector2d> > StdVectorOfVector2d;
28 StdVectorOfVector2d redPoints, bluePoints;
29 for(
int i = 0;
i < 100; ++
i) {
30 redPoints.push_back(Vector2d::Random());
31 bluePoints.push_back(Vector2d::Random());
38 for(
int i = 0;
i < (
int)redPoints.size(); ++
i)
39 for(
int j = 0;
j < (
int)bluePoints.size(); ++
j)
41 std::cout <<
"Brute force distance = " <<
sqrt(minDistSq) <<
", calls = " << minimizer.
calls << std::endl;
46 minDistSq =
BVMinimize(redTree, blueTree, minimizer);
47 std::cout <<
"BVH distance = " <<
sqrt(minDistSq) <<
", calls = " << minimizer.
calls << std::endl;