27 typedef std::vector<Vector2d, aligned_allocator<Vector2d> > StdVectorOfVector2d;
28 StdVectorOfVector2d redPoints, bluePoints;
29 for(
int i = 0;
i < 100; ++
i) {
34 PointPointMinimizer minimizer;
38 for(
int i = 0;
i < (int)redPoints.size(); ++
i)
39 for(
int j = 0;
j < (int)bluePoints.size(); ++
j)
40 minDistSq =
std::min(minDistSq, minimizer.minimumOnObjectObject(redPoints[i], bluePoints[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;
static const RandomReturnType Random()
A simple bounding volume hierarchy based on AlignedBox.
Eigen::AutoDiffScalar< EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(Eigen::internal::remove_all_t< DerType >, typename Eigen::internal::traits< Eigen::internal::remove_all_t< DerType >>::Scalar, product) > sqrt(const Eigen::AutoDiffScalar< DerType > &x)
CleanedUpDerType< DerType >::type() min(const AutoDiffScalar< DerType > &x, const T &y)
CleanedUpDerType< DerType >::type() max(const AutoDiffScalar< DerType > &x, const T &y)
Minimizer::Scalar BVMinimize(const BVH &tree, Minimizer &minimizer)