From acb32c69d4e8a78763400ac045b7e06930348fe9 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 23 Apr 2009 11:33:36 +0000 Subject: * update BVH to explicitely use aligned_allocator * fix warning in StdVector --- unsupported/test/BVH.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'unsupported/test/BVH.cpp') diff --git a/unsupported/test/BVH.cpp b/unsupported/test/BVH.cpp index 445489eef..879daacc2 100644 --- a/unsupported/test/BVH.cpp +++ b/unsupported/test/BVH.cpp @@ -42,10 +42,12 @@ EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(double, Dim) double radius; }; + template AlignedBox ei_bounding_box(const Matrix &v) { return AlignedBox(v); } template AlignedBox ei_bounding_box(const Ball &b) { return AlignedBox(b.center.cwise() - b.radius, b.center.cwise() + b.radius); } + template struct BallPointStuff //this class provides functions to be both an intersector and a minimizer, both for a ball and a point and for two trees { @@ -97,16 +99,19 @@ struct BallPointStuff //this class provides functions to be both an intersector int count; }; + template struct TreeTest { typedef Matrix VectorType; + typedef std::vector > VectorTypeList; typedef Ball BallType; + typedef std::vector > BallTypeList; typedef AlignedBox BoxType; void testIntersect1() { - std::vector b; + BallTypeList b; for(int i = 0; i < 500; ++i) { b.push_back(BallType(VectorType::Random(), 0.5 * ei_random(0., 1.))); } @@ -125,7 +130,7 @@ struct TreeTest void testMinimize1() { - std::vector b; + BallTypeList b; for(int i = 0; i < 500; ++i) { b.push_back(BallType(VectorType::Random(), 0.01 * ei_random(0., 1.))); } @@ -146,8 +151,8 @@ struct TreeTest void testIntersect2() { - std::vector b; - std::vector v; + BallTypeList b; + VectorTypeList v; for(int i = 0; i < 50; ++i) { b.push_back(BallType(VectorType::Random(), 0.5 * ei_random(0., 1.))); @@ -171,8 +176,8 @@ struct TreeTest void testMinimize2() { - std::vector b; - std::vector v; + BallTypeList b; + VectorTypeList v; for(int i = 0; i < 50; ++i) { b.push_back(BallType(VectorType::Random(), 1e-7 + 1e-6 * ei_random(0., 1.))); @@ -197,6 +202,7 @@ struct TreeTest } }; + void test_BVH() { for(int i = 0; i < g_repeat; i++) { -- cgit v1.2.3