From 0d5bb166cace20375c2c8341cd9b5b98c21af9e8 Mon Sep 17 00:00:00 2001 From: Brad Barber <bradb@shore.net> Date: Fri, 8 Jan 2010 21:35:02 -0500 Subject: [PATCH] Patched qh_gethash in project/patch/qhull-2003.1/poly.c Compared results of q_test, q_eg, and q_eghash Found elapsed time error in Qhull 2010.1 --- README.txt | 2 -- project/patch/qhull-2003.1/poly.c | 8 +++++--- src/Changes.txt | 6 ++++++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README.txt b/README.txt index ad5ebf7..aec15bc 100644 --- a/README.txt +++ b/README.txt @@ -308,8 +308,6 @@ src/ qhalf.exe qvoronoi.exe qhullcpp.dll - user_eg.exe - user_eg2.exe user_eg3.exe // cpp demonstration eg/qhull-go.bat // DOS window qconvex.htm // html manuals diff --git a/project/patch/qhull-2003.1/poly.c b/project/patch/qhull-2003.1/poly.c index 3bacbf8..bd21394 100644 --- a/project/patch/qhull-2003.1/poly.c +++ b/project/patch/qhull-2003.1/poly.c @@ -403,6 +403,7 @@ unsigned qh_gethash (int hashsize, setT *set, int size, int firstindex, void *sk void **elemp= SETelemaddr_(set, firstindex, void); ptr_intT hash = 0, elem; int i; + unsigned result; switch (size-firstindex) { case 1: @@ -441,9 +442,10 @@ unsigned qh_gethash (int hashsize, setT *set, int size, int firstindex, void *sk }while(*elemp); break; } - hash %= (ptr_intT) hashsize; - /* hash= 0; for debugging purposes */ - return hash; + result= (unsigned)hash; + result %= (unsigned)hashsize; + /* result= 0; for debugging purposes */ + return result; } /* gethash */ /*-<a href="qh-poly.htm#TOC" diff --git a/src/Changes.txt b/src/Changes.txt index 4656bdb..76cc290 100644 --- a/src/Changes.txt +++ b/src/Changes.txt @@ -99,12 +99,18 @@ To do - user.h qh_qhPOINTER 0 for qhull -- need two static libraries - review os << QhullFacetSet vs QhullFacetList vs. QhullHyperplane vs. QhullPoint QhullRidge - generate static qhull for qhull.exe + - timer is off by 3 orders of magnitude Need help - ConvexHull is a submodule to git. How to get rid of? - Set up configure and debian build. If possible, please use project/ instead of qhull-2010.1/ - Set up CMake. If possible, please use project/ instead of qhull-2010.1/ - The C++ interface needs a lot of work + +qhull 2010.1 2010/01/08 + - Patched qh_gethash. See project/patch/qhull-2003.1 with patched poly.c and patch. + Compared results of q_test, q_eg, and q_egtest with patched poly.c, qhull-2003.1 + - Remove user_eg.exe and user_eg2.exe from Windows distribution qhull 2010.1 2010/01/07 - Assign type to qh.old_qhstat and memT.tempstack [amorilia] -- GitLab