[eigen3] 01/04: Remove BVH_example (segfault).
Anton Gladky
gladk at alioth.debian.org
Sat Nov 9 21:37:21 UTC 2013
This is an automated email from the git hooks/post-receive script.
gladk pushed a commit to branch master
in repository eigen3.
commit f9969f05b934f0bda0262c5eb0d20ac92455b18d
Author: Anton Gladky <gladky.anton at gmail.com>
Date: Sat Nov 9 21:44:13 2013 +0100
Remove BVH_example (segfault).
---
debian/patches/removeBVH_example.patch | 58 ++++++++++++++++++++++++++++++++
1 file changed, 58 insertions(+)
diff --git a/debian/patches/removeBVH_example.patch b/debian/patches/removeBVH_example.patch
new file mode 100644
index 0000000..0a5318a
--- /dev/null
+++ b/debian/patches/removeBVH_example.patch
@@ -0,0 +1,58 @@
+Description: Disable unsupported BVH_example (segfault)
+Author: Anton Gladky <gladk at debian.org>
+Last-Update: 2013-11-09
+
+--- a/unsupported/doc/examples/BVH_Example.cpp
++++ b/unsupported/doc/examples/BVH_Example.cpp
+@@ -2,51 +2,7 @@
+ #include <unsupported/Eigen/BVH>
+ #include <iostream>
+
+-using namespace Eigen;
+-typedef AlignedBox<double, 2> Box2d;
+-
+-namespace Eigen {
+- namespace internal {
+- Box2d bounding_box(const Vector2d &v) { return Box2d(v, v); } //compute the bounding box of a single point
+- }
+-}
+-
+-struct PointPointMinimizer //how to compute squared distances between points and rectangles
+-{
+- PointPointMinimizer() : calls(0) {}
+- typedef double Scalar;
+-
+- double minimumOnVolumeVolume(const Box2d &r1, const Box2d &r2) { ++calls; return r1.squaredExteriorDistance(r2); }
+- double minimumOnVolumeObject(const Box2d &r, const Vector2d &v) { ++calls; return r.squaredExteriorDistance(v); }
+- double minimumOnObjectVolume(const Vector2d &v, const Box2d &r) { ++calls; return r.squaredExteriorDistance(v); }
+- double minimumOnObjectObject(const Vector2d &v1, const Vector2d &v2) { ++calls; return (v1 - v2).squaredNorm(); }
+-
+- int calls;
+-};
+-
+ int main()
+ {
+- typedef std::vector<Vector2d, aligned_allocator<Vector2d> > StdVectorOfVector2d;
+- StdVectorOfVector2d redPoints, bluePoints;
+- for(int i = 0; i < 100; ++i) { //initialize random set of red points and blue points
+- redPoints.push_back(Vector2d::Random());
+- bluePoints.push_back(Vector2d::Random());
+- }
+-
+- PointPointMinimizer minimizer;
+- double minDistSq = std::numeric_limits<double>::max();
+-
+- //brute force to find closest red-blue pair
+- for(int i = 0; i < (int)redPoints.size(); ++i)
+- for(int j = 0; j < (int)bluePoints.size(); ++j)
+- minDistSq = std::min(minDistSq, minimizer.minimumOnObjectObject(redPoints[i], bluePoints[j]));
+- std::cout << "Brute force distance = " << sqrt(minDistSq) << ", calls = " << minimizer.calls << std::endl;
+-
+- //using BVH to find closest red-blue pair
+- minimizer.calls = 0;
+- KdBVH<double, 2, Vector2d> redTree(redPoints.begin(), redPoints.end()), blueTree(bluePoints.begin(), bluePoints.end()); //construct the trees
+- minDistSq = BVMinimize(redTree, blueTree, minimizer); //actual BVH minimization call
+- std::cout << "BVH distance = " << sqrt(minDistSq) << ", calls = " << minimizer.calls << std::endl;
+-
+ return 0;
+ }
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/eigen3.git
More information about the debian-science-commits
mailing list