From 82c5f29d85257d6255168ce6093b5c51b8ca55d5 Mon Sep 17 00:00:00 2001 From: Brad Barber <bradb@shore.net> Date: Thu, 7 Jan 2010 22:03:32 -0500 Subject: [PATCH] qhull 2010.1 2010/01/07 Fixed type of tempstack and old_qhstat [amorilia] Changed tabs to spaces --- Announce.txt | 14 +- File_id.diz | 2 +- README.txt | 21 +- cpp/Coordinates.h | 8 +- cpp/PointCoordinates.cpp | 24 +- cpp/PointCoordinates.h | 20 +- cpp/Qhull.cpp | 124 +-- cpp/Qhull.h | 44 +- cpp/QhullError.cpp | 2 +- cpp/QhullEvent.cpp | 2 +- cpp/QhullFacet.cpp | 8 +- cpp/QhullFacet.h | 30 +- cpp/QhullFacetList.h | 16 +- cpp/QhullFacetSet.h | 12 +- cpp/QhullHyperplane.h | 18 +- cpp/QhullLinkedList.h | 54 +- cpp/QhullLog.cpp | 14 +- cpp/QhullLog.h | 14 +- cpp/QhullPoint.h | 14 +- cpp/QhullPointSet.cpp | 34 +- cpp/QhullPointSet.h | 18 +- cpp/QhullPoints.h | 50 +- cpp/QhullQh.cpp | 24 +- cpp/QhullQh.h | 6 +- cpp/QhullRidge.cpp | 16 +- cpp/QhullRidge.h | 12 +- cpp/QhullSet.cpp | 8 +- cpp/QhullSet.h | 66 +- cpp/QhullStat.cpp | 8 +- cpp/QhullStat.h | 6 +- cpp/QhullVertex.cpp | 10 +- cpp/QhullVertex.h | 12 +- cpp/QhullVertexSet.h | 14 +- cpp/RboxPoints.cpp | 34 +- cpp/RboxPoints.h | 20 +- cpp/UsingLibQhull.cpp | 76 +- cpp/UsingLibQhull.h | 18 +- cpp/functionObjects.h | 12 +- cpp/qhull_interface.cpp | 66 +- cpp/qhulltest/Coordinates_test.cpp | 34 +- cpp/qhulltest/PointCoordinates_test.cpp | 26 +- cpp/qhulltest/Point_test.cpp | 16 +- cpp/qhulltest/QhullFacetList_test.cpp | 18 +- cpp/qhulltest/QhullFacetSet_test.cpp | 16 +- cpp/qhulltest/QhullFacet_test.cpp | 22 +- cpp/qhulltest/QhullHyperplane_test.cpp | 48 +- cpp/qhulltest/QhullLinkedList_test.cpp | 40 +- cpp/qhulltest/QhullPointSet_test.cpp | 30 +- cpp/qhulltest/QhullPoint_test.cpp | 48 +- cpp/qhulltest/QhullPoints_test.cpp | 42 +- cpp/qhulltest/QhullRidge_test.cpp | 16 +- cpp/qhulltest/QhullSet_test.cpp | 44 +- cpp/qhulltest/QhullVertexSet_test.cpp | 16 +- cpp/qhulltest/QhullVertex_test.cpp | 16 +- cpp/qhulltest/Qhull_test.cpp | 46 +- cpp/qhulltest/RboxPoints_test.cpp | 30 +- cpp/qhulltest/qhulltest.cpp | 16 +- cpp/road/RoadError.cpp | 16 +- cpp/road/RoadError.h | 6 +- cpp/road/RoadLogEvent.cpp | 10 +- cpp/road/RoadLogEvent.h | 6 +- cpp/road/RoadTest.cpp | 8 +- cpp/road/RoadTest.h | 24 +- cpp/user_eg3.cpp | 8 +- eg/q_test-ok.txt | 1362 ++++++++++++----------- html/index.htm | 72 +- html/qconvex.htm | 182 +-- html/qdelau_f.htm | 146 +-- html/qdelaun.htm | 74 +- html/qh-code.htm | 39 +- html/qh-eg.htm | 58 +- html/qh-faq.htm | 134 +-- html/qh-get.htm | 64 +- html/qh-impre.htm | 22 +- html/qh-optc.htm | 44 +- html/qh-optg.htm | 44 +- html/qh-opto.htm | 42 +- html/qh-optp.htm | 36 +- html/qh-optq.htm | 72 +- html/qh-optt.htm | 66 +- html/qh-quick.htm | 48 +- html/qhalf.htm | 204 ++-- html/qhull.htm | 106 +- html/qvoron_f.htm | 168 +-- html/qvoronoi.htm | 128 +-- html/rbox.htm | 140 +-- index.htm | 146 +-- project/libqhull.vcproj | 1264 ++++++++++----------- project/qhulltest.vcproj | 2 +- src/Changes.txt | 32 +- src/Make-config.sh | 6 +- src/Makefile.txt | 102 +- src/Mborland | 142 +-- src/geom.c | 318 +++--- src/geom.h | 64 +- src/geom2.c | 168 +-- src/global.c | 1206 ++++++++++---------- src/index.htm | 44 +- src/io.c | 22 +- src/io.h | 90 +- src/libqhull.c | 396 +++---- src/libqhull.h | 248 ++--- src/mem.c | 112 +- src/mem.h | 66 +- src/merge.c | 886 +++++++-------- src/merge.h | 80 +- src/poly.c | 380 +++---- src/poly.h | 142 +-- src/poly2.c | 1114 +++++++++--------- src/qconvex.c | 30 +- src/qdelaun.c | 32 +- src/qh-geom.htm | 46 +- src/qh-globa.htm | 40 +- src/qh-io.htm | 40 +- src/qh-mem.htm | 32 +- src/qh-merge.htm | 32 +- src/qh-poly.htm | 42 +- src/qh-qhull.htm | 36 +- src/qh-set.htm | 34 +- src/qh-stat.htm | 34 +- src/qh-user.htm | 34 +- src/qhalf.c | 32 +- src/qhull_a.h | 42 +- src/qset.c | 249 +++-- src/qset.h | 162 +-- src/qvoronoi.c | 34 +- src/random.c | 36 +- src/random.h | 8 +- src/rbox.c | 4 +- src/rboxlib.c | 306 ++--- src/stat.c | 112 +- src/stat.h | 62 +- src/unix.c | 20 +- src/user.c | 72 +- src/user.h | 246 ++-- src/user_eg.c | 20 +- src/user_eg2.c | 38 +- src/usermem.c | 4 +- src/userprintf.c | 10 +- 139 files changed, 6871 insertions(+), 6852 deletions(-) diff --git a/Announce.txt b/Announce.txt index 549a044..2974ac8 100644 --- a/Announce.txt +++ b/Announce.txt @@ -1,5 +1,5 @@ - Qhull 2010.1 2010/01/06 + Qhull 2010.1 2010/01/07 http://www.qhull.org git@gitorious.org:qhull/qhull.git @@ -8,10 +8,10 @@ http://www.geomview.org http://www.geom.uiuc.edu -Qhull computes convex hulls, Delaunay triangulations, Voronoi diagrams, -furthest-site Voronoi diagrams, and halfspace intersections about a point. -It runs in 2-d, 3-d, 4-d, or higher. It implements the Quickhull algorithm -for computing convex hulls. Qhull handles round-off errors from floating +Qhull computes convex hulls, Delaunay triangulations, Voronoi diagrams, +furthest-site Voronoi diagrams, and halfspace intersections about a point. +It runs in 2-d, 3-d, 4-d, or higher. It implements the Quickhull algorithm +for computing convex hulls. Qhull handles round-off errors from floating point arithmetic. It can approximate a convex hull. The program includes options for hull volume, facet area, partial hulls, @@ -40,7 +40,7 @@ combines the two-dimensional Quickhull Algorithm with the general dimension Beneath-Beyond Algorithm. It is similar to the randomized, incremental algorithms for convex hull and Delaunay triangulation. We provide empirical evidence that the algorithm runs faster when the input contains non-extreme -points, and that it uses less memory. +points, and that it uses less memory. Computational geometry algorithms have traditionally assumed that input sets are well behaved. When an algorithm is implemented with floating point @@ -48,5 +48,5 @@ arithmetic, this assumption can lead to serious errors. We briefly describe a solution to this problem when computing the convex hull in two, three, or four dimensions. The output is a set of "thick" facets that contain all possible exact convex hulls of the input. A variation is effective in five -or more dimensions. +or more dimensions. diff --git a/File_id.diz b/File_id.diz index 21120bd..3514b41 100644 --- a/File_id.diz +++ b/File_id.diz @@ -1,4 +1,4 @@ -Qhull 2003.1 - Qhull computes convex hulls, +Qhull 2010.1 - Qhull computes convex hulls, Delaunay triangulations, halfspace inter- sections about a point, Voronoi diagrams, furthest-site Delaunay triangulations, and diff --git a/README.txt b/README.txt index 95207ed..2cfe53a 100644 --- a/README.txt +++ b/README.txt @@ -283,7 +283,15 @@ Distributed files src/Makefile.txt // Makefile for Unix or cygwin 'make' src/Mborland // Makefile for Borland C++/Win32 src/Make-config.sh // Create Debian configure and automake - + project/qhull-all.pro // Qt project with Visual C++ vcproj files + +eg/ + q_eg // shell script for Geomview examples + q_egtest // shell script for Geomview test examples + q_test // shell script to test qhull + q_test-ok.txt // output from q_test + qhulltest-ok.txt // output from qhulltest (Qt only) + src/ rbox consists of: rbox.exe // Win32 executable (.zip only) @@ -299,7 +307,11 @@ src/ qdelaunay.exe qhalf.exe qvoronoi.exe - qhull-go.bat // DOS window + qhullcpp.dll + user_eg.exe + user_eg2.exe + user_eg3.exe // cpp demonstration + eg/qhull-go.bat // DOS window qconvex.htm // html manuals qdelaun.htm qdelau_f.htm @@ -315,15 +327,12 @@ src/ qh--4d.gif,etc. // images for manual qhull.man // Unix man page qhull.txt - q_eg // shell script for Geomview examples - q_egtest // shell script for Geomview test examples - q_test // shell script to test qhull top-level source files: src/index.htm // index to source files qh-...htm // specific files user.h // header file of user definable constants - libqhull.h // header file for qhull + libqhull.h // header file for qhull unix.c // Unix front end to qhull qconvex.c qhalf.c diff --git a/cpp/Coordinates.h b/cpp/Coordinates.h index f200600..cc6679c 100644 --- a/cpp/Coordinates.h +++ b/cpp/Coordinates.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2009-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/Coordinates.h#31 $$Change: 1150 $ -** $DateTime: 2010/01/04 22:43:14 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/Coordinates.h#32 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -34,7 +34,7 @@ class Coordinates { private: #//Fields - std::vector<coordT> coordinate_array; + std::vector<coordT> coordinate_array; public: #//Subtypes @@ -59,7 +59,7 @@ public: Coordinates &operator=(const Coordinates &other) { coordinate_array= other.coordinate_array; return *this; } Coordinates &operator=(const std::vector<coordT> &other) { coordinate_array= other; return *this; } ~Coordinates() {} - + #//Conversion coordT *data() { return isEmpty() ? 0 : &at(0); } diff --git a/cpp/PointCoordinates.cpp b/cpp/PointCoordinates.cpp index bb62c16..38ded1e 100644 --- a/cpp/PointCoordinates.cpp +++ b/cpp/PointCoordinates.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2009-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/PointCoordinates.cpp#22 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/PointCoordinates.cpp#23 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -49,7 +49,7 @@ PointCoordinates(const std::string &comment) : QhullPoints() , point_coordinates() , point_comment() -{ +{ appendComment(comment); makeValid(); } @@ -59,7 +59,7 @@ PointCoordinates(int dimension, const std::string &comment) : QhullPoints(dimension) , point_coordinates() , point_comment() -{ +{ appendComment(comment); makeValid(); } @@ -69,7 +69,7 @@ PointCoordinates(int dimension, const std::string &comment, int coordinateCount, : QhullPoints(dimension) , point_coordinates() , point_comment(comment) -{ +{ append(coordinateCount, c); } @@ -78,7 +78,7 @@ PointCoordinates(const PointCoordinates &other) : QhullPoints(other) , point_coordinates(other.point_coordinates) , point_comment(other.point_comment) -{ +{ makeValid(); } @@ -157,17 +157,17 @@ append(const PointCoordinates &other) }//append PointCoordinates void PointCoordinates:: -append(const QhullPoint &p) -{ +append(const QhullPoint &p) +{ setDimension(p.dimension()); - append(p.dimension(), p.coordinates()); + append(p.dimension(), p.coordinates()); }//append QhullPoint void PointCoordinates:: appendComment(const std::string &s){ if(char c= s[0] && point_comment.empty()){ if(c=='-' || isdigit(c)){ - throw QhullError(10028, "Qhull argument error: comments can not start with a number or minus, %s", 0, 0, 0.0, s.c_str()); + throw QhullError(10028, "Qhull argument error: comments can not start with a number or minus, %s", 0, 0, 0.0, s.c_str()); } } point_comment += s; @@ -242,7 +242,7 @@ operator+(const PointCoordinates &other) const void PointCoordinates:: reserveCoordinates(int newCoordinates) -{ +{ // vector::reserve is not const point_coordinates.reserve((int)point_coordinates.size()+newCoordinates); // WARN64 makeValid(); @@ -272,7 +272,7 @@ using orgQhull::PointCoordinates; ostream& operator<<(ostream &os, const PointCoordinates &p) -{ +{ p.checkValid(); int count= p.count(); int dimension= p.dimension(); diff --git a/cpp/PointCoordinates.h b/cpp/PointCoordinates.h index 7b13d1d..5b07c8a 100644 --- a/cpp/PointCoordinates.h +++ b/cpp/PointCoordinates.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2009-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/PointCoordinates.h#14 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/PointCoordinates.h#15 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -28,8 +28,8 @@ class PointCoordinates : public QhullPoints { private: #//Field - Coordinates point_coordinates; //! array of point coordinates - //! may have extraCoordinates() + Coordinates point_coordinates; //! array of point coordinates + //! may have extraCoordinates() std::string point_comment; //! Comment describing PointCoordinates public: @@ -47,11 +47,11 @@ public: #//Convert //! QhullPoints coordinates, constData, data, count, size #ifndef QHULL_NO_STL - void append(const std::vector<coordT> &coordinates) { if(!coordinates.empty()){ append((int)coordinates.size(), &coordinates[0]); } } + void append(const std::vector<coordT> &coordinates) { if(!coordinates.empty()){ append((int)coordinates.size(), &coordinates[0]); } } std::vector<coordT> toStdVector() const { return point_coordinates.toStdVector(); } #endif //QHULL_NO_STL #ifdef QHULL_USES_QT - void append(const QList<coordT> &coordinates) { if(!coordinates.isEmpty()){ append(coordinates.count(), &coordinates[0]); } } + void append(const QList<coordT> &coordinates) { if(!coordinates.isEmpty()){ append(coordinates.count(), &coordinates[0]); } } QList<coordT> toQList() const { return point_coordinates.toQList(); } #endif //QHULL_USES_QT @@ -74,10 +74,10 @@ public: #//Foreach //! See QhullPoints for begin, constBegin, end - Coordinates::ConstIterator beginCoordinates() const { return point_coordinates.begin(); } + Coordinates::ConstIterator beginCoordinates() const { return point_coordinates.begin(); } Coordinates::Iterator beginCoordinates() { return point_coordinates.begin(); } Coordinates::ConstIterator beginCoordinates(int pointIndex) const; - Coordinates::Iterator beginCoordinates(int pointIndex); + Coordinates::Iterator beginCoordinates(int pointIndex); Coordinates::ConstIterator endCoordinates() const { return point_coordinates.end(); } Coordinates::Iterator endCoordinates() { return point_coordinates.end(); } @@ -93,7 +93,7 @@ public: void append(const coordT &c) { append(1, &c); } //! Dimension previously defined void append(const QhullPoint &p); //! See convert for std::vector and QList - void append(const Coordinates &c) { append(c.count(), c.data()); } + void append(const Coordinates &c) { append(c.count(), c.data()); } void append(const PointCoordinates &other); void appendComment(const std::string &s); void appendPoints(std::istream &in); @@ -104,7 +104,7 @@ public: PointCoordinates &operator<<(const coordT &c) { return *this += c; } PointCoordinates &operator<<(const QhullPoint &p) { return *this += p; } // reserve() is non-const - void reserveCoordinates(int newCoordinates); + void reserveCoordinates(int newCoordinates); #//Helpers private: diff --git a/cpp/Qhull.cpp b/cpp/Qhull.cpp index b46b1f7..fcdae4d 100644 --- a/cpp/Qhull.cpp +++ b/cpp/Qhull.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/Qhull.cpp#41 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/Qhull.cpp#42 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -27,7 +27,7 @@ using std::string; using std::vector; using std::ostream; -#ifdef _MSC_VER // Microsoft Visual C++ -- warning level 4 +#ifdef _MSC_VER // Microsoft Visual C++ -- warning level 4 #pragma warning( disable : 4611) // interaction between '_setjmp' and C++ object destruction is non-portable #pragma warning( disable : 4996) // function was declared deprecated(strcpy, localtime, etc.) #endif @@ -54,7 +54,7 @@ Qhull() , output_stream(0) , feasiblePoint() , useOutputStream(false) -{ +{ initializeQhull(); }//Qhull @@ -72,7 +72,7 @@ Qhull(const RboxPoints &points, const char *qhullCommand) , output_stream(0) , feasiblePoint() , useOutputStream(false) -{ +{ initializeQhull(); runQhull(points, qhullCommand); }//Qhull rbox @@ -91,7 +91,7 @@ Qhull(const char *rboxCommand, int pointDimension, int pointCount, const realT * , output_stream(0) , feasiblePoint() , useOutputStream(false) -{ +{ initializeQhull(); runQhull(rboxCommand, pointDimension, pointCount, points, qhullCommand); }//Qhull points @@ -100,10 +100,10 @@ Qhull(const char *rboxCommand, int pointDimension, int pointCount, const realT * void Qhull:: initializeQhull() { - #if qh_QHpointer + #if qh_QHpointer qhull_qh= new QhullQh; qhull_qh->old_qhstat= qh_qhstat; - qhull_qh->old_tempstack= static_cast<setT *>(qhmem.tempstack); + qhull_qh->old_tempstack= qhmem.tempstack; qh_qh= 0; qh_qhstat= 0; #else @@ -123,19 +123,19 @@ Qhull:: if(q.defined()){ int exitCode = setjmp(qh errexit); if(!exitCode){ // no object creation -- destructors skipped on longjmp() -#if qh_QHpointer +#if qh_QHpointer delete qhull_qh; // clears qhull_qh and qh_qh qh_qh= 0; #else qhull_qh->~QhullQh(); qhull_qh= 0; -#endif +#endif qhull_run_id= UsingLibQhull::NOqhRunId; // Except for cerr, does not throw errors if(hasQhullMessage()){ - cerr<< "\nQhull output at end\n"; //FIXUP 2009: where should error and log messages go on ~Qhull? - cerr<<qhullMessage(); + cerr<< "\nQhull output at end\n"; //FIXUP 2009: where should error and log messages go on ~Qhull? + cerr<<qhullMessage(); clearQhullMessage(); } } @@ -149,7 +149,7 @@ Qhull:: void Qhull:: appendQhullMessage(const string &s) { - if(output_stream && useOutputStream && qh USEstdout){ // threading errors caught elsewhere + if(output_stream && useOutputStream && qh USEstdout){ // threading errors caught elsewhere *output_stream << s; }else if(error_stream){ *error_stream << s; @@ -169,7 +169,7 @@ clearQhullMessage() //! hasQhullMessage does not throw errors (~Qhull) bool Qhull:: -hasQhullMessage() const +hasQhullMessage() const { return (!qhull_message.empty() || qhull_status!=qh_ERRnone); //FIXUP 2009 -- inconsistent usage with Rbox. hasRboxMessage just tests rbox_status. No appendRboxMessage() @@ -219,11 +219,11 @@ checkIfQhullInitialized() //! Setup global state (qh_qh, qh_qhstat, qhmem.tempstack) int Qhull:: runId() -{ +{ UsingLibQhull u(this); QHULL_UNUSED(u); - return qhull_run_id; + return qhull_run_id; }//runId @@ -264,15 +264,15 @@ facetList() const{ }//facetList QhullPoints Qhull:: -points() const -{ - return QhullPoints(hullDimension(), qhull_qh->num_points*hullDimension(), qhull_qh->first_point); +points() const +{ + return QhullPoints(hullDimension(), qhull_qh->num_points*hullDimension(), qhull_qh->first_point); }//points QhullPointSet Qhull:: -otherPoints() const -{ - return QhullPointSet(hullDimension(), qhull_qh->other_points); +otherPoints() const +{ + return QhullPointSet(hullDimension(), qhull_qh->other_points); }//otherPoints QhullVertexList Qhull:: @@ -289,7 +289,7 @@ outputQhull() UsingLibQhull q(this); int exitCode = setjmp(qh errexit); if(!exitCode){ // no object creation -- destructors skipped on longjmp() - qh_produce_output2(); + qh_produce_output2(); } maybeThrowQhullMessage(exitCode); }//outputQhull @@ -307,10 +307,10 @@ outputQhull(const char *outputflags) qh_clear_outputflags(); char *s = qh qhull_command + strlen(qh qhull_command) + 1; //space strncat(qh qhull_command, command, sizeof(qh qhull_command)); - qh_checkflags(command, s_not_output_options); + qh_checkflags(command, s_not_output_options); qh_initflags(s); qh_initqhull_outputflags(); - if(qh KEEPminArea < REALmax/2 + if(qh KEEPminArea < REALmax/2 || (0 != qh KEEParea + qh KEEPmerge + qh GOODvertex + qh GOODthreshold + qh GOODpoint + qh SPLITthresholds)){ facetT *facet; @@ -320,7 +320,7 @@ outputQhull(const char *outputflags) } qh_prepare_output(); } - qh_produce_output2(); + qh_produce_output2(); if(qh VERIFYoutput && !qh STOPpoint && !qh STOPcone){ qh_check_points(); } @@ -334,7 +334,7 @@ runQhull(const RboxPoints &points, const char *qhullCommand) runQhull(points.comment().c_str(), points.dimension(), points.count(), &*points.coordinates(), qhullCommand); }//runQhull, RboxPoints -//! points is a array of points, input sites ('d' or 'v'), or halfspaces with offset last ('H') +//! points is a array of points, input sites ('d' or 'v'), or halfspaces with offset last ('H') //! Derived from qh_new_qhull [user.c] void Qhull:: runQhull(const char *rboxCommand, int pointDimension, int pointCount, const realT *points, const char *qhullCommand) @@ -343,36 +343,36 @@ runQhull(const char *rboxCommand, int pointDimension, int pointCount, const real throw QhullError(10027, "Qhull error: runQhull called twice. Only one call allowed."); } run_called= true; - string s("qhull "); + string s("qhull "); s += qhullCommand; char *command= const_cast<char*>(s.c_str()); UsingLibQhull q(this); int exitCode = setjmp(qh errexit); if(!exitCode){ // no object creation -- destructors skipped on longjmp() qh_checkflags(command, s_unsupported_options); - qh_initflags(command); + qh_initflags(command); *qh rbox_command= '\0'; strncat( qh rbox_command, rboxCommand, sizeof( qh rbox_command)); - if(qh DELAUNAY){ - qh PROJECTdelaunay= True; // qh_init_B() calls qh_projectinput() - } - pointT *newPoints= const_cast<pointT*>(points); - int newDimension= pointDimension; - int newIsMalloc= False; - if(qh HALFspace){ - --newDimension; - initializeFeasiblePoint(newDimension); - newPoints= qh_sethalfspace_all(pointDimension, pointCount, newPoints, qh feasible_point); - newIsMalloc= True; - } - qh_init_B(newPoints, pointCount, newDimension, newIsMalloc); + if(qh DELAUNAY){ + qh PROJECTdelaunay= True; // qh_init_B() calls qh_projectinput() + } + pointT *newPoints= const_cast<pointT*>(points); + int newDimension= pointDimension; + int newIsMalloc= False; + if(qh HALFspace){ + --newDimension; + initializeFeasiblePoint(newDimension); + newPoints= qh_sethalfspace_all(pointDimension, pointCount, newPoints, qh feasible_point); + newIsMalloc= True; + } + qh_init_B(newPoints, pointCount, newDimension, newIsMalloc); qhull_dimension= (qh DELAUNAY ? qh hull_dim - 1 : qh hull_dim); - qh_qhull(); - qh_check_output(); + qh_qhull(); + qh_check_output(); qh_prepare_output(); - if(qh VERIFYoutput && !qh STOPpoint && !qh STOPcone){ - qh_check_points(); - } + if(qh VERIFYoutput && !qh STOPpoint && !qh STOPcone){ + qh_check_points(); + } } for(int k= qhull_dimension; k--; ){ // Do not move up (may throw) origin_point << 0.0; @@ -386,24 +386,24 @@ void Qhull:: initializeFeasiblePoint(int hulldim) { if(qh feasible_string){ - qh_setfeasible(hulldim); + qh_setfeasible(hulldim); }else{ if(feasiblePoint.empty()){ qh_fprintf(qh ferr, 6209, "qhull error: missing feasible point for halfspace intersection. Use option 'Hn,n' or set qh.feasiblePoint\n"); qh_errexit(qh_ERRmem, NULL, NULL); } if(feasiblePoint.size()!=(size_t)hulldim){ - qh_fprintf(qh ferr, 6210, "qhull error: dimension of feasiblePoint should be %d. It is %u", hulldim, feasiblePoint.size()); + qh_fprintf(qh ferr, 6210, "qhull error: dimension of feasiblePoint should be %d. It is %u", hulldim, feasiblePoint.size()); qh_errexit(qh_ERRmem, NULL, NULL); } - if (!(qh feasible_point= (coordT*)qh_malloc(hulldim * sizeof(coordT)))) { - qh_fprintf(qh ferr, 6202, "qhull error: insufficient memory for feasible point\n"); - qh_errexit(qh_ERRmem, NULL, NULL); - } - coordT *t= qh feasible_point; - // No qh_... routines after here -- longjmp() ignores destructor - for(Coordinates::ConstIterator p=feasiblePoint.begin(); p<feasiblePoint.end(); p++){ - *t++= *p; + if (!(qh feasible_point= (coordT*)qh_malloc(hulldim * sizeof(coordT)))) { + qh_fprintf(qh ferr, 6202, "qhull error: insufficient memory for feasible point\n"); + qh_errexit(qh_ERRmem, NULL, NULL); + } + coordT *t= qh feasible_point; + // No qh_... routines after here -- longjmp() ignores destructor + for(Coordinates::ConstIterator p=feasiblePoint.begin(); p<feasiblePoint.end(); p++){ + *t++= *p; } } }//initializeFeasiblePoint @@ -448,14 +448,14 @@ notes: fgets() is not trapped like fprintf() Do not throw errors from here. Use qh_errexit; */ -extern "C" +extern "C" void qh_fprintf(FILE *fp, int msgcode, const char *fmt, ... ) { va_list args; using namespace orgQhull; if(!s_qhull_output){ - fprintf(stderr, "QH10025 Qhull error: UsingLibQhull not declared prior to calling qh_...(). s_qhull_output==NULL.\n"); + fprintf(stderr, "QH10025 Qhull error: UsingLibQhull not declared prior to calling qh_...(). s_qhull_output==NULL.\n"); qh_exit(10025); } Qhull *out= s_qhull_output; @@ -466,10 +466,10 @@ void qh_fprintf(FILE *fp, int msgcode, const char *fmt, ... ) { out->qhull_status= msgcode; } } - char newMessage[MSG_MAXLEN]; + char newMessage[MSG_MAXLEN]; // RoadError will add the message tag - vsnprintf(newMessage, sizeof(newMessage), fmt, args); - out->appendQhullMessage(newMessage); + vsnprintf(newMessage, sizeof(newMessage), fmt, args); + out->appendQhullMessage(newMessage); va_end(args); return; } diff --git a/cpp/Qhull.h b/cpp/Qhull.h index 4a840b5..db384e0 100644 --- a/cpp/Qhull.h +++ b/cpp/Qhull.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/Qhull.h#36 $$Change: 1143 $ -** $DateTime: 2010/01/03 22:41:47 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/Qhull.h#37 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -41,14 +41,14 @@ class Qhull { private: #//Members and friends - QhullQh *qhull_qh; //! qh_qh for this instance + QhullQh *qhull_qh; //! qh_qh for this instance int qhull_run_id; //! qh.run_id at initialization (catch multiple runs if !qh_QHpointer) Coordinates origin_point; //! origin for qhull_dimension. Set by runQhull() - int qhull_status; //! qh_ERRnone if valid - int qhull_dimension; //! Dimension of result (qh.hull_dim or one less for Delaunay/Voronoi) + int qhull_status; //! qh_ERRnone if valid + int qhull_dimension; //! Dimension of result (qh.hull_dim or one less for Delaunay/Voronoi) bool run_called; //! True at start of runQhull. Errors if call again. bool qh_active; //! True if qh_qh is qhull_qh - std::string qhull_message; + std::string qhull_message; std::ostream *error_stream; //! overrides errorMessage, use appendQhullMessage() std::ostream *output_stream; //! send output to stream @@ -62,7 +62,7 @@ public: // FIXUP 2009 feasiblePoint useOutputStream as field or getter? #//constructor, assignment, destructor, invariant - Qhull(); //! Qhull::runQhull() must be called next + Qhull(); //! Qhull::runQhull() must be called next Qhull(const RboxPoints &points, const char *qhullCommand); Qhull(const char *rboxCommand, int pointDimension, int pointCount, const realT *points, const char *qhullCommand); ~Qhull() throw(); @@ -70,7 +70,7 @@ private: void initializeQhull(); Qhull(const Qhull&); //disabled Qhull &operator=(const Qhull&); //disabled - + public: #//virtual methods //FIXUP 2009 -- qh_memfree, etc. as virtual? @@ -79,39 +79,39 @@ public: void appendQhullMessage(const std::string &s); void clearQhullMessage(); std::string qhullMessage() const; - bool hasQhullMessage() const; - int qhullStatus() const; + bool hasQhullMessage() const; + int qhullStatus() const; void setErrorStream(std::ostream *os); void setOutputStream(std::ostream *os); #//GetSet void checkIfQhullInitialized(); bool initialized() const { return qhull_dimension>0; } - int dimension() const { return qhull_dimension; } - int hullDimension() const { return qhullQh()->hull_dim; } + int dimension() const { return qhull_dimension; } + int hullDimension() const { return qhullQh()->hull_dim; } // non-const due to QhullPoint QhullPoint origin() { QHULL_ASSERT(initialized()); return QhullPoint(dimension(), origin_point.data()); } QhullQh *qhullQh() const { return qhull_qh; }; int runId(); // Modifies my_qhull #//GetQh -- access to qhT (Qhull's global data structure) - const char *qhullCommand() const { return qhull_qh->qhull_command; } - const char *rboxCommand() const { return qhull_qh->rbox_command; } + const char *qhullCommand() const { return qhull_qh->qhull_command; } + const char *rboxCommand() const { return qhull_qh->rbox_command; } int facetCount() const { return qhull_qh->num_facets; } int vertexCount() const { return qhull_qh->num_vertices; } #//GetValue - double area(); - double volume(); + double area(); + double volume(); #//ForEach - QhullFacet beginFacet() const { return QhullFacet(qhull_qh->facet_list); } - QhullVertex beginVertex() const { return QhullVertex(qhull_qh->vertex_list); } - QhullFacet endFacet() const { return QhullFacet(qhull_qh->facet_tail); } - QhullVertex endVertex() const { return QhullVertex(qhull_qh->vertex_tail); } + QhullFacet beginFacet() const { return QhullFacet(qhull_qh->facet_list); } + QhullVertex beginVertex() const { return QhullVertex(qhull_qh->vertex_list); } + QhullFacet endFacet() const { return QhullFacet(qhull_qh->facet_tail); } + QhullVertex endVertex() const { return QhullVertex(qhull_qh->vertex_tail); } QhullFacetList facetList() const; - QhullFacet firstFacet() const { return beginFacet(); } - QhullVertex firstVertex() const { return beginVertex(); } + QhullFacet firstFacet() const { return beginFacet(); } + QhullVertex firstVertex() const { return beginVertex(); } QhullPoints points() const; QhullPointSet otherPoints() const; //! Same as points().coordinates() diff --git a/cpp/QhullError.cpp b/cpp/QhullError.cpp index a98b583..f715c01 100644 --- a/cpp/QhullError.cpp +++ b/cpp/QhullError.cpp @@ -19,7 +19,7 @@ using std::string; typedef std::auto_ptr<std::stringstream> StringStreamPointer; //! auto_ptr transfers ownership on copy -#ifdef _MSC_VER // Microsoft Visual C++ -- warning level 4 +#ifdef _MSC_VER // Microsoft Visual C++ -- warning level 4 #endif namespace orgQhull { diff --git a/cpp/QhullEvent.cpp b/cpp/QhullEvent.cpp index 2e31ac8..3a81b45 100644 --- a/cpp/QhullEvent.cpp +++ b/cpp/QhullEvent.cpp @@ -8,7 +8,7 @@ #include "QhullEvent.h" -#ifdef _MSC_VER // Microsoft Visual C++ -- warning level 4 +#ifdef _MSC_VER // Microsoft Visual C++ -- warning level 4 #endif namespace orgQhull { diff --git a/cpp/QhullFacet.cpp b/cpp/QhullFacet.cpp index a5e00ff..180a3a6 100644 --- a/cpp/QhullFacet.cpp +++ b/cpp/QhullFacet.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullFacet.cpp#33 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullFacet.cpp#34 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -208,7 +208,7 @@ using orgQhull::QhullVertexSet; using orgQhull::UsingLibQhull; ostream & -operator<<(ostream &os, const QhullFacet::PrintFacet &pr) +operator<<(ostream &os, const QhullFacet::PrintFacet &pr) { QhullFacet f= *pr.facet; if(f.getFacetT()==0){ // Special values from set iterator @@ -281,7 +281,7 @@ operator<<(ostream &os, const QhullFacet::PrintCenter &pr) ostream & operator<<(ostream &os, const QhullFacet::PrintFlags &p) { - const facetT *f= p.facet->getFacetT(); + const facetT *f= p.facet->getFacetT(); if(p.message){ os << p.message; } diff --git a/cpp/QhullFacet.h b/cpp/QhullFacet.h index 06bf379..85e6e42 100644 --- a/cpp/QhullFacet.h +++ b/cpp/QhullFacet.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullFacet.h#35 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullFacet.h#36 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -49,7 +49,7 @@ public: #//Constants #//Constructors - QhullFacet() : qh_facet(&s_empty_facet) {} + QhullFacet() : qh_facet(&s_empty_facet) {} //! Shallow copy QhullFacet(const QhullFacet &o) : qh_facet(o.qh_facet ? o.qh_facet : &s_empty_facet) {} QhullFacet &operator=(const QhullFacet &o) { qh_facet= o.qh_facet ? o.qh_facet : &s_empty_facet; return *this; } @@ -65,7 +65,7 @@ public: facetT *getBaseT() const { return getFacetT(); } #//getSet - int dimension() const; + int dimension() const; int id() const { return qh_facet ? qh_facet->id : -1; } bool isDefined() const { return qh_facet && qh_facet != &s_empty_facet; } bool isGood() const { return qh_facet && qh_facet->good; } @@ -78,8 +78,8 @@ public: QhullPoint getCenter(int qhRunId) { return getCenter(qhRunId, qh_PRINTpoints); } QhullPoint getCenter(int qhRunId, qh_PRINT printFormat); QhullHyperplane hyperplane() const { return QhullHyperplane(dimension(), qh_facet->normal, qh_facet->offset); } - QhullHyperplane innerplane(int qhRunId) const; - QhullHyperplane outerplane(int qhRunId) const; + QhullHyperplane innerplane(int qhRunId) const; + QhullHyperplane outerplane(int qhRunId) const; QhullPoint voronoiVertex(int qhRunId); #//value @@ -103,35 +103,35 @@ public: const char *message; int run_id; qh_PRINT print_format; - PrintCenter(int qhRunId, QhullFacet &f, qh_PRINT printFormat, const char * s) : facet(&f), message(s), run_id(qhRunId), print_format(printFormat){} + PrintCenter(int qhRunId, QhullFacet &f, qh_PRINT printFormat, const char * s) : facet(&f), message(s), run_id(qhRunId), print_format(printFormat){} };//PrintCenter PrintCenter printCenter(int qhRunId, qh_PRINT printFormat, const char *message) { return PrintCenter(qhRunId, *this, printFormat, message); } struct PrintFacet{ - QhullFacet *facet; //! FIXUP, non-const due to f->center() + QhullFacet *facet; //! FIXUP, non-const due to f->center() int run_id; - PrintFacet(int qhRunId, QhullFacet &f) : facet(&f), run_id(qhRunId) {} + PrintFacet(int qhRunId, QhullFacet &f) : facet(&f), run_id(qhRunId) {} };//PrintFacet PrintFacet print(int qhRunId) { return PrintFacet(qhRunId, *this); } struct PrintFlags{ const QhullFacet *facet; // Pointer to allow as subclass const char *message; - PrintFlags(const QhullFacet &f, const char *s) : facet(&f), message(s) {} + PrintFlags(const QhullFacet &f, const char *s) : facet(&f), message(s) {} };//PrintFlags PrintFlags printFlags(const char *message) const { return PrintFlags(*this, message); } struct PrintHeader{ - QhullFacet *facet; //! FIXUP, non-const due to f->center() + QhullFacet *facet; //! FIXUP, non-const due to f->center() int run_id; - PrintHeader(int qhRunId, QhullFacet &f) : facet(&f), run_id(qhRunId) {} + PrintHeader(int qhRunId, QhullFacet &f) : facet(&f), run_id(qhRunId) {} };//PrintHeader PrintHeader printHeader(int qhRunId) { return PrintHeader(qhRunId, *this); } struct PrintRidges{ - QhullFacet *facet; - int run_id; - PrintRidges(int qhRunId, QhullFacet &f) : facet(&f), run_id(qhRunId) {} + QhullFacet *facet; + int run_id; + PrintRidges(int qhRunId, QhullFacet &f) : facet(&f), run_id(qhRunId) {} };//PrintRidges PrintRidges printRidges(int qhRunId) { return PrintRidges(qhRunId, *this); } diff --git a/cpp/QhullFacetList.h b/cpp/QhullFacetList.h index d5191fa..9a4ed79 100644 --- a/cpp/QhullFacetList.h +++ b/cpp/QhullFacetList.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullFacetList.h#21 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullFacetList.h#22 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -23,7 +23,7 @@ namespace orgQhull { //! QhullFacetList -- List of Qhull facets, as a C++ class. See QhullFacetSet.h class QhullFacetList; //! QhullFacetListIterator -- if(f.isGood()){ ... } - typedef QhullLinkedListIterator<QhullFacet> + typedef QhullLinkedListIterator<QhullFacet> QhullFacetListIterator; class QhullFacetList : public QhullLinkedList<QhullFacet> { @@ -71,21 +71,21 @@ public: struct PrintFacetList{ const QhullFacetList *facet_list; int run_id; - PrintFacetList(int qhRunId, const QhullFacetList &fl) : facet_list(&fl), run_id(qhRunId) {} + PrintFacetList(int qhRunId, const QhullFacetList &fl) : facet_list(&fl), run_id(qhRunId) {} };//PrintFacetList PrintFacetList print(int qhRunId) const { return PrintFacetList(qhRunId, *this); } struct PrintFacets{ const QhullFacetList *facet_list; int run_id; - PrintFacets(int qhRunId, const QhullFacetList &fl) : facet_list(&fl), run_id(qhRunId) {} + PrintFacets(int qhRunId, const QhullFacetList &fl) : facet_list(&fl), run_id(qhRunId) {} };//PrintFacets PrintFacets printFacets(int qhRunId) const { return PrintFacets(qhRunId, *this); } struct PrintVertices{ - const QhullFacetList *facet_list; + const QhullFacetList *facet_list; int run_id; //! Can not be NOrunId due to qh_facetvertices - PrintVertices(int qhRunId, const QhullFacetList &fl) : facet_list(&fl), run_id(qhRunId) {} + PrintVertices(int qhRunId, const QhullFacetList &fl) : facet_list(&fl), run_id(qhRunId) {} };//PrintVertices PrintVertices printVertices(int qhRunId) const { return PrintVertices(qhRunId, *this); } };//class QhullFacetList @@ -101,6 +101,6 @@ std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetList::Print // FIXUP -- why did <<facetList work and the others did not? // print() not available since printVertices() requires qhRunId. // [9/09] added const -inline std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetList &fs) { os << fs.printFacets(orgQhull::UsingLibQhull::NOqhRunId); return os; } +inline std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetList &fs) { os << fs.printFacets(orgQhull::UsingLibQhull::NOqhRunId); return os; } #endif // QHULLFACETLIST_H diff --git a/cpp/QhullFacetSet.h b/cpp/QhullFacetSet.h index e78c88e..7af7f9e 100644 --- a/cpp/QhullFacetSet.h +++ b/cpp/QhullFacetSet.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullFacetSet.h#19 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullFacetSet.h#20 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -21,7 +21,7 @@ namespace orgQhull { #//Types //! QhullFacetSet -- a set of Qhull facets, as a C++ class. See QhullFacetList.h class QhullFacetSet; - typedef QhullSetIterator<QhullFacet> + typedef QhullSetIterator<QhullFacet> QhullFacetSetIterator; class QhullFacetSet : public QhullSet<QhullFacet> { @@ -64,20 +64,20 @@ public: //! operator==() does not depend on isGood() #//IO - // Not same as QhullFacetList#IO. A QhullFacetSet is a component of a QhullFacetList. + // Not same as QhullFacetList#IO. A QhullFacetSet is a component of a QhullFacetList. struct PrintFacetSet{ const QhullFacetSet *facet_set; // FIXUP should Print... use pointers? const char *message; int run_id; - PrintFacetSet(int qhRunId, const char *message, const QhullFacetSet *s) : facet_set(s), message(message), run_id(qhRunId) {} + PrintFacetSet(int qhRunId, const char *message, const QhullFacetSet *s) : facet_set(s), message(message), run_id(qhRunId) {} };//PrintFacetSet const PrintFacetSet print(int qhRunId, const char *message) const { return PrintFacetSet(qhRunId, message, this); } struct PrintIdentifiers{ const QhullFacetSet *facet_set; const char *message; - PrintIdentifiers(const char *message, const QhullFacetSet *s) : facet_set(s), message(message) {} + PrintIdentifiers(const char *message, const QhullFacetSet *s) : facet_set(s), message(message) {} };//PrintIdentifiers PrintIdentifiers printIdentifiers(const char *message) const { return PrintIdentifiers(message, this); } diff --git a/cpp/QhullHyperplane.h b/cpp/QhullHyperplane.h index f96c057..3caac47 100644 --- a/cpp/QhullHyperplane.h +++ b/cpp/QhullHyperplane.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2009-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullHyperplane.h#10 $$Change: 1150 $ -** $DateTime: 2010/01/04 22:43:14 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullHyperplane.h#11 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -23,7 +23,7 @@ namespace orgQhull { class QhullPoint; #//Types - //! QhullHyperplane as an offset, dimension, and pointer to coordinates + //! QhullHyperplane as an offset, dimension, and pointer to coordinates class QhullHyperplane; //! Java-style iterator for QhullHyperplane coordinates class QhullHyperplaneIterator; @@ -52,7 +52,7 @@ public: QhullHyperplane &operator=(const QhullHyperplane &other) { hyperplane_coordinates= other.hyperplane_coordinates; hyperplane_dimension= other.hyperplane_dimension; hyperplane_offset= other.hyperplane_offset; return *this; } ~QhullHyperplane() {} -#//Conversions -- +#//Conversions -- //! Includes offset at end #ifndef QHULL_NO_STL std::vector<coordT> toStdVector() const; @@ -65,7 +65,7 @@ public: public: const coordT *coordinates() const { return hyperplane_coordinates; } coordT *coordinates() { return hyperplane_coordinates; } - int dimension() const { return hyperplane_dimension; } + int dimension() const { return hyperplane_dimension; } bool isDefined() const { return hyperplane_coordinates!=0 && hyperplane_dimension>0; } coordT offset() const { return hyperplane_offset; } @@ -73,9 +73,9 @@ public: void defineAs(int dimension, coordT *c, coordT offset) { QHULL_ASSERT(dimension>=0); hyperplane_coordinates= c; hyperplane_dimension= dimension; hyperplane_offset= offset; } //! Creates an alias to other void defineAs(QhullHyperplane &other) { hyperplane_coordinates= other.coordinates(); hyperplane_dimension= other.dimension(); hyperplane_offset= other.offset(); } - void setCoordinates(coordT *c) { hyperplane_coordinates= c; } - void setDimension(int dimension) { hyperplane_dimension= dimension; } - void setOffset(coordT c) { hyperplane_offset= c; } + void setCoordinates(coordT *c) { hyperplane_coordinates= c; } + void setDimension(int dimension) { hyperplane_dimension= dimension; } + void setOffset(coordT c) { hyperplane_offset= c; } #//value double distance(const QhullPoint &p) const; @@ -102,7 +102,7 @@ public: const QhullHyperplane *hyperplane; //! FIXUP elsewhere. const is OK now const char *hyperplane_message; const char *hyperplane_offset_message; - PrintHyperplane(const char *message, const char *offsetMessage, const QhullHyperplane &p) : hyperplane(&p), hyperplane_message(message), hyperplane_offset_message(offsetMessage) {} + PrintHyperplane(const char *message, const char *offsetMessage, const QhullHyperplane &p) : hyperplane(&p), hyperplane_message(message), hyperplane_offset_message(offsetMessage) {} };//PrintHyperplane PrintHyperplane print() const { return PrintHyperplane(0, 0, *this); } PrintHyperplane print(const char *message, const char *offsetMessage) const { return PrintHyperplane(message, offsetMessage, *this); } diff --git a/cpp/QhullLinkedList.h b/cpp/QhullLinkedList.h index 0d4f354..d88a9e1 100644 --- a/cpp/QhullLinkedList.h +++ b/cpp/QhullLinkedList.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullLinkedList.h#30 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullLinkedList.h#31 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -26,7 +26,7 @@ namespace orgQhull { #//Type //! QhullLinkedList<T> -- A linked list modeled on QLinkedList. //! T is an opaque type with T(B *b), b=t.getBaseT(), t=t.next(), and t=t.prev(). The end node is a sentinel. - //! libqhull owns the contents. + //! libqhull owns the contents. //! QhullLinkedList does not define erase(), clear(), removeFirst(), removeLast(), pop_back(), pop_front(), fromStdList() //! Derived from Qt/core/tools/qlinkedlist.h and libqhull.h/FORALLfacets_() //! QhullLinkedList<T>::const_iterator -- STL-style iterator @@ -56,13 +56,13 @@ public: typedef const value_type &const_reference; typedef value_type *pointer; typedef value_type &reference; - + #//Constructors QhullLinkedList<T>(T b, T e) : begin_node(b), end_node(e) {} QhullLinkedList<T>(const QhullLinkedList<T> &o) : begin_node(o.begin_node), end_node(o.end_node) {} ~QhullLinkedList<T>() {} - -private: + +private: //!disabled since a sentinel must be allocated as the private type QhullLinkedList<T>() {} //!disabled since qs= qs2 is ambiguous (pointer vs. contents) @@ -125,7 +125,7 @@ public: iterator(const iterator &o) : i(o.i) {} iterator &operator=(const iterator &o) { i= o.i; return *this; } - T operator*() const { return i; } + T operator*() const { return i; } T operator->() const { return i; } bool operator==(const iterator &o) const { return i == o.i; } bool operator!=(const iterator &o) const { return !operator==(o); } @@ -159,7 +159,7 @@ public: const_iterator(iterator o) : i(o.i) {} const_iterator &operator=(const const_iterator &o) { i= o.i; return *this; } - T operator*() const { return i; } + T operator*() const { return i; } T operator->() const { return i; } bool operator==(const const_iterator &o) const { return i == o.i; } bool operator!=(const const_iterator &o) const { return !operator==(o); } @@ -206,16 +206,16 @@ public: template <typename T> std::vector<T> QhullLinkedList<T>:: toStdVector() const -{ - std::vector<T> tmp; +{ + std::vector<T> tmp; std::copy(constBegin(), constEnd(), std::back_inserter(tmp)); - return tmp; + return tmp; }//toStdVector #endif #ifdef QHULL_USES_QT template <typename T> -QList<T> QhullLinkedList<T>:: +QList<T> QhullLinkedList<T>:: toQList() const { QhullLinkedListIterator<T> i(*this); @@ -300,35 +300,35 @@ operator==(const QhullLinkedList<T> &l) const template <typename T> typename QhullLinkedList<T>::iterator QhullLinkedList<T>::iterator:: operator+(int j) const -{ - T n= i; +{ + T n= i; if(j>0){ while(j--){ - n= n.next(); + n= n.next(); } }else{ while(j++){ - n= n.previous(); + n= n.previous(); } } - return iterator(n); + return iterator(n); }//operator+ template <typename T> typename QhullLinkedList<T>::const_iterator QhullLinkedList<T>::const_iterator:: operator+(int j) const -{ - T n= i; +{ + T n= i; if(j>0){ while(j--){ - n= n.next(); + n= n.next(); } }else{ while(j++){ - n= n.previous(); + n= n.previous(); } } - return const_iterator(n); + return const_iterator(n); }//operator+ #//QhullLinkedListIterator @@ -336,19 +336,19 @@ operator+(int j) const template <typename T> bool QhullLinkedListIterator<T>:: findNext(const T &t) -{ +{ while(i != c->constEnd()){ if (*i++ == t){ - return true; + return true; } } - return false; + return false; }//findNext template <typename T> bool QhullLinkedListIterator<T>:: findPrevious(const T &t) -{ +{ while(i!=c->constBegin()){ if(*(--i)==t){ return true; @@ -362,7 +362,7 @@ findPrevious(const T &t) #//Global functions template <typename T> -std::ostream & +std::ostream & operator<<(std::ostream &os, const orgQhull::QhullLinkedList<T> &qs) { typename orgQhull::QhullLinkedList<T>::const_iterator i; diff --git a/cpp/QhullLog.cpp b/cpp/QhullLog.cpp index c8c583b..a8b26da 100644 --- a/cpp/QhullLog.cpp +++ b/cpp/QhullLog.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullLog.cpp#9 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullLog.cpp#10 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -12,7 +12,7 @@ #include <time.h> -#ifdef _MSC_VER // Microsoft Visual C++ -- warning level 4 +#ifdef _MSC_VER // Microsoft Visual C++ -- warning level 4 #endif namespace orgQhull { @@ -27,7 +27,7 @@ int a_tail_end= 0; int a_max_overrun= 0; int a_call_depth= 0; int a_min_call_depth= 0; -time_t a_start_time_s= 0; +time_t a_start_time_s= 0; int a_logging_enabled= 0; #//Constructor, destructor, etc. @@ -111,7 +111,7 @@ log(int level, const char *message, int arg1, const char* arg3) #//Helper void QhullLog:: -cullEvents() +cullEvents() { }//cullEvents @@ -133,7 +133,7 @@ log(QhullEvent::EventTypes e, int traceLevel, const char *message, int arg1, int } void QhullLog:: -maybeCullEvents() +maybeCullEvents() { if(a_tail>=a_tail_end){ if(a_tail-a_tail_end > a_max_overrun){ @@ -146,7 +146,7 @@ maybeCullEvents() cullEvents(); } }else if(a_head>a_tail && a_head-a_tail < a_head_gap){ - cullEvents(); + cullEvents(); } }//maybeCullEvents diff --git a/cpp/QhullLog.h b/cpp/QhullLog.h index 75ac774..1fb2b6a 100644 --- a/cpp/QhullLog.h +++ b/cpp/QhullLog.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullLog.h#11 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullLog.h#12 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -32,16 +32,16 @@ public: #//Constants #//Class global - static std::vector<std::string> + static std::vector<std::string> a_log; - static std::vector<QhullEvent> + static std::vector<QhullEvent> a_events; static int a_head; //! Head of event queue. Multiple threads may simultaneously increment a_head static int a_tail; //! Tail of event queue. - static int a_head_gap; //! Gap between tail and head. + static int a_head_gap; //! Gap between tail and head. static int a_tail_end; //! End of event queue. Additional elements allocated to avoid buffer overflow - static int a_max_overrun; //! Maximum overrun due to multiple threads (a_head-a_end) + static int a_max_overrun; //! Maximum overrun due to multiple threads (a_head-a_end) static int a_call_depth; //! Current call depth static int a_min_call_depth; //! Minimum call depth since last cull @@ -75,7 +75,7 @@ private: };//QhullLog -#if 0 +#if 0 .what is the last error message .where is the stack + execution log messageLength() diff --git a/cpp/QhullPoint.h b/cpp/QhullPoint.h index e8082ba..2311a61 100644 --- a/cpp/QhullPoint.h +++ b/cpp/QhullPoint.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2009-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullPoint.h#31 $$Change: 1150 $ -** $DateTime: 2010/01/04 22:43:14 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullPoint.h#32 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -22,7 +22,7 @@ extern "C" { namespace orgQhull { #//Types - //! QhullPoint as a pointer and dimension to shared memory + //! QhullPoint as a pointer and dimension to shared memory class QhullPoint; //! Java-style iterator for QhullPoint coordinates class QhullPointIterator; @@ -75,7 +75,7 @@ public: public: const coordT *coordinates() const { return point_coordinates; } coordT *coordinates() { return point_coordinates; } - int dimension() const { return point_dimension; } + int dimension() const { return point_dimension; } int id(int qhRunId) const { return id(qhRunId, dimension(), coordinates()); } int id() const { return id(UsingLibQhull::NOqhRunId, dimension(), coordinates()); } bool isDefined() const { return point_coordinates!=0 && point_dimension>0; } @@ -85,8 +85,8 @@ public: void defineAs(int dimension, coordT *c) { QHULL_ASSERT(dimension>=0); point_coordinates= c; point_dimension= dimension; } //! Creates an alias to other void defineAs(QhullPoint &other) { point_coordinates= other.coordinates(); point_dimension= other.dimension(); } - void setCoordinates(coordT *c) { point_coordinates= c; } - void setDimension(int dimension) { point_dimension= dimension; } + void setCoordinates(coordT *c) { point_coordinates= c; } + void setDimension(int dimension) { point_dimension= dimension; } #//value double distance(const QhullPoint &p) const; @@ -112,7 +112,7 @@ public: const char *point_message; int run_id; bool with_identifier; - PrintPoint(int qhRunId, const char *message, bool withIdentifier, const QhullPoint &p) : point(&p), point_message(message), run_id(qhRunId), with_identifier(withIdentifier) {} + PrintPoint(int qhRunId, const char *message, bool withIdentifier, const QhullPoint &p) : point(&p), point_message(message), run_id(qhRunId), with_identifier(withIdentifier) {} };//PrintPoint PrintPoint print() const { return PrintPoint(UsingLibQhull::NOqhRunId, "", false, *this); } PrintPoint print(int qhRunId) const { return PrintPoint(qhRunId, "", true, *this); } diff --git a/cpp/QhullPointSet.cpp b/cpp/QhullPointSet.cpp index af45d08..212a11d 100644 --- a/cpp/QhullPointSet.cpp +++ b/cpp/QhullPointSet.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2009-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullPointSet.cpp#9 $$Change: 1150 $ -** $DateTime: 2010/01/04 22:43:14 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullPointSet.cpp#10 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -22,13 +22,13 @@ QhullPoint QhullPointSet:: value(int idx) const { // Avoid call to qh_setsize() and assert in elementPointer() - //const T *n= reinterpret_cast<const T *>(&SETelem_(getSetT(), idx)); - void **n= reinterpret_cast<void **>(&SETelem_(getSetT(), idx)); - coordT **n2= reinterpret_cast<coordT **>(n); + //const T *n= reinterpret_cast<const T *>(&SETelem_(getSetT(), idx)); + void **n= reinterpret_cast<void **>(&SETelem_(getSetT(), idx)); + coordT **n2= reinterpret_cast<coordT **>(n); if(idx>=0 && n<endPointer()){ return QhullPoint(dimension(), *n2); }else{ - return QhullPoint(); + return QhullPoint(); } }//value @@ -38,8 +38,8 @@ QhullPoint QhullPointSet:: value(int idx, QhullPoint &defaultValue) const { // Avoid call to qh_setsize() and assert in elementPointer() - void **n= reinterpret_cast<void **>(&SETelem_(getSetT(), idx)); - coordT **n2= reinterpret_cast<coordT **>(n); + void **n= reinterpret_cast<void **>(&SETelem_(getSetT(), idx)); + coordT **n2= reinterpret_cast<coordT **>(n); if(idx>=0 && n<endPointer()){ return QhullPoint(dimension(), *n2); }else{ @@ -128,21 +128,21 @@ findNext(const QhullPoint &p) { while(i!=c->constEnd()){ if(*i++ == p){ - return true; + return true; } } - return false; + return false; }//findNext bool QhullPointSetIterator:: findPrevious(const QhullPoint &p) -{ +{ while(i!=c->constBegin()){ if(*(--i) == p){ return true; } } - return false; + return false; }//findPrevious }//namespace orgQhull @@ -157,14 +157,14 @@ using orgQhull::UsingLibQhull; #//operator<< -ostream & +ostream & operator<<(ostream &os, const QhullPointSet &ps) { - os << ps.print(UsingLibQhull::NOqhRunId); - return os; + os << ps.print(UsingLibQhull::NOqhRunId); + return os; }//<<QhullPointSet -ostream & +ostream & operator<<(ostream &os, const QhullPointSet::PrintIdentifiers &pr) { const QhullPointSet s= *pr.point_set; @@ -183,7 +183,7 @@ operator<<(ostream &os, const QhullPointSet::PrintIdentifiers &pr) return os; }//PrintIdentifiers -ostream & +ostream & operator<<(ostream &os, const QhullPointSet::PrintPointSet &pr) { const QhullPointSet s= *pr.point_set; diff --git a/cpp/QhullPointSet.h b/cpp/QhullPointSet.h index ac302ca..a64bfcd 100644 --- a/cpp/QhullPointSet.h +++ b/cpp/QhullPointSet.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2009-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullPointSet.h#17 $$Change: 1150 $ -** $DateTime: 2010/01/04 22:43:14 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullPointSet.h#18 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -33,7 +33,7 @@ class QhullPointSet : public QhullSet<coordT *> { private: #//Field - int point_dimension; + int point_dimension; public: #//Subtypes and types @@ -75,7 +75,7 @@ public: #//Read-only //inherits count, empty, isEmpty, size using QhullSetBase::count; - int dimension() const { return point_dimension; } + int dimension() const { return point_dimension; } bool operator==(const QhullPointSet &o) const; bool operator!=(const QhullPointSet &o) const { return !operator==(o); } @@ -129,7 +129,7 @@ public: iterator(const iterator &o) : i(o.i), point_dimension(o.point_dimension) {} iterator &operator=(const iterator &o) { i= o.i; point_dimension= o.point_dimension; return *this; } - QhullPoint operator*() const { return QhullPoint(point_dimension, *i); } + QhullPoint operator*() const { return QhullPoint(point_dimension, *i); } //operator->() n/a, value-type QhullPoint operator[](int idx) { return QhullPoint(point_dimension, *(i+idx)); } bool operator==(const iterator &o) const { return i == o.i && point_dimension == o.point_dimension; } @@ -178,8 +178,8 @@ public: const_iterator(const const_iterator &o) : i(o.i), point_dimension(o.point_dimension) {} const_iterator(iterator o) : i(o.i), point_dimension(o.point_dimension) {} const_iterator &operator=(const const_iterator &o) { i= o.i; point_dimension= o.point_dimension; return *this; } - - QhullPoint operator*() const { return QhullPoint(point_dimension, *i); } + + QhullPoint operator*() const { return QhullPoint(point_dimension, *i); } QhullPoint operator[](int idx) { return QhullPoint(point_dimension, *(i+idx)); } //operator->() n/a, value-type bool operator==(const const_iterator &o) const { return i == o.i && point_dimension == o.point_dimension; } @@ -207,7 +207,7 @@ public: const QhullPointSet *point_set; // FIXUP should Print... use pointers? const char *message; int run_id; - PrintIdentifiers(const char *message, const QhullPointSet *s) : point_set(s), message(message) {} + PrintIdentifiers(const char *message, const QhullPointSet *s) : point_set(s), message(message) {} };//PrintIdentifiers PrintIdentifiers printIdentifiers(const char *message) const { return PrintIdentifiers(message, this); } @@ -215,7 +215,7 @@ public: const QhullPointSet *point_set; // FIXUP should Print... use pointers? const char *message; int run_id; - PrintPointSet(int qhRunId, const char *message, const QhullPointSet &s) : point_set(&s), message(message), run_id(qhRunId) {} + PrintPointSet(int qhRunId, const char *message, const QhullPointSet &s) : point_set(&s), message(message), run_id(qhRunId) {} };//PrintPointSet PrintPointSet print(int qhRunId) const { return PrintPointSet(qhRunId, 0, *this); } PrintPointSet print(int qhRunId, const char *message) const { return PrintPointSet(qhRunId, message, *this); } diff --git a/cpp/QhullPoints.h b/cpp/QhullPoints.h index f76efb1..05f8e3e 100644 --- a/cpp/QhullPoints.h +++ b/cpp/QhullPoints.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2009-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullPoints.h#28 $$Change: 1150 $ -** $DateTime: 2010/01/04 22:43:14 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullPoints.h#29 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -68,21 +68,21 @@ public: #//GetSet coordT *coordinates() const { return point_first; } - int coordinateCount() const { return (int)(point_end-point_first); } // WARN64 - int count() const { return (int)size(); } // WARN64 + int coordinateCount() const { return (int)(point_end-point_first); } // WARN64 + int count() const { return (int)size(); } // WARN64 void defineAs(int dimension, int coordinateCount, coordT *c) { QHULL_ASSERT(dimension>=0 && coordinateCount>=0 && c!=0); point_first= c; point_end= c+coordinateCount; point_dimension= dimension; } void defineAs(int coordinateCount, coordT *c) { QHULL_ASSERT((coordinateCount>=0 && c!=0) || (c==0 && coordinateCount==0)); point_first= c; point_end= c+coordinateCount; } void defineAs(const QhullPoints &other) { point_first= other.point_first; point_end= other.point_end; point_dimension= other.point_dimension; } - int dimension() const { return point_dimension; } + int dimension() const { return point_dimension; } bool empty() const { return point_end==point_first; } coordT *extraCoordinates() const { return extraCoordinatesCount() ? (point_end-extraCoordinatesCount()) : 0; } - int extraCoordinatesCount() const { return point_dimension>0 ? (int)((point_end-point_first)%(size_t)point_dimension) : 0; } // WARN64 + int extraCoordinatesCount() const { return point_dimension>0 ? (int)((point_end-point_first)%(size_t)point_dimension) : 0; } // WARN64 bool includesCoordinates(const coordT *coordinates) const { return coordinates>=point_first && coordinates<point_end; } bool isEmpty() const { return empty(); } bool operator==(const QhullPoints &other) const; bool operator!=(const QhullPoints &other) const { return !operator==(other); } - void setDimension(int dimension) { QHULL_ASSERT(dimension>=0); point_dimension= dimension; } - size_t size() const { return (point_dimension ? (point_end-point_first)/point_dimension : 0); } + void setDimension(int dimension) { QHULL_ASSERT(dimension>=0); point_dimension= dimension; } + size_t size() const { return (point_dimension ? (point_end-point_first)/point_dimension : 0); } #//ElementAccess -- can not return references to QhullPoint QhullPoint at(int idx) const { coordT *p= point_first+idx*point_dimension; QHULL_ASSERT(p<point_end); return QhullPoint(point_dimension, p); } @@ -201,7 +201,7 @@ public: const char *point_message; int run_id; bool with_identifier; - PrintPoints(int qhRunId, const char *message, bool withIdentifier, const QhullPoints &ps) : points(&ps), point_message(message), run_id(qhRunId), with_identifier(withIdentifier) {} + PrintPoints(int qhRunId, const char *message, bool withIdentifier, const QhullPoints &ps) : points(&ps), point_message(message), run_id(qhRunId), with_identifier(withIdentifier) {} };//PrintPoints PrintPoints print() const { return PrintPoints(UsingLibQhull::NOqhRunId, "", false, *this); } PrintPoints print(int qhRunId) const { return PrintPoints(qhRunId, "", true, *this); } @@ -211,28 +211,28 @@ public: };//QhullPoints // FIXUP -- can't use macro because next(),etc would return a reference to a temporary -- QHULL_DECLARE_SEQUENTIAL_ITERATOR(QhullPoints, QhullPoint) -class QhullPointsIterator -{ - typedef QhullPoints::const_iterator const_iterator; +class QhullPointsIterator +{ + typedef QhullPoints::const_iterator const_iterator; private: #//Fields - const QhullPoints *ps; - const_iterator i; + const QhullPoints *ps; + const_iterator i; -public: - QhullPointsIterator(const QhullPoints &other) : ps(&other), i(ps->constBegin()) {} - QhullPointsIterator &operator=(const QhullPoints &other) { ps = &other; i = ps->constBegin(); return *this; } +public: + QhullPointsIterator(const QhullPoints &other) : ps(&other), i(ps->constBegin()) {} + QhullPointsIterator &operator=(const QhullPoints &other) { ps = &other; i = ps->constBegin(); return *this; } bool findNext(const QhullPoint &t); bool findPrevious(const QhullPoint &t); - bool hasNext() const { return i != ps->constEnd(); } - bool hasPrevious() const { return i != ps->constBegin(); } - QhullPoint next() { return *i++; } - QhullPoint peekNext() const { return *i; } - QhullPoint peekPrevious() const { const_iterator p = i; return *--p; } - QhullPoint previous() { return *--i; } - void toBack() { i = ps->constEnd(); } - void toFront() { i = ps->constBegin(); } + bool hasNext() const { return i != ps->constEnd(); } + bool hasPrevious() const { return i != ps->constBegin(); } + QhullPoint next() { return *i++; } + QhullPoint peekNext() const { return *i; } + QhullPoint peekPrevious() const { const_iterator p = i; return *--p; } + QhullPoint previous() { return *--i; } + void toBack() { i = ps->constEnd(); } + void toFront() { i = ps->constBegin(); } };//QhullPointsIterator }//namespace orgQhull diff --git a/cpp/QhullQh.cpp b/cpp/QhullQh.cpp index b1be88d..ef406f6 100644 --- a/cpp/QhullQh.cpp +++ b/cpp/QhullQh.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullQh.cpp#25 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullQh.cpp#26 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -22,7 +22,7 @@ using std::string; using std::vector; using std::ostream; -#ifdef _MSC_VER // Microsoft Visual C++ -- warning level 4 +#ifdef _MSC_VER // Microsoft Visual C++ -- warning level 4 #pragma warning( disable : 4611) // interaction between '_setjmp' and C++ object destruction is non-portable #pragma warning( disable : 4996) // function was declared deprecated(strcpy, localtime, etc.) #endif @@ -34,11 +34,11 @@ namespace orgQhull { #//Constructor, destructor, etc. //! If qh_QHpointer==0, invoke with placement new on qh_qh; -//! Sets qh_qh and qh_qhstat. Need to reset before UsingLibQhull. +//! Sets qh_qh and qh_qhstat. Need to reset before UsingLibQhull. //! Derived from qh_new_qhull[user.c] QhullQh:: QhullQh() -{ +{ static boolT firstcall = True; if(firstcall){ @@ -52,10 +52,10 @@ QhullQh() #if qh_QHpointer if(qh_qh){ if(qh old_qhstat){ - throw QhullError(10041, "Qhull internal error: qh_qh.old_qhstat defined (%x) but qh_qh is active. qh_qh not restored correctly.", 0, 0, 0.0, qh old_qhstat); + throw QhullError(10041, "Qhull internal error: qh_qh.old_qhstat defined (%x) but qh_qh is active. qh_qh not restored correctly.", 0, 0, 0.0, qh old_qhstat); } qh old_qhstat= qh_qhstat; - qh old_tempstack= static_cast<setT *>(qhmem.tempstack); + qh old_tempstack= qhmem.tempstack; qh_qhstat= 0; qhmem.tempstack= 0; } @@ -66,7 +66,7 @@ QhullQh() } #endif // NOerrors -- Does not call qh_errexit() - qh_initstatistics(); + qh_initstatistics(); // NOerrors -- Does not call qh_errexit() qh_initqhull_start2(NULL, NULL, qh_FILEstderr); }//QhullQh @@ -77,20 +77,20 @@ QhullQh:: { #if qh_QHpointer if(!qh_qh){ - QhullError e(10042, "Qhull internal error: qh_qh undefined. Was ~QhullQh() invoked independent of UsingLibQhull?", qh run_id, 0, 0, qh_qh); + QhullError e(10042, "Qhull internal error: qh_qh undefined. Was ~QhullQh() invoked independent of UsingLibQhull?", qh run_id, 0, 0, qh_qh); e.logError(); }else if(!qh_qhstat){ - QhullError e(10043, "Qhull internal error: qh_qhstat null. Is another thread running?"); + QhullError e(10043, "Qhull internal error: qh_qhstat null. Is another thread running?"); e.logError(); }else if(qh_qh!=this){ - QhullError e(10044, "Qhull error: ~QhullQh() invoked independent of UsingLibQhull. qh_qh %x (runId %d) vs. QhullQh.runId %d.", qh run_id, run_id, 0.0, qh_qh); + QhullError e(10044, "Qhull error: ~QhullQh() invoked independent of UsingLibQhull. qh_qh %x (runId %d) vs. QhullQh.runId %d.", qh run_id, run_id, 0.0, qh_qh); e.logError(); }else{ qh_freeqhull2(qh_ALL); // sets qh.NOerrexit. Clears struct *qh_qh including run_id, but not qh_qh itself } #else if(&qh_qh!=this){ - QhullError e(10045, "Qhull error: ~QhullQh() invoked independent of UsingLibQhull. qh_qh %x (runId %d) vs. QhullQh.runId %d.", qh run_id, run_id, 0.0, qh_qh); + QhullError e(10045, "Qhull error: ~QhullQh() invoked independent of UsingLibQhull. qh_qh %x (runId %d) vs. QhullQh.runId %d.", qh run_id, run_id, 0.0, qh_qh); e.logError(); }else{ qh_freeqhull2(qh_ALL); // sets qh.NOerrexit. Clears struct *qh_qh including run_id, but not qh_qh itself diff --git a/cpp/QhullQh.h b/cpp/QhullQh.h index 7d4dab7..f4e1957 100644 --- a/cpp/QhullQh.h +++ b/cpp/QhullQh.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullQh.h#19 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullQh.h#20 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -39,7 +39,7 @@ public: QhullQh(); ~QhullQh(); -private: +private: //!disable copy constructor and assignment QhullQh(const QhullQh &); QhullQh &operator=(const QhullQh &); diff --git a/cpp/QhullRidge.cpp b/cpp/QhullRidge.cpp index b1c6f5a..276e941 100644 --- a/cpp/QhullRidge.cpp +++ b/cpp/QhullRidge.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullRidge.cpp#15 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullRidge.cpp#16 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -12,7 +12,7 @@ #include "QhullVertex.h" #include "QhullRidge.h" -#ifdef _MSC_VER // Microsoft Visual C++ -- warning level 4 +#ifdef _MSC_VER // Microsoft Visual C++ -- warning level 4 #pragma warning( disable : 4611) // interaction between '_setjmp' and C++ object destruction is non-portable #pragma warning( disable : 4996) // function was declared deprecated(strcpy, localtime, etc.) #endif @@ -27,7 +27,7 @@ s_empty_ridge= {}; #//Accessors //! Return next ridge and optional vertex for a 3d facet and ridge -//! Returns !isDefined() if no more ridges +//! Returns !isDefined() if no more ridges //! Does not use qh_qh or qh_errexit() QhullRidge QhullRidge:: nextRidge3d(const QhullFacet f, QhullVertex *nextVertex) const @@ -56,16 +56,16 @@ using orgQhull::UsingLibQhull; ostream & operator<<(ostream &os, const QhullRidge &r) -{ - os << r.print(UsingLibQhull::NOqhRunId); - return os; +{ + os << r.print(UsingLibQhull::NOqhRunId); + return os; }//<< QhullRidge //! Duplicate of qh_printridge [io.c] //! if pr.run_id==UsingLibQhull::NOqhRunId, no access to qh [needed for QhullVertex/QhullPoint] ostream & operator<<(ostream &os, const QhullRidge::PrintRidge &pr) -{ +{ QhullRidge r= *pr.ridge; os << " - r" << r.id(); if(r.getRidgeT()->tested){ diff --git a/cpp/QhullRidge.h b/cpp/QhullRidge.h index e9c8b91..54dae99 100644 --- a/cpp/QhullRidge.h +++ b/cpp/QhullRidge.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullRidge.h#22 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullRidge.h#23 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -33,7 +33,7 @@ namespace orgQhull { typedef QhullSetIterator<QhullRidge> QhullRidgeSetIterator; // see QhullSets.h for QhullRidgeSet and QhullRidgeSetIterator -- avoids circular references - + /************************ a ridge is hull_dim-1 simplex between two neighboring facets. If the facets are non-simplicial, there may be more than one ridge between @@ -61,7 +61,7 @@ public: #//Constants #//Constructors - QhullRidge() : qh_ridge(&s_empty_ridge) {} + QhullRidge() : qh_ridge(&s_empty_ridge) {} //! Shallow copy QhullRidge(const QhullRidge &o) : qh_ridge(o.qh_ridge) {} QhullRidge &operator=(const QhullRidge &o) { qh_ridge= o.qh_ridge; return *this; } @@ -93,9 +93,9 @@ public: #//IO struct PrintRidge{ - const QhullRidge *ridge; + const QhullRidge *ridge; int run_id; - PrintRidge(int qhRunId, const QhullRidge &r) : ridge(&r), run_id(qhRunId) {} + PrintRidge(int qhRunId, const QhullRidge &r) : ridge(&r), run_id(qhRunId) {} };//PrintRidge PrintRidge print(int qhRunId) const { return PrintRidge(qhRunId, *this); } };//class QhullRidge diff --git a/cpp/QhullSet.cpp b/cpp/QhullSet.cpp index 4e3929a..31c0618 100644 --- a/cpp/QhullSet.cpp +++ b/cpp/QhullSet.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullSet.cpp#17 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullSet.cpp#18 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -11,7 +11,7 @@ #include "QhullError.h" #include "QhullSet.h" -#ifdef _MSC_VER // Microsoft Visual C++ -- warning level 4 +#ifdef _MSC_VER // Microsoft Visual C++ -- warning level 4 #endif namespace orgQhull { @@ -22,7 +22,7 @@ setT QhullSetBase:: s_empty_set; // Same code for qh_setsize [qset.c] and QhullSetBase::count -int QhullSetBase::count(const setT *set) +int QhullSetBase::count(const setT *set) { int size; const int *sizep; diff --git a/cpp/QhullSet.h b/cpp/QhullSet.h index 2212ce0..0335094 100644 --- a/cpp/QhullSet.h +++ b/cpp/QhullSet.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullSet.h#36 $$Change: 1150 $ -** $DateTime: 2010/01/04 22:43:14 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullSet.h#37 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -35,14 +35,14 @@ namespace orgQhull { //! A QhullSet does not own its contents -- erase(), clear(), removeFirst(), removeLast(), pop_back(), pop_front(), fromStdList() not defined //! Qhull's FOREACHelement_() [qset.h] is more efficient than QhullSet. It uses a NULL terminator instead of an end pointer. STL requires an end pointer. //! Derived from QhullLinkedList.h and Qt/core/tools/qvector.h - + //! QhullSetIterator<T> defined below //See: QhullPointSet, QhullLinkedList<T> class QhullSetBase { private: -#//Fields -- +#//Fields -- setT *qh_set; #//Class objects @@ -124,7 +124,7 @@ private: QhullSet<T> &operator=(const QhullSet<T> &); public: -#//Conversion +#//Conversion #ifndef QHULL_NO_STL std::vector<T> toStdVector() const; @@ -182,23 +182,23 @@ public: // FIXUP? can't use QHULL_DECLARE_SEQUENTIAL_ITERATOR because it is not a template -template <typename T> -class QhullSetIterator { +template <typename T> +class QhullSetIterator { #//Subtypes - typedef typename QhullSet<T>::const_iterator const_iterator; + typedef typename QhullSet<T>::const_iterator const_iterator; private: #//Fields - const_iterator i; - const_iterator begin_i; - const_iterator end_i; + const_iterator i; + const_iterator begin_i; + const_iterator end_i; -public: +public: #//Constructors - QhullSetIterator<T>(const QhullSet<T> &s) : i(s.begin()), begin_i(i), end_i(s.end()) {} - QhullSetIterator<T>(const QhullSetIterator<T> &o) : i(o.i), begin_i(o.begin_i), end_i(o.end_i) {} - QhullSetIterator<T> &operator=(const QhullSetIterator<T> &o) { i= o.i; begin_i= o.begin_i; end_i= o.end_i; return *this; } + QhullSetIterator<T>(const QhullSet<T> &s) : i(s.begin()), begin_i(i), end_i(s.end()) {} + QhullSetIterator<T>(const QhullSetIterator<T> &o) : i(o.i), begin_i(o.begin_i), end_i(o.end_i) {} + QhullSetIterator<T> &operator=(const QhullSetIterator<T> &o) { i= o.i; begin_i= o.begin_i; end_i= o.end_i; return *this; } #//ReadOnly int countRemaining() { return (int)(end_i-begin_i); } // WARN64 @@ -208,22 +208,22 @@ public: bool findPrevious(const T &t); #//Foreach - bool hasNext() const { return i != end_i; } - bool hasPrevious() const { return i != begin_i; } - T next() { return *i++; } - T peekNext() const { return *i; } - T peekPrevious() const { const_iterator p = i; return *--p; } - T previous() { return *--i; } - void toBack() { i = end_i; } - void toFront() { i = begin_i; } + bool hasNext() const { return i != end_i; } + bool hasPrevious() const { return i != begin_i; } + T next() { return *i++; } + T peekNext() const { return *i; } + T peekPrevious() const { const_iterator p = i; return *--p; } + T previous() { return *--i; } + void toBack() { i = end_i; } + void toFront() { i = begin_i; } };//class QhullSetIterator #//== Definitions ========================================= -#//Conversion +#//Conversion #ifndef QHULL_NO_STL -template <typename T> +template <typename T> std::vector<T> QhullSet<T>:: toStdVector() const { @@ -238,7 +238,7 @@ toStdVector() const #endif #ifdef QHULL_USES_QT -template <typename T> +template <typename T> QList<T> QhullSet<T>:: toQList() const { @@ -258,8 +258,8 @@ T QhullSet<T>:: value(int idx) const { // Avoid call to qh_setsize() and assert in elementPointer() - const T *n= reinterpret_cast<const T *>(&SETelem_(getSetT(), idx)); - return (idx>=0 && n<end()) ? *n : T(); + const T *n= reinterpret_cast<const T *>(&SETelem_(getSetT(), idx)); + return (idx>=0 && n<end()) ? *n : T(); }//value template <typename T> @@ -267,16 +267,16 @@ T QhullSet<T>:: value(int idx, const T &defaultValue) const { // Avoid call to qh_setsize() and assert in elementPointer() - const T *n= reinterpret_cast<const T *>(&SETelem_(getSetT(), idx)); - return (idx>=0 && n<end()) ? *n : defaultValue; + const T *n= reinterpret_cast<const T *>(&SETelem_(getSetT(), idx)); + return (idx>=0 && n<end()) ? *n : defaultValue; }//value #//Search template <typename T> bool QhullSet<T>:: -contains(const T &t) const -{ +contains(const T &t) const +{ setT *s= getSetT(); void *e= t.getBaseT(); // contains() is not inline for better error reporting int result= qh_setin(s, e); @@ -345,7 +345,7 @@ findPrevious(const T &t) #//== Global namespace ========================================= template <typename T> -std::ostream & +std::ostream & operator<<(std::ostream &os, const orgQhull::QhullSet<T> &qs) { const T *i= qs.begin(); diff --git a/cpp/QhullStat.cpp b/cpp/QhullStat.cpp index 9ebb29d..4ac347e 100644 --- a/cpp/QhullStat.cpp +++ b/cpp/QhullStat.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullStat.cpp#8 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullStat.cpp#9 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -20,7 +20,7 @@ using std::string; using std::vector; using std::ostream; -#ifdef _MSC_VER // Microsoft Visual C++ -- warning level 4 +#ifdef _MSC_VER // Microsoft Visual C++ -- warning level 4 #endif namespace orgQhull { @@ -30,7 +30,7 @@ namespace orgQhull { //! If qh_QHpointer==0, invoke with placement new on qh_stat; QhullStat:: QhullStat() -{ +{ }//QhullStat QhullStat:: diff --git a/cpp/QhullStat.h b/cpp/QhullStat.h index d23c406..3c7f433 100644 --- a/cpp/QhullStat.h +++ b/cpp/QhullStat.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullStat.h#10 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullStat.h#11 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -38,7 +38,7 @@ public: QhullStat(); ~QhullStat(); -private: +private: //!disable copy constructor and assignment QhullStat(const QhullStat &); QhullStat &operator=(const QhullStat &); diff --git a/cpp/QhullVertex.cpp b/cpp/QhullVertex.cpp index 5e055ca..6f1dd9b 100644 --- a/cpp/QhullVertex.cpp +++ b/cpp/QhullVertex.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullVertex.cpp#22 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullVertex.cpp#23 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -15,7 +15,7 @@ #include "QhullVertexSet.h" #include "QhullFacet.h" -#ifdef _MSC_VER // Microsoft Visual C++ -- warning level 4 +#ifdef _MSC_VER // Microsoft Visual C++ -- warning level 4 #pragma warning( disable : 4611) // interaction between '_setjmp' and C++ object destruction is non-portable #pragma warning( disable : 4996) // function was declared deprecated(strcpy, localtime, etc.) #endif @@ -54,13 +54,13 @@ using orgQhull::UsingLibQhull; //! Duplicate of qh_printvertex [io.c] ostream & operator<<(ostream &os, const QhullVertex::PrintVertex &pr) -{ +{ QhullVertex v= *pr.vertex; QhullPoint p= v.point(); os << "- p" << p.id(pr.run_id) << " (v" << v.id() << "): "; const realT *c= p.coordinates(); for(int k= p.dimension(); k--; ){ - os << " " << *c++; // FIXUP %5.2g + os << " " << *c++; // FIXUP %5.2g } if(v.getVertexT()->deleted){ os << " deleted"; diff --git a/cpp/QhullVertex.h b/cpp/QhullVertex.h index b257dfb..a41c577 100644 --- a/cpp/QhullVertex.h +++ b/cpp/QhullVertex.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullVertex.h#25 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullVertex.h#26 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -53,7 +53,7 @@ public: #//Constants #//Constructors - QhullVertex() : qh_vertex(&s_empty_vertex) {} + QhullVertex() : qh_vertex(&s_empty_vertex) {} //! Shallow copy QhullVertex(const QhullVertex &o) : qh_vertex(o.qh_vertex) {} QhullVertex &operator=(const QhullVertex &o) { qh_vertex= o.qh_vertex; return *this; } @@ -79,13 +79,13 @@ public: #//ForEach //See also QhullVertexList - QhullFacetSet neighborFacets() const; + QhullFacetSet neighborFacets() const; #//IO struct PrintVertex{ - const QhullVertex *vertex; + const QhullVertex *vertex; int run_id; - PrintVertex(int qhRunId, const QhullVertex &v) : vertex(&v), run_id(qhRunId) {} + PrintVertex(int qhRunId, const QhullVertex &v) : vertex(&v), run_id(qhRunId) {} };//PrintVertex PrintVertex print(int qhRunId) const { return PrintVertex(qhRunId, *this); } };//class QhullVertex diff --git a/cpp/QhullVertexSet.h b/cpp/QhullVertexSet.h index c16b8cc..f609c93 100644 --- a/cpp/QhullVertexSet.h +++ b/cpp/QhullVertexSet.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2009-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullVertexSet.h#8 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullVertexSet.h#9 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -19,10 +19,10 @@ namespace orgQhull { class QhullVertex; #//Types - //! QhullVertexSet -- a set of Qhull Vertices, as a C++ class. + //! QhullVertexSet -- a set of Qhull Vertices, as a C++ class. //! See Qhull class QhullVertexSet; - typedef QhullSetIterator<QhullVertex> + typedef QhullSetIterator<QhullVertex> QhullVertexSetIterator; class QhullVertexSet : public QhullSet<QhullVertex> { @@ -30,7 +30,7 @@ class QhullVertexSet : public QhullSet<QhullVertex> { private: #//Fields Qhull *qhsettemp_qhull; //! For sets allocated with qh_settemp() - bool qhsettemp_defined; //! Set was allocated with q_memalloc() + bool qhsettemp_defined; //! Set was allocated with q_memalloc() public: #//Constructor @@ -55,14 +55,14 @@ public: const QhullVertexSet *Vertex_set; const char *message; int run_id; - PrintVertexSet(int qhRunId, const char *message, const QhullVertexSet *s) : Vertex_set(s), message(message), run_id(qhRunId) {} + PrintVertexSet(int qhRunId, const char *message, const QhullVertexSet *s) : Vertex_set(s), message(message), run_id(qhRunId) {} };//PrintVertexSet const PrintVertexSet print(int qhRunId, const char *message) const { return PrintVertexSet(qhRunId, message, this); } struct PrintIdentifiers{ const QhullVertexSet *Vertex_set; const char *message; - PrintIdentifiers(const char *message, const QhullVertexSet *s) : Vertex_set(s), message(message) {} + PrintIdentifiers(const char *message, const QhullVertexSet *s) : Vertex_set(s), message(message) {} };//PrintIdentifiers PrintIdentifiers printIdentifiers(const char *message) const { return PrintIdentifiers(message, this); } diff --git a/cpp/RboxPoints.cpp b/cpp/RboxPoints.cpp index 50cdb54..3d221f1 100644 --- a/cpp/RboxPoints.cpp +++ b/cpp/RboxPoints.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/RboxPoints.cpp#32 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/RboxPoints.cpp#33 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -48,7 +48,7 @@ RboxPoints(const char *rboxCommand) , rbox_new_count(0) , rbox_status(qh_ERRnone) , rbox_message() -{ +{ appendPoints(rboxCommand); } @@ -62,7 +62,7 @@ RboxPoints(const RboxPoints &other) RboxPoints & RboxPoints:: operator=(const RboxPoints &other) -{ +{ PointCoordinates::operator=(other); rbox_new_count= other.rbox_new_count; rbox_status= other.rbox_status; @@ -123,11 +123,11 @@ appendPoints(const char *rboxCommand) throw QhullError(10067, "Qhull error: Extra coordinates (%d) prior to calling RboxPoints::appendPoints. Was %s", extraCoordinatesCount(), 0, 0.0, comment().c_str()); } int previousCount= count(); - rbox_output= this; // set rbox_output for qh_fprintf() + rbox_output= this; // set rbox_output for qh_fprintf() int status= ::qh_rboxpoints(0, 0, command); rbox_output= 0; if(rbox_status==qh_ERRnone){ - rbox_status= status; + rbox_status= status; } if(rbox_status!=qh_ERRnone){ throw QhullError(rbox_status, rbox_message); @@ -157,7 +157,7 @@ notes: fgets() is not trapped like fprintf() Do not throw errors from here. Use qh_errexit_rbox; */ -extern "C" +extern "C" void qh_fprintf_rbox(FILE*, int msgcode, const char *fmt, ... ) { va_list args; @@ -166,10 +166,10 @@ void qh_fprintf_rbox(FILE*, int msgcode, const char *fmt, ... ) { RboxPoints *out= rbox_output; va_start(args, fmt); if(msgcode<MSG_OUTPUT){ - char newMessage[MSG_MAXLEN]; + char newMessage[MSG_MAXLEN]; // RoadError provides the message tag - vsnprintf(newMessage, sizeof(newMessage), fmt, args); - out->rbox_message += newMessage; + vsnprintf(newMessage, sizeof(newMessage), fmt, args); + out->rbox_message += newMessage; if(out->rbox_status<MSG_ERROR || out->rbox_status>=MSG_STDERR){ out->rbox_status= msgcode; } @@ -183,7 +183,7 @@ void qh_fprintf_rbox(FILE*, int msgcode, const char *fmt, ... ) { qh_errexit_rbox(10010); /* never returns */ case 9393: - { + { int dimension= va_arg(args, int); string command(va_arg(args, char*)); int count= va_arg(args, int); @@ -193,8 +193,8 @@ void qh_fprintf_rbox(FILE*, int msgcode, const char *fmt, ... ) { out->appendComment("\""); out->setNewCount(count); out->reservePoints(); - } - break; + } + break; case 9407: *out << va_arg(args, int); // fall through @@ -205,14 +205,14 @@ void qh_fprintf_rbox(FILE*, int msgcode, const char *fmt, ... ) { *out << va_arg(args, int); break; case 9408: - *out << va_arg(args, double); - // fall through + *out << va_arg(args, double); + // fall through case 9406: *out << va_arg(args, double); - // fall through + // fall through case 9404: *out << va_arg(args, double); - break; + break; } va_end(args); } /* qh_fprintf_rbox */ diff --git a/cpp/RboxPoints.h b/cpp/RboxPoints.h index f92dce9..72836f7 100644 --- a/cpp/RboxPoints.h +++ b/cpp/RboxPoints.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/RboxPoints.h#27 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/RboxPoints.h#28 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -32,9 +32,9 @@ namespace orgQhull { private: #//Fields and friends - int rbox_new_count; //! Number of points for PointCoordinates - int rbox_status; //! error status from rboxpoints. qh_ERRnone if none. - std::string rbox_message; //! stderr from rboxpoints + int rbox_new_count; //! Number of points for PointCoordinates + int rbox_status; //! error status from rboxpoints. qh_ERRnone if none. + std::string rbox_message; //! stderr from rboxpoints friend void ::qh_fprintf_rbox(FILE *fp, int msgcode, const char *fmt, ... ); @@ -49,14 +49,14 @@ public: public: #//GetSet void clearRboxMessage(); - int newCount() const { return rbox_new_count; } - std::string rboxMessage() const; - int rboxStatus() const; - bool hasRboxMessage() const; + int newCount() const { return rbox_new_count; } + std::string rboxMessage() const; + int rboxStatus() const; + bool hasRboxMessage() const; void setNewCount(int pointCount) { QHULL_ASSERT(pointCount>=0); rbox_new_count= pointCount; } #//Modify - void appendPoints(const char* rboxCommand); + void appendPoints(const char* rboxCommand); using PointCoordinates::appendPoints; void reservePoints() { reserveCoordinates((count()+newCount())*dimension()); } };//class RboxPoints diff --git a/cpp/UsingLibQhull.cpp b/cpp/UsingLibQhull.cpp index 10ca607..e62d6b1 100644 --- a/cpp/UsingLibQhull.cpp +++ b/cpp/UsingLibQhull.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/UsingLibQhull.cpp#4 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/UsingLibQhull.cpp#5 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -13,7 +13,7 @@ #include "QhullError.h" #include "QhullQh.h" -#ifdef _MSC_VER // Microsoft Visual C++ -- warning level 4 +#ifdef _MSC_VER // Microsoft Visual C++ -- warning level 4 #endif namespace orgQhull { @@ -60,7 +60,7 @@ bool UsingLibQhull:: s_has_distance_epsilon= false; bool UsingLibQhull:: -s_using_libqhull= false; +s_using_libqhull= false; #//Constructors @@ -86,11 +86,11 @@ UsingLibQhull(Qhull *q) #if qh_QHpointer if(qh_qh){ qh old_qhstat= qh_qhstat; - qh old_tempstack= static_cast<setT *>(qhmem.tempstack); + qh old_tempstack= qhmem.tempstack; } qh_qh= qhullqh; - qh_qhstat= static_cast<qhstatT *>(qhullqh->old_qhstat); - qhmem.tempstack= qhullqh->old_tempstack; + qh_qhstat= qhullqh->old_qhstat; + qhmem.tempstack= qhullqh->old_tempstack; qhullqh->old_qhstat= 0; qhullqh->old_tempstack= 0; #else @@ -99,7 +99,7 @@ UsingLibQhull(Qhull *q) throw QhullError(10040, "Qhull internal error: Qhull.qhullQh() is not qh_qh (%x, static). Overwrite?", 0,0,0.0, &qh_qh); } #endif - s_qhull_output= q; // set s_qhull_output for qh_fprintf() + s_qhull_output= q; // set s_qhull_output for qh_fprintf() qh NOerrexit= False; // assumes setjmp called next }//UsingLibQhull qhull @@ -124,16 +124,16 @@ UsingLibQhull(Qhull *q, int noThrow) #if qh_QHpointer if(qh_qh){ qh old_qhstat= qh_qhstat; - qh old_tempstack= static_cast<setT *>(qhmem.tempstack); + qh old_tempstack= qhmem.tempstack; } qh_qh= qhullqh; - qh_qhstat= static_cast<qhstatT *>(qhullqh->old_qhstat); - qhmem.tempstack= qhullqh->old_tempstack; + qh_qhstat= qhullqh->old_qhstat; + qhmem.tempstack= qhullqh->old_tempstack; qhullqh->old_qhstat= 0; qhullqh->old_tempstack= 0; #endif my_qhull= q; - s_qhull_output= q; // set s_qhull_output for qh_fprintf() + s_qhull_output= q; // set s_qhull_output for qh_fprintf() qh NOerrexit= False; // assumes setjmp called next } }//UsingLibQhull qhull noThrow @@ -148,17 +148,17 @@ UsingLibQhull(int qhRunId) checkUsingLibQhull(); #if qh_QHpointer if(!qh_qh || !qh_qhstat){ - throw QhullError(10024, "Qhull error: UsingLibQhull is not active (qh_qh %x or qh_qhstat is not defined)", 0,0,0.0, qh_qh); + throw QhullError(10024, "Qhull error: UsingLibQhull is not active (qh_qh %x or qh_qhstat is not defined)", 0,0,0.0, qh_qh); } #endif if(qh run_id!=qhRunId){ throw QhullError(10036, "Qhull error: qhRunId %d != qh_qh.runId %d. Is another Qhull active?", qhRunId, qh run_id); } if(!s_qhull_output){ - throw QhullError(10037, "Qhull error: UsingLibQhull not active(s_qhull_output undefined). Invoke UsingLibQhull before this call"); + throw QhullError(10037, "Qhull error: UsingLibQhull not active(s_qhull_output undefined). Invoke UsingLibQhull before this call"); } if(s_qhull_output->qhull_run_id!=qhRunId){ - throw QhullError(10046, "Qhull error: qhRunId %d != s_qhull_output.runId %d. Is another Qhull active", qhRunId, s_qhull_output->qhull_run_id); + throw QhullError(10046, "Qhull error: qhRunId %d != s_qhull_output.runId %d. Is another Qhull active", qhRunId, s_qhull_output->qhull_run_id); } my_qhull= s_qhull_output; qh NOerrexit= False; // assumes setjmp called next @@ -192,16 +192,16 @@ checkQhullMemoryEmpty() // qh_memtotal does not error qh_memtotal(&curlong, &totlong, &curshort, &totshort, &maxlong, &totbuffer); if (curlong || totlong){ - throw QhullError(10026, "Qhull error: qhull did not free %d bytes of long memory (%d pieces).", totlong, curlong); + throw QhullError(10026, "Qhull error: qhull did not free %d bytes of long memory (%d pieces).", totlong, curlong); } if (curshort || totshort){ - throw QhullError(10035, "Qhull error: qhull did not free %d bytes of short memory (%d pieces).", totshort, curshort); + throw QhullError(10035, "Qhull error: qhull did not free %d bytes of short memory (%d pieces).", totshort, curshort); } }//checkQhullMemoryEmpty double UsingLibQhull:: -currentAngleEpsilon() -{ +currentAngleEpsilon() +{ if(s_qhull_output && s_qhull_output->initialized()){ return s_qhull_output->qhullQh()->ANGLEround*FACTORepsilon; }else if(s_has_angle_epsilon){ @@ -211,8 +211,8 @@ currentAngleEpsilon() }//currentAngleEpsilon double UsingLibQhull:: -currentDistanceEpsilon() -{ +currentDistanceEpsilon() +{ if(s_qhull_output && s_qhull_output->initialized()){ return s_qhull_output->qhullQh()->DISTround*FACTORepsilon; }else if(s_has_distance_epsilon){ @@ -229,9 +229,9 @@ currentPoints(int *dimension, const coordT **pointsEnd) *pointsEnd= qh first_point+qh num_points*qh hull_dim; return qh first_point; }else if(s_has_points){ - *dimension= s_points_dimension; - *pointsEnd= s_points_end; - return s_points_begin; + *dimension= s_points_dimension; + *pointsEnd= s_points_end; + return s_points_begin; } throw QhullError(10059, "Qhull error: missing definition for currentPoints(). Need currentQhull() or setGlobalDistanceEpsilon()"); }//currentPoints @@ -240,15 +240,15 @@ Qhull &UsingLibQhull:: currentQhull() { if(!s_qhull_output){ - throw QhullError(10055, "Qhull error: currentQhull not defined. Run qhull first."); + throw QhullError(10055, "Qhull error: currentQhull not defined. Run qhull first."); } return *s_qhull_output; }//currentQhull // for QhullVertex::dimension() when >= 16 int UsingLibQhull:: -currentVertexDimension() -{ +currentVertexDimension() +{ if(s_qhull_output && s_qhull_output->initialized()){ return s_qhull_output->dimension(); }else if(s_has_vertex_dimension){ @@ -261,29 +261,29 @@ const coordT *UsingLibQhull:: globalPoints(int *dimension, const coordT **pointsEnd) { if(s_has_points){ - *dimension= s_points_dimension; - *pointsEnd= s_points_end; - return s_points_begin; + *dimension= s_points_dimension; + *pointsEnd= s_points_end; + return s_points_begin; }else{ return currentPoints(dimension, pointsEnd); } }//globalPoints bool UsingLibQhull:: -hasPoints() -{ +hasPoints() +{ return s_has_points || (s_qhull_output && s_qhull_output->initialized()); } bool UsingLibQhull:: -hasVertexDimension() -{ +hasVertexDimension() +{ return s_has_vertex_dimension || (s_qhull_output && s_qhull_output->initialized()); } void UsingLibQhull:: -setGlobals() -{ +setGlobals() +{ if(s_qhull_output && s_qhull_output->initialized()){ QhullQh *qqh= s_qhull_output->qhullQh(); s_angle_epsilon= qqh->ANGLEround*FACTORepsilon; @@ -302,8 +302,8 @@ setGlobals() }//setGlobals void UsingLibQhull:: -unsetGlobals() -{ +unsetGlobals() +{ s_has_angle_epsilon= false; s_has_distance_epsilon= false; s_has_points= false; diff --git a/cpp/UsingLibQhull.h b/cpp/UsingLibQhull.h index db3a30b..c3c8c10 100644 --- a/cpp/UsingLibQhull.h +++ b/cpp/UsingLibQhull.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/UsingLibQhull.h#5 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/UsingLibQhull.h#6 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -23,9 +23,9 @@ namespace orgQhull { /******************************* UsingLibQhull is stack based, but as a call -Qhull declarations are stack-based. But can't define a -setjmp environment, since the target goes away. So must be UsingLibQhull, but can only have one -setjmp at a time? Can embedded another Using as long as save/restore +Qhull declarations are stack-based. But can't define a +setjmp environment, since the target goes away. So must be UsingLibQhull, but can only have one +setjmp at a time? Can embedded another Using as long as save/restore longjmp on exit. */ class UsingLibQhull; @@ -56,9 +56,9 @@ private: //! Global values static double s_angle_epsilon; //! Epsilon for angle equality static double s_distance_epsilon; //! Epsilon for distance equality - static const coordT *s_points_begin; //! For QhullPoint::id() w/o qhRunId. - static const coordT *s_points_end; //! For QhullPoint::id() w/o qhRunId. - static int s_points_dimension; + static const coordT *s_points_begin; //! For QhullPoint::id() w/o qhRunId. + static const coordT *s_points_end; //! For QhullPoint::id() w/o qhRunId. + static int s_points_dimension; static int s_vertex_dimension; //! Default dimension (e.g., if Vertex::dimension() >= 16) public: @@ -120,7 +120,7 @@ You may use global variables in 'qh' after declaring UsingLibQhull. For example To trap errors from libqhull, UsingLibQhull must be followed by -UsingLibQhull q(qhRunId); +UsingLibQhull q(qhRunId); int exitCode = setjmp(qh errexit); if(!exitCode){ // no object creation -- destructors skipped on longjmp() calls to libqhull diff --git a/cpp/functionObjects.h b/cpp/functionObjects.h index 611d6dc..dd91a10 100644 --- a/cpp/functionObjects.h +++ b/cpp/functionObjects.h @@ -1,26 +1,26 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/functionObjects.h#7 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/functionObjects.h#8 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ #ifndef QHFUNCTIONOBJECTS_H #define QHFUNCTIONOBJECTS_H -#include <stdlib.h> +#include <stdlib.h> #include <math.h> // abs() namespace orgQhull { #//Type //! Sum of absolute values of the elements in a container - class AbsoluteSumOf; + class AbsoluteSumOf; //! Sum of the elements in a container - class SumOf; + class SumOf; //! Sum of squares of the elements in a container - class SumSquaresOf; + class SumSquaresOf; #//Class diff --git a/cpp/qhull_interface.cpp b/cpp/qhull_interface.cpp index f460e57..9b008e0 100644 --- a/cpp/qhull_interface.cpp +++ b/cpp/qhull_interface.cpp @@ -49,33 +49,33 @@ extern "C" /*********************************************************************/ void compute_convex_hull(void) -{ - int dim; /* dimension of points */ - int numpoints; /* number of points */ - coordT *points; /* array of coordinates for each point */ - boolT ismalloc; /* True if qhull should free points in qh_freeqhull() or reallocation */ - char flags[]= "qhull Tv"; /* option flags for qhull, see qh_opt.htm */ - FILE *outfile= stdout; /* output from qh_produce_output() - use NULL to skip qh_produce_output() */ - FILE *errfile= stderr; /* error messages from qhull code */ - int exitcode; /* 0 if no error from qhull */ - facetT *facet; /* set by FORALLfacets */ - int curlong, totlong; /* memory remaining after qh_memfreeshort */ +{ + int dim; /* dimension of points */ + int numpoints; /* number of points */ + coordT *points; /* array of coordinates for each point */ + boolT ismalloc; /* True if qhull should free points in qh_freeqhull() or reallocation */ + char flags[]= "qhull Tv"; /* option flags for qhull, see qh_opt.htm */ + FILE *outfile= stdout; /* output from qh_produce_output() + use NULL to skip qh_produce_output() */ + FILE *errfile= stderr; /* error messages from qhull code */ + int exitcode; /* 0 if no error from qhull */ + facetT *facet; /* set by FORALLfacets */ + int curlong, totlong; /* memory remaining after qh_memfreeshort */ - /* initialize dim, numpoints, points[], ismalloc here */ - exitcode= qh_new_qhull(dim, numpoints, points, ismalloc, - flags, outfile, errfile); - if (!exitcode) { /* if no error */ - /* 'qh facet_list' contains the convex hull */ - FORALLfacets { - /* ... your code ... */ - } - } - qh_freeqhull(!qh_ALL); - qh_memfreeshort(&curlong, &totlong); - if (curlong || totlong) - fprintf(errfile, "qhull internal warning (main): did not free %d bytes of long memory(%d pieces)\n", - totlong, curlong); + /* initialize dim, numpoints, points[], ismalloc here */ + exitcode= qh_new_qhull(dim, numpoints, points, ismalloc, + flags, outfile, errfile); + if (!exitcode) { /* if no error */ + /* 'qh facet_list' contains the convex hull */ + FORALLfacets { + /* ... your code ... */ + } + } + qh_freeqhull(!qh_ALL); + qh_memfreeshort(&curlong, &totlong); + if (curlong || totlong) + fprintf(errfile, "qhull internal warning (main): did not free %d bytes of long memory(%d pieces)\n", + totlong, curlong); }; /*********************************************************************/ @@ -85,12 +85,12 @@ void compute_convex_hull(void) /* */ /*********************************************************************/ -void main() -{ - cout << "Hello world" << endl; - - cout << "Press any key..." << endl; - - while (!_kbhit()); +void main() +{ + cout << "Hello world" << endl; + + cout << "Press any key..." << endl; + + while (!_kbhit()); }; diff --git a/cpp/qhulltest/Coordinates_test.cpp b/cpp/qhulltest/Coordinates_test.cpp index 731b824..1d9e427 100644 --- a/cpp/qhulltest/Coordinates_test.cpp +++ b/cpp/qhulltest/Coordinates_test.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2009-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/Coordinates_test.cpp#16 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/qhulltest/Coordinates_test.cpp#17 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -51,7 +51,7 @@ add_Coordinates_test() void Coordinates_test:: t_construct() -{ +{ Coordinates c; QCOMPARE(c.size(), 0U); QVERIFY(c.isEmpty()); @@ -79,7 +79,7 @@ t_construct() void Coordinates_test:: t_convert() -{ +{ Coordinates c; c << 1.0 << 3.0; QCOMPARE(c.data()[1], 3.0); @@ -100,13 +100,13 @@ t_convert() c4= std::vector<double>(2, 0.0); //FIXUP move to Coordinates_test QCOMPARE(c4.back(), 0.0); Coordinates c5(std::vector<double>(2, 0.0)); - QCOMPARE(c4.size(), c5.size()); + QCOMPARE(c4.size(), c5.size()); QVERIFY(c4==c5); }//t_convert void Coordinates_test:: t_element() -{ +{ Coordinates c; c << 1.0 << -2.0; c.at(1)= -3; @@ -139,7 +139,7 @@ t_element() void Coordinates_test:: t_readonly() -{ +{ Coordinates c; QCOMPARE(c.size(), 0u); QCOMPARE(c.count(), 0); @@ -154,7 +154,7 @@ t_readonly() void Coordinates_test:: t_operator() -{ +{ Coordinates c; Coordinates c2(c); QVERIFY(c==c2); @@ -185,7 +185,7 @@ t_operator() void Coordinates_test:: t_const_iterator() -{ +{ Coordinates c; QCOMPARE(c.begin(), c.end()); // begin and end checked elsewhere @@ -219,7 +219,7 @@ t_const_iterator() void Coordinates_test:: t_iterator() -{ +{ Coordinates c; QCOMPARE(c.begin(), c.end()); // begin and end checked elsewhere @@ -254,7 +254,7 @@ t_iterator() void Coordinates_test:: t_coord_iterator() -{ +{ Coordinates c; c << 1.0 << 3.0; CoordinatesIterator i(c); @@ -302,7 +302,7 @@ t_coord_iterator() void Coordinates_test:: t_mutable_coord_iterator() -{ +{ // Same tests as CoordinatesIterator Coordinates c; c << 1.0 << 3.0; @@ -405,7 +405,7 @@ t_mutable_coord_iterator() void Coordinates_test:: t_readwrite() -{ +{ Coordinates c; c.clear(); QCOMPARE(c.count(), 0); @@ -419,9 +419,9 @@ t_readwrite() Coordinates::iterator i= c.erase(c.begin()); QCOMPARE(*i, 0.0); i= c.insert(c.end(), 1.0); - QCOMPARE(*i, 1.0); + QCOMPARE(*i, 1.0); QCOMPARE(c.count(), 2); - c.pop_back(); + c.pop_back(); QCOMPARE(c.count(), 1); // 0 QCOMPARE(c[0], 0.0); c.push_back(2.0); @@ -474,7 +474,7 @@ t_readwrite() void Coordinates_test:: t_search() -{ +{ Coordinates c; c << 1.0 << 3.0 << 1.0; QVERIFY(c.contains(1.0)); @@ -519,7 +519,7 @@ t_search() void Coordinates_test:: t_io() -{ +{ Coordinates c; c << 1.0 << 2.0 << 3.0; ostringstream os; diff --git a/cpp/qhulltest/PointCoordinates_test.cpp b/cpp/qhulltest/PointCoordinates_test.cpp index 28bf71c..3bb28ba 100644 --- a/cpp/qhulltest/PointCoordinates_test.cpp +++ b/cpp/qhulltest/PointCoordinates_test.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2009-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/PointCoordinates_test.cpp#14 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/qhulltest/PointCoordinates_test.cpp#15 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -50,7 +50,7 @@ add_PointCoordinates_test() void PointCoordinates_test:: t_construct() -{ +{ PointCoordinates pc; QCOMPARE(pc.size(), 0U); QCOMPARE(pc.coordinateCount(), 0); @@ -121,7 +121,7 @@ t_construct() void PointCoordinates_test:: t_convert() -{ +{ //defineAs tested above coordT c[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0}; PointCoordinates ps(3, "two 3-d points", 6, c); @@ -144,7 +144,7 @@ t_convert() void PointCoordinates_test:: t_getset() -{ +{ // See t_construct() for test of coordinates, coordinateCount, dimension, empty, isEmpty, ==, != // See t_construct() for test of checkValid, comment, setDimension PointCoordinates pc("Coordinates c"); @@ -169,13 +169,13 @@ t_getset() QFAIL("setDimension(2) did not fail for 3-d."); }catch (const std::exception &e) { const char *s= e.what(); - cout << "INFO : Caught " << s; + cout << "INFO : Caught " << s; } }//t_getset void PointCoordinates_test:: t_element() -{ +{ coordT c[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0}; PointCoordinates pc(2, "2-d points", 6, c); QhullPoint p= pc.at(0); @@ -192,7 +192,7 @@ t_element() void PointCoordinates_test:: t_foreach() -{ +{ coordT c[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0}; PointCoordinates pc(2, "2-d points", 6, c); QhullPoints::Iterator i= pc.begin(); @@ -239,7 +239,7 @@ t_foreach() void PointCoordinates_test:: t_search() -{ +{ coordT c[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0}; PointCoordinates pc(2, "2-d points", 6, c); QhullPoint p0= pc[0]; @@ -253,7 +253,7 @@ t_search() void PointCoordinates_test:: t_modify() -{ +{ coordT c[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0}; PointCoordinates pc(2, "2-d points", 6, c); coordT c3[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0}; @@ -313,11 +313,11 @@ t_modify() void PointCoordinates_test:: t_append_points() -{ +{ PointCoordinates pc(2, "stringstream"); stringstream s("2 3 1 2 3 4 5 6"); pc.appendPoints(s); - QCOMPARE(pc.count(), 3); + QCOMPARE(pc.count(), 3); }//t_append_points void PointCoordinates_test:: @@ -379,7 +379,7 @@ t_coord_iterator() void PointCoordinates_test:: t_io() -{ +{ PointCoordinates c; c << 1.0 << 2.0 << 3.0 << 1.0 << 2.0 << 3.0; ostringstream os; diff --git a/cpp/qhulltest/Point_test.cpp b/cpp/qhulltest/Point_test.cpp index 15554e4..e4f6979 100644 --- a/cpp/qhulltest/Point_test.cpp +++ b/cpp/qhulltest/Point_test.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (p) 2009-2010 p. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/Point_test.cpp#11 $$Change: 1137 $ -** $DateTime: 2010/01/02 21:58:11 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/qhulltest/Point_test.cpp#12 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -41,7 +41,7 @@ add_Point_test() } void Point_test:: -initTestCase(){ +initTestCase(){ RboxPoints rcube("c"); Qhull q(rcube, ""); UsingQhullLib::setGlobals(); @@ -49,7 +49,7 @@ initTestCase(){ void Point_test:: t_construct() -{ +{ QhullPoint p; QCOMPARE(p.dimension(), 0); coordT c[]= {0.0, 1.0, 2.0}; @@ -66,7 +66,7 @@ t_construct() void Point_test:: t_getset() -{ +{ coordT c[]= {0.0, 1.0, 2.0}; QhullPoint p(3, c); QCOMPARE(p.coordinates(), c); @@ -90,7 +90,7 @@ t_getset() void Point_test:: t_operator() -{ +{ QhullPoint p; QhullPoint p2(p); QVERIFY(p==p2); @@ -169,7 +169,7 @@ t_iterator() QVERIFY(i3>i); QVERIFY(i3>=i); // compiler errors -- QhullPoint is const-only - // QCOMPARE((i[0]= -10.0), -10.0); + // QCOMPARE((i[0]= -10.0), -10.0); // coordT *c3= &i3[1]; }//t_iterator @@ -221,7 +221,7 @@ t_point_iterator() void Point_test:: t_io() -{ +{ QhullPoint p; cout<< "INFO: empty point" << p << endl; const coordT c[]= {1.0, 3.0, 4.0}; diff --git a/cpp/qhulltest/QhullFacetList_test.cpp b/cpp/qhulltest/QhullFacetList_test.cpp index 36ed870..6689f21 100644 --- a/cpp/qhulltest/QhullFacetList_test.cpp +++ b/cpp/qhulltest/QhullFacetList_test.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullFacetList_test.cpp#15 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullFacetList_test.cpp#16 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -54,7 +54,7 @@ cleanup() void QhullFacetList_test:: t_construct() -{ +{ RboxPoints rcube("c"); Qhull q(rcube,"QR0"); // rotated unit cube QhullFacetList fs2= q.facetList(); @@ -75,7 +75,7 @@ t_construct() void QhullFacetList_test:: t_convert() -{ +{ RboxPoints rcube("c"); Qhull q(rcube,"QR0 QV2"); // rotated unit cube QhullFacetList fs2= q.facetList(); @@ -105,7 +105,7 @@ t_convert() //! Spot check properties and read-only. See QhullLinkedList_test void QhullFacetList_test:: t_readonly() -{ +{ RboxPoints rcube("c"); Qhull q(rcube,"QV0"); // good facets are adjacent to point 0 QhullFacetList fs= q.facetList(); @@ -135,7 +135,7 @@ t_readonly() void QhullFacetList_test:: t_foreach() -{ +{ RboxPoints rcube("c"); // Spot check predicates and accessors. See QhullLinkedList_test Qhull q(rcube,"Qt QR0"); // triangulation of rotated unit cube @@ -152,7 +152,7 @@ t_foreach() void QhullFacetList_test:: t_io() -{ +{ RboxPoints rcube("c"); { Qhull q(rcube,"QR0 QV0"); // good facets are adjacent to point 0 @@ -169,7 +169,7 @@ t_io() //FIXUP -- Move conditional, QhullFacetSet code to QhullFacetSet.cpp #ifndef QHULL_NO_STL -std::vector<QhullFacet> QhullFacetList:: +std::vector<QhullFacet> QhullFacetList:: toStdVector() const { QhullLinkedListIterator<QhullFacet> i(*this); @@ -202,7 +202,7 @@ toQList() const #ifndef QHULL_NO_STL //! Same as PrintVertices -std::vector<QhullVertex> QhullFacetList:: +std::vector<QhullVertex> QhullFacetList:: vertices_toStdVector(int qhRunId) const { std::vector<QhullVertex> vs; diff --git a/cpp/qhulltest/QhullFacetSet_test.cpp b/cpp/qhulltest/QhullFacetSet_test.cpp index b21a82e..c0e2d12 100644 --- a/cpp/qhulltest/QhullFacetSet_test.cpp +++ b/cpp/qhulltest/QhullFacetSet_test.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullFacetSet_test.cpp#12 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullFacetSet_test.cpp#13 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -53,7 +53,7 @@ cleanup() void QhullFacetSet_test:: t_construct() -{ +{ RboxPoints rcube("c"); Qhull q(rcube,"QR0"); // rotated unit cube QhullFacet f= q.firstFacet(); @@ -68,7 +68,7 @@ t_construct() void QhullFacetSet_test:: t_convert() -{ +{ RboxPoints rcube("c"); Qhull q(rcube,"QR0 QV2"); // rotated unit cube QhullFacet f= q.firstFacet(); @@ -90,7 +90,7 @@ t_convert() //! Spot check properties and read-only. See QhullSet_test void QhullFacetSet_test:: t_readonly() -{ +{ RboxPoints rcube("c"); Qhull q(rcube,"QV0"); // good facets are adjacent to point 0 QhullFacetSet fs= q.firstFacet().neighborFacets(); @@ -116,7 +116,7 @@ t_readonly() void QhullFacetSet_test:: t_foreach() -{ +{ RboxPoints rcube("c"); // Spot check predicates and accessors. See QhullLinkedList_test Qhull q(rcube,"QR0"); // rotated unit cube @@ -134,7 +134,7 @@ t_foreach() void QhullFacetSet_test:: t_io() -{ +{ RboxPoints rcube("c"); { Qhull q(rcube,"QR0 QV0"); // good facets are adjacent to point 0 @@ -150,7 +150,7 @@ t_io() //FIXUP -- Move conditional, QhullFacetSet code to QhullFacetSet.cpp #ifndef QHULL_NO_STL -std::vector<QhullFacet> QhullFacetSet:: +std::vector<QhullFacet> QhullFacetSet:: toStdVector() const { QhullSetIterator<QhullFacet> i(*this); diff --git a/cpp/qhulltest/QhullFacet_test.cpp b/cpp/qhulltest/QhullFacet_test.cpp index 95446fe..e661620 100644 --- a/cpp/qhulltest/QhullFacet_test.cpp +++ b/cpp/qhulltest/QhullFacet_test.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullFacet_test.cpp#31 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullFacet_test.cpp#32 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -58,8 +58,8 @@ cleanup() void QhullFacet_test:: t_constructConvert() -{ - // Qhull.runQhull() constructs QhullFacets as facetT +{ + // Qhull.runQhull() constructs QhullFacets as facetT QhullFacet f; QVERIFY(!f.isDefined()); QCOMPARE(f.dimension(),0); @@ -81,7 +81,7 @@ t_constructConvert() void QhullFacet_test:: t_getSet() -{ +{ RboxPoints rcube("c"); { Qhull q(rcube,"Qt QR0"); // triangulation of rotated unit cube @@ -92,7 +92,7 @@ t_getSet() const QhullFacet f= i.next(); cout << f.id() << endl; QCOMPARE(f.dimension(),3); - QVERIFY(f.id()>0 && f.id()<=39); + QVERIFY(f.id()>0 && f.id()<=39); QVERIFY(f.isDefined()); if(i.hasNext()){ QCOMPARE(f.next(), i.peekNext()); @@ -120,7 +120,7 @@ t_getSet() int tricoplanarCount2= 0; foreach (QhullFacet f, q.facetList()){ // Qt only QhullHyperplane h= f.hyperplane(); - cout << "Hyperplane: " << h << endl; + cout << "Hyperplane: " << h << endl; QCOMPARE(h.count(), 3); QCOMPARE(h.offset(), -0.5); double n= h.norm(); @@ -161,7 +161,7 @@ t_getSet() QVERIFY(center4[i]==center3[i]); } Qhull q3(rcube,"v Qz QR0"); // Voronoi diagram of a cube (one vertex) - + UsingLibQhull::setGlobalDistanceEpsilon(1e-12); // Voronoi vertices are not necessarily within distance episilon foreach(QhullFacet f, q3.facetList()){ //Qt only if(f.isGood()){ @@ -176,7 +176,7 @@ t_getSet() void QhullFacet_test:: t_value() -{ +{ RboxPoints rcube("c"); { Qhull q(rcube, ""); @@ -198,7 +198,7 @@ t_value() void QhullFacet_test:: t_foreach() -{ +{ RboxPoints rcube("c W0 300"); // 300 points on surface of cube { Qhull q(rcube, "QR0 Qc"); // keep coplanars, thick facet, and rotate the cube @@ -227,7 +227,7 @@ t_foreach() void QhullFacet_test:: t_io() -{ +{ RboxPoints rcube("c"); { Qhull q(rcube, ""); diff --git a/cpp/qhulltest/QhullHyperplane_test.cpp b/cpp/qhulltest/QhullHyperplane_test.cpp index 5bfdc89..0b079fe 100644 --- a/cpp/qhulltest/QhullHyperplane_test.cpp +++ b/cpp/qhulltest/QhullHyperplane_test.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2009-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullHyperplane_test.cpp#10 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullHyperplane_test.cpp#11 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -62,8 +62,8 @@ cleanup() void QhullHyperplane_test:: t_construct() -{ - // Qhull.runQhull() constructs QhullFacets as facetT +{ + // Qhull.runQhull() constructs QhullFacets as facetT QhullHyperplane h; QVERIFY(!h.isDefined()); QCOMPARE(h.dimension(),0); @@ -83,7 +83,7 @@ t_construct() void QhullHyperplane_test:: t_convert() -{ +{ RboxPoints rcube("c"); Qhull q(rcube,"Qt QR0"); // triangulation of rotated unit cube QhullHyperplane h= q.firstFacet().hyperplane(); @@ -105,7 +105,7 @@ t_convert() void QhullHyperplane_test:: t_readonly() -{ +{ RboxPoints rcube("c"); { Qhull q(rcube,"Qt QR0"); // triangulation of rotated unit cube @@ -138,7 +138,7 @@ t_readonly() void QhullHyperplane_test:: t_define() -{ +{ RboxPoints rcube("c"); { Qhull q(rcube,"Qt QR0"); // triangulation of rotated unit cube @@ -169,7 +169,7 @@ t_define() void QhullHyperplane_test:: t_value() -{ +{ RboxPoints rcube("c G1"); Qhull q(rcube,"Qt QR0"); // triangulation of rotated unit cube const QhullHyperplane h= q.firstFacet().hyperplane(); @@ -181,7 +181,7 @@ t_value() void QhullHyperplane_test:: t_operator() -{ +{ RboxPoints rcube("c"); Qhull q(rcube,"Qt QR0"); // triangulation of rotated unit cube const QhullHyperplane h= q.firstFacet().hyperplane(); @@ -190,7 +190,7 @@ t_operator() for(int k=h.dimension(); k--; ){ QCOMPARE(c[k], h[k]); } - //h[0]= 10.0; // compiler error, const + //h[0]= 10.0; // compiler error, const QhullHyperplane h2= q.firstFacet().hyperplane(); h2[0]= 10.0; // Overwrites Hyperplane coordinate! QCOMPARE(h2[0], 10.0); @@ -198,7 +198,7 @@ t_operator() void QhullHyperplane_test:: t_iterator() -{ +{ RboxPoints rcube("c"); { QhullHyperplane h2; @@ -264,16 +264,16 @@ t_iterator() QCOMPARE(i, i2--); QCOMPARE(i2, h.begin()); QCOMPARE(--i, i2); - QCOMPARE(i2 += 3, h.end()); - QCOMPARE(i2 -= 3, h.begin()); - QCOMPARE(i2+0, h.begin()); + QCOMPARE(i2 += 3, h.end()); + QCOMPARE(i2 -= 3, h.begin()); + QCOMPARE(i2+0, h.begin()); QCOMPARE(i2+3, h.end()); i2 += 3; i= i2-0; QCOMPARE(i, i2); i= i2-3; - QCOMPARE(i, h.begin()); - QCOMPARE(i2-i, 3); + QCOMPARE(i, h.begin()); + QCOMPARE(i2-i, 3); //h.begin end tested above @@ -283,7 +283,7 @@ t_iterator() void QhullHyperplane_test:: t_const_iterator() -{ +{ RboxPoints rcube("c"); { Qhull q(rcube,"QR0"); // rotated unit cube @@ -324,16 +324,16 @@ t_const_iterator() QCOMPARE(i, i2--); QCOMPARE(i2, h.constBegin()); QCOMPARE(--i, i2); - QCOMPARE(i2+=3, h.constEnd()); - QCOMPARE(i2-=3, h.constBegin()); - QCOMPARE(i2+0, h.constBegin()); + QCOMPARE(i2+=3, h.constEnd()); + QCOMPARE(i2-=3, h.constBegin()); + QCOMPARE(i2+0, h.constBegin()); QCOMPARE(i2+3, h.constEnd()); i2 += 3; i= i2-0; QCOMPARE(i, i2); i= i2-3; - QCOMPARE(i, h.constBegin()); - QCOMPARE(i2-i, 3); + QCOMPARE(i, h.constBegin()); + QCOMPARE(i2-i, 3); // QhullHyperplane is const-only } @@ -388,7 +388,7 @@ t_qhullHyperplane_iterator() void QhullHyperplane_test:: t_io() -{ +{ RboxPoints rcube("c"); { Qhull q(rcube, ""); @@ -409,7 +409,7 @@ t_io() //FIXUP -- Move conditional, QhullHyperplane code to QhullHyperplane.cpp #ifndef QHULL_NO_STL -std::vector<coordT> QhullHyperplane:: +std::vector<coordT> QhullHyperplane:: toStdVector() const { QhullHyperplaneIterator i(*this); diff --git a/cpp/qhulltest/QhullLinkedList_test.cpp b/cpp/qhulltest/QhullLinkedList_test.cpp index 6ec1bb6..dcd97ec 100644 --- a/cpp/qhulltest/QhullLinkedList_test.cpp +++ b/cpp/qhulltest/QhullLinkedList_test.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (f) 2009-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullLinkedList_test.cpp#14 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullLinkedList_test.cpp#15 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -48,7 +48,7 @@ cleanup() void QhullLinkedList_test:: t_construct() -{ +{ // QhullLinkedList vs; //private (compiler error). No memory allocation RboxPoints rcube("c"); { @@ -73,7 +73,7 @@ t_construct() void QhullLinkedList_test:: t_convert() -{ +{ RboxPoints rcube("c"); { Qhull q(rcube,"Qt QR0"); // triangulation of rotated unit cube @@ -106,7 +106,7 @@ t_convert() void QhullLinkedList_test:: t_element() -{ +{ RboxPoints rcube("c"); Qhull q(rcube,"QR0"); // rotated unit cube QhullVertexList vs = q.vertexList(); @@ -120,7 +120,7 @@ t_element() void QhullLinkedList_test:: t_search() -{ +{ RboxPoints rcube("c"); Qhull q(rcube,"QR0"); // rotated unit cube QhullVertexList vs = q.vertexList(); @@ -137,7 +137,7 @@ t_search() void QhullLinkedList_test:: t_iterator() -{ +{ RboxPoints rcube("c"); { Qhull q(rcube,"QR0"); // rotated unit cube @@ -180,15 +180,15 @@ t_iterator() QCOMPARE(i, i2--); QCOMPARE(i2, vs.begin()); QCOMPARE(--i, i2); - QCOMPARE(i2 += 8, vs.end()); - QCOMPARE(i2 -= 8, vs.begin()); - QCOMPARE(i2+0, vs.begin()); + QCOMPARE(i2 += 8, vs.end()); + QCOMPARE(i2 -= 8, vs.begin()); + QCOMPARE(i2+0, vs.begin()); QCOMPARE(i2+8, vs.end()); i2 += 8; i= i2-0; QCOMPARE(i, i2); i= i2-8; - QCOMPARE(i, vs.begin()); + QCOMPARE(i, vs.begin()); //vs.begin end tested above @@ -198,7 +198,7 @@ t_iterator() void QhullLinkedList_test:: t_const_iterator() -{ +{ RboxPoints rcube("c"); { Qhull q(rcube,"QR0"); // rotated unit cube @@ -235,16 +235,16 @@ t_const_iterator() QCOMPARE(i, i2--); QCOMPARE(i2, vs.constBegin()); QCOMPARE(--i, i2); - QCOMPARE(i2 += 8, vs.constEnd()); - QCOMPARE(i2 -= 8, vs.constBegin()); - QCOMPARE(i2+0, vs.constBegin()); + QCOMPARE(i2 += 8, vs.constEnd()); + QCOMPARE(i2 -= 8, vs.constBegin()); + QCOMPARE(i2+0, vs.constBegin()); QCOMPARE(i2+8, vs.constEnd()); i2 += 8; i= i2-0; QCOMPARE(i, i2); i= i2-8; - QCOMPARE(i, vs.constBegin()); - + QCOMPARE(i, vs.constBegin()); + // QhullVertexList is const-only } }//t_const_iterator @@ -278,7 +278,7 @@ t_QhullLinkedList_iterator() QVERIFY(i.hasNext()); QVERIFY(!i.hasPrevious()); - // i at front, i2 at end/back, 4 neighbors + // i at front, i2 at end/back, 4 neighbors QhullVertexList vs3 = q.vertexList(); // same as vs2 QhullVertex v3(vs3.first()); QhullVertex v4= vs3.first(); @@ -290,7 +290,7 @@ t_QhullLinkedList_iterator() QhullVertex v7(v6.next()); QhullVertex v8(vs3.last()); QCOMPARE(i2.peekPrevious(), v8); - i2.previous(); + i2.previous(); i2.previous(); i2.previous(); i2.previous(); @@ -317,7 +317,7 @@ t_QhullLinkedList_iterator() void QhullLinkedList_test:: t_io() -{ +{ RboxPoints rcube("c"); Qhull q(rcube,"QR0"); // rotated unit cube QhullVertexList vs(q.endVertex(), q.endVertex()); diff --git a/cpp/qhulltest/QhullPointSet_test.cpp b/cpp/qhulltest/QhullPointSet_test.cpp index 8dce75d..a51b122 100644 --- a/cpp/qhulltest/QhullPointSet_test.cpp +++ b/cpp/qhulltest/QhullPointSet_test.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (p) 2009-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullPointSet_test.cpp#8 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullPointSet_test.cpp#9 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -56,7 +56,7 @@ cleanup() void QhullPointSet_test:: t_construct() -{ +{ RboxPoints rcube("c W0 1000"); Qhull q(rcube,"Qc"); // cube with 1000 coplanar points int coplanarCount= 0; @@ -86,7 +86,7 @@ t_construct() void QhullPointSet_test:: t_convert() -{ +{ RboxPoints rcube("c W0 1000"); Qhull q(rcube,"Qc"); // cube with 1000 coplanar points QhullFacet f= q.firstFacet(); @@ -109,7 +109,7 @@ t_convert() void QhullPointSet_test:: t_element() -{ +{ RboxPoints rcube("c W0 1000"); Qhull q(rcube,"Qc"); // cube with 1000 coplanar points QhullFacet f= q.firstFacet(); @@ -139,7 +139,7 @@ t_element() void QhullPointSet_test:: t_iterator() -{ +{ RboxPoints rcube("c W0 1000"); Qhull q(rcube,"Qc"); // cube with 1000 coplanar points QhullFacet f= q.firstFacet(); @@ -206,16 +206,16 @@ t_iterator() QCOMPARE(i, i2--); QCOMPARE(i2, ps.begin()); QCOMPARE(--i, i2); - QCOMPARE(i2+=ps.count(), ps.end()); - QCOMPARE(i2-=ps.count(), ps.begin()); - QCOMPARE(i2+0, ps.begin()); + QCOMPARE(i2+=ps.count(), ps.end()); + QCOMPARE(i2-=ps.count(), ps.begin()); + QCOMPARE(i2+0, ps.begin()); QCOMPARE(i2+ps.count(), ps.end()); i2 += ps.count(); i= i2-0; QCOMPARE(i, i2); i= i2-ps.count(); - QCOMPARE(i, ps.begin()); - QCOMPARE(i2-i, ps.count()); + QCOMPARE(i, ps.begin()); + QCOMPARE(i2-i, ps.count()); //ps.begin end tested above @@ -224,7 +224,7 @@ t_iterator() void QhullPointSet_test:: t_const_iterator() -{ +{ RboxPoints rcube("c W0 1000"); Qhull q(rcube,"Qc"); // cube with 1000 coplanar points QhullFacet f= q.firstFacet(); @@ -242,7 +242,7 @@ t_const_iterator() QVERIFY(i==i2); i2= ps.end(); QVERIFY(i!=i2); - QhullPoint p= *i; // QhullPoint is the base class for QhullPointSet::iterator + QhullPoint p= *i; // QhullPoint is the base class for QhullPointSet::iterator QCOMPARE(p.dimension(), ps.dimension()); QCOMPARE(p, ps[0]); i2--; @@ -349,7 +349,7 @@ t_pointset_iterator() void QhullPointSet_test:: t_io() -{ +{ ostringstream os; RboxPoints rcube("c W0 120"); Qhull q(rcube,"Qc"); // cube with 100 coplanar points @@ -367,7 +367,7 @@ t_io() //FIXUP -- Move conditional, QhullPointSet code to QhullPointSet.cpp #ifndef QHULL_NO_STL -std::vector<QhullPoint> QhullPointSet:: +std::vector<QhullPoint> QhullPointSet:: toStdVector() const { QhullPointSetIterator i(*this); diff --git a/cpp/qhulltest/QhullPoint_test.cpp b/cpp/qhulltest/QhullPoint_test.cpp index 455b600..6393839 100644 --- a/cpp/qhulltest/QhullPoint_test.cpp +++ b/cpp/qhulltest/QhullPoint_test.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullPoint_test.cpp#15 $$Change: 1150 $ -** $DateTime: 2010/01/04 22:43:14 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullPoint_test.cpp#16 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -62,8 +62,8 @@ cleanup() void QhullPoint_test:: t_construct() -{ - // Qhull.runQhull() constructs QhullFacets as facetT +{ + // Qhull.runQhull() constructs QhullFacets as facetT QhullPoint p; QVERIFY(!p.isDefined()); QCOMPARE(p.dimension(),0); @@ -87,7 +87,7 @@ t_construct() void QhullPoint_test:: t_convert() -{ +{ RboxPoints rcube("c"); Qhull q(rcube,"Qt QR0"); // triangulation of rotated unit cube QhullVertex v= q.firstVertex(); @@ -106,7 +106,7 @@ t_convert() void QhullPoint_test:: t_readonly() -{ +{ RboxPoints rcube("c"); { Qhull q(rcube,"Qt QR0"); // triangulation of rotated unit cube @@ -119,7 +119,7 @@ t_readonly() QVERIFY(p.isDefined()); QCOMPARE(p.dimension(),3); QCOMPARE(id, p.id()); - QVERIFY(p.id()>=0 && p.id()<9); + QVERIFY(p.id()>=0 && p.id()<9); const coordT *c= p.coordinates(); coordT *c2= p.coordinates(); QCOMPARE(c, c2); @@ -134,7 +134,7 @@ t_readonly() void QhullPoint_test:: t_define() -{ +{ RboxPoints rcube("c"); { Qhull q(rcube,"Qt QR0"); // triangulation of rotated unit cube @@ -171,7 +171,7 @@ t_define() void QhullPoint_test:: t_operator() -{ +{ RboxPoints rcube("c"); Qhull q(rcube,"Qt QR0"); // triangulation of rotated unit cube const QhullPoint p= q.firstVertex().point(); @@ -180,7 +180,7 @@ t_operator() for(int k=p.dimension(); k--; ){ QCOMPARE(c[k], p[k]); } - //p[0]= 10.0; // compiler error, const + //p[0]= 10.0; // compiler error, const QhullPoint p2= q.firstVertex().point(); p2[0]= 10.0; // Overwrites point coordinate QCOMPARE(p2[0], 10.0); @@ -188,7 +188,7 @@ t_operator() void QhullPoint_test:: t_iterator() -{ +{ RboxPoints rcube("c"); { QhullPoint p2; @@ -250,16 +250,16 @@ t_iterator() QCOMPARE(i, i2--); QCOMPARE(i2, p.begin()); QCOMPARE(--i, i2); - QCOMPARE(i2 += 3, p.end()); - QCOMPARE(i2 -= 3, p.begin()); - QCOMPARE(i2+0, p.begin()); + QCOMPARE(i2 += 3, p.end()); + QCOMPARE(i2 -= 3, p.begin()); + QCOMPARE(i2+0, p.begin()); QCOMPARE(i2+3, p.end()); i2 += 3; i= i2-0; QCOMPARE(i, i2); i= i2-3; - QCOMPARE(i, p.begin()); - QCOMPARE(i2-i, 3); + QCOMPARE(i, p.begin()); + QCOMPARE(i2-i, 3); //p.begin end tested above @@ -269,7 +269,7 @@ t_iterator() void QhullPoint_test:: t_const_iterator() -{ +{ RboxPoints rcube("c"); { Qhull q(rcube,"QR0"); // rotated unit cube @@ -310,16 +310,16 @@ t_const_iterator() QCOMPARE(i, i2--); QCOMPARE(i2, p.constBegin()); QCOMPARE(--i, i2); - QCOMPARE(i2+=3, p.constEnd()); - QCOMPARE(i2-=3, p.constBegin()); - QCOMPARE(i2+0, p.constBegin()); + QCOMPARE(i2+=3, p.constEnd()); + QCOMPARE(i2-=3, p.constBegin()); + QCOMPARE(i2+0, p.constBegin()); QCOMPARE(i2+3, p.constEnd()); i2 += 3; i= i2-0; QCOMPARE(i, i2); i= i2-3; - QCOMPARE(i, p.constBegin()); - QCOMPARE(i2-i, 3); + QCOMPARE(i, p.constBegin()); + QCOMPARE(i2-i, 3); // QhullPoint is const-only } @@ -374,7 +374,7 @@ t_qhullpoint_iterator() void QhullPoint_test:: t_io() -{ +{ RboxPoints rcube("c"); { Qhull q(rcube, ""); @@ -394,7 +394,7 @@ t_io() //FIXUP -- Move conditional, QhullPoint code to QhullPoint.cpp #ifndef QHULL_NO_STL -std::vector<coordT> QhullPoint:: +std::vector<coordT> QhullPoint:: toStdVector() const { QhullPointIterator i(*this); diff --git a/cpp/qhulltest/QhullPoints_test.cpp b/cpp/qhulltest/QhullPoints_test.cpp index 10cc9a1..12b051c 100644 --- a/cpp/qhulltest/QhullPoints_test.cpp +++ b/cpp/qhulltest/QhullPoints_test.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (p) 2009-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullPoints_test.cpp#17 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullPoints_test.cpp#18 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -54,7 +54,7 @@ cleanup() void QhullPoints_test:: t_construct() -{ +{ QhullPoints ps; QCOMPARE(ps.dimension(), 0); QVERIFY(ps.isEmpty()); @@ -93,7 +93,7 @@ t_construct() void QhullPoints_test:: t_convert() -{ +{ //defineAs tested above coordT c[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0}; QhullPoints ps(3, 6, c); @@ -117,7 +117,7 @@ t_convert() void QhullPoints_test:: t_getset() -{ +{ //See t_construct for coordinates, count, defineAs, dimension, empty, isempty, ==, !=, size coordT c[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0}; QhullPoints ps(3, 6, c); @@ -158,7 +158,7 @@ t_getset() void QhullPoints_test:: t_element() -{ +{ coordT c[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0}; QhullPoints ps(2, 6, c); QhullPoint p(2, c); @@ -197,7 +197,7 @@ t_element() void QhullPoints_test:: t_iterator() -{ +{ coordT c[]= {0.0, 1.0, 2.0}; QhullPoints ps(1, 3, c); QhullPoints::Iterator i(ps); @@ -209,7 +209,7 @@ t_iterator() QVERIFY(i==i2); i2= ps.end(); QVERIFY(i!=i2); - QhullPoint p(i); // QhullPoint is the base class for QhullPoints::iterator + QhullPoint p(i); // QhullPoint is the base class for QhullPoints::iterator QCOMPARE(p.dimension(), ps.dimension()); QCOMPARE(p.coordinates(), ps.coordinates()); i2--; @@ -265,16 +265,16 @@ t_iterator() QCOMPARE(i, i2--); QCOMPARE(i2, ps.begin()); QCOMPARE(--i, i2); - QCOMPARE(i2+=3, ps.end()); - QCOMPARE(i2-=3, ps.begin()); - QCOMPARE(i2+0, ps.begin()); + QCOMPARE(i2+=3, ps.end()); + QCOMPARE(i2-=3, ps.begin()); + QCOMPARE(i2+0, ps.begin()); QCOMPARE(i2+3, ps.end()); i2 += 3; i= i2-0; QCOMPARE(i, i2); i= i2-3; - QCOMPARE(i, ps.begin()); - QCOMPARE(i2-i, 3); + QCOMPARE(i, ps.begin()); + QCOMPARE(i2-i, 3); //ps.begin end tested above @@ -283,7 +283,7 @@ t_iterator() void QhullPoints_test:: t_const_iterator() -{ +{ coordT c[]= {0.0, 1.0, 2.0}; const QhullPoints ps(1, 3, c); QhullPoints::ConstIterator i(ps); @@ -333,16 +333,16 @@ t_const_iterator() QCOMPARE(i, i2--); QCOMPARE(i2, ps.constBegin()); QCOMPARE(--i, i2); - QCOMPARE(i2+=3, ps.constEnd()); - QCOMPARE(i2-=3, ps.constBegin()); - QCOMPARE(i2+0, ps.constBegin()); + QCOMPARE(i2+=3, ps.constEnd()); + QCOMPARE(i2-=3, ps.constBegin()); + QCOMPARE(i2+0, ps.constBegin()); QCOMPARE(i2+3, ps.constEnd()); i2 += 3; i= i2-0; QCOMPARE(i, i2); i= i2-3; - QCOMPARE(i, ps.constBegin()); - QCOMPARE(i2-i, 3); + QCOMPARE(i, ps.constBegin()); + QCOMPARE(i2-i, 3); // QhullPoints is const-only }//t_const_iterator @@ -456,7 +456,7 @@ t_points_iterator() void QhullPoints_test:: t_io() -{ +{ QhullPoints ps; ostringstream os; os << "Empty QhullPoints\n" << ps << endl; @@ -478,7 +478,7 @@ t_io() //FIXUP -- Move conditional, QhullPoints code to QhullPoints.cpp #ifndef QHULL_NO_STL -std::vector<QhullPoint> QhullPoints:: +std::vector<QhullPoint> QhullPoints:: toStdVector() const { QhullPointsIterator i(*this); diff --git a/cpp/qhulltest/QhullRidge_test.cpp b/cpp/qhulltest/QhullRidge_test.cpp index e3e9de3..68ee138 100644 --- a/cpp/qhulltest/QhullRidge_test.cpp +++ b/cpp/qhulltest/QhullRidge_test.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullRidge_test.cpp#11 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullRidge_test.cpp#12 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -53,8 +53,8 @@ cleanup() void QhullRidge_test:: t_construct() -{ - // Qhull.runQhull() constructs QhullFacets as facetT +{ + // Qhull.runQhull() constructs QhullFacets as facetT QhullRidge r; QVERIFY(!r.isDefined()); QCOMPARE(r.dimension(),0); @@ -79,7 +79,7 @@ t_construct() void QhullRidge_test:: t_getSet() -{ +{ RboxPoints rcube("c"); { Qhull q(rcube,"QR0"); // triangulation of rotated unit cube @@ -93,7 +93,7 @@ t_getSet() cout << r.id() << endl; QVERIFY(r.bottomFacet()!=r.topFacet()); QCOMPARE(r.dimension(), 2); // Ridge one-dimension less than facet - QVERIFY(r.id()>=0 && r.id()<9*27); + QVERIFY(r.id()>=0 && r.id()<9*27); QVERIFY(r.isDefined()); QVERIFY(r==r); QVERIFY(r==i.peekPrevious()); @@ -108,7 +108,7 @@ t_getSet() void QhullRidge_test:: t_foreach() -{ +{ RboxPoints rcube("c"); // cube { Qhull q(rcube, "QR0"); // rotated cube @@ -141,7 +141,7 @@ t_foreach() void QhullRidge_test:: t_io() -{ +{ RboxPoints rcube("c"); { Qhull q(rcube, ""); diff --git a/cpp/qhulltest/QhullSet_test.cpp b/cpp/qhulltest/QhullSet_test.cpp index d7d6283..a948d4a 100644 --- a/cpp/qhulltest/QhullSet_test.cpp +++ b/cpp/qhulltest/QhullSet_test.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (f) 2009-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullSet_test.cpp#19 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullSet_test.cpp#20 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -52,7 +52,7 @@ cleanup() void QhullSet_test:: t_qhullsetbase() -{ +{ RboxPoints rcube("c"); { Qhull q(rcube,"Qt QR0"); // triangulation of rotated unit cube @@ -92,7 +92,7 @@ t_qhullsetbase() void QhullSet_test:: t_convert() -{ +{ RboxPoints rcube("c"); { Qhull q(rcube,"Qt QR0"); // triangulation of rotated unit cube @@ -118,7 +118,7 @@ t_convert() void QhullSet_test:: t_element() -{ +{ RboxPoints rcube("c"); Qhull q(rcube,"QR0"); // rotated unit cube QhullFacet f = q.beginFacet(); @@ -155,7 +155,7 @@ t_element() void QhullSet_test:: t_search() -{ +{ RboxPoints rcube("c"); Qhull q(rcube,"QR0"); // rotated unit cube QhullFacet f = q.beginFacet(); @@ -182,7 +182,7 @@ t_search() void QhullSet_test:: t_iterator() -{ +{ RboxPoints rcube("c"); { Qhull q(rcube,"QR0"); // rotated unit cube @@ -204,7 +204,7 @@ t_iterator() QCOMPARE(f2.id(), fs[3].id()); QhullFacetSet::Iterator i3(i2); QCOMPARE(*i2, *i3); - + (i3= i)++; QCOMPARE((*i3).id(), fs[1].id()); QVERIFY(i==i); @@ -213,7 +213,7 @@ t_iterator() QVERIFY(i<=i2); QVERIFY(i2>i); QVERIFY(i2>=i); - + QhullFacetSet::ConstIterator i4= fs.begin(); QVERIFY(i==i4); // iterator COMP const_iterator QVERIFY(i<=i4); @@ -243,16 +243,16 @@ t_iterator() QCOMPARE(i, i2--); QCOMPARE(i2, fs.begin()); QCOMPARE(--i, i2); - QCOMPARE(i2 += 4, fs.end()); - QCOMPARE(i2 -= 4, fs.begin()); - QCOMPARE(i2+0, fs.begin()); + QCOMPARE(i2 += 4, fs.end()); + QCOMPARE(i2 -= 4, fs.begin()); + QCOMPARE(i2+0, fs.begin()); QCOMPARE(i2+4, fs.end()); i2 += 4; i= i2-0; QCOMPARE(i, i2); i= i2-4; - QCOMPARE(i, fs.begin()); - QCOMPARE(i2-i, 4); + QCOMPARE(i, fs.begin()); + QCOMPARE(i2-i, 4); //fs.begin end tested above @@ -262,7 +262,7 @@ t_iterator() void QhullSet_test:: t_const_iterator() -{ +{ RboxPoints rcube("c"); { Qhull q(rcube,"QR0"); // rotated unit cube @@ -304,16 +304,16 @@ t_const_iterator() QCOMPARE(i, i2--); QCOMPARE(i2, fs.constBegin()); QCOMPARE(--i, i2); - QCOMPARE(i2+=4, fs.constEnd()); - QCOMPARE(i2-=4, fs.constBegin()); - QCOMPARE(i2+0, fs.constBegin()); + QCOMPARE(i2+=4, fs.constEnd()); + QCOMPARE(i2-=4, fs.constBegin()); + QCOMPARE(i2+0, fs.constBegin()); QCOMPARE(i2+4, fs.constEnd()); i2 += 4; i= i2-0; QCOMPARE(i, i2); i= i2-4; - QCOMPARE(i, fs.constBegin()); - QCOMPARE(i2-i, 4); + QCOMPARE(i, fs.constBegin()); + QCOMPARE(i2-i, 4); // QhullFacetSet is const-only } @@ -352,7 +352,7 @@ t_qhullset_iterator() QVERIFY(i.hasNext()); QVERIFY(!i.hasPrevious()); - // i at front, i2 at end/back, 4 neighbors + // i at front, i2 at end/back, 4 neighbors QhullFacetSet fs3 = f2.neighborFacets(); // same as fs2 QhullFacet f3(fs2[0]); QhullFacet f4= fs3[0]; @@ -382,7 +382,7 @@ t_qhullset_iterator() void QhullSet_test:: t_io() -{ +{ RboxPoints rcube("c"); Qhull q(rcube,"QR0"); // rotated unit cube // Fake an empty set. Default constructor not defined. No memory allocation. diff --git a/cpp/qhulltest/QhullVertexSet_test.cpp b/cpp/qhulltest/QhullVertexSet_test.cpp index e246073..5d65091 100644 --- a/cpp/qhulltest/QhullVertexSet_test.cpp +++ b/cpp/qhulltest/QhullVertexSet_test.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullVertexSet_test.cpp#3 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullVertexSet_test.cpp#4 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -52,7 +52,7 @@ cleanup() void QhullFacetSet_test:: t_construct() -{ +{ RboxPoints rcube("c"); Qhull q(rcube,"QR0"); // rotated unit cube QhullFacet f= q.firstFacet(); @@ -67,7 +67,7 @@ t_construct() void QhullFacetSet_test:: t_convert() -{ +{ RboxPoints rcube("c"); Qhull q(rcube,"QR0 QV2"); // rotated unit cube QhullFacet f= q.firstFacet(); @@ -89,7 +89,7 @@ t_convert() //! Spot check properties and read-only. See QhullSet_test void QhullFacetSet_test:: t_readonly() -{ +{ RboxPoints rcube("c"); Qhull q(rcube,"QV0"); // good facets are adjacent to point 0 QhullFacetSet fs= q.firstFacet().neighborFacets(); @@ -115,7 +115,7 @@ t_readonly() void QhullFacetSet_test:: t_foreach() -{ +{ RboxPoints rcube("c"); // Spot check predicates and accessors. See QhullLinkedList_test Qhull q(rcube,"QR0"); // rotated unit cube @@ -133,7 +133,7 @@ t_foreach() void QhullFacetSet_test:: t_io() -{ +{ RboxPoints rcube("c"); { Qhull q(rcube,"QR0 QV0"); // good facets are adjacent to point 0 @@ -149,7 +149,7 @@ t_io() //FIXUP -- Move conditional, QhullFacetSet code to QhullFacetSet.cpp #ifndef QHULL_NO_STL -std::vector<QhullFacet> QhullFacetSet:: +std::vector<QhullFacet> QhullFacetSet:: toStdVector() const { QhullSetIterator<QhullFacet> i(*this); diff --git a/cpp/qhulltest/QhullVertex_test.cpp b/cpp/qhulltest/QhullVertex_test.cpp index c78d40d..eb7f18c 100644 --- a/cpp/qhulltest/QhullVertex_test.cpp +++ b/cpp/qhulltest/QhullVertex_test.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullVertex_test.cpp#11 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullVertex_test.cpp#12 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ //pre-compiled headers @@ -55,8 +55,8 @@ cleanup() void QhullVertex_test:: t_constructConvert() -{ - // Qhull.runQhull() constructs QhullFacets as facetT +{ + // Qhull.runQhull() constructs QhullFacets as facetT QhullVertex v; QVERIFY(!v.isDefined()); QCOMPARE(v.dimension(),0); @@ -78,7 +78,7 @@ t_constructConvert() void QhullVertex_test:: t_getSet() -{ +{ RboxPoints rcube("c"); { Qhull q(rcube,"Qt QR0"); // triangulation of rotated unit cube @@ -92,7 +92,7 @@ t_getSet() const QhullVertex v= i.next(); cout << v.id() << endl; QCOMPARE(v.dimension(),3); - QVERIFY(v.id()>=0 && v.id()<9); + QVERIFY(v.id()>=0 && v.id()<9); QVERIFY(v.isDefined()); if(i.hasNext()){ QCOMPARE(v.next(), i.peekNext()); @@ -118,7 +118,7 @@ t_getSet() void QhullVertex_test:: t_foreach() -{ +{ RboxPoints rcube("c W0 300"); // 300 points on surface of cube { Qhull q(rcube, "QR0 Qc"); // keep coplanars, thick facet, and rotate the cube @@ -134,7 +134,7 @@ t_foreach() void QhullVertex_test:: t_io() -{ +{ RboxPoints rcube("c"); { Qhull q(rcube, ""); diff --git a/cpp/qhulltest/Qhull_test.cpp b/cpp/qhulltest/Qhull_test.cpp index 8de3de3..aa4530f 100644 --- a/cpp/qhulltest/Qhull_test.cpp +++ b/cpp/qhulltest/Qhull_test.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/Qhull_test.cpp#36 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/qhulltest/Qhull_test.cpp#37 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -56,7 +56,7 @@ cleanup() void Qhull_test:: t_construct() -{ +{ { Qhull q; QCOMPARE(q.dimension(),0); @@ -68,7 +68,7 @@ t_construct() QCOMPARE(q.area(),0.0); QFAIL("area() did not fail."); }catch (const std::exception &e) { - cout << "INFO : Caught " << e.what(); + cout << "INFO : Caught " << e.what(); } } { @@ -96,7 +96,7 @@ t_construct() void Qhull_test:: t_attribute() -{ +{ RboxPoints rcube("c"); { double normals[] = { @@ -123,7 +123,7 @@ t_attribute() //! No QhullMessage for errors outside of qhull void Qhull_test:: t_message() -{ +{ RboxPoints rcube("c"); { Qhull q; @@ -135,17 +135,17 @@ t_message() QFAIL("runQhull Fd did not fail."); }catch (const std::exception &e) { const char *s= e.what(); - cout << "INFO : Caught " << s; + cout << "INFO : Caught " << s; QCOMPARE(QString::fromStdString(s).left(6), QString("QH6029")); // Cleared when copied to QhullError - QVERIFY(!q.hasQhullMessage()); + QVERIFY(!q.hasQhullMessage()); // QCOMPARE(q.qhullMessage(), QString::fromStdString(s).remove(0, 7)); // QCOMPARE(q.qhullStatus(), 6029); q.clearQhullMessage(); // FIXUP -- review decision to clearQhullMessage at QhullError() QVERIFY(!q.hasQhullMessage()); } q.appendQhullMessage("Append 1"); - QVERIFY(q.hasQhullMessage()); + QVERIFY(q.hasQhullMessage()); QCOMPARE(QString::fromStdString(q.qhullMessage()), QString("Append 1")); q.appendQhullMessage("\nAppend 2\n"); QCOMPARE(QString::fromStdString(q.qhullMessage()), QString("Append 1\nAppend 2\n")); @@ -154,7 +154,7 @@ t_message() QCOMPARE(QString::fromStdString(q.qhullMessage()), QString("")); } { - cout << "INFO : Error stream without output stream\n"; + cout << "INFO : Error stream without output stream\n"; Qhull q; q.setErrorStream(&cout); q.setOutputStream(0); @@ -162,17 +162,17 @@ t_message() q.runQhull(rcube, "Fd"); QFAIL("runQhull Fd did not fail."); }catch (const QhullError &e) { - cout << "INFO : Caught " << e; + cout << "INFO : Caught " << e; QCOMPARE(e.errorCode(), 6029); } //FIXUP Qhullmessage cleared when QhullError thrown. Switched to e - //QVERIFY(q.hasQhullMessage()); + //QVERIFY(q.hasQhullMessage()); //QCOMPARE(QString::fromStdString(q.qhullMessage()).left(6), QString("QH6029")); q.clearQhullMessage(); QVERIFY(!q.hasQhullMessage()); } { - cout << "INFO : Error output sent to output stream without error stream\n"; + cout << "INFO : Error output sent to output stream without error stream\n"; Qhull q; q.setErrorStream(0); q.setOutputStream(&cout); @@ -181,18 +181,18 @@ t_message() QFAIL("runQhull TZ did not fail."); }catch (const std::exception &e) { const char *s= e.what(); - cout << "INFO : Caught " << s; + cout << "INFO : Caught " << s; QCOMPARE(QString::fromAscii(s).left(6), QString("QH6023")); } //FIXUP Qhullmessage cleared when QhullError thrown. Switched to e - //QVERIFY(q.hasQhullMessage()); + //QVERIFY(q.hasQhullMessage()); //QCOMPARE(QString::fromStdString(q.qhullMessage()).left(17), QString("qhull: no message")); //QCOMPARE(q.qhullStatus(), 6023); q.clearQhullMessage(); QVERIFY(!q.hasQhullMessage()); } { - cout << "INFO : No error stream or output stream\n"; + cout << "INFO : No error stream or output stream\n"; Qhull q; q.setErrorStream(0); q.setOutputStream(0); @@ -201,11 +201,11 @@ t_message() QFAIL("outputQhull did not fail."); }catch (const std::exception &e) { const char *s= e.what(); - cout << "INFO : Caught " << s; + cout << "INFO : Caught " << s; QCOMPARE(QString::fromAscii(s).left(6), QString("QH6029")); } //FIXUP Qhullmessage cleared when QhullError thrown. Switched to e - //QVERIFY(q.hasQhullMessage()); + //QVERIFY(q.hasQhullMessage()); //QCOMPARE(QString::fromStdString(q.qhullMessage()).left(9), QString("qhull err")); //QCOMPARE(q.qhullStatus(), 6029); q.clearQhullMessage(); @@ -215,7 +215,7 @@ t_message() void Qhull_test:: t_getSet() -{ +{ RboxPoints rcube("c"); { Qhull q; @@ -242,7 +242,7 @@ t_getSet() void Qhull_test:: t_getQh() -{ +{ RboxPoints rcube("c"); { Qhull q; @@ -269,7 +269,7 @@ t_getQh() void Qhull_test:: t_getValue() -{ +{ RboxPoints rcube("c"); { Qhull q; @@ -281,7 +281,7 @@ t_getValue() void Qhull_test:: t_foreach() -{ +{ RboxPoints rcube("c"); { Qhull q; @@ -314,7 +314,7 @@ t_foreach() void Qhull_test:: t_modify() -{ +{ //addPoint() tested in t_foreach RboxPoints diamond("d"); Qhull q(diamond, "o"); diff --git a/cpp/qhulltest/RboxPoints_test.cpp b/cpp/qhulltest/RboxPoints_test.cpp index 4ef0163..dd78394 100644 --- a/cpp/qhulltest/RboxPoints_test.cpp +++ b/cpp/qhulltest/RboxPoints_test.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2006-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/RboxPoints_test.cpp#19 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/qhulltest/RboxPoints_test.cpp#20 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ //pre-compiled headers @@ -45,7 +45,7 @@ add_RboxPoints_test() void RboxPoints_test:: t_construct() -{ +{ RboxPoints rp; QCOMPARE(rp.dimension(), 0); QCOMPARE(rp.count(), 0); @@ -67,16 +67,16 @@ t_construct() void RboxPoints_test:: t_error() -{ +{ RboxPoints rp; try{ rp.appendPoints("D0 c"); QFAIL("'D0 c' did not fail."); }catch (const std::exception &e) { const char *s= e.what(); - cout << "INFO : Caught " << s; + cout << "INFO : Caught " << s; QCOMPARE(QString(s).left(6), QString("QH6189")); - QVERIFY(rp.hasRboxMessage()); + QVERIFY(rp.hasRboxMessage()); QCOMPARE(QString::fromStdString(rp.rboxMessage()).left(8), QString("rbox err")); QCOMPARE(rp.rboxStatus(), 6189); rp.clearRboxMessage(); @@ -88,7 +88,7 @@ t_error() QFAIL("setDimension(-1) did not fail."); }catch (const RoadError &e) { const char *s= e.what(); - cout << "INFO : Caught " << s; + cout << "INFO : Caught " << s; QCOMPARE(QString(s).left(7), QString("QH10062")); QCOMPARE(e.errorCode(), 10062); QCOMPARE(QString::fromStdString(e.what()), QString(s)); @@ -99,13 +99,13 @@ t_error() void RboxPoints_test:: t_test() -{ +{ // isEmpty -- t_construct }//t_test void RboxPoints_test:: t_getSet() -{ +{ // comment -- t_construct // count -- t_construct // dimension -- t_construct @@ -120,7 +120,7 @@ t_getSet() rp.setDimension(102); QFAIL("setDimension(102) did not fail."); }catch (const std::exception &e) { - cout << "INFO : Caught " << e.what(); + cout << "INFO : Caught " << e.what(); } QCOMPARE(rp.newCount(), 0); rp.appendPoints("D2 P1 P2"); @@ -131,7 +131,7 @@ t_getSet() QCOMPARE(pc.dimension(), 2); QCOMPARE(pc.count(), 2); QVERIFY(rp==pc); - rp.setNewCount(10); // Normally only used by appendPoints for rbox processing + rp.setNewCount(10); // Normally only used by appendPoints for rbox processing QCOMPARE(rp.newCount(), 10); rp.reservePoints(); QVERIFY(rp==pc); @@ -139,7 +139,7 @@ t_getSet() void RboxPoints_test:: t_foreach() -{ +{ RboxPoints rp("c"); Coordinates::ConstIterator cci= rp.beginCoordinates(); orgQhull::Coordinates::Iterator ci= rp.beginCoordinates(); @@ -162,7 +162,7 @@ t_foreach() void RboxPoints_test:: t_change() -{ +{ RboxPoints rp("c D2"); stringstream s; s << "4 count" << endl; @@ -180,7 +180,7 @@ t_change() rp.appendPoints(s2); QFAIL("incomplete appendPoints() did not fail."); }catch (const std::exception &e) { - cout << "INFO : Caught " << e.what(); + cout << "INFO : Caught " << e.what(); } RboxPoints rp2; rp2.append(rp); @@ -202,7 +202,7 @@ t_change() void RboxPoints_test:: t_ostream() -{ +{ RboxPoints rp("c D2"); ostringstream oss; oss << rp; diff --git a/cpp/qhulltest/qhulltest.cpp b/cpp/qhulltest/qhulltest.cpp index 542a1db..e68ffcb 100644 --- a/cpp/qhulltest/qhulltest.cpp +++ b/cpp/qhulltest/qhulltest.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/qhulltest.cpp#53 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/qhulltest/qhulltest.cpp#54 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -11,7 +11,7 @@ #include <sstream> #include <string> #include <stdexcept> -#include "../road/RoadTest.h" +#include "../road/RoadTest.h" #include "../road/RoadError.h" @@ -48,9 +48,9 @@ void addQhullTests(QStringList &args) }//--all }//addQhullTests -int main(int argc, char *argv[]) -{ - QCoreApplication app(argc, argv); +int main(int argc, char *argv[]) +{ + QCoreApplication app(argc, argv); QStringList args= app.arguments(); addQhullTests(args); int status=1010; @@ -73,8 +73,8 @@ int main(int argc, char *argv[]) }//orgQhull -int main(int argc, char *argv[]) -{ +int main(int argc, char *argv[]) +{ return orgQhull::main(argc, argv); // Needs RoadTest:: for TESTadd_() linkage } diff --git a/cpp/road/RoadError.cpp b/cpp/road/RoadError.cpp index 7f43615..03c2e15 100644 --- a/cpp/road/RoadError.cpp +++ b/cpp/road/RoadError.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/road/RoadError.cpp#15 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/road/RoadError.cpp#16 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -19,7 +19,7 @@ using std::cerr; using std::cout; using std::string; -#ifdef _MSC_VER // Microsoft Visual C++ -- warning level 4 +#ifdef _MSC_VER // Microsoft Visual C++ -- warning level 4 #endif namespace orgQhull { @@ -37,7 +37,7 @@ global_log; #//Constructor RoadError:: -RoadError() +RoadError() : error_code(0) , log_event() , error_message() @@ -48,7 +48,7 @@ RoadError(const RoadError &e) : error_code(e.error_code) , log_event(e.log_event) , error_message(e.error_message) -{ +{ }//copy construct RoadError:: @@ -56,7 +56,7 @@ RoadError(int code, const std::string &message) : error_code(code) , log_event(message.c_str()) , error_message(log_event.toString(ROADtag, error_code)) -{ +{ log_event.cstr_1= error_message.c_str(); // overwrites initial value } @@ -84,7 +84,7 @@ RoadError(int code, const char *fmt, int d, int d2) RoadError:: RoadError(int code, const char *fmt, int d, int d2, float f) : error_code(code) -, log_event(fmt, d, d2, f) +, log_event(fmt, d, d2, f) , error_message() { } @@ -123,7 +123,7 @@ RoadError(int code, const char *fmt, int d, int d2, float f, double e) , error_message() { } -RoadError & RoadError:: +RoadError & RoadError:: operator=(const RoadError &e) { error_code= e.error_code; diff --git a/cpp/road/RoadError.h b/cpp/road/RoadError.h index ff9b552..03abd21 100644 --- a/cpp/road/RoadError.h +++ b/cpp/road/RoadError.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/road/RoadError.h#19 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/road/RoadError.h#20 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -22,7 +22,7 @@ namespace orgQhull { #//Types //! RoadError -- Report and log errors - //! See discussion in Saylan, G., "Practical C++ error handling in hybrid environments," Dr. Dobb's Journal, p. 50-55, March 2007. + //! See discussion in Saylan, G., "Practical C++ error handling in hybrid environments," Dr. Dobb's Journal, p. 50-55, March 2007. //! He uses an auto_ptr to track a stringstream. It constructs a string on the fly. RoadError uses the copy constructor to transform RoadLogEvent into a string class RoadError; diff --git a/cpp/road/RoadLogEvent.cpp b/cpp/road/RoadLogEvent.cpp index 9bf0023..a81201b 100644 --- a/cpp/road/RoadLogEvent.cpp +++ b/cpp/road/RoadLogEvent.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/road/RoadLogEvent.cpp#12 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/road/RoadLogEvent.cpp#13 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -19,7 +19,7 @@ using std::endl; using std::ostringstream; using std::string; -#ifdef _MSC_VER // Microsoft Visual C++ -- warning level 4 +#ifdef _MSC_VER // Microsoft Visual C++ -- warning level 4 #endif namespace orgQhull { @@ -91,13 +91,13 @@ toString(const char *tag, int code) const default: os << " ERROR_%" << c << "_not_defined_in_format"; break; - } + } } } if(s[-1]!='\n'){ os << endl; } - return os.str(); + return os.str(); }//toString #//Class helpers (static) diff --git a/cpp/road/RoadLogEvent.h b/cpp/road/RoadLogEvent.h index 514150c..bfe2cf6 100644 --- a/cpp/road/RoadLogEvent.h +++ b/cpp/road/RoadLogEvent.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/road/RoadLogEvent.h#11 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/road/RoadLogEvent.h#12 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -23,7 +23,7 @@ struct RoadLogEvent { public: #//Fields - const char *format_string; //! Format string (a literal with format codes, for logging) + const char *format_string; //! Format string (a literal with format codes, for logging) int int_1; //! Integer argument (%d, for logging) int int_2; //! Integer argument (%d, for logging) float float_1; //! Float argument (%f, for logging) diff --git a/cpp/road/RoadTest.cpp b/cpp/road/RoadTest.cpp index 15edfbb..d363c7f 100644 --- a/cpp/road/RoadTest.cpp +++ b/cpp/road/RoadTest.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/road/RoadTest.cpp#12 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/road/RoadTest.cpp#13 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -61,12 +61,12 @@ runTests(QStringList arguments) foreach(RoadTest *testcase, s_testcases){ try{ - result += QTest::qExec(testcase, arguments); + result += QTest::qExec(testcase, arguments); }catch(const std::exception &e){ cout << "FAIL! : Threw error "; cout << e.what() << endl; s_test_count++; - testcase->recordFailedTest(); + testcase->recordFailedTest(); // Qt 4.5.2 OK. In Qt 4.3.3, qtestcase did not clear currentTestObject } } diff --git a/cpp/road/RoadTest.h b/cpp/road/RoadTest.h index bc120b1..d0b340c 100644 --- a/cpp/road/RoadTest.h +++ b/cpp/road/RoadTest.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/road/RoadTest.h#14 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/road/RoadTest.h#15 $$Change: 1164 $ +** $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ ** ****************************************************************************/ @@ -34,7 +34,7 @@ class Name_test : public RoadTest private slots: void t_name(); //Executed before any test - void initTestCase(); + void initTestCase(); void init(); // Each test //Executed after each test void cleanup(); //RoadTest::cleanup(); @@ -57,7 +57,7 @@ class RoadTest : public QObject protected: #//class variable - static QList<RoadTest*> + static QList<RoadTest*> s_testcases; ///! List of testcases to execute. Initialized via add_...() static int s_test_count; ///! Total number of tests executed static int s_test_fail; ///! Number of failed tests @@ -69,15 +69,15 @@ public slots: public: #//constructor, destructor - RoadTest() { s_testcases.append(this); }; - ~RoadTest() { s_testcases.removeAll(this); }; + RoadTest() { s_testcases.append(this); }; + ~RoadTest() { s_testcases.removeAll(this); }; #//Helper void recordFailedTest(); #//class function - static int runTests(QStringList arguments); + static int runTests(QStringList arguments); };//RoadTest @@ -88,11 +88,11 @@ public: namespace QTest { -template<> -inline char * -toString(const std::string &s) -{ - return qstrdup(s.c_str()); +template<> +inline char * +toString(const std::string &s) +{ + return qstrdup(s.c_str()); } }//namespace QTest diff --git a/cpp/user_eg3.cpp b/cpp/user_eg3.cpp index 88111ef..43a5db1 100644 --- a/cpp/user_eg3.cpp +++ b/cpp/user_eg3.cpp @@ -49,10 +49,10 @@ For example\n\ -user_eg3- main procedure of user_eg3 application */ int main(int argc, char **argv) { - + if(argc==1){ - cout << prompt; - return 1; + cout << prompt; + return 1; } try{ return user_eg3(argc, argv); @@ -62,7 +62,7 @@ int main(int argc, char **argv) { } }//main -int user_eg3(int argc, char **argv) +int user_eg3(int argc, char **argv) { if(strcmp(argv[1], "eg-100")==0){ RboxPoints rbox; diff --git a/eg/q_test-ok.txt b/eg/q_test-ok.txt index d6d7486..f6232eb 100644 --- a/eg/q_test-ok.txt +++ b/eg/q_test-ok.txt @@ -2,7 +2,7 @@ echo === errors if 'user_eg' and 'user_eg2' not found === === errors if user_eg and user_eg2 not found === echo === check user_eg ${d:-`date`} ===================== date -=== check user_eg Wed Jan 6 20:32:58 EST 2010 ===================== +=== check user_eg Thu Jan 7 21:56:08 EST 2010 ===================== user_eg "QR1 p n Qt" "v p" Fp This is the output from user_eg.c @@ -61,139 +61,136 @@ input -0.74 -0.41 -0.52 compute 3-d Delaunay triangulation -seed: 1262827978 +seed: 1262919368 input --0.284 -0.937 -0.613 - 0.413 -0.668 0.0705 - 0.14 0.477 0.291 - 0.664 -0.849 0.757 - 0.638 -0.135 -0.0323 --0.809 0.26 0.855 - 0.953 0.301 0.936 - 0.392 0.976 -0.411 +-0.853 -0.46 0.928 + 0.484 0.527 -0.569 + 0.955 -0.63 0.0877 +-0.169 -0.34 -0.318 + 0.484 0.956 -0.315 +-0.207 0.945 -0.0709 +-0.335 -0.275 -0.978 + 0.708 0.127 0.772 3 11 --0.107122721676714 4.642012758895731 2.594014131991853 --1.143432268087588 0.4673409800796297 -0.7502417401774856 -0.07333064744704747 -0.1241567200549079 1.069448053241315 --0.4868070746917165 -0.2575061767744242 0.07616537619949211 --0.7890761620126147 -1.242379665518076 0.7718258022524666 --0.07233986329948129 -0.2903874968351289 0.7606758488539565 -0.3709567557844827 -0.1400449796017737 0.6901497505936796 -0.29614179471238 -0.1821717507120503 0.6544496282833386 -0.9785991222438674 0.6464362793808945 0.1386495456450708 --0.1831649785520406 0.1182376164616292 -0.6542706771096271 --0.2244108981135336 -0.134229004898564 -0.2398235548629705 - -8 vertices and 17 facets with normals: - -0.21 0.13 -0.26 0.93 - -0.02 0.87 0.49 -0.094 - -0.75 0.31 -0.49 -0.33 - -0.22 -0.04 -0.12 0.97 - 0.062 -0.1 0.9 -0.42 - 0.58 -0.13 -0.56 0.58 - -0.65 -0.34 0.1 -0.67 - -0.45 -0.72 0.44 -0.29 --0.075 -0.3 0.79 -0.52 - 0.39 -0.15 0.73 -0.53 - 0.33 -0.2 0.73 -0.56 - 0.76 0.5 0.11 -0.39 - 0.82 -0.15 -0.51 0.21 - -0.22 0.14 -0.77 -0.59 - -0.37 -0.22 -0.39 -0.82 - 0.76 -0.2 -0.58 0.22 - 0.75 -0.39 -0.52 0.09 +-1.650309701925787 -9.96156110001477 -1.246395145509007 +0.08723720662125217 -0.6560370789330168 0.6088334137228063 +0.6880659497827446 -0.4367443883796152 -0.8972178751668613 +1.8275598991067 0.5071952853358334 -0.0510912663712511 +0.467389368413527 -0.003758275135992077 0.02373591674656786 +-0.2311614135631412 0.1650476072727042 0.5133390853450056 +-1.628920827665618 0.2688091843114415 -0.2446481710148914 +0.2750464865955517 0.3775909308533857 0.1697321324387715 +0.1802729290864751 0.2479826293279265 0.1468821222095433 +-0.9233618948546398 2.351570427848397 -3.144696202222904 +-0.2660305667547745 0.3739158687749589 -0.5772967873921827 + +8 vertices and 16 facets with normals: + 0.12 0.0017 -0.3 0.95 + -0.16 -0.98 -0.12 -0.049 + 0.34 0.19 0.18 0.9 + 0.085 -0.64 0.59 -0.49 + 0.53 -0.0045 -0.72 0.45 + 0.52 -0.33 -0.68 -0.38 + 0.93 0.26 -0.026 -0.25 + 0.68 -0.0055 0.035 -0.73 +-0.0036 0.68 0.58 0.44 + -0.3 0.21 0.67 -0.65 + -0.44 0.41 -0.33 0.72 + -0.93 0.15 -0.14 -0.29 + 0.39 0.54 0.24 -0.71 + 0.3 0.41 0.24 -0.83 + -0.23 0.58 -0.77 -0.12 + -0.3 0.42 -0.65 -0.56 find 3-d Delaunay triangle closest to [0.5, 0.5, ...] - 0.64 -0.13 -0.03 - 0.14 0.48 0.29 - 0.39 0.98 -0.41 - 0.95 0.30 0.94 +-0.21 0.94 -0.07 + 0.48 0.53 -0.57 + 0.71 0.13 0.77 +-0.17 -0.34 -0.32 save first triangulation and compute a new triangulation -seed: 1262827979 +seed: 1262919369 input --0.284 -0.674 0.898 - -0.67 0.397 0.508 - 0.234 -0.166 -0.351 - 0.533 -0.0824 -0.204 - 0.3 -0.0657 0.0746 - 0.251 -0.397 0.87 - -0.28 0.435 -0.229 --0.235 0.154 -0.55 +-0.853 -0.197 0.439 +-0.599 -0.407 -0.132 +-0.951 0.727 -0.554 +-0.299 0.427 0.721 + 0.146 -0.975 -0.208 + 0.852 0.287 -0.0555 + 0.432 -0.141 -0.143 +0.0815 -0.695 0.632 3 -12 --0.5318247905139241 -0.3789926222692477 0.09689119901402704 -14.18050906035933 21.00050920804131 10.19021100269239 --0.2449106218239875 -0.1362278031044013 0.4796146924436587 -6.019740682265416 9.657431965223601 4.040955175646227 --0.4938454908232109 -0.2962072559865082 0.09349513909119164 --0.5160164454199128 -0.4430209930311082 0.06081216810905762 -1.125944674473549 -2.857784804064876 -0.2416058095684987 -0.5088821308870263 -1.206486240607808 0.08033463171387149 -0.2430625208148472 -1.117527237379534 0.1008723020956014 -0.3063880070395068 0.4482640498873325 -0.4440151470058987 -0.2353123883968058 0.3463716540105546 -0.2415762868804195 --0.1774340847016189 -0.03860147353887491 -0.08688633319034281 +11 +7.486757059063602 -0.8025420758782212 -28.7402061378259 +-0.02488002759246963 0.7444492068759935 -0.184252469577099 +-0.1040809948192905 -0.2756347492282451 -2.073429023154145 +-0.2557544692611101 0.3934714381790995 -0.1487920751033827 +1.727440784898959 -1.097868884797501 0.4243030309841424 +0.4844557181499234 0.06608493053259087 0.693762183054271 +-0.03092133996595983 -0.4682056892643358 0.07880021754302799 +-0.1214777129272572 -0.1081313419316735 0.2951464762167854 +-0.5478380537041357 0.3550317758098195 -0.008439244525016312 +-0.1761126844903194 -0.1298443529696475 0.3356201996385853 +-1.415693194209642 -2.354158650510546 0.6012968844263423 8 vertices and 16 facets with normals: - 0.31 0.36 -0.33 0.82 - -0.64 -0.46 0.12 -0.6 - 0.34 0.38 -0.29 0.81 - 0.52 0.77 0.37 -0.018 - -0.33 -0.18 0.64 -0.67 - 0.35 0.55 -0.3 0.69 - 0.5 0.8 0.33 -0.041 - -0.64 -0.39 0.12 -0.65 - 0.19 -0.45 -0.64 0.59 - -0.61 -0.52 0.072 -0.59 - 0.36 -0.92 -0.077 -0.16 - 0.36 -0.86 0.057 -0.36 - 0.19 -0.89 0.081 -0.4 - 0.36 0.52 -0.52 -0.58 - 0.34 0.5 -0.35 -0.72 - -0.33 -0.072 -0.16 -0.93 + 0.25 -0.027 -0.97 -0.017 +-0.027 0.81 -0.2 -0.55 +-0.048 -0.13 -0.96 -0.23 + -0.36 0.56 -0.21 -0.71 + 0.39 -0.094 0.2 0.9 + 0.32 0.14 0.47 0.81 + 0.8 -0.51 0.2 -0.23 + 0.49 0.067 0.7 -0.51 +-0.045 -0.68 0.11 -0.72 + -0.2 -0.18 0.49 -0.83 + -0.67 0.43 -0.01 -0.61 +-0.071 -0.0043 0.62 0.78 + -0.27 -0.2 0.52 -0.78 + -0.68 -0.62 -0.28 0.28 + -0.23 -0.45 0.26 0.83 + -0.5 -0.82 0.21 -0.18 save second triangulation and restore first one -8 vertices and 17 facets with normals: - -0.21 0.13 -0.26 0.93 - -0.02 0.87 0.49 -0.094 - -0.75 0.31 -0.49 -0.33 - -0.22 -0.04 -0.12 0.97 - 0.062 -0.1 0.9 -0.42 - 0.58 -0.13 -0.56 0.58 - -0.65 -0.34 0.1 -0.67 - -0.45 -0.72 0.44 -0.29 --0.075 -0.3 0.79 -0.52 - 0.39 -0.15 0.73 -0.53 - 0.33 -0.2 0.73 -0.56 - 0.76 0.5 0.11 -0.39 - 0.82 -0.15 -0.51 0.21 - -0.22 0.14 -0.77 -0.59 - -0.37 -0.22 -0.39 -0.82 - 0.76 -0.2 -0.58 0.22 - 0.75 -0.39 -0.52 0.09 +8 vertices and 16 facets with normals: + 0.12 0.0017 -0.3 0.95 + -0.16 -0.98 -0.12 -0.049 + 0.34 0.19 0.18 0.9 + 0.085 -0.64 0.59 -0.49 + 0.53 -0.0045 -0.72 0.45 + 0.52 -0.33 -0.68 -0.38 + 0.93 0.26 -0.026 -0.25 + 0.68 -0.0055 0.035 -0.73 +-0.0036 0.68 0.58 0.44 + -0.3 0.21 0.67 -0.65 + -0.44 0.41 -0.33 0.72 + -0.93 0.15 -0.14 -0.29 + 0.39 0.54 0.24 -0.71 + 0.3 0.41 0.24 -0.83 + -0.23 0.58 -0.77 -0.12 + -0.3 0.42 -0.65 -0.56 free first triangulation and restore second one. 8 vertices and 16 facets with normals: - 0.31 0.36 -0.33 0.82 - -0.64 -0.46 0.12 -0.6 - 0.34 0.38 -0.29 0.81 - 0.52 0.77 0.37 -0.018 - -0.33 -0.18 0.64 -0.67 - 0.35 0.55 -0.3 0.69 - 0.5 0.8 0.33 -0.041 - -0.64 -0.39 0.12 -0.65 - 0.19 -0.45 -0.64 0.59 - -0.61 -0.52 0.072 -0.59 - 0.36 -0.92 -0.077 -0.16 - 0.36 -0.86 0.057 -0.36 - 0.19 -0.89 0.081 -0.4 - 0.36 0.52 -0.52 -0.58 - 0.34 0.5 -0.35 -0.72 - -0.33 -0.072 -0.16 -0.93 + 0.25 -0.027 -0.97 -0.017 +-0.027 0.81 -0.2 -0.55 +-0.048 -0.13 -0.96 -0.23 + -0.36 0.56 -0.21 -0.71 + 0.39 -0.094 0.2 0.9 + 0.32 0.14 0.47 0.81 + 0.8 -0.51 0.2 -0.23 + 0.49 0.067 0.7 -0.51 +-0.045 -0.68 0.11 -0.72 + -0.2 -0.18 0.49 -0.83 + -0.67 0.43 -0.01 -0.61 +-0.071 -0.0043 0.62 0.78 + -0.27 -0.2 0.52 -0.78 + -0.68 -0.62 -0.28 0.28 + -0.23 -0.45 0.26 0.83 + -0.5 -0.82 0.21 -0.18 compute halfspace intersection about the origin for a diamond input as halfspace coefficients + offsets @@ -250,9 +247,9 @@ Voronoi diagram by the convex hull of 8 points in 4-d: Statistics for: | qhull s d Tcv v p Number of points processed: 8 - Number of hyperplanes created: 28 - Number of facets in hull: 17 - Number of distance tests for qhull: 35 + Number of hyperplanes created: 24 + Number of facets in hull: 16 + Number of distance tests for qhull: 36 CPU seconds to compute hull (after input): 0 @@ -262,19 +259,19 @@ all facets. Will make 88 distance computations. Voronoi diagram by the convex hull of 8 points in 4-d: Number of Voronoi regions: 8 - Number of Voronoi vertices: 12 + Number of Voronoi vertices: 11 Statistics for: | qhull s d Tcv v p Number of points processed: 8 - Number of hyperplanes created: 22 + Number of hyperplanes created: 24 Number of facets in hull: 16 - Number of distance tests for qhull: 29 + Number of distance tests for qhull: 32 CPU seconds to compute hull (after input): 0 -Output completed. Verifying that all points are below 8.1e-015 of -all facets. Will make 96 distance computations. +Output completed. Verifying that all points are below 1.1e-014 of +all facets. Will make 88 distance computations. Halfspace intersection by the convex hull of 8 points in 3-d: @@ -371,31 +368,31 @@ add points in a diamond 0 0 2 compute 2-d Delaunay triangulation -seed: 1262827978 +seed: 1262919369 8 vertices and 12 facets with normals: - 0.5 -0.0036 0.86 - -0.94 -0.33 0.064 - 0.56 0.14 0.81 - -0.23 0.86 -0.45 - 0.69 0.38 -0.62 - -0.26 0.84 -0.47 - -0.88 0.25 -0.39 - -0.37 0.3 -0.88 --0.025 -0.3 -0.95 --0.096 -0.29 -0.95 - 0.72 -0.6 0.34 - -0.53 -0.53 -0.66 + -0.63 0.49 -0.61 + -0.77 0.32 -0.55 + 0.23 0.88 0.42 + 0.45 0.11 -0.89 + 0.015 0.51 -0.86 + -0.79 -0.089 -0.61 + 0.47 0.063 0.88 + 0.84 -0.054 0.54 + -0.54 -0.53 0.65 + -0.57 -0.79 -0.24 +-0.089 -0.71 -0.7 + -0.15 -0.73 -0.67 2 8 --0.259496361687563 0.9528344385574261 -0.5490224770006654 0.3013148093005802 --0.2750696212613971 0.8979367376368015 --1.118619090455706 0.3190511096405528 --0.2132915806472766 0.1722858731592264 --0.01329395930930872 -0.1570034641305634 --0.0502384878542752 -0.1520557268483896 --0.397780133553935 -0.4034732257626989 +-0.5144418187613961 0.402213426322057 +-0.6965591570888112 0.2868713180068905 +0.2504704061481158 0.05922212544237453 +0.008428080594123664 0.2962244842024809 +-0.6437063340905285 -0.07263906698997066 +-1.180777197421119 -1.648755267762747 +-0.06372492322189324 -0.5096776961726223 +-0.1094820918128661 -0.5396823051418752 add points to triangulation added point p8: -1 -0.7369 1.543 @@ -411,31 +408,30 @@ added point p12: 0.3586 0.8694 0.8844 added point p13: -0.233 0.03883 0.0558 14 points, 0 extra points, 14 vertices, and 24 facets in total 2 -19 --0.259496361687563 0.9528344385574261 --0.2750696212613971 0.8979367376368015 --0.5353825561212637 -0.455971672228587 -0.7851077816595146 0.4040843218587615 -0.5190447766192479 0.3254714019535874 -0.84981005407999 -1.015913517586868 -0.4322617492664664 -0.456162908166885 --0.322530648104052 -0.5508484793660541 --1.244818200732448 -0.1645143912873466 --0.7893133737607369 0.5450370815051274 --0.7353291925675684 0.2569148861247563 --0.2589451145556475 0.9595553589764398 -1.059639137937667 0.5235896578957147 --0.2341685629474075 0.417508934673909 --0.4394328223799044 0.2089462777768801 -0.1565429254891246 0.08483328287170187 +18 +-0.6437063340905285 -0.07263906698997066 +-0.7906881323907262 -0.5039795275076754 +-0.2414076970437759 -0.4243469141467029 +0.2363075092450541 -0.7432406413491619 +-0.4309071632680435 -0.8708291050611805 +-0.4304876020318793 -0.8733859755953544 +0.2787094253964058 -0.313406970181112 +-0.5458190430525474 0.5893545880554811 +-0.6691203032763438 0.1002293878622461 +-4.455196333063841 0.1113826523423351 +-2.408314118343879 -0.06452458612658141 +0.08185399085589437 0.6511558665685923 +0.03763747862286312 0.4374189478933212 +-0.448957639791513 0.4525431579306378 +-0.5661920114774245 0.20516285980938 +0.1900204798083482 0.2898337330781518 +-0.1009919836125647 -0.2701997415319729 0.1161835094406035 -0.1623083804984112 --0.4863784325856633 -0.4372754871757206 --0.4419604743424794 -0.4395906521601979 find Delaunay triangle closest to [0.5, 0.5, ...] - 0.36 0.87 - 0.29 0.66 - 0.64 -0.13 +-0.23 0.04 + 0.51 -0.08 + 0.43 0.72 compute halfspace intersection about the origin for a diamond 3 @@ -517,31 +513,31 @@ Voronoi diagram by the convex hull of 8 points in 3-d: Statistics for: user_eg Delaunay | qhull s d Tcv v p Number of points processed: 8 - Number of hyperplanes created: 19 + Number of hyperplanes created: 21 Number of facets in hull: 12 - Number of distance tests for qhull: 30 + Number of distance tests for qhull: 27 CPU seconds to compute hull (after input): 0 -Output completed. Verifying that all points are below 5.4e-015 of +Output completed. Verifying that all points are below 6e-015 of all facets. Will make 64 distance computations. Voronoi diagram by the convex hull of 14 points in 3-d: Number of Voronoi regions: 14 - Number of Voronoi vertices: 19 + Number of Voronoi vertices: 18 Statistics for: user_eg Delaunay | qhull s d Tcv v p Number of points processed: 14 - Number of hyperplanes created: 49 + Number of hyperplanes created: 51 Number of facets in hull: 24 - Number of distance tests for qhull: 71 + Number of distance tests for qhull: 69 CPU seconds to compute hull (after input): 0 -Output completed. Verifying that all points are below 5.4e-015 of -all facets. Will make 266 distance computations. +Output completed. Verifying that all points are below 6e-015 of +all facets. Will make 252 distance computations. Halfspace intersection by the convex hull of 8 points in 3-d: @@ -585,11 +581,11 @@ Output completed. Verifying that all points are below outer planes of all facets. Will make 192 distance computations. echo === check front ends ${d:-`date`} ================== date -=== check front ends Wed Jan 6 20:32:58 EST 2010 ================== +=== check front ends Thu Jan 7 21:56:09 EST 2010 ================== qconvex - qconvex- compute the convex hull - http://www.qhull.org 2010.0.3 2010/01/05 + http://www.qhull.org 2010.1 2010/01/07 input (stdin): first lines: dimension and number of points (or vice-versa). @@ -702,7 +698,7 @@ Print options: - - one line descriptions of all options qconvex . -Qhull 2010.0.3 2010/01/05. +Qhull 2010.1 2010/01/07. Except for 'F.' and 'PG', upper-case options take an argument. incidences mathematica normals OFF_format points @@ -731,7 +727,7 @@ Except for 'F.' and 'PG', upper-case options take an argument. Angle_max Centrum_size Random_dist Ucoplanar_max Wide_outside qconvex -qconvex- compute the convex hull. Qhull 2010.0.3 2010/01/05 +qconvex- compute the convex hull. Qhull 2010.1 2010/01/07 input (stdin): dimension, number of points, point coordinates comments start with a non-numeric character @@ -792,7 +788,7 @@ Statistics for: rbox c D3 | qconvex s n Qt Number of distance tests for merging: 108 Number of distance tests for checking: 56 Number of merged facets: 6 - CPU seconds to compute hull (after input): 1.5e-005 + CPU seconds to compute hull (after input): 0 rbox c D2 | qconvex s i 4 @@ -836,7 +832,7 @@ Statistics for: rbox 1000 s | qconvex s Tv FA Number of points processed: 1000 Number of hyperplanes created: 5545 Number of distance tests for qhull: 25488 - CPU seconds to compute hull (after input): 0 + CPU seconds to compute hull (after input): 1.5e-005 Total facet area: 3.1201951 Total volume: 0.51650274 @@ -905,13 +901,13 @@ Convex hull of 24 points in 12-d: Number of vertices: 24 Number of facets: 4096 -Statistics for: rbox d G1 D12 | qconvex QR0 FA QR1262827979 +Statistics for: rbox d G1 D12 | qconvex QR0 FA QR1262919369 Number of points processed: 24 Number of hyperplanes created: 4108 Number of distance tests for qhull: 4216 Number of distance tests for merging: 121128 - Number of distance tests for checking: 98328 + Number of distance tests for checking: 196656 Number of merged facets: 2036 CPU seconds to compute hull (after input): 6.2e-005 Approximate facet area: 0.00035546337 @@ -938,19 +934,19 @@ Statistics for: rbox c D6 | qconvex FA TF500 Approximate volume: 1 -At 20:32:59 & 0 CPU secs, qhull has created 543 facets and merged 289. +At 21:56:09 & 0 CPU secs, qhull has created 543 facets and merged 289. The current hull contains 91 facets and 23 vertices. There are 41 outside points. Next is point p27(v24), 0.64 above f107. -At 20:32:59 & 0 CPU secs, qhull has created 1061 facets and merged 737. +At 21:56:09 & 0 CPU secs, qhull has created 1061 facets and merged 737. The current hull contains 69 facets and 33 vertices. There are 31 outside points. Next is point p22(v34), 0.52 above f610. -At 20:32:59 & 1.5e-005 CPU secs, qhull has created 1575 facets and merged 1230. +At 21:56:09 & 1.5e-005 CPU secs, qhull has created 1575 facets and merged 1230. The current hull contains 25 facets and 51 vertices. There are 13 outside points. Next is point p45(v52), 0.45 above f1476. -At 20:32:59 & 1.5e-005 CPU secs, qhull has created 1815 facets and merged 1457. +At 21:56:09 & 1.5e-005 CPU secs, qhull has created 1815 facets and merged 1457. The current hull contains 12 facets and 64 vertices. Last point was p35 Convex hull of 64 points in 6-d: @@ -971,7 +967,7 @@ Statistics for: rbox c D6 | qconvex FA TF500 First post-merge with 'C3.5e-015' and 'A1.8e+308' -At 20:32:59 & 1.5e-005 CPU secs, qhull has created 1815 facets and merged 1457. +At 21:56:09 & 1.5e-005 CPU secs, qhull has created 1815 facets and merged 1457. The current hull contains 12 facets and 64 vertices. Last point was p35 Testing all coplanar points. @@ -1057,12 +1053,12 @@ QH6029 qhull error: option 'Q0' is not used with this program. It may be used with qhull. While executing: | qconvex Q0 -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 768959753 +Options selected for Qhull 2010.1 2010/01/07: + run-id 157467836 qvoronoi - qvoronoi- compute the Voronoi diagram - http://www.qhull.org 2010.0.3 2010/01/05 + http://www.qhull.org 2010.1 2010/01/07 input (stdin): first lines: dimension and number of points (or vice-versa). @@ -1138,7 +1134,7 @@ Geomview options (2-d only) Gi - inner planes only Gn - no planes Go - outer planes only - Gc - centrums + Gc - centrums Gh - hyperplane intersections Gr - ridges GDn - drop dimension n in 3-d and 4-d output @@ -1158,7 +1154,7 @@ Print options: - - one line descriptions of all options qvoronoi . -Qhull 2010.0.3 2010/01/05. +Qhull 2010.1 2010/01/07. Except for 'F.' and 'PG', upper-case options take an argument. OFF_format p_vertices i_delaunay summary facet_dump @@ -1184,7 +1180,7 @@ Except for 'F.' and 'PG', upper-case options take an argument. Angle_max Centrum_size Random_dist Wide_outside qvoronoi -qvoronoi- compute the Voronoi diagram. Qhull 2010.0.3 2010/01/05 +qvoronoi- compute the Voronoi diagram. Qhull 2010.1 2010/01/07 input (stdin): dimension, number of points, point coordinates comments start with a non-numeric character @@ -1242,7 +1238,7 @@ Statistics for: rbox c P0 D2 | qvoronoi s o Number of distance tests for merging: 29 Number of distance tests for checking: 30 Number of merged facets: 1 - CPU seconds to compute hull (after input): 0 + CPU seconds to compute hull (after input): 1.5e-005 rbox c P0 D2 | qvoronoi Fi Tv 4 @@ -1415,7 +1411,7 @@ Statistics for: rbox P0 c D2 | qvoronoi s Fv QV0 qdelaunay - qdelaunay- compute the Delaunay triangulation - http://www.qhull.org 2010.0.3 2010/01/05 + http://www.qhull.org 2010.1 2010/01/07 input (stdin): first lines: dimension and number of points (or vice-versa). @@ -1496,7 +1492,7 @@ Geomview options (2-d and 3-d) Gi - inner planes only Gn - no planes Go - outer planes only - Gc - centrums + Gc - centrums Gh - hyperplane intersections Gr - ridges GDn - drop dimension n in 3-d and 4-d output @@ -1517,7 +1513,7 @@ Print options: - - one line descriptions of all options qdelaunay . -Qhull 2010.0.3 2010/01/05. +Qhull 2010.1 2010/01/07. Except for 'F.' and 'PG', upper-case options take an argument. incidences mathematica OFF_format points_lifted summary @@ -1545,7 +1541,7 @@ Except for 'F.' and 'PG', upper-case options take an argument. Angle_max Centrum_size Random_dist Wide_outside qdelaunay -qdelaunay- compute the Delaunay triangulation. Qhull 2010.0.3 2010/01/05 +qdelaunay- compute the Delaunay triangulation. Qhull 2010.1 2010/01/07 input (stdin): dimension, number of points, point coordinates comments start with a non-numeric character @@ -1600,7 +1596,7 @@ Statistics for: rbox c P0 D2 | qdelaunay s o Number of distance tests for merging: 29 Number of distance tests for checking: 30 Number of merged facets: 1 - CPU seconds to compute hull (after input): 0 + CPU seconds to compute hull (after input): 1.5e-005 rbox c P0 D2 | qdelaunay i 4 @@ -1820,7 +1816,7 @@ Statistics for: rbox P0 P0 c D2 | qdelaunay s FP QV0 qhalf - qhalf- compute the intersection of halfspaces about a point - http://www.qhull.org 2010.0.3 2010/01/05 + http://www.qhull.org 2010.1 2010/01/07 input (stdin): optional interior point: dimension, 1, coordinates @@ -1902,7 +1898,7 @@ Geomview output (2-d, 3-d and 4-d; dual convex hull) Gi - inner planes (i.e., halfspace intersections) only Gn - no planes Go - outer planes only - Gc - centrums + Gc - centrums Gh - hyperplane intersections Gr - ridges GDn - drop dimension n in 3-d and 4-d output @@ -1922,7 +1918,7 @@ Print options: - - one line descriptions of all options qhalf . -Qhull 2010.0.3 2010/01/05. +Qhull 2010.1 2010/01/07. Except for 'F.' and 'PG', upper_case options take an argument. incidences Geomview mathematica OFF_format point_dual @@ -1948,7 +1944,7 @@ Except for 'F.' and 'PG', upper_case options take an argument. Angle_max Centrum_size Random_dist Ucoplanar_max Wide_outside qhalf -qhalf- halfspace intersection about a point. Qhull 2010.0.3 2010/01/05 +qhalf- halfspace intersection about a point. Qhull 2010.1 2010/01/07 input (stdin): [dim, 1, interior point], dim+1, n, coefficients+offset comments start with a non-numeric character @@ -2098,7 +2094,7 @@ Statistics for: rbox d D2 | qhull FQ n | qhalf s H0 Fc FP Fn FN FQ Fv Fx echo === check quality of Qhull for ${d:-`hostname`} ${d:-`date`} hostname date -=== check quality of Qhull for ispy Wed Jan 6 20:33:00 EST 2010 +=== check quality of Qhull for ispy Thu Jan 7 21:56:11 EST 2010 rbox 1000 W0 | qhull QR2 QJ s Fs Tv 10 3 1000 144 284 144 284 0 0 33 0 2 5.045982607091334e-011 -5.045982607091334e-011 @@ -2113,7 +2109,7 @@ Statistics for: rbox 1000 W0 | qhull QR2 QJ s Fs Tv QR2 Number of points processed: 171 Number of hyperplanes created: 1233 Number of distance tests for qhull: 33563 - CPU seconds to compute hull (after input): 1.5e-005 + CPU seconds to compute hull (after input): 0 After 1 retries, input joggled by: 2.9e-011 @@ -2229,7 +2225,7 @@ Statistics for: rbox 1000 s | qhull C-0.02 Qc Tv Number of distance tests for merging: 2966 Number of distance tests for checking: 24231 Number of merged facets: 98 - CPU seconds to compute hull (after input): 0 + CPU seconds to compute hull (after input): 1.5e-005 Maximum distance of point above facet: 0.065 (1.1x) Maximum distance of vertex below facet: -0.062 (1.0x) @@ -2302,7 +2298,7 @@ Statistics for: rbox 100 s D6 | qhull C-0.001 Qx Qc Tv Number of distance tests for merging: 299744 Number of distance tests for checking: 66106 Number of merged facets: 3948 - CPU seconds to compute hull (after input): 0.000109 + CPU seconds to compute hull (after input): 9.3e-005 Maximum distance of point above facet: 0.0029 (0.5x) Maximum distance of vertex below facet: -0.014 (2.4x) @@ -2387,7 +2383,7 @@ Output completed. Verifying that all points are below outer planes of all facets. Will make 2220800 distance computations. echo === check input format etc. ${d:-`date`} date -=== check input format etc. Wed Jan 6 20:33:01 EST 2010 +=== check input format etc. Thu Jan 7 21:56:12 EST 2010 qhull <<EOF Convex hull of 4 points in 2-d: @@ -2426,8 +2422,8 @@ point, line 1 is the first comment, line 2 is the first long line. Continue wit QH6013 qhull input error: input is less than 2-dimensional since it has the same x coordinate While executing: #;laskdjf | qhull -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 768993367 _pre-merge _zero-centrum _max-width 2 +Options selected for Qhull 2010.1 2010/01/07: + run-id 157518257 _pre-merge _zero-centrum _max-width 2 Error-roundoff 1.7e-015 _one-merge 8.6e-015 _near-inside 4.3e-014 Visible-distance 3.4e-015 U-coplanar-distance 3.4e-015 Width-outside 6.9e-015 _wide-facet 2.1e-014 @@ -2439,8 +2435,8 @@ line, line 4 is the first long line. Continue with 3 points. QH6013 qhull input error: input is less than 2-dimensional since it has the same x coordinate While executing: #;laskdjf | qhull -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 768993367 _pre-merge _zero-centrum _max-width 2 +Options selected for Qhull 2010.1 2010/01/07: + run-id 157518257 _pre-merge _zero-centrum _max-width 2 Error-roundoff 1.7e-015 _one-merge 8.6e-015 _near-inside 4.3e-014 Visible-distance 3.4e-015 U-coplanar-distance 3.4e-015 Width-outside 6.9e-015 _wide-facet 2.1e-014 @@ -2540,7 +2536,7 @@ Output completed. Verifying that all points are below 2.5e-015 of all facets. Will make 99 distance computations. echo === check rbox ${d:-`date`} date -=== check rbox Wed Jan 6 20:33:01 EST 2010 +=== check rbox Thu Jan 7 21:56:12 EST 2010 rbox 3 n D2 2 3 @@ -2866,7 +2862,7 @@ Statistics for: rbox 1000 D4 | qhull s i A-0.97 C0.2 A0.7 Tcv Number of distance tests for merging: 76094 Number of distance tests for checking: 5989 Number of merged facets: 1889 - CPU seconds to compute hull (after input): 4.7e-005 + CPU seconds to compute hull (after input): 6.2e-005 Maximum distance of point above facet: 0.07 Maximum distance of vertex below facet: -0.92 (0.6x) @@ -2921,16 +2917,16 @@ Convex hull of 1000 points in 3-d: Number of facets: 26 Number of non-simplicial facets: 26 -Statistics for: rbox 1000 s t1262827982 | qhull Qm C0.05 Tcv +Statistics for: rbox 1000 s t1262919372 | qhull Qm C0.05 Tcv Number of points processed: 1000 - Number of hyperplanes created: 5484 - Number of distance tests for qhull: 56825 - Number of distance tests for merging: 99361 - Number of distance tests for checking: 6742 + Number of hyperplanes created: 5549 + Number of distance tests for qhull: 57315 + Number of distance tests for merging: 100158 + Number of distance tests for checking: 6696 Number of merged facets: 1970 CPU seconds to compute hull (after input): 3.1e-005 - Maximum distance of vertex below facet: -0.17 (1.2x) + Maximum distance of vertex below facet: -0.19 (1.3x) Output completed. Verifying that all points are below outer planes of @@ -3318,7 +3314,7 @@ Statistics for: rbox c D5 | qhull Tcv C-0 Number of distance tests for merging: 4130 Number of distance tests for checking: 352 Number of merged facets: 210 - CPU seconds to compute hull (after input): 1.5e-005 + CPU seconds to compute hull (after input): 0 Output completed. Verifying that all points are below outer planes of @@ -3578,7 +3574,7 @@ Statistics for: rbox 100 r s Z1 G0.1 | qhull Tcv C-0 Number of distance tests for merging: 38388 Number of distance tests for checking: 11601 Number of merged facets: 328 - CPU seconds to compute hull (after input): 4.6e-005 + CPU seconds to compute hull (after input): 3.1e-005 Output completed. Verifying that all points are below outer planes of @@ -3595,7 +3591,7 @@ Statistics for: rbox 100 s Z1 G0.1 | qhull Tcv Number of points processed: 101 Number of hyperplanes created: 460 Number of distance tests for qhull: 1622 - CPU seconds to compute hull (after input): 0 + CPU seconds to compute hull (after input): 1.5e-005 Output completed. Verifying that all points are below 2.1e-015 of @@ -3616,13 +3612,13 @@ Statistics for: rbox 100 s Z1e-5 G0.1 | qhull Tc Pp Number of distance tests for merging: 2108 Number of distance tests for checking: 1274 Number of merged facets: 3 - CPU seconds to compute hull (after input): 1.5e-005 + CPU seconds to compute hull (after input): 0 Maximum distance of vertex below facet: -1.1e-015 (0.3x) echo === check qhull output formats ${d:-`date`} date -=== check qhull output formats Wed Jan 6 20:33:03 EST 2010 +=== check qhull output formats Thu Jan 7 21:56:13 EST 2010 rbox 5 r s D2 | qhull Tcv Convex hull of 5 points in 2-d: @@ -4331,7 +4327,7 @@ Statistics for: rbox 1000 s D2 | qhull FA Tcv Number of points processed: 1000 Number of hyperplanes created: 1998 Number of distance tests for qhull: 13978 - CPU seconds to compute hull (after input): 0 + CPU seconds to compute hull (after input): 1.5e-005 Total facet area: 3.1415592 Total volume: 0.7853647 @@ -4350,7 +4346,7 @@ Statistics for: rbox 1000 s | qhull FA Tcv Number of points processed: 1000 Number of hyperplanes created: 5545 Number of distance tests for qhull: 25488 - CPU seconds to compute hull (after input): 0 + CPU seconds to compute hull (after input): 1.5e-005 Total facet area: 3.1201951 Total volume: 0.51650274 @@ -4396,7 +4392,7 @@ Statistics for: rbox c D5 | qhull FA Tcv Number of distance tests for merging: 2775 Number of distance tests for checking: 352 Number of merged facets: 210 - CPU seconds to compute hull (after input): 0 + CPU seconds to compute hull (after input): 1.5e-005 Approximate facet area: 10 Approximate volume: 1 @@ -4641,8 +4637,8 @@ rbox 6 s D3 | qhull C-0.1 Qc FF s FQ Fi n Fo FQ FI Fm Fn FN FO FO FQ Fs FS FV Fv 1 1 3 2 0 1 3 3 0 1 -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 769043788 Centrum-premerge- 0.1 Qcoplanar-keep FFacets-xridge +Options selected for Qhull 2010.1 2010/01/07: + run-id 157551871 Centrum-premerge- 0.1 Qcoplanar-keep FFacets-xridge summary FQhull Finner normals Fouter FQhull FIDs Fmerges Fneighbors FNeighbors-vertex FOptions FQhull Fsummary FSize FVertex-average Tcheck-frequently Tverify Fvertices _max-width 0.86 @@ -4661,8 +4657,8 @@ rbox 6 s D3 | qhull C-0.1 Qc FF s FQ Fi n Fo FQ FI Fm Fn FN FO FO FQ Fs FS FV Fv 3 2 5 4 3 2 1 4 3 2 1 5 -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 769043788 Centrum-premerge- 0.1 Qcoplanar-keep FFacets-xridge +Options selected for Qhull 2010.1 2010/01/07: + run-id 157551871 Centrum-premerge- 0.1 Qcoplanar-keep FFacets-xridge summary FQhull Finner normals Fouter FQhull FIDs Fmerges Fneighbors FNeighbors-vertex FOptions FQhull Fsummary FSize FVertex-average Tcheck-frequently Tverify Fvertices _max-width 0.86 @@ -4711,7 +4707,7 @@ QH7055 qhull warning: no facets printed echo === test Qt ${d:-`date`} date -=== test Qt Wed Jan 6 20:33:04 EST 2010 +=== test Qt Thu Jan 7 21:56:14 EST 2010 rbox c | qhull Qt s o Tcv 3 8 12 18 @@ -5317,8 +5313,8 @@ rbox c | qhull Qt C-0.1 Qc FF s FQ Fi n Fo FQ FI Fm Fn FN FO FO FQ Fs FS FV Fv T 6 11 5 4 2 3 10 6 9 5 4 1 0 8 3 11 5 9 -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 769043788 Qtriangulate Centrum-premerge- 0.1 Qcoplanar-keep +Options selected for Qhull 2010.1 2010/01/07: + run-id 157568678 Qtriangulate Centrum-premerge- 0.1 Qcoplanar-keep FFacets-xridge summary FQhull Finner normals Fouter FQhull FIDs Fmerges Fneighbors FNeighbors-vertex FOptions FQhull Fsummary FSize FVertex-average Tcheck-frequently Tverify Fvertices _max-width 1 @@ -5345,8 +5341,8 @@ rbox c | qhull Qt C-0.1 Qc FF s FQ Fi n Fo FQ FI Fm Fn FN FO FO FQ Fs FS FV Fv T 3 3 6 7 3 3 5 1 3 3 5 7 -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 769043788 Qtriangulate Centrum-premerge- 0.1 Qcoplanar-keep +Options selected for Qhull 2010.1 2010/01/07: + run-id 157568678 Qtriangulate Centrum-premerge- 0.1 Qcoplanar-keep FFacets-xridge summary FQhull Finner normals Fouter FQhull FIDs Fmerges Fneighbors FNeighbors-vertex FOptions FQhull Fsummary FSize FVertex-average Tcheck-frequently Tverify Fvertices _max-width 1 @@ -5378,8 +5374,8 @@ all facets. Will make 96 distance computations. rbox 6 r s c G0.1 D2 P0.1,0.1 | qhull s FP d FO Qt 1 0 10 16 0 -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 769043788 summary FPoint-nearest delaunay Qtriangulate _pre-merge +Options selected for Qhull 2010.1 2010/01/07: + run-id 157568678 summary FPoint-nearest delaunay Qtriangulate _pre-merge _zero-centrum Pgood Qcoplanar _max-width 1 Error-roundoff 6.9e-016 _one-merge 4.9e-015 _near-inside 2.4e-014 Visible-distance 1.4e-015 U-coplanar-distance 1.4e-015 Width-outside 2.8e-015 _wide-facet 8.3e-015 @@ -5426,7 +5422,7 @@ all facets. Will make 8600 distance computations. echo === test unbounded intersection ${d:-`date`} date -=== test unbounded intersection Wed Jan 6 20:33:04 EST 2010 +=== test unbounded intersection Thu Jan 7 21:56:15 EST 2010 rbox c | qhull PD0:0.5 n | qhull H0 Fp Tcv 3 5 @@ -5472,7 +5468,7 @@ Statistics for: rbox 1000 W1e-3 D3 | qhull PA8 Fa FS s n Tcv Number of points processed: 203 Number of hyperplanes created: 1043 Number of distance tests for qhull: 21470 - CPU seconds to compute hull (after input): 1.5e-005 + CPU seconds to compute hull (after input): 0 Total facet area: 5.8817432 Total volume: 0.99685163 @@ -5525,8 +5521,8 @@ Output completed. Verifying that all points are below outer planes of all facets. Will make 8000 distance computations. rbox 10 | qhull FO Tz TO q_test.log.1 cat q_test.log.1 -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 769043788 Tz-stdout TOutput-file q_test.log.1 _pre-merge +Options selected for Qhull 2010.1 2010/01/07: + run-id 157568678 Tz-stdout TOutput-file q_test.log.1 _pre-merge _zero-centrum _max-width 0.92 Error-roundoff 6.8e-016 _one-merge 4.8e-015 _near-inside 2.4e-014 Visible-distance 1.4e-015 U-coplanar-distance 1.4e-015 Width-outside 2.7e-015 _wide-facet 8.2e-015 @@ -5546,7 +5542,7 @@ Statistics for: rbox 10 | qhull FO Tz TO q_test.log.1 echo === check Delaunay/Voronoi ${d:-`date`} date -=== check Delaunay/Voronoi Wed Jan 6 20:33:04 EST 2010 +=== check Delaunay/Voronoi Thu Jan 7 21:56:15 EST 2010 rbox 10 D2 | qhull d Tcv Delaunay triangulation by the convex hull of 10 points in 3-d: @@ -6185,7 +6181,7 @@ Vertices and facets: echo === check Halfspace ${d:-`date`} date -=== check Halfspace Wed Jan 6 20:33:05 EST 2010 +=== check Halfspace Thu Jan 7 21:56:16 EST 2010 rbox 100 s D4 | qhull FA FV n s Tcv | qhull H Fp Tcv | qhull FA Tcv Convex hull of 100 points in 4-d: @@ -6288,7 +6284,7 @@ all facets. Will make 25 distance computations. echo === check qhull ${d:-`date`} date -=== check qhull Wed Jan 6 20:33:05 EST 2010 +=== check qhull Thu Jan 7 21:56:16 EST 2010 rbox 10 s D3 | qhull Tcv Convex hull of 10 points in 3-d: @@ -6369,7 +6365,7 @@ Convex hull of 10 points in 3-d: Number of vertices: 10 Number of facets: 16 -Statistics for: rbox 10 s D3 | qhull QR-1 QR-1262827985 +Statistics for: rbox 10 s D3 | qhull QR-1 QR-1262919376 Number of points processed: 10 Number of hyperplanes created: 29 @@ -6394,8 +6390,8 @@ rbox 1000 D3 | qhull Tcvs qhull invoked by: rbox 1000 D3 | qhull Tcvs -2010.0.3 2010/01/05 with options: - run-id 769060595 Tcheck-frequently Tverify Tstatistics _pre-merge +2010.1 2010/01/07 with options: + run-id 157585485 Tcheck-frequently Tverify Tstatistics _pre-merge _zero-centrum _max-width 1 Error-roundoff 6.9e-016 _one-merge 4.9e-015 _near-inside 2.4e-014 Visible-distance 1.4e-015 U-coplanar-distance 1.4e-015 Width-outside 2.8e-015 _wide-facet 8.3e-015 @@ -6497,7 +6493,7 @@ statistics for merging -6.9e-016 max distance of merged vertex below facet(or roundoff) memory usage statistics(in bytes) - 21584 for facets a + 21584 for facets and Convex hull of 1000 points in 3-d: Number of vertices: 73 @@ -6510,7 +6506,7 @@ Statistics for: rbox 1000 D3 | qhull Tcvs Number of distance tests for qhull: 12884 CPU seconds to compute hull (after input): 0 -nd their normals, neighbor and vertex sets + their normals, neighbor and vertex sets 1752 for vertices and their neighbor sets 30368 for input points and outside and coplanar sets @@ -6543,7 +6539,7 @@ qh_mem 004B0170 n 1022 free short: 88 bytes (tot 8984 cnt 228) qh_mem 004B01C8 n 1023 free short: 88 bytes (tot 8896 cnt 227) qh_mem 004B0220 n 1024 free short: 88 bytes (tot 8808 cnt 226) qh_mem 004B0278 n 1025 free short: 88 bytes (tot 8720 cnt 225) -qh_mem 003E72E8 n 30 free long: 96 bytes (tot 0 cnt 0) +qh_mem 003E7328 n 30 free long: 96 bytes (tot 0 cnt 0) qh_mem 004B02D0 n 1026 free short: 16 bytes (tot 8704 cnt 224) qh_mem 004B0050 n 1027 free short: 88 bytes (tot 8616 cnt 223) qh_mem 004B00A8 n 1028 free short: 88 bytes (tot 8528 cnt 222) @@ -6614,8 +6610,8 @@ qh_readpoints: read in 100 3-dimensional points qh_initqhull_globals: for rbox 100 s D3 | qhull T1cvV2P2 Trace level 1 for rbox 100 s D3 | qhull T1cvV2P2 -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 769060595 Tcheck-frequently Tverify TV-stop-after-point 2 +Options selected for Qhull 2010.1 2010/01/07: + run-id 157585485 Tcheck-frequently Tverify TV-stop-after-point 2 Trace-point 2 _pre-merge _zero-centrum _max-width 0.94 Error-roundoff 6.7e-016 _one-merge 4.7e-015 _near-inside 2.3e-014 Visible-distance 1.3e-015 U-coplanar-distance 1.3e-015 @@ -6665,19 +6661,19 @@ Statistics for: rbox 100 s D3 | qhull TcvF100 CPU seconds to compute hull (after input): 0 -At 20:33:05 & 0 CPU secs, qhull has created 102 facets and merged 0. +At 21:56:16 & 0 CPU secs, qhull has created 102 facets and merged 0. The current hull contains 46 facets and 25 vertices. There are 75 outside points. Next is point p55(v26), 0.035 above f44. -At 20:33:05 & 0 CPU secs, qhull has created 203 facets and merged 0. +At 21:56:16 & 0 CPU secs, qhull has created 203 facets and merged 0. The current hull contains 86 facets and 45 vertices. There are 55 outside points. Next is point p82(v46), 0.067 above f117. -At 20:33:05 & 0 CPU secs, qhull has created 306 facets and merged 0. +At 21:56:16 & 0 CPU secs, qhull has created 306 facets and merged 0. The current hull contains 122 facets and 63 vertices. There are 37 outside points. Next is point p50(v64), 0.042 above f218. -At 20:33:05 & 0 CPU secs, qhull has created 412 facets and merged 0. +At 21:56:16 & 0 CPU secs, qhull has created 412 facets and merged 0. The current hull contains 160 facets and 82 vertices. There are 18 outside points. Next is point p60(v83), 0.031 above f307. @@ -6746,7 +6742,7 @@ Statistics for: rbox 100 D5 | qhull Qs Tcv Number of points processed: 85 Number of hyperplanes created: 4015 Number of distance tests for qhull: 8584 - CPU seconds to compute hull (after input): 0 + CPU seconds to compute hull (after input): 1.5e-005 QH7076 qhull input warning: exact merge ('Qx'). Verify may report that a point is outside of a facet. See qh-optq.htm#Qx @@ -7032,8 +7028,8 @@ Statistics for: rbox 100 D3 | qhull QbB FO Tcv Number of distance tests for qhull: 1164 CPU seconds to compute hull (after input): 0 -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 769077402 QbBound-unit-box 0.5 Tcheck-frequently Tverify +Options selected for Qhull 2010.1 2010/01/07: + run-id 157602292 QbBound-unit-box 0.5 Tcheck-frequently Tverify _pre-merge _zero-centrum _max-width 1 Error-roundoff 6.9e-016 _one-merge 4.9e-015 _near-inside 2.4e-014 Visible-distance 1.4e-015 U-coplanar-distance 1.4e-015 Width-outside 2.8e-015 _wide-facet 8.3e-015 @@ -7055,8 +7051,8 @@ Statistics for: rbox 1000 D2 B1e6 | qhull d Qbb FO Tcv Number of distance tests for qhull: 27767 CPU seconds to compute hull (after input): 1.5e-005 -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 769077402 delaunay Qbbound-last Tcheck-frequently Tverify +Options selected for Qhull 2010.1 2010/01/07: + run-id 157602292 delaunay Qbbound-last Tcheck-frequently Tverify _pre-merge _zero-centrum Pgood _max-width 2e+006 Error-roundoff 2.8e-009 _one-merge 1.9e-008 _near-inside 9.7e-008 Visible-distance 5.5e-009 U-coplanar-distance 5.5e-009 Width-outside 1.1e-008 _wide-facet 3.3e-008 @@ -7206,7 +7202,7 @@ Output completed. Verifying that all points are below 1.3e-015 of all facets. Will make 40 distance computations. echo "== next command will error ${d:-`date`} ==" date -== next command will error Wed Jan 6 20:33:06 EST 2010 == +== next command will error Thu Jan 7 21:56:17 EST 2010 == rbox 10 D2 | qhull Qb1:1B1:1 Tcv QH6154 qhull precision error: initial facet 1 is coplanar with the interior point ERRONEOUS FACET: @@ -7218,8 +7214,8 @@ ERRONEOUS FACET: - neighboring facets: f2 f3 While executing: rbox 10 D2 | qhull Qb1:1B1:1 Tcv -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 769077402 Qbound-dim-low 1 1 QBound-dim-high 1 1 +Options selected for Qhull 2010.1 2010/01/07: + run-id 157602292 Qbound-dim-low 1 1 QBound-dim-high 1 1 Tcheck-frequently Tverify _pre-merge _zero-centrum _max-width 0.81 Error-roundoff 8.6e-016 _one-merge 4.3e-015 _near-inside 2.1e-014 Visible-distance 1.7e-015 U-coplanar-distance 1.7e-015 @@ -7279,15 +7275,15 @@ Convex hull of 200 points in 2-d: Number of vertices: 200 Number of facets: 200 -Statistics for: rbox 200 L20 D2 t1262827986 | qhull FO Tcv C-0 +Statistics for: rbox 200 L20 D2 t1262919377 | qhull FO Tcv C-0 Number of points processed: 200 Number of hyperplanes created: 398 - Number of distance tests for qhull: 2106 + Number of distance tests for qhull: 2125 CPU seconds to compute hull (after input): 0 -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 769077402 Tcheck-frequently Tverify Centrum-premerge- 0 +Options selected for Qhull 2010.1 2010/01/07: + run-id 157602292 Tcheck-frequently Tverify Centrum-premerge- 0 _zero-centrum _max-width 1 Error-roundoff 3.4e-016 _one-merge 1.7e-015 _near-inside 8.5e-015 Visible-distance 6.8e-016 U-coplanar-distance 6.8e-016 Width-outside 1.4e-015 _wide-facet 4.1e-015 @@ -7298,121 +7294,121 @@ rbox 1000 L20 t | qhull FO Tcv C-0 Convex hull of 1000 points in 3-d: - Number of vertices: 57 - Number of facets: 110 + Number of vertices: 37 + Number of facets: 70 -Statistics for: rbox 1000 L20 t1262827986 | qhull FO Tcv C-0 +Statistics for: rbox 1000 L20 t1262919377 | qhull FO Tcv C-0 - Number of points processed: 77 - Number of hyperplanes created: 330 - Number of distance tests for qhull: 15606 + Number of points processed: 44 + Number of hyperplanes created: 167 + Number of distance tests for qhull: 12549 CPU seconds to compute hull (after input): 0 -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 769077402 Tcheck-frequently Tverify Centrum-premerge- 0 +Options selected for Qhull 2010.1 2010/01/07: + run-id 157602292 Tcheck-frequently Tverify Centrum-premerge- 0 _zero-centrum _max-width 1 Error-roundoff 6.9e-016 _one-merge 4.8e-015 _near-inside 2.4e-014 Visible-distance 1.4e-015 U-coplanar-distance 1.4e-015 Width-outside 2.8e-015 _wide-facet 8.3e-015 Output completed. Verifying that all points are below outer planes of -all facets. Will make 110000 distance computations. +all facets. Will make 70000 distance computations. rbox 200 L20 D4 t | qhull FO Tcv C-0 Convex hull of 200 points in 4-d: - Number of vertices: 61 - Number of facets: 299 + Number of vertices: 62 + Number of facets: 278 -Statistics for: rbox 200 L20 D4 t1262827986 | qhull FO Tcv C-0 +Statistics for: rbox 200 L20 D4 t1262919377 | qhull FO Tcv C-0 - Number of points processed: 71 - Number of hyperplanes created: 900 - Number of distance tests for qhull: 6283 - CPU seconds to compute hull (after input): 0 + Number of points processed: 67 + Number of hyperplanes created: 744 + Number of distance tests for qhull: 5906 + CPU seconds to compute hull (after input): 1.5e-005 -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 769077402 Tcheck-frequently Tverify Centrum-premerge- 0 - _zero-centrum _max-width 0.99 Error-roundoff 1e-015 _one-merge 9e-015 +Options selected for Qhull 2010.1 2010/01/07: + run-id 157602292 Tcheck-frequently Tverify Centrum-premerge- 0 + _zero-centrum _max-width 0.99 Error-roundoff 1e-015 _one-merge 9.1e-015 _near-inside 4.5e-014 Visible-distance 6e-015 U-coplanar-distance 6e-015 Width-outside 1.2e-014 _wide-facet 3.6e-014 Output completed. Verifying that all points are below outer planes of -all facets. Will make 59800 distance computations. +all facets. Will make 55600 distance computations. rbox 200 L20 D5 t | qhull FO Tcv Qx Convex hull of 200 points in 5-d: - Number of vertices: 104 - Number of facets: 1438 + Number of vertices: 90 + Number of facets: 1300 -Statistics for: rbox 200 L20 D5 t1262827986 | qhull FO Tcv Qx +Statistics for: rbox 200 L20 D5 t1262919377 | qhull FO Tcv Qx - Number of points processed: 117 - Number of hyperplanes created: 5328 - Number of distance tests for qhull: 19776 + Number of points processed: 112 + Number of hyperplanes created: 4387 + Number of distance tests for qhull: 17974 CPU seconds to compute hull (after input): 1.5e-005 -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 769077402 Tcheck-frequently Tverify Qxact-merge _zero-centrum - _max-width 1 Error-roundoff 1.4e-015 _one-merge 1.5e-014 +Options selected for Qhull 2010.1 2010/01/07: + run-id 157602292 Tcheck-frequently Tverify Qxact-merge _zero-centrum + _max-width 0.99 Error-roundoff 1.4e-015 _one-merge 1.5e-014 _near-inside 7.5e-014 Visible-distance 8.2e-015 U-coplanar-distance 8.2e-015 Width-outside 1.6e-014 _wide-facet 4.9e-014 QH7076 qhull input warning: exact merge ('Qx'). Verify may report that a point is outside of a facet. See qh-optq.htm#Qx Output completed. Verifying that all points are below outer planes of -all facets. Will make 287600 distance computations. +all facets. Will make 260000 distance computations. rbox 1000 W1e-3 s D2 t | qhull d FO Tcv Qu Q0 Furthest-site Delaunay triangulation by the convex hull of 1000 points in 3-d: Number of input sites: 1000 - Number of Delaunay regions: 267 + Number of Delaunay regions: 278 -Statistics for: rbox 1000 W1e-3 s D2 t1262827986 | qhull d FO Tcv Qu Q0 +Statistics for: rbox 1000 W1e-3 s D2 t1262919377 | qhull d FO Tcv Qu Q0 Number of points processed: 1000 - Number of hyperplanes created: 4606 + Number of hyperplanes created: 4654 Number of facets in hull: 1996 - Number of distance tests for qhull: 27314 + Number of distance tests for qhull: 26700 CPU seconds to compute hull (after input): 0 -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 769077402 delaunay Tcheck-frequently Tverify QupperDelaunay +Options selected for Qhull 2010.1 2010/01/07: + run-id 157602292 delaunay Tcheck-frequently Tverify QupperDelaunay Q0-no-premerge Pgood _max-width 1 Error-roundoff 6.9e-016 Visible-distance 6.9e-016 U-coplanar-distance 6.9e-016 Width-outside 1.4e-015 _wide-facet 4.2e-015 Output completed. Verifying that all points are below 2.1e-015 of -all facets. Will make 267000 distance computations. +all facets. Will make 278000 distance computations. rbox 1000 W1e-3 s D2 t | qhull d FO Tcv Qu C-0 Furthest-site Delaunay triangulation by the convex hull of 1000 points in 3-d: Number of input sites: 1000 - Number of Delaunay regions: 267 + Number of Delaunay regions: 278 -Statistics for: rbox 1000 W1e-3 s D2 t1262827986 | qhull d FO Tcv Qu C-0 +Statistics for: rbox 1000 W1e-3 s D2 t1262919377 | qhull d FO Tcv Qu C-0 Number of points processed: 1000 - Number of hyperplanes created: 4606 + Number of hyperplanes created: 4654 Number of facets in hull: 1996 - Number of distance tests for qhull: 27314 - CPU seconds to compute hull (after input): 0 + Number of distance tests for qhull: 26700 + CPU seconds to compute hull (after input): 1.5e-005 -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 769077402 delaunay Tcheck-frequently Tverify QupperDelaunay +Options selected for Qhull 2010.1 2010/01/07: + run-id 157602292 delaunay Tcheck-frequently Tverify QupperDelaunay Centrum-premerge- 0 _zero-centrum Pgood _max-width 1 Error-roundoff 6.9e-016 _one-merge 4.9e-015 _near-inside 2.4e-014 Visible-distance 1.4e-015 U-coplanar-distance 1.4e-015 Width-outside 2.8e-015 _wide-facet 8.3e-015 Output completed. Verifying that all points are below 2.1e-015 of -all facets. Will make 267000 distance computations. +all facets. Will make 278000 distance computations. echo === check joggle and TRn ${d:-`date`} date -=== check joggle and TRn Wed Jan 6 20:33:06 EST 2010 +=== check joggle and TRn Thu Jan 7 21:56:17 EST 2010 rbox 100 W0 | qhull QJ1e-14 Qc TR100 Tv At a premature exit due to 'TVn', 'TCn', 'TRn', or precision error with 'QJn'. @@ -7427,7 +7423,7 @@ Statistics for: rbox 100 W0 | qhull QJ1e-14 Qc TR100 Tv Number of points processed: 15 Number of hyperplanes created: 11249 Number of distance tests for qhull: 120401 - CPU seconds to compute hull (after input): 3.1e-005 + CPU seconds to compute hull (after input): 1.5e-005 Percentage of runs with precision errors: 100.0 @@ -7448,7 +7444,7 @@ Statistics for: rbox 100 W0 | qhull QJ1e-13 Qc TR100 Tv Number of points processed: 28 Number of hyperplanes created: 24818 Number of distance tests for qhull: 197992 - CPU seconds to compute hull (after input): 3.1e-005 + CPU seconds to compute hull (after input): 4.6e-005 Percentage of runs with precision errors: 62.0 @@ -7470,7 +7466,7 @@ Statistics for: rbox 100 W0 | qhull QJ1e-12 Qc TR100 Tv Number of points processed: 40 Number of hyperplanes created: 29128 Number of distance tests for qhull: 216985 - CPU seconds to compute hull (after input): 4.6e-005 + CPU seconds to compute hull (after input): 3.1e-005 Percentage of runs with precision errors: 8.0 @@ -7491,7 +7487,7 @@ Statistics for: rbox 100 W0 | qhull QJ1e-11 Qc TR100 Tv Number of points processed: 75 Number of hyperplanes created: 29630 Number of distance tests for qhull: 219095 - CPU seconds to compute hull (after input): 4.6e-005 + CPU seconds to compute hull (after input): 3.1e-005 Percentage of runs with precision errors: 0.0 @@ -7535,8 +7531,8 @@ Statistics for: rbox 100 | qhull d QJ Qb0:1e4 QB0:1e5 Qb1:1e4 QB1:1e6 Qb2:1e5 QB CPU seconds to compute hull (after input): 0 Input joggled by: 6.7e+003 -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 769077402 delaunay Qbound-dim-low 0 1e+004 QBound-dim-high 0 1e+005 +Options selected for Qhull 2010.1 2010/01/07: + run-id 157602292 delaunay Qbound-dim-low 0 1e+004 QBound-dim-high 0 1e+005 Qbound-dim-low 1 1e+004 QBound-dim-high 1 1e+006 Qbound-dim-low 2 1e+005 QBound-dim-high 2 1e+007 Tverify Pgood _run 1 QJoggle 6.7e+003 _joggle-seed 16807 _max-width 1e+014 Error-roundoff 0.11 @@ -7548,7 +7544,7 @@ all facets. Will make 48800 distance computations. echo === check precision options ${d:-`date`} date -=== check precision options Wed Jan 6 20:33:06 EST 2010 +=== check precision options Thu Jan 7 21:56:17 EST 2010 rbox 100 D3 s | qhull E0.01 Qx Tcv FO Convex hull of 100 points in 3-d: @@ -7569,8 +7565,8 @@ Statistics for: rbox 100 D3 s | qhull E0.01 Qx Tcv FO Maximum distance of point above facet: 0.048 (0.6x) Maximum distance of vertex below facet: -0.072 (0.9x) -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 769094209 Distance-roundoff 0.01 Qxact-merge Tcheck-frequently +Options selected for Qhull 2010.1 2010/01/07: + run-id 157602292 Distance-roundoff 0.01 Qxact-merge Tcheck-frequently Tverify _zero-centrum _max-width 0.98 _one-merge 0.07 _near-inside 0.35 Visible-distance 0.02 U-coplanar-distance 0.02 Width-outside 0.04 _wide-facet 0.12 @@ -7669,7 +7665,7 @@ Statistics for: rbox 15 D2 P0 P1e-14,1e-14 | qhull d Quc Tcv Number of distance tests for merging: 527 Number of distance tests for checking: 194 Number of merged facets: 7 - CPU seconds to compute hull (after input): 0 + CPU seconds to compute hull (after input): 1.5e-005 Maximum distance of point above facet: 1.6e-015 (0.3x) @@ -7782,7 +7778,7 @@ Statistics for: rbox 1000 s D3 | qhull C-0.01 V0 Qcm Tcv Number of distance tests for merging: 10179 Number of distance tests for checking: 18597 Number of merged facets: 288 - CPU seconds to compute hull (after input): 1.5e-005 + CPU seconds to compute hull (after input): 0 Maximum distance of point above facet: 0.025 (0.8x) Maximum distance of vertex below facet: -0.07 (2.3x) @@ -7830,12 +7826,12 @@ Statistics for: rbox 1000 s D3 | qhull C-0.01 Q1 FO Tcv Qc Number of distance tests for merging: 8730 Number of distance tests for checking: 23168 Number of merged facets: 258 - CPU seconds to compute hull (after input): 0 + CPU seconds to compute hull (after input): 1.5e-005 Maximum distance of point above facet: 0.02 (0.7x) Maximum distance of vertex below facet: -0.035 (1.2x) -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 769094209 Centrum-premerge- 0.01 Q1-no-angle-sort Tcheck-frequently +Options selected for Qhull 2010.1 2010/01/07: + run-id 157619099 Centrum-premerge- 0.01 Q1-no-angle-sort Tcheck-frequently Tverify Qcoplanar-keep _max-width 1 Error-roundoff 6.9e-016 _one-merge 0.03 _near-inside 0.15 Visible-distance 0.01 U-coplanar-distance 0.01 Width-outside 0.02 _wide-facet 0.06 @@ -7863,8 +7859,8 @@ Statistics for: rbox 1000 s D3 | qhull C-0.01 Q2 FO Tcv Qc Maximum distance of point above facet: 0.02 (0.7x) Maximum distance of vertex below facet: -0.049 (1.6x) -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 769094209 Centrum-premerge- 0.01 Q2-no-merge-independent +Options selected for Qhull 2010.1 2010/01/07: + run-id 157619099 Centrum-premerge- 0.01 Q2-no-merge-independent Tcheck-frequently Tverify Qcoplanar-keep _max-width 1 Error-roundoff 6.9e-016 _one-merge 0.03 _near-inside 0.15 Visible-distance 0.01 U-coplanar-distance 0.01 Width-outside 0.02 @@ -7889,12 +7885,12 @@ Statistics for: rbox 1000 s D3 | qhull C-0.01 Q3 FO Tcv Qc Number of distance tests for merging: 8529 Number of distance tests for checking: 23283 Number of merged facets: 260 - CPU seconds to compute hull (after input): 1.5e-005 + CPU seconds to compute hull (after input): 0 Maximum distance of point above facet: 0.02 (0.7x) Maximum distance of vertex below facet: -0.035 (1.2x) -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 769094209 Centrum-premerge- 0.01 Q3-no-merge-vertices +Options selected for Qhull 2010.1 2010/01/07: + run-id 157619099 Centrum-premerge- 0.01 Q3-no-merge-vertices Tcheck-frequently Tverify Qcoplanar-keep _max-width 1 Error-roundoff 6.9e-016 _one-merge 0.03 _near-inside 0.15 Visible-distance 0.01 U-coplanar-distance 0.01 Width-outside 0.02 @@ -7923,8 +7919,8 @@ Statistics for: rbox 1000 s D3 | qhull C-0.01 Q4 FO Tcv Qc Maximum distance of point above facet: 0.02 (0.7x) Maximum distance of vertex below facet: -0.035 (1.2x) -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 769094209 Centrum-premerge- 0.01 Q4-avoid-old-into-new +Options selected for Qhull 2010.1 2010/01/07: + run-id 157619099 Centrum-premerge- 0.01 Q4-avoid-old-into-new Tcheck-frequently Tverify Qcoplanar-keep _max-width 1 Error-roundoff 6.9e-016 _one-merge 0.03 _near-inside 0.15 Visible-distance 0.01 U-coplanar-distance 0.01 Width-outside 0.02 @@ -7934,7 +7930,7 @@ Output completed. Verifying that all points are below outer planes of all facets. Will make 96000 distance computations. echo === this may generate an error ${d:-`date`} date -=== this may generate an error Wed Jan 6 20:33:07 EST 2010 +=== this may generate an error Thu Jan 7 21:56:18 EST 2010 rbox 1000 s D3 | qhull C-0.01 Q5 FO Tcv Convex hull of 1000 points in 3-d: @@ -7955,8 +7951,8 @@ Statistics for: rbox 1000 s D3 | qhull C-0.01 Q5 FO Tcv Maximum distance of point above facet: 0.022 (0.7x) Maximum distance of vertex below facet: -0.035 (1.2x) -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 769094209 Centrum-premerge- 0.01 Q5-no-check-outer +Options selected for Qhull 2010.1 2010/01/07: + run-id 157619099 Centrum-premerge- 0.01 Q5-no-check-outer Tcheck-frequently Tverify _max-width 1 Error-roundoff 6.9e-016 _one-merge 0.03 Visible-distance 0.01 U-coplanar-distance 0.01 Width-outside 0.02 _wide-facet 0.06 @@ -7968,7 +7964,7 @@ Output completed. Verifying that all points are below 0.022 of all facets. Will make 96000 distance computations. echo === this should generate an error ${d:-`date`} date -=== this should generate an error Wed Jan 6 20:33:07 EST 2010 +=== this should generate an error Thu Jan 7 21:56:18 EST 2010 rbox 1000 s D3 | qhull C-0.01 Q6 FO Po Tcv Qc Convex hull of 1000 points in 3-d: @@ -7986,12 +7982,12 @@ Statistics for: rbox 1000 s D3 | qhull C-0.01 Q6 FO Po Tcv Qc Number of distance tests for merging: 3458 Number of distance tests for checking: 27470 Number of merged facets: 88 - CPU seconds to compute hull (after input): 1.5e-005 + CPU seconds to compute hull (after input): 0 Maximum distance of point above facet: 0.02 (0.7x) Maximum distance of vertex below facet: -0.009 (0.3x) -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 769094209 Centrum-premerge- 0.01 Q6-no-concave-merge Poutput-forced +Options selected for Qhull 2010.1 2010/01/07: + run-id 157619099 Centrum-premerge- 0.01 Q6-no-concave-merge Poutput-forced Tcheck-frequently Tverify Qcoplanar-keep _max-width 1 Error-roundoff 6.9e-016 _one-merge 0.03 _near-inside 0.15 Visible-distance 0.01 U-coplanar-distance 0.01 Width-outside 0.02 @@ -8015,12 +8011,12 @@ Statistics for: rbox 1000 s D3 | qhull C-0.01 Q7 FO Tcv Qc Number of distance tests for merging: 8005 Number of distance tests for checking: 21158 Number of merged facets: 233 - CPU seconds to compute hull (after input): 1.5e-005 + CPU seconds to compute hull (after input): 0 Maximum distance of point above facet: 0.02 (0.7x) Maximum distance of vertex below facet: -0.042 (1.4x) -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 769094209 Centrum-premerge- 0.01 Q7-no-breadth-first +Options selected for Qhull 2010.1 2010/01/07: + run-id 157619099 Centrum-premerge- 0.01 Q7-no-breadth-first Tcheck-frequently Tverify Qcoplanar-keep _max-width 1 Error-roundoff 6.9e-016 _one-merge 0.03 _near-inside 0.15 Visible-distance 0.01 U-coplanar-distance 0.01 Width-outside 0.02 @@ -8045,7 +8041,7 @@ Statistics for: rbox 1000 s D3 | qhull C-0.01 Qx Tcv Qc Number of distance tests for merging: 5483 Number of distance tests for checking: 20583 Number of merged facets: 167 - CPU seconds to compute hull (after input): 0 + CPU seconds to compute hull (after input): 1.5e-005 Maximum distance of point above facet: 0.02 (0.7x) Maximum distance of vertex below facet: -0.034 (1.1x) @@ -8058,144 +8054,144 @@ rbox 100 s D3 t | qhull R1e-3 Tcv Qc Convex hull of 100 points in 3-d: - Number of vertices: 96 - Number of coplanar points: 4 - Number of facets: 151 - Number of non-simplicial facets: 33 + Number of vertices: 98 + Number of coplanar points: 2 + Number of facets: 166 + Number of non-simplicial facets: 23 -Statistics for: rbox 100 s D3 t1262827987 | qhull R1e-3 Tcv Qc +Statistics for: rbox 100 s D3 t1262919378 | qhull R1e-3 Tcv Qc - Number of points processed: 96 - Number of hyperplanes created: 437 - Number of distance tests for qhull: 1665 - Number of distance tests for merging: 3856 - Number of distance tests for checking: 1447 - Number of merged facets: 63 - CPU seconds to compute hull (after input): 1.5e-005 - Maximum distance of point above facet: 0.0026 (0.7x) - Maximum distance of vertex below facet: -0.0047 (1.2x) + Number of points processed: 98 + Number of hyperplanes created: 465 + Number of distance tests for qhull: 1618 + Number of distance tests for merging: 3255 + Number of distance tests for checking: 1312 + Number of merged facets: 38 + CPU seconds to compute hull (after input): 0 + Maximum distance of point above facet: 0.0023 (0.6x) + Maximum distance of vertex below facet: -0.0052 (1.3x) Output completed. Verifying that all points are below outer planes of -all facets. Will make 15100 distance computations. +all facets. Will make 16600 distance computations. rbox 100 s D3 t | qhull R1e-2 Tcv Qc Convex hull of 100 points in 3-d: - Number of vertices: 58 - Number of coplanar points: 42 - Number of facets: 60 - Number of non-simplicial facets: 35 + Number of vertices: 67 + Number of coplanar points: 33 + Number of facets: 70 + Number of non-simplicial facets: 38 -Statistics for: rbox 100 s D3 t1262827987 | qhull R1e-2 Tcv Qc +Statistics for: rbox 100 s D3 t1262919378 | qhull R1e-2 Tcv Qc - Number of points processed: 61 - Number of hyperplanes created: 254 - Number of distance tests for qhull: 3136 - Number of distance tests for merging: 3872 - Number of distance tests for checking: 1852 - Number of merged facets: 111 + Number of points processed: 70 + Number of hyperplanes created: 299 + Number of distance tests for qhull: 3080 + Number of distance tests for merging: 4427 + Number of distance tests for checking: 2108 + Number of merged facets: 123 CPU seconds to compute hull (after input): 0 - Maximum distance of point above facet: 0.03 (0.7x) - Maximum distance of vertex below facet: -0.061 (1.5x) + Maximum distance of point above facet: 0.028 (0.7x) + Maximum distance of vertex below facet: -0.047 (1.2x) Output completed. Verifying that all points are below outer planes of -all facets. Will make 6000 distance computations. +all facets. Will make 7000 distance computations. rbox 500 s D3 t | qhull R0.05 A-1 Tcv Qc Convex hull of 500 points in 3-d: - Number of vertices: 20 - Number of coplanar points: 480 - Number of facets: 15 - Number of non-simplicial facets: 13 + Number of vertices: 22 + Number of coplanar points: 478 + Number of facets: 19 + Number of non-simplicial facets: 15 -Statistics for: rbox 500 s D3 t1262827987 | qhull R0.05 A-1 Tcv Qc +Statistics for: rbox 500 s D3 t1262919378 | qhull R0.05 A-1 Tcv Qc - Number of points processed: 26 - Number of hyperplanes created: 86 - Number of distance tests for qhull: 27123 - Number of distance tests for merging: 1723 - Number of distance tests for checking: 8454 - Number of merged facets: 56 + Number of points processed: 22 + Number of hyperplanes created: 76 + Number of distance tests for qhull: 21240 + Number of distance tests for merging: 1345 + Number of distance tests for checking: 7997 + Number of merged facets: 41 CPU seconds to compute hull (after input): 0 - Maximum distance of point above facet: 0.15 (0.2x) - Maximum distance of vertex below facet: -0.24 (0.4x) + Maximum distance of point above facet: 0.13 (0.2x) + Maximum distance of vertex below facet: -0.21 (0.4x) Output completed. Verifying that all points are below outer planes of -all facets. Will make 7500 distance computations. +all facets. Will make 9500 distance computations. rbox 100 W0 D3 t | qhull R1e-3 Tcv Qc Convex hull of 100 points in 3-d: - Number of vertices: 39 - Number of coplanar points: 61 - Number of facets: 50 - Number of non-simplicial facets: 6 + Number of vertices: 34 + Number of coplanar points: 66 + Number of facets: 42 + Number of non-simplicial facets: 9 -Statistics for: rbox 100 W0 D3 t1262827987 | qhull R1e-3 Tcv Qc +Statistics for: rbox 100 W0 D3 t1262919378 | qhull R1e-3 Tcv Qc - Number of points processed: 43 - Number of hyperplanes created: 143 - Number of distance tests for qhull: 1835 - Number of distance tests for merging: 1474 - Number of distance tests for checking: 1104 - Number of merged facets: 32 + Number of points processed: 39 + Number of hyperplanes created: 128 + Number of distance tests for qhull: 1698 + Number of distance tests for merging: 1355 + Number of distance tests for checking: 1008 + Number of merged facets: 33 CPU seconds to compute hull (after input): 0 - Maximum distance of point above facet: 0.0022 (0.5x) + Maximum distance of point above facet: 0.0018 (0.5x) Maximum distance of vertex below facet: -0.0036 (0.9x) Output completed. Verifying that all points are below outer planes of -all facets. Will make 5000 distance computations. +all facets. Will make 4200 distance computations. rbox 100 W0 D3 t | qhull R1e-3 Qx Tcv Qc Convex hull of 100 points in 3-d: - Number of vertices: 38 - Number of coplanar points: 62 - Number of facets: 49 - Number of non-simplicial facets: 6 + Number of vertices: 35 + Number of coplanar points: 65 + Number of facets: 44 + Number of non-simplicial facets: 9 -Statistics for: rbox 100 W0 D3 t1262827987 | qhull R1e-3 Qx Tcv Qc +Statistics for: rbox 100 W0 D3 t1262919378 | qhull R1e-3 Qx Tcv Qc - Number of points processed: 42 - Number of hyperplanes created: 148 - Number of distance tests for qhull: 2360 - Number of distance tests for merging: 1359 - Number of distance tests for checking: 1081 - Number of merged facets: 31 + Number of points processed: 37 + Number of hyperplanes created: 120 + Number of distance tests for qhull: 1847 + Number of distance tests for merging: 1079 + Number of distance tests for checking: 1020 + Number of merged facets: 26 CPU seconds to compute hull (after input): 0 - Maximum distance of point above facet: 0.0021 (0.5x) - Maximum distance of vertex below facet: -0.004 (1.0x) + Maximum distance of point above facet: 0.0019 (0.5x) + Maximum distance of vertex below facet: -0.0036 (0.9x) QH7076 qhull input warning: exact merge ('Qx'). Verify may report that a point is outside of a facet. See qh-optq.htm#Qx Output completed. Verifying that all points are below outer planes of -all facets. Will make 4900 distance computations. +all facets. Will make 4400 distance computations. rbox 100 W0 D3 t | qhull R1e-2 Tcv Qc Convex hull of 100 points in 3-d: - Number of vertices: 27 - Number of coplanar points: 73 + Number of vertices: 24 + Number of coplanar points: 76 Number of facets: 27 - Number of non-simplicial facets: 9 + Number of non-simplicial facets: 7 -Statistics for: rbox 100 W0 D3 t1262827987 | qhull R1e-2 Tcv Qc +Statistics for: rbox 100 W0 D3 t1262919378 | qhull R1e-2 Tcv Qc - Number of points processed: 31 - Number of hyperplanes created: 105 - Number of distance tests for qhull: 2384 - Number of distance tests for merging: 1465 - Number of distance tests for checking: 1125 - Number of merged facets: 40 - CPU seconds to compute hull (after input): 0 - Maximum distance of point above facet: 0.025 (0.6x) - Maximum distance of vertex below facet: -0.046 (1.1x) + Number of points processed: 30 + Number of hyperplanes created: 94 + Number of distance tests for qhull: 2316 + Number of distance tests for merging: 1280 + Number of distance tests for checking: 1033 + Number of merged facets: 36 + CPU seconds to compute hull (after input): 1.5e-005 + Maximum distance of point above facet: 0.018 (0.5x) + Maximum distance of vertex below facet: -0.052 (1.3x) Output completed. Verifying that all points are below outer planes of @@ -8204,22 +8200,22 @@ rbox 100 W0 D3 t | qhull R1e-2 Qx Tcv Qc Convex hull of 100 points in 3-d: - Number of vertices: 28 - Number of coplanar points: 72 + Number of vertices: 26 + Number of coplanar points: 74 Number of facets: 29 Number of non-simplicial facets: 11 -Statistics for: rbox 100 W0 D3 t1262827987 | qhull R1e-2 Qx Tcv Qc +Statistics for: rbox 100 W0 D3 t1262919378 | qhull R1e-2 Qx Tcv Qc Number of points processed: 32 - Number of hyperplanes created: 106 - Number of distance tests for qhull: 3494 - Number of distance tests for merging: 1349 - Number of distance tests for checking: 1141 - Number of merged facets: 38 - CPU seconds to compute hull (after input): 1.5e-005 - Maximum distance of point above facet: 0.026 (0.6x) - Maximum distance of vertex below facet: -0.038 (0.9x) + Number of hyperplanes created: 109 + Number of distance tests for qhull: 3497 + Number of distance tests for merging: 1216 + Number of distance tests for checking: 1023 + Number of merged facets: 35 + CPU seconds to compute hull (after input): 0 + Maximum distance of point above facet: 0.022 (0.5x) + Maximum distance of vertex below facet: -0.05 (1.2x) QH7076 qhull input warning: exact merge ('Qx'). Verify may report that a point is outside of a facet. See qh-optq.htm#Qx @@ -8235,17 +8231,17 @@ Convex hull of 500 points in 3-d: Number of facets: 6 Number of non-simplicial facets: 6 -Statistics for: rbox 500 W0 D3 t1262827987 | qhull R0.05 A-1 Tcv Qc +Statistics for: rbox 500 W0 D3 t1262919378 | qhull R0.05 A-1 Tcv Qc Number of points processed: 14 - Number of hyperplanes created: 34 - Number of distance tests for qhull: 13190 - Number of distance tests for merging: 579 - Number of distance tests for checking: 3900 - Number of merged facets: 21 + Number of hyperplanes created: 35 + Number of distance tests for qhull: 14966 + Number of distance tests for merging: 627 + Number of distance tests for checking: 3942 + Number of merged facets: 23 CPU seconds to compute hull (after input): 0 - Maximum distance of point above facet: 0.13 (0.2x) - Maximum distance of vertex below facet: -0.2 (0.3x) + Maximum distance of point above facet: 0.11 (0.2x) + Maximum distance of vertex below facet: -0.17 (0.3x) Output completed. Verifying that all points are below outer planes of @@ -8259,16 +8255,16 @@ Convex hull of 500 points in 3-d: Number of facets: 6 Number of non-simplicial facets: 6 -Statistics for: rbox 500 W0 D3 t1262827987 | qhull R0.05 Qx Tcv Qc +Statistics for: rbox 500 W0 D3 t1262919378 | qhull R0.05 Qx Tcv Qc - Number of points processed: 16 - Number of hyperplanes created: 39 - Number of distance tests for qhull: 18602 - Number of distance tests for merging: 512 - Number of distance tests for checking: 3794 - Number of merged facets: 25 + Number of points processed: 17 + Number of hyperplanes created: 33 + Number of distance tests for qhull: 16823 + Number of distance tests for merging: 442 + Number of distance tests for checking: 3838 + Number of merged facets: 26 CPU seconds to compute hull (after input): 0 - Maximum distance of point above facet: 0.11 (0.5x) + Maximum distance of point above facet: 0.11 (0.6x) Maximum distance of vertex below facet: -0.17 (0.8x) QH7076 qhull input warning: exact merge ('Qx'). Verify may report that a point @@ -8280,137 +8276,136 @@ rbox 1000 W1e-20 t | qhull Tcv Qc Convex hull of 1000 points in 3-d: - Number of vertices: 85 - Number of coplanar points: 915 - Number of facets: 99 + Number of vertices: 87 + Number of coplanar points: 913 + Number of facets: 101 Number of non-simplicial facets: 6 -Statistics for: rbox 1000 W1e-20 t1262827987 | qhull Tcv Qc +Statistics for: rbox 1000 W1e-20 t1262919378 | qhull Tcv Qc - Number of points processed: 103 - Number of hyperplanes created: 314 - Number of distance tests for qhull: 17474 - Number of distance tests for merging: 4494 - Number of distance tests for checking: 31961 - Number of merged facets: 103 - CPU seconds to compute hull (after input): 0 + Number of points processed: 101 + Number of hyperplanes created: 311 + Number of distance tests for qhull: 18497 + Number of distance tests for merging: 4474 + Number of distance tests for checking: 32997 + Number of merged facets: 97 + CPU seconds to compute hull (after input): 1.5e-005 Output completed. Verifying that all points are below outer planes of -all facets. Will make 99000 distance computations. +all facets. Will make 101000 distance computations. rbox 1000 W1e-20 D4 t | qhull Tcv Qc Convex hull of 1000 points in 4-d: - Number of vertices: 291 - Number of coplanar points: 709 - Number of facets: 1098 + Number of vertices: 289 + Number of coplanar points: 711 + Number of facets: 1078 Number of non-simplicial facets: 8 -Statistics for: rbox 1000 W1e-20 D4 t1262827987 | qhull Tcv Qc +Statistics for: rbox 1000 W1e-20 D4 t1262919378 | qhull Tcv Qc - Number of points processed: 363 - Number of hyperplanes created: 4944 - Number of distance tests for qhull: 77136 - Number of distance tests for merging: 75790 - Number of distance tests for checking: 153113 - Number of merged facets: 1148 - CPU seconds to compute hull (after input): 0.000109 + Number of points processed: 368 + Number of hyperplanes created: 4812 + Number of distance tests for qhull: 76427 + Number of distance tests for merging: 74329 + Number of distance tests for checking: 150701 + Number of merged facets: 1158 + CPU seconds to compute hull (after input): 7.8e-005 Output completed. Verifying that all points are below outer planes of -all facets. Will make 1098000 distance computations. +all facets. Will make 1078000 distance computations. rbox 500 W1e-20 D5 t | qhull Tv Qc Convex hull of 500 points in 5-d: - Number of vertices: 357 - Number of coplanar points: 143 - Number of facets: 5624 + Number of vertices: 348 + Number of coplanar points: 152 + Number of facets: 5469 Number of non-simplicial facets: 10 -Statistics for: rbox 500 W1e-20 D5 t1262827988 | qhull Tv Qc +Statistics for: rbox 500 W1e-20 D5 t1262919378 | qhull Tv Qc - Number of points processed: 407 - Number of hyperplanes created: 26660 - Number of distance tests for qhull: 124300 - Number of distance tests for merging: 299911 - Number of distance tests for checking: 241343 - Number of merged facets: 3392 + Number of points processed: 412 + Number of hyperplanes created: 27672 + Number of distance tests for qhull: 131709 + Number of distance tests for merging: 308636 + Number of distance tests for checking: 234054 + Number of merged facets: 3557 CPU seconds to compute hull (after input): 0.000109 QH7076 qhull input warning: exact merge ('Qx'). Verify may report that a point is outside of a facet. See qh-optq.htm#Qx Output completed. Verifying that all points are below outer planes of -all facets. Will make 2812000 distance computations. +all facets. Will make 2734500 distance computations. rbox 100 W1e-20 D6 t | qhull Tv Qc Convex hull of 100 points in 6-d: - Number of vertices: 99 - Number of coplanar points: 1 - Number of facets: 5987 - Number of non-simplicial facets: 8 + Number of vertices: 100 + Number of facets: 5591 + Number of non-simplicial facets: 10 -Statistics for: rbox 100 W1e-20 D6 t1262827988 | qhull Tv Qc +Statistics for: rbox 100 W1e-20 D6 t1262919379 | qhull Tv Qc Number of points processed: 100 - Number of hyperplanes created: 20805 - Number of distance tests for qhull: 33169 - Number of distance tests for merging: 205663 - Number of distance tests for checking: 124429 - Number of merged facets: 213 - CPU seconds to compute hull (after input): 7.8e-005 + Number of hyperplanes created: 20873 + Number of distance tests for qhull: 33201 + Number of distance tests for merging: 173291 + Number of distance tests for checking: 115768 + Number of merged facets: 183 + CPU seconds to compute hull (after input): 6.2e-005 QH7076 qhull input warning: exact merge ('Qx'). Verify may report that a point is outside of a facet. See qh-optq.htm#Qx Output completed. Verifying that all points are below outer planes of -all facets. Will make 598700 distance computations. +all facets. Will make 559100 distance computations. rbox 50 W1e-20 D6 t | qhull Qv Tv Qc Convex hull of 50 points in 6-d: Number of vertices: 50 - Number of facets: 2049 - Number of non-simplicial facets: 1 + Number of facets: 2060 + Number of non-simplicial facets: 2 -Statistics for: rbox 50 W1e-20 D6 t1262827988 | qhull Qv Tv Qc +Statistics for: rbox 50 W1e-20 D6 t1262919379 | qhull Qv Tv Qc Number of points processed: 50 - Number of hyperplanes created: 6722 - Number of distance tests for qhull: 9793 - Number of distance tests for merging: 3409430 - Number of distance tests for checking: 41868 - Number of merged facets: 2 + Number of hyperplanes created: 5870 + Number of distance tests for qhull: 8334 + Number of distance tests for merging: 3484024 + Number of distance tests for checking: 42044 + Number of merged facets: 4 CPU seconds to compute hull (after input): 0.00014 QH7076 qhull input warning: exact merge ('Qx'). Verify may report that a point is outside of a facet. See qh-optq.htm#Qx Output completed. Verifying that all points are below outer planes of -all facets. Will make 102450 distance computations. +all facets. Will make 103000 distance computations. rbox 10000 D4 t | qhull QR0 Qc C-0.01 A0.3 Tv Convex hull of 10000 points in 4-d: Number of vertices: 16 - Number of coplanar points: 7557 + Number of coplanar points: 8258 Number of facets: 8 Number of non-simplicial facets: 8 -Statistics for: rbox 10000 D4 t1262827988 | qhull QR0 Qc C-0.01 A0.3 Tv QR1262827988 +Statistics for: rbox 10000 D4 t1262919379 | qhull QR0 Qc C-0.01 A0.3 Tv QR1262919379 - Number of points processed: 42 - Number of hyperplanes created: 280 - Number of distance tests for qhull: 1195764 - Number of distance tests for merging: 9453 - Number of distance tests for checking: 99514 - Number of merged facets: 283 - CPU seconds to compute hull (after input): 6.2e-005 - Maximum distance of point above facet: 0.081 - Maximum distance of vertex below facet: -0.13 + Number of points processed: 49 + Number of hyperplanes created: 310 + Number of distance tests for qhull: 1527319 + Number of distance tests for merging: 8651 + Number of distance tests for checking: 98798 + Number of merged facets: 343 + CPU seconds to compute hull (after input): 7.8e-005 + Maximum distance of point above facet: 0.042 + Maximum distance of vertex below facet: -0.17 (0.1x) Output completed. Verifying that all points are below outer planes of @@ -8420,99 +8415,98 @@ rbox 1000 D2 t | qhull d QR0 Qc C-1e-8 Qu Tv Furthest-site Delaunay triangulation by the convex hull of 1000 points in 3-d: Number of input sites: 1000 - Number of Delaunay regions: 18 + Number of Delaunay regions: 19 -Statistics for: rbox 1000 D2 t1262827988 | qhull d QR0 Qc C-1e-8 Qu Tv QR1262827988 +Statistics for: rbox 1000 D2 t1262919379 | qhull d QR0 Qc C-1e-8 Qu Tv QR1262919379 Number of points processed: 1000 - Number of hyperplanes created: 5554 + Number of hyperplanes created: 5549 Number of facets in hull: 1996 - Number of distance tests for qhull: 30518 + Number of distance tests for qhull: 29938 CPU seconds to compute hull (after input): 1.5e-005 Output completed. Verifying that all points are below outer planes of -all facets. Will make 18000 distance computations. +all facets. Will make 19000 distance computations. rbox 300 D5 t |qhull A-0.999 Qx Qc Tcv Convex hull of 300 points in 5-d: - Number of vertices: 156 - Number of coplanar points: 33 - Number of facets: 1721 - Number of non-simplicial facets: 427 + Number of vertices: 160 + Number of coplanar points: 31 + Number of facets: 1753 + Number of non-simplicial facets: 451 -Statistics for: rbox 300 D5 t1262827988 | qhull A-0.999 Qx Qc Tcv +Statistics for: rbox 300 D5 t1262919379 | qhull A-0.999 Qx Qc Tcv - Number of points processed: 201 - Number of hyperplanes created: 12171 - Number of distance tests for qhull: 179621 - Number of distance tests for merging: 56968 - Number of distance tests for checking: 20698 - Number of merged facets: 1137 - CPU seconds to compute hull (after input): 4.6e-005 - Maximum distance of vertex below facet: -0.021 (0.2x) + Number of points processed: 193 + Number of hyperplanes created: 11247 + Number of distance tests for qhull: 184654 + Number of distance tests for merging: 57626 + Number of distance tests for checking: 21098 + Number of merged facets: 1211 + CPU seconds to compute hull (after input): 3.1e-005 + Maximum distance of vertex below facet: -0.023 (0.2x) QH7076 qhull input warning: exact merge ('Qx'). Verify may report that a point is outside of a facet. See qh-optq.htm#Qx Output completed. Verifying that all points are below outer planes of -all facets. Will make 516300 distance computations. +all facets. Will make 525900 distance computations. rbox 100 D6 t |qhull A-0.9999 Qx Qc Tcv Convex hull of 100 points in 6-d: - Number of vertices: 90 - Number of coplanar points: 1 - Number of facets: 3862 - Number of non-simplicial facets: 245 - -Statistics for: rbox 100 D6 t1262827988 | qhull A-0.9999 Qx Qc Tcv - - Number of points processed: 94 - Number of hyperplanes created: 13686 - Number of distance tests for qhull: 27172 - Number of distance tests for merging: 81053 - Number of distance tests for checking: 83121 - Number of merged facets: 602 + Number of vertices: 96 + Number of facets: 4202 + Number of non-simplicial facets: 290 + +Statistics for: rbox 100 D6 t1262919379 | qhull A-0.9999 Qx Qc Tcv + + Number of points processed: 97 + Number of hyperplanes created: 17704 + Number of distance tests for qhull: 32704 + Number of distance tests for merging: 92171 + Number of distance tests for checking: 90705 + Number of merged facets: 700 CPU seconds to compute hull (after input): 6.2e-005 - Maximum distance of vertex below facet: -0.0071 (0.2x) + Maximum distance of vertex below facet: -0.0074 (0.2x) QH7076 qhull input warning: exact merge ('Qx'). Verify may report that a point is outside of a facet. See qh-optq.htm#Qx Output completed. Verifying that all points are below outer planes of -all facets. Will make 386200 distance computations. +all facets. Will make 420200 distance computations. rbox 50 D7 t |qhull A-0.99999 Qx Qc Tcv W0.1 Convex hull of 50 points in 7-d: - Number of vertices: 47 - Number of coplanar points: 2 - Number of facets: 4864 - Number of non-simplicial facets: 91 + Number of vertices: 46 + Number of coplanar points: 3 + Number of facets: 5058 + Number of non-simplicial facets: 109 -Statistics for: rbox 50 D7 t1262827988 | qhull A-0.99999 Qx Qc Tcv W0.1 +Statistics for: rbox 50 D7 t1262919379 | qhull A-0.99999 Qx Qc Tcv W0.1 - Number of points processed: 47 - Number of hyperplanes created: 13336 - Number of distance tests for qhull: 20540 - Number of distance tests for merging: 97428 - Number of distance tests for checking: 113814 - Number of merged facets: 254 - CPU seconds to compute hull (after input): 6.2e-005 - Maximum distance of point above facet: 0.086 + Number of points processed: 46 + Number of hyperplanes created: 13275 + Number of distance tests for qhull: 22918 + Number of distance tests for merging: 101753 + Number of distance tests for checking: 121916 + Number of merged facets: 306 + CPU seconds to compute hull (after input): 6.3e-005 + Maximum distance of point above facet: 0.1 Maximum distance of vertex below facet: -0.0018 (0.2x) QH7076 qhull input warning: exact merge ('Qx'). Verify may report that a point is outside of a facet. See qh-optq.htm#Qx Output completed. Verifying that all points are below outer planes of -all facets. Will make 243200 distance computations. +all facets. Will make 252900 distance computations. echo === check bad cases for Qhull. May cause errors ${d:-`date`} date -=== check bad cases for Qhull. May cause errors Wed Jan 6 20:33:09 EST 2010 +=== check bad cases for Qhull. May cause errors Thu Jan 7 21:56:20 EST 2010 rbox 1000 L100000 s G1e-6 t | qhull Tv QH6154 qhull precision error: initial facet 1 is coplanar with the interior point ERRONEOUS FACET: @@ -8520,12 +8514,12 @@ ERRONEOUS FACET: - flags: bottom simplicial flipped - normal: 0 0 1 - offset: 0 - - vertices: p961(v2) p777(v1) p485(v0) + - vertices: p373(v2) p780(v1) p588(v0) - neighboring facets: f2 f3 f4 -While executing: rbox 1000 L100000 s G1e-6 t1262827989 | qhull Tv -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 769127823 Tverify _pre-merge _zero-centrum _max-width 1 +While executing: rbox 1000 L100000 s G1e-6 t1262919380 | qhull Tv +Options selected for Qhull 2010.1 2010/01/07: + run-id 157652713 Tverify _pre-merge _zero-centrum _max-width 1 Error-roundoff 6.9e-016 _one-merge 4.9e-015 _near-inside 2.4e-014 Visible-distance 1.4e-015 U-coplanar-distance 1.4e-015 Width-outside 2.8e-015 _wide-facet 8.3e-015 @@ -8537,22 +8531,22 @@ The input to qhull appears to be less than 3 dimensional, or a computation has overflowed. Qhull could not construct a clearly convex simplex from points: -- p441(v3): 0.00028 -0.5 0 -- p961(v2): -4.7e-005 0.5 0 -- p777(v1): 0.5 0.0017 0 -- p485(v0): -0.5 -0.0036 0 +- p803(v3): -0.0026 -0.5 0 +- p373(v2): -0.00023 0.5 0 +- p780(v1): 0.5 -0.0019 0 +- p588(v0): -0.5 -0.0027 0 The center point is coplanar with a facet, or a vertex is coplanar with a neighboring facet. The maximum round off error for computing distances is 6.9e-016. The center point, facets and distances to the center point are as follows: -center point 5.99e-005 -0.0004625 0 +center point -0.0007053 -0.001132 0 -facet p961 p777 p485 distance= 0 -facet p441 p777 p485 distance= 0 -facet p441 p961 p485 distance= 0 -facet p441 p961 p777 distance= 0 +facet p373 p780 p588 distance= 0 +facet p803 p780 p588 distance= 0 +facet p803 p373 p588 distance= 0 +facet p803 p373 p780 distance= 0 These points either have a maximum or minimum x-coordinate, or they maximize the determinant for k coordinates. Trial points @@ -8587,12 +8581,12 @@ ERRONEOUS FACET: - flags: bottom simplicial flipped - normal: 0 0 1 - offset: 0 - - vertices: p961(v2) p777(v1) p485(v0) + - vertices: p373(v2) p780(v1) p588(v0) - neighboring facets: f2 f3 f4 -While executing: rbox 1000 L100000 s G1e-6 t1262827989 | qhull Tv Q10 -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 769127823 Tverify Q10-no-narrow _pre-merge _zero-centrum +While executing: rbox 1000 L100000 s G1e-6 t1262919380 | qhull Tv Q10 +Options selected for Qhull 2010.1 2010/01/07: + run-id 157652713 Tverify Q10-no-narrow _pre-merge _zero-centrum _max-width 1 Error-roundoff 6.9e-016 _one-merge 4.9e-015 _near-inside 2.4e-014 Visible-distance 1.4e-015 U-coplanar-distance 1.4e-015 Width-outside 2.8e-015 _wide-facet 8.3e-015 @@ -8604,22 +8598,22 @@ The input to qhull appears to be less than 3 dimensional, or a computation has overflowed. Qhull could not construct a clearly convex simplex from points: -- p441(v3): 0.00028 -0.5 0 -- p961(v2): -4.7e-005 0.5 0 -- p777(v1): 0.5 0.0017 0 -- p485(v0): -0.5 -0.0036 0 +- p803(v3): -0.0026 -0.5 0 +- p373(v2): -0.00023 0.5 0 +- p780(v1): 0.5 -0.0019 0 +- p588(v0): -0.5 -0.0027 0 The center point is coplanar with a facet, or a vertex is coplanar with a neighboring facet. The maximum round off error for computing distances is 6.9e-016. The center point, facets and distances to the center point are as follows: -center point 5.99e-005 -0.0004625 0 +center point -0.0007053 -0.001132 0 -facet p961 p777 p485 distance= 0 -facet p441 p777 p485 distance= 0 -facet p441 p961 p485 distance= 0 -facet p441 p961 p777 distance= 0 +facet p373 p780 p588 distance= 0 +facet p803 p780 p588 distance= 0 +facet p803 p373 p588 distance= 0 +facet p803 p373 p780 distance= 0 These points either have a maximum or minimum x-coordinate, or they maximize the determinant for k coordinates. Trial points @@ -8652,24 +8646,24 @@ rbox 1000 s Z1 G1e-13 t | qhull Tv Convex hull of 1001 points in 3-d: Number of vertices: 1001 - Number of facets: 1410 - Number of non-simplicial facets: 146 + Number of facets: 1499 + Number of non-simplicial facets: 167 -Statistics for: rbox 1000 s Z1 G1e-13 t1262827989 | qhull Tv +Statistics for: rbox 1000 s Z1 G1e-13 t1262919380 | qhull Tv Number of points processed: 1001 - Number of hyperplanes created: 4938 - Number of distance tests for qhull: 28876 - Number of distance tests for merging: 148847 - Number of distance tests for checking: 308338 - Number of merged facets: 2258 + Number of hyperplanes created: 4118 + Number of distance tests for qhull: 27448 + Number of distance tests for merging: 74048 + Number of distance tests for checking: 214031 + Number of merged facets: 1246 CPU seconds to compute hull (after input): 3.1e-005 - Maximum distance of point above facet: 1.4e-014 (2.4x) - Maximum distance of vertex below facet: -1.7e-014 (3.1x) + Maximum distance of point above facet: 5.6e-015 (1.0x) + Maximum distance of vertex below facet: -1.2e-014 (2.1x) Output completed. Verifying that all points are below outer planes of -all facets. Will make 1411410 distance computations. +all facets. Will make 1500499 distance computations. rbox 1000 s W1e-13 P0 t | qhull d Qbb Qc Tv Delaunay triangulation by the convex hull of 1001 points in 4-d: @@ -8677,75 +8671,89 @@ Delaunay triangulation by the convex hull of 1001 points in 4-d: Number of input sites: 1001 Number of Delaunay regions: 1996 -Statistics for: rbox 1000 s W1e-13 P0 t1262827989 | qhull d Qbb Qc Tv +Statistics for: rbox 1000 s W1e-13 P0 t1262919380 | qhull d Qbb Qc Tv Number of points processed: 1001 - Number of hyperplanes created: 13876 - Number of facets in hull: 3726 - Number of distance tests for qhull: 56917 - Number of distance tests for merging: 190963 - Number of distance tests for checking: 289581 - Number of merged facets: 4391 - CPU seconds to compute hull (after input): 6.3e-005 - Maximum distance of point above facet: 4.3e-014 (2.1x) - Maximum distance of vertex below facet: -4.8e-014 (2.4x) + Number of hyperplanes created: 93245 + Number of facets in hull: 2021 + Number of distance tests for qhull: 134376 + Number of distance tests for merging: 6910665 + Number of distance tests for checking: 1992302 + Number of merged facets: 86352 + CPU seconds to compute hull (after input): 0.001672 + Maximum distance of point above facet: 5.1e-013 (25.2x) + Maximum distance of vertex below facet: -2.8e-013 (14.2x) Output completed. Verifying that all points are below outer planes of all facets. Will make 1997996 distance computations. rbox 1000 s W1e-13 t | qhull d Tv - -Delaunay triangulation by the convex hull of 1000 points in 4-d: - - Number of input sites: 884 - Total number of deleted points due to merging: 71 - Total number of nearly incident points: 45 - Number of Delaunay regions: 1064 - Number of non-simplicial Delaunay regions: 359 - -Statistics for: rbox 1000 s W1e-13 t1262827989 | qhull d Tv - - Number of points processed: 955 - Number of hyperplanes created: 10496 - Number of facets in hull: 2106 - Number of distance tests for qhull: 4768700 - Number of distance tests for merging: 284649 - Number of distance tests for checking: 2107000 - Number of merged facets: 7387 - CPU seconds to compute hull (after input): 0.000625 - Maximum distance of point above facet: 3.2e-011 (3138.6x) - Maximum distance of vertex below facet: -4.9e-014 (4.8x) - qhull precision warning: The initial hull is narrow (cosine of min. angle is 1.0000000000000000). A coplanar point may lead to a wide facet. Options 'QbB' (scale to unit box) or 'Qbb' (scale last coordinate) may remove this warning. Use 'Pp' to skip this warning. See 'Limitations' in qh-impre.htm. +QH6170 qhull precision error (qh_partitionvisible): all new facets deleted as + degenerate facets. Can not continue. -Output completed. Verifying that all points are below outer planes of -all facets. Will make 1064000 distance computations. +While executing: rbox 1000 s W1e-13 t1262919381 | qhull d Tv +Options selected for Qhull 2010.1 2010/01/07: + run-id 157669520 delaunay Tverify _pre-merge _zero-centrum Pgood + _max-width 1 Error-roundoff 1e-015 _one-merge 9.1e-015 + _near-inside 4.5e-014 Visible-distance 6e-015 U-coplanar-distance 6e-015 + Width-outside 1.2e-014 _wide-facet 3.6e-014 _narrow-hull 0 +Last point added to hull was p106. Last merge was #9844. + +At error exit: + +Delaunay triangulation by the convex hull of 1000 points in 4-d: + + Number of input sites: 51 + Total number of deleted points due to merging: 768 + Number of nearly incident points: 117 + Number of Delaunay regions: 0 + Number of non-simplicial Delaunay regions: 27 + +Statistics for: rbox 1000 s W1e-13 t1262919381 | qhull d Tv + + Number of points processed: 830 + Number of hyperplanes created: 11522 + Number of facets in hull: 72 + Number of distance tests for qhull: 3559494 + Number of distance tests for merging: 457601 + Number of distance tests for checking: 0 + Number of merged facets: 10316 + Maximum distance of merged point above facet: 9.6e-012 (955.4x) + Maximum distance of merged vertex below facet: -1.4e-013 (13.6x) + + +precision problems (corrected unless 'Q0' or an error) + 948 flipped facets + 1737 coplanar horizon facets for new vertices + 161 coplanar points during partitioning + 44 ridges with multiple neighbors rbox 1000 s W1e-13 t D2 | qhull d Tv Delaunay triangulation by the convex hull of 1000 points in 3-d: - Number of input sites: 708 - Total number of deleted points due to merging: 207 - Total number of nearly incident points: 85 - Number of Delaunay regions: 522 - Number of non-simplicial Delaunay regions: 101 - -Statistics for: rbox 1000 s W1e-13 D2 t1262827990 | qhull d Tv - - Number of points processed: 915 - Number of hyperplanes created: 4471 - Number of facets in hull: 979 - Number of distance tests for qhull: 726533 - Number of distance tests for merging: 106688 - Number of distance tests for checking: 305010 - Number of merged facets: 1998 - CPU seconds to compute hull (after input): 4.7e-005 - Maximum distance of point above facet: 3e-013 (54.5x) - Maximum distance of vertex below facet: -4.7e-014 (8.5x) + Number of input sites: 972 + Total number of deleted points due to merging: 10 + Total number of nearly incident points: 18 + Number of Delaunay regions: 746 + Number of non-simplicial Delaunay regions: 121 + +Statistics for: rbox 1000 s W1e-13 D2 t1262919382 | qhull d Tv + + Number of points processed: 982 + Number of hyperplanes created: 3886 + Number of facets in hull: 1452 + Number of distance tests for qhull: 70477 + Number of distance tests for merging: 44044 + Number of distance tests for checking: 99486 + Number of merged facets: 841 + CPU seconds to compute hull (after input): 1.5e-005 + Maximum distance of point above facet: 2e-014 (3.6x) + Maximum distance of vertex below facet: -6.8e-015 (1.2x) qhull precision warning: The initial hull is narrow (cosine of min. angle is 1.0000000000000000). @@ -8754,7 +8762,7 @@ or 'Qbb' (scale last coordinate) may remove this warning. Use 'Pp' to skip this warning. See 'Limitations' in qh-impre.htm. Output completed. Verifying that all points are below outer planes of -all facets. Will make 522000 distance computations. +all facets. Will make 746000 distance computations. echo ======================================================= ======================================================= @@ -8762,7 +8770,7 @@ echo ======================================================= ======================================================= echo === The following commands may cause errors ${d:-`date`} date -=== The following commands may cause errors Wed Jan 6 20:33:10 EST 2010 +=== The following commands may cause errors Thu Jan 7 21:56:22 EST 2010 echo ======================================================= ======================================================= echo ======================================================= @@ -8948,8 +8956,8 @@ A flipped facet occurs when its distance to the interior point is greater than -0.024, the maximum roundoff error. While executing: rbox 100 s D3 | qhull Q0 R0.05 Tc -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 769144630 Q0-no-premerge Random_perturb 0.05 Tcheck-frequently +Options selected for Qhull 2010.1 2010/01/07: + run-id 157686327 Q0-no-premerge Random_perturb 0.05 Tcheck-frequently _max-width 0.94 Error-roundoff 0.024 Visible-distance 0.024 U-coplanar-distance 0.024 Width-outside 0.048 _wide-facet 0.15 Last point added to hull was p40. @@ -8967,7 +8975,7 @@ Statistics for: rbox 100 s D3 | qhull Q0 R0.05 Tc Number of points processed: 51 Number of hyperplanes created: 206 Number of distance tests for qhull: 2041 - CPU seconds to compute hull (after input): 0 + CPU seconds to compute hull (after input): 1.5e-005 precision problems (corrected unless 'Q0' or an error) @@ -9062,7 +9070,7 @@ Statistics for: rbox 1000 W1e-7 | qhull Q0 Tc Po Number of points processed: 221 Number of hyperplanes created: 1160 Number of distance tests for qhull: 22647 - CPU seconds to compute hull (after input): 0 + CPU seconds to compute hull (after input): 1.5e-005 rbox 50 s | qhull Q0 V0.05 W0.01 Tc Po QH6136 qhull precision error: facet f105 is flipped, distance= 0.328228630954 @@ -9172,8 +9180,8 @@ ERRONEOUS OTHER FACET: ERRONEOUS and NEIGHBORING FACETS to output While executing: rbox 100 s D5 | qhull Q0 R1e-2 Tc Po -Options selected for Qhull 2010.0.3 2010/01/05: - run-id 769144630 Q0-no-premerge Random_perturb 0.01 Tcheck-frequently +Options selected for Qhull 2010.1 2010/01/07: + run-id 157686327 Q0-no-premerge Random_perturb 0.01 Tcheck-frequently Poutput-forced _max-width 0.88 Error-roundoff 0.0045 Visible-distance 0.0045 U-coplanar-distance 0.0045 Width-outside 0.009 _wide-facet 0.027 @@ -9217,7 +9225,7 @@ To guarantee simplicial output: - use exact arithmetic (see "Imprecision in Qhull", qh-impre.htm) qhull -qhull- compute convex hulls and related structures. Qhull 2010.0.3 2010/01/05 +qhull- compute convex hulls and related structures. Qhull 2010.1 2010/01/07 input (stdin): dimension, n, point coordinates comments start with a non-numeric character halfspace: use dim+1 and put offsets after coefficients @@ -9259,10 +9267,10 @@ examples: qhull . -Qhull 2010.0.3 2010/01/05. +Qhull 2010.1 2010/01/07. Except for 'F.' and 'PG', upper-case options take an argument. - delaunay voronoi Geomview Halfspace facet_dump + delaunay voronoi Geomview Halfspace facet_dump incidences mathematica normals OFF_format points summary @@ -9297,7 +9305,7 @@ Except for 'F.' and 'PG', upper-case options take an argument. qhull - qhull- compute convex hulls and related structures. - http://www.qhull.org 2010.0.3 2010/01/05 + http://www.qhull.org 2010.1 2010/01/07 input (stdin): first lines: dimension and number of points (or vice-versa). @@ -9338,7 +9346,7 @@ Qhull control options: QGn - good facet if visible from point n, -n for not visible QVn - good facet if it includes point n, -n if not Q0 - turn off default premerge with 'C-0'/'Qx' - Q1 - sort merges by type instead of angle + Q1 - sort merges by type instead of angle Q2 - merge all non-convex at once instead of independent sets Q3 - do not merge redundant vertices Q4 - avoid old->new merges diff --git a/html/index.htm b/html/index.htm index dfd7e70..4919b90 100644 --- a/html/index.htm +++ b/html/index.htm @@ -95,14 +95,14 @@ Contents </a></h2> <ul> <li><a href="#when">When</a> to use Qhull - <ul> - <li><a href="http://www.qhull.org/news">News</a> for Qhull - with new features and reported bugs. + <ul> + <li><a href="http://www.qhull.org/news">News</a> for Qhull + with new features and reported bugs. <li><a href="http://www.qhull.org">Home</a> for Qhull with additional URLs - (<a href=index.htm>local copy</a>) - <li><a href="http://www.qhull.org/html/qh-faq.htm">FAQ</a> for Qhull (<a href="qh-faq.htm">local copy</a>) - <li><a href="http://www.qhull.org/download">Download</a> Qhull (<a href=qh-get.htm>local copy</a>) - <li><a href="qh-quick.htm#programs">Quick</a> reference for Qhull and its <a href="qh-quick.htm#options">options</a> + (<a href=index.htm>local copy</a>) + <li><a href="http://www.qhull.org/html/qh-faq.htm">FAQ</a> for Qhull (<a href="qh-faq.htm">local copy</a>) + <li><a href="http://www.qhull.org/download">Download</a> Qhull (<a href=qh-get.htm>local copy</a>) + <li><a href="qh-quick.htm#programs">Quick</a> reference for Qhull and its <a href="qh-quick.htm#options">options</a> <p> <li><a href="../COPYING.txt">COPYING.txt</a> - copyright notice<br> <li><a href="../REGISTER.txt">REGISTER.txt</a> - registration<br> @@ -110,55 +110,55 @@ Contents </a></h2> instructions<br> <li><a href="../src/Changes.txt">Changes.txt</a> - change history <br> <li><a href="qhull.txt">qhull.txt</a> - Unix manual page - </ul> - <p> + </ul> + <p> <li><a href="#description">Description</a> of Qhull - <ul> + <ul> <li><a href="#definition">de</a>finition • <a href="#input">in</a>put • <a href="#output">ou</a>tput • <a href="#algorithm">al</a>gorithm • <a href="#structure">da</a>ta structure </li> <li><a href="qh-impre.htm">Imprecision</a> in Qhull</li> <LI><a href="qh-impre.htm#joggle">Merged facets</a> or joggled input - <li><a href="#geomview">Geomview</a>, Qhull's graphical - viewer</li> - <li><a href="qh-eg.htm">Examples</a> of Qhull using Geomview</li> + <li><a href="#geomview">Geomview</a>, Qhull's graphical + viewer</li> + <li><a href="qh-eg.htm">Examples</a> of Qhull using Geomview</li> </ul> - <p> + <p> <li><a href=qh-quick.htm#programs>Qhull programs</a> - <ul> - <li><a href="qconvex.htm">qconvex</a> -- convex hulls - <li><a href="qdelaun.htm">qdelaunay</a> -- Delaunay triangulations and - furthest-site Delaunay triangulations - <li><a href="qhalf.htm">qhalf</a> -- halfspace intersections about a point - <li><a href="qhull.htm">qhull</a> -- all structures with additional options - <li><a href="qvoronoi.htm">qvoronoi</a> -- Voronoi diagrams and - furthest-site Voronoi diagrams - <li><a href="rbox.htm">rbox</a> -- generate point distributions for qhull - </ul> - <p> + <ul> + <li><a href="qconvex.htm">qconvex</a> -- convex hulls + <li><a href="qdelaun.htm">qdelaunay</a> -- Delaunay triangulations and + furthest-site Delaunay triangulations + <li><a href="qhalf.htm">qhalf</a> -- halfspace intersections about a point + <li><a href="qhull.htm">qhull</a> -- all structures with additional options + <li><a href="qvoronoi.htm">qvoronoi</a> -- Voronoi diagrams and + furthest-site Voronoi diagrams + <li><a href="rbox.htm">rbox</a> -- generate point distributions for qhull + </ul> + <p> <li>Related URLs - <ul> + <ul> - <li><a href="news:comp.graphics.algorithms">Newsgroup</a>: + <li><a href="news:comp.graphics.algorithms">Newsgroup</a>: comp.graphics.algorithms - <li><a + <li><a href="http://exaflop.org/docs/cgafaq/">FAQ</a> for computer graphics algorithms and - <a href="http://exaflop.org/docs/cgafaq/cga6.html">geometric</a> structures. + <a href="http://exaflop.org/docs/cgafaq/cga6.html">geometric</a> structures. <li>Amenta's <a href="http://www.geom.uiuc.edu/software/cglist">Directory of Computational Geometry Software </a></li> <li>Erickson's <a href="http://compgeom.cs.uiuc.edu/~jeffe/compgeom/code.html">Computational Geometry Software</a> </li> - <li>Fukuda's <a - href="http://www.ifor.math.ethz.ch/staff/fukuda/polyfaq/polyfaq.html"> - introduction</a> to convex hulls, Delaunay triangulations, - Voronoi diagrams, and linear programming. + <li>Fukuda's <a + href="http://www.ifor.math.ethz.ch/staff/fukuda/polyfaq/polyfaq.html"> + introduction</a> to convex hulls, Delaunay triangulations, + Voronoi diagrams, and linear programming. <li>Stony Brook's <a href="http://www.cs.sunysb.edu/~algorith/major_section/1.6.shtml">Algorithm Repository</a> on computational geometry. </li> </ul> - <p> + <p> <li><a href="qh-quick.htm#options">Qhull options</a><ul> <li><a href="qh-opto.htm#output">Output</a> formats</li> <li><a href="qh-optf.htm#format">Additional</a> I/O @@ -172,7 +172,7 @@ Contents </a></h2> <li><a href="qh-optt.htm#trace">Trace</a> options</li> </ul> </li> - <p> + <p> <li><a href="qh-code.htm">Qhull internals</a><ul> <li><a href="qh-code.htm#performance">Performance</a> of Qhull</li> @@ -184,7 +184,7 @@ Contents </a></h2> data structures</a> </li> </ul> </li> - <p> + <p> <li><a href="#bugs">What to do</a> if something goes wrong</li> <li><a href="#email">Email</a></li> <li><a href="#authors">Authors</a></li> diff --git a/html/qconvex.htm b/html/qconvex.htm index 900f0a9..b77b555 100644 --- a/html/qconvex.htm +++ b/html/qconvex.htm @@ -7,22 +7,22 @@ <body> <!-- Navigation links --> -<a name="TOP"><b>Up</b></a><b>:</b> +<a name="TOP"><b>Up</b></a><b>:</b> <a href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="index.htm#TOC">Qhull manual</a> -- Table of Contents<br> <b>To:</b> <a href="qh-quick.htm#programs">Programs</a> -• <a href="qh-quick.htm#options">Options</a> -• <a href="qh-opto.htm#output">Output</a> -• <a href="qh-optf.htm#format">Formats</a> -• <a href="qh-optg.htm#geomview">Geomview</a> +• <a href="qh-quick.htm#options">Options</a> +• <a href="qh-opto.htm#output">Output</a> +• <a href="qh-optf.htm#format">Formats</a> +• <a href="qh-optg.htm#geomview">Geomview</a> • <a href="qh-optp.htm#print">Print</a> -• <a href="qh-optq.htm#qhull">Qhull</a> -• <a href="qh-optc.htm#prec">Precision</a> +• <a href="qh-optq.htm#qhull">Qhull</a> +• <a href="qh-optc.htm#prec">Precision</a> • <a href="qh-optt.htm#trace">Trace</a><br> -<b>To:</b> <a href="#synopsis">sy</a>nopsis -• <a href="#input">in</a>put • <a href="#outputs">ou</a>tputs -• <a href="#controls">co</a>ntrols • <a href="#graphics">gr</a>aphics -• <a href="#notes">no</a>tes • <a href="#conventions">co</a>nventions +<b>To:</b> <a href="#synopsis">sy</a>nopsis +• <a href="#input">in</a>put • <a href="#outputs">ou</a>tputs +• <a href="#controls">co</a>ntrols • <a href="#graphics">gr</a>aphics +• <a href="#notes">no</a>tes • <a href="#conventions">co</a>nventions • <a href="#options">op</a>tions <hr> <!-- Main text of document --> @@ -62,8 +62,8 @@ href="qh-eg.htm#how">How Qhull adds a point</a>.</p> <dt><b>Example:</b> rbox x W1e-12 1000 | qconvex <a href="qh-optq.htm#QR">QR0</a></dt> <dd>Compute the convex hull of 1000 points near the - surface of a randomly rotated simplex. Report - the maximum thickness of a facet.</dd> + surface of a randomly rotated simplex. Report + the maximum thickness of a facet.</dd> <dt> </dt> <dt><b>Example:</b> rbox 1000 s | qconvex <a href="qh-opto.htm#s">s</a> <a @@ -99,19 +99,19 @@ href="qh-eg.htm#how">How Qhull adds a point</a>.</p> </dl> </blockquote> -<p>Except for rbox, all of the qhull programs compute a convex hull. +<p>Except for rbox, all of the qhull programs compute a convex hull. <p>By default, Qhull merges coplanar facets. For example, the convex hull of a cube's vertices has six facets. -<p>If you use '<a href="qh-optq.htm#Qt">Qt</a>' (triangulated output), -all facets will be simplicial (e.g., triangles in 2-d). For the cube +<p>If you use '<a href="qh-optq.htm#Qt">Qt</a>' (triangulated output), +all facets will be simplicial (e.g., triangles in 2-d). For the cube example, it will have 12 facets. Some facets may be -degenerate and have zero area. +degenerate and have zero area. -<p>If you use '<a href="qh-optq.htm#QJn">QJ</a>' (joggled input), +<p>If you use '<a href="qh-optq.htm#QJn">QJ</a>' (joggled input), all facets will be simplicial. The corresponding vertices will be -slightly perturbed and identical points will be joggled apart. +slightly perturbed and identical points will be joggled apart. Joggled input is less accurate that triangulated output.See <a href="qh-impre.htm#joggle">Merged facets or joggled input</a>. </p> @@ -123,11 +123,11 @@ are there extra points in a 4-d or higher convex hull?</a><br> </p> </p> -<p>The 'qconvex' program is equivalent to +<p>The 'qconvex' program is equivalent to '<a href=qhull.htm#outputs>qhull</a>' in 2-d to 4-d, and -'<a href=qhull.htm#outputs>qhull</a> <a href=qh-optq.htm#Qx>Qx</a>' +'<a href=qhull.htm#outputs>qhull</a> <a href=qh-optq.htm#Qx>Qx</a>' in 5-d and higher. It disables the following Qhull -<a href=qh-quick.htm#options>options</a>: <i>d v H Qbb Qf Qg Qm +<a href=qh-quick.htm#options>options</a>: <i>d v H Qbb Qf Qg Qm Qr Qu Qv Qx Qz TR E V Fp Gt Q0,etc</i>. <p><b>Copyright © 1995-2010 C.B. Barber</b></p> @@ -136,7 +136,7 @@ Qr Qu Qv Qx Qz TR E V Fp Gt Q0,etc</i>. <h3><a href="#TOP">»</a><a name="synopsis">qconvex synopsis</a></h3> <pre> -qconvex- compute the convex hull. +qconvex- compute the convex hull. input (stdin): dimension, number of points, point coordinates comments start with a non-numeric character @@ -180,11 +180,11 @@ input</a></h3> </ul> <p>Use I/O redirection (e.g., qconvex < data.txt), a pipe (e.g., rbox 10 | qconvex), -or the '<a href=qh-optt.htm#TI>TI</a>' option (e.g., qconvex TI data.txt). +or the '<a href=qh-optt.htm#TI>TI</a>' option (e.g., qconvex TI data.txt). <p>Comments start with a non-numeric character. Error reporting is simpler if there is one point per line. Dimension -and number of points may be reversed. +and number of points may be reversed. <p>Here is the input for computing the convex hull of the unit cube. The output is the normals, one @@ -245,79 +245,79 @@ individually or together.</p> <dd><b>Vertices</b></dd> <dt><a href="qh-optf.htm#Fx">Fx</a></dt> <dd>list extreme points (i.e., vertices). The first line is the number of - extreme points. Each point is listed, one per line. The cube example - has eight vertices.</dd> + extreme points. Each point is listed, one per line. The cube example + has eight vertices.</dd> <dt><a href="qh-optf.htm#Fv">Fv</a></dt> - <dd>list vertices for each facet. The first line is the number of facets. - Each remaining line starts with the number of vertices. For the cube example, - each facet has four vertices.</dd> + <dd>list vertices for each facet. The first line is the number of facets. + Each remaining line starts with the number of vertices. For the cube example, + each facet has four vertices.</dd> <dt><a href="qh-opto.htm#i">i</a></dt> <dd>list vertices for each facet. The first line is the number of facets. The - remaining lines list the vertices for each facet. In 3-d and + remaining lines list the vertices for each facet. In 3-d and higher, report cospherical sites by adding extra points.</dd> <dt> </dt> <dt> </dt> <dd><b>Coordinates</b></dd> <dt><a href="qh-opto.htm#o">o</a></dt> <dd>print vertices and facets of the convex hull in OFF format. The - first line is the dimension. The second line is the number of - vertices, facets, and ridges. The vertex - coordinates are next, followed by the facets. Each facet starts with - the number of vertices. The cube example has four vertices per facet.</dd> + first line is the dimension. The second line is the number of + vertices, facets, and ridges. The vertex + coordinates are next, followed by the facets. Each facet starts with + the number of vertices. The cube example has four vertices per facet.</dd> <dt><a href="qh-optf.htm#Ft">Ft</a></dt> <dd>print a triangulation of the convex hull in OFF format. The first line - is the dimension. The second line is the number of vertices and added points, - followed by the number of facets and the number of ridges. + is the dimension. The second line is the number of vertices and added points, + followed by the number of facets and the number of ridges. The vertex coordinates are next, followed by the centrum coordinates. There is - one centrum for each non-simplicial facet. - The cube example has six centrums, one per square. + one centrum for each non-simplicial facet. + The cube example has six centrums, one per square. Each facet starts with the number of vertices or centrums. - In the cube example, each facet uses two vertices and one centrum.</dd> + In the cube example, each facet uses two vertices and one centrum.</dd> <dt><a href="qh-opto.htm#p">p</a></dt> <dd>print vertex coordinates. The first line is the dimension and the second - line is the number of vertices. The following lines are the coordinates of each - vertex. The cube example has eight vertices.</dd> + line is the number of vertices. The following lines are the coordinates of each + vertex. The cube example has eight vertices.</dd> <dt><a href="qh-optq.htm#Qc">Qc</a> <a href="qh-opto.htm#p">p</a></dt> <dd>print coordinates of vertices and coplanar points. The first line is the dimension. - The second line is the number of vertices and coplanar points. The coordinates - are next, one line per point. Use '<a href="qh-optq.htm#Qc">Qc</a> <a href="qh-optq.htm#Qi">Qi</a> p' - to print the coordinates of all points.</dd> + The second line is the number of vertices and coplanar points. The coordinates + are next, one line per point. Use '<a href="qh-optq.htm#Qc">Qc</a> <a href="qh-optq.htm#Qi">Qi</a> p' + to print the coordinates of all points.</dd> <dt> </dt> <dt> </dt> <dd><b>Facets</b></dd> <dt><a href="qh-optf.htm#Fn">Fn</a></dt> <dd>list neighboring facets for each facet. The first line is the - number of facets. Each remaining line starts with the number of - neighboring facets. The cube example has four neighbors per facet.</dd> + number of facets. Each remaining line starts with the number of + neighboring facets. The cube example has four neighbors per facet.</dd> <dt><a href="qh-optf.htm#FN">FN</a></dt> <dd>list neighboring facets for each point. The first line is the - total number of points. Each remaining line starts with the number of - neighboring facets. Each vertex of the cube example has three neighboring - facets. Use '<a href="qh-optq.htm#Qc">Qc</a> <a href="qh-optq.htm#Qi">Qi</a> FN' - to include coplanar and interior points. </dd> + total number of points. Each remaining line starts with the number of + neighboring facets. Each vertex of the cube example has three neighboring + facets. Use '<a href="qh-optq.htm#Qc">Qc</a> <a href="qh-optq.htm#Qi">Qi</a> FN' + to include coplanar and interior points. </dd> <dt><a href="qh-optf.htm#Fa">Fa</a></dt> <dd>print area for each facet. The first line is the number of facets. - Facet area follows, one line per facet. For the cube example, each facet has area one.</dd> + Facet area follows, one line per facet. For the cube example, each facet has area one.</dd> <dt><a href="qh-optf.htm#FI">FI</a></dt> - <dd>list facet IDs. The first line is the number of - facets. The IDs follow, one per line.</dd> + <dd>list facet IDs. The first line is the number of + facets. The IDs follow, one per line.</dd> <dt> </dt> <dt> </dt> <dd><b>Coplanar and interior points</b></dd> <dt><a href="qh-optf.htm#Fc">Fc</a></dt> <dd>list coplanar points for each facet. The first line is the number - of facets. The remaining lines start with the number of coplanar points. - A coplanar point is assigned to one facet.</dd> + of facets. The remaining lines start with the number of coplanar points. + A coplanar point is assigned to one facet.</dd> <dt><a href="qh-optq.htm#Qi">Qi</a> <a href="qh-optf.htm#Fc">Fc</a></dt> <dd>list interior points for each facet. The first line is the number - of facets. The remaining lines start with the number of interior points. - A coplanar point is assigned to one facet.</dd> + of facets. The remaining lines start with the number of interior points. + A coplanar point is assigned to one facet.</dd> <dt><a href="qh-optf.htm#FP">FP</a></dt> - <dd>print distance to nearest vertex for coplanar points. The first line is the - number of coplanar points. Each remaining line starts with the point ID of - a vertex, followed by the point ID of a coplanar point, its facet, and distance. - Use '<a href="qh-optq.htm#Qc">Qc</a> <a href="qh-optq.htm#Qi">Qi</a> + <dd>print distance to nearest vertex for coplanar points. The first line is the + number of coplanar points. Each remaining line starts with the point ID of + a vertex, followed by the point ID of a coplanar point, its facet, and distance. + Use '<a href="qh-optq.htm#Qc">Qc</a> <a href="qh-optq.htm#Qi">Qi</a> <a href="qh-optf.htm#FP">FP</a>' for coplanar and interior points.</dd> <dt> </dt> @@ -325,19 +325,19 @@ individually or together.</p> <dd><b>Hyperplanes</b></dd> <dt><a href="qh-opto.htm#n">n</a></dt> <dd>print hyperplane for each facet. The first line is the dimension. The - second line is the number of facets. Each remaining line is the hyperplane's - coefficients followed by its offset.</dd> + second line is the number of facets. Each remaining line is the hyperplane's + coefficients followed by its offset.</dd> <dt><a href="qh-optf.htm#Fo">Fo</a></dt> <dd>print outer plane for each facet. The output plane is above all points. - The first line is the dimension. The - second line is the number of facets. Each remaining line is the outer plane's - coefficients followed by its offset.</dd> + The first line is the dimension. The + second line is the number of facets. Each remaining line is the outer plane's + coefficients followed by its offset.</dd> <dt><a href="qh-optf.htm#Fi">Fi</a></dt> <dd>print inner plane for each facet. The inner plane of a facet is - below its vertices. - The first line is the dimension. The - second line is the number of facets. Each remaining line is the inner plane's - coefficients followed by its offset.</dd> + below its vertices. + The first line is the dimension. The + second line is the number of facets. Each remaining line is the inner plane's + coefficients followed by its offset.</dd> <dt> </dt> <dt> </dt> @@ -367,11 +367,11 @@ individually or together.</p> <dd>scale input to unit cube centered at the origin.</dd> <dt><a href="qh-optq.htm#QRn">QRn</a></dt> <dd>randomly rotate the input with a random seed of n. If n=0, the - seed is the time. If n=-1, use time for the random seed, but do - not rotate the input.</dd> + seed is the time. If n=-1, use time for the random seed, but do + not rotate the input.</dd> <dt><a href="qh-optq.htm#Qb0">Qbk:0Bk:0</a></dt> <dd>remove k'th coordinate from input. This computes the - convex hull in one lower dimension.</dd> + convex hull in one lower dimension.</dd> </dl> </blockquote> @@ -387,8 +387,8 @@ individually or together.</p> <dd>triangulated output. Qhull triangulates non-simplicial facets. It may produce degenerate facets of zero area.</dd> <dt><a href="qh-optq.htm#QJn">QJ</a></dt> - <dd>joggle the input instead of merging facets. This guarantees simplicial facets - (e.g., triangles in 3-d). It is less accurate than triangulated output ('Qt').</dd> + <dd>joggle the input instead of merging facets. This guarantees simplicial facets + (e.g., triangles in 3-d). It is less accurate than triangulated output ('Qt').</dd> <dt><a href="qh-optq.htm#Qc">Qc</a></dt> <dd>keep coplanar points</dd> <dt><a href="qh-optq.htm#Qi">Qi</a></dt> @@ -410,10 +410,10 @@ individually or together.</p> <dd>input data from file. The filename may not use spaces or quotes.</dd> <dt><a href="qh-optt.htm#TO">TO file</a></dt> <dd>output results to file. Use single quotes if the filename - contains spaces (e.g., <tt>TO 'file with spaces.txt'</tt></dd> + contains spaces (e.g., <tt>TO 'file with spaces.txt'</tt></dd> <dt><a href="qh-optq.htm#Qs">Qs</a></dt> - <dd>search all points for the initial simplex. If Qhull can - not construct an initial simplex, it reports a + <dd>search all points for the initial simplex. If Qhull can + not construct an initial simplex, it reports a descriptive message. Usually, the point set is degenerate and one or more dimensions should be removed ('<a href="qh-optq.htm#Qb0">Qbk:0Bk:0</a>'). If not, use option 'Qs'. It performs an exhaustive search for the @@ -534,7 +534,7 @@ Output formats (may be combined; if none, produces a summary to stdout): m - Mathematica output (2-d and 3-d) n - normals with offsets o - OFF file format (dim, points and facets; Voronoi regions) - p - point coordinates + p - point coordinates s - summary (stderr) More formats: @@ -560,7 +560,7 @@ More formats: for output: #vertices, #facets, #coplanar points, #non-simplicial facets #real (2), max outer plane, min vertex - FS - sizes: #int (0) + FS - sizes: #int (0) #real(2) tot area, tot volume Ft - triangulation with centrums for non-simplicial facets (OFF format) Fv - count plus vertices for each facet @@ -601,18 +601,18 @@ Print options: <p><b>Up:</b> <a href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="index.htm#TOC">Qhull manual</a>: Table of Contents<br> <b>To:</b> <a href="qh-quick.htm#programs">Programs</a> -•<a href="qh-quick.htm#options">Options</a> -• <a href="qh-opto.htm#output">Output</a> -• <a href="qh-optf.htm#format">Formats</a> -• <a href="qh-optg.htm#geomview">Geomview</a> +•<a href="qh-quick.htm#options">Options</a> +• <a href="qh-opto.htm#output">Output</a> +• <a href="qh-optf.htm#format">Formats</a> +• <a href="qh-optg.htm#geomview">Geomview</a> • <a href="qh-optp.htm#print">Print</a> -• <a href="qh-optq.htm#qhull">Qhull</a> -• <a href="qh-optc.htm#prec">Precision</a> +• <a href="qh-optq.htm#qhull">Qhull</a> +• <a href="qh-optc.htm#prec">Precision</a> • <a href="qh-optt.htm#trace">Trace</a><br> -<b>To:</b> <a href="#synopsis">sy</a>nopsis -• <a href="#input">in</a>put • <a href="#outputs">ou</a>tputs -• <a href="#controls">co</a>ntrols • <a href="#graphics">gr</a>aphics -• <a href="#notes">no</a>tes • <a href="#conventions">co</a>nventions +<b>To:</b> <a href="#synopsis">sy</a>nopsis +• <a href="#input">in</a>put • <a href="#outputs">ou</a>tputs +• <a href="#controls">co</a>ntrols • <a href="#graphics">gr</a>aphics +• <a href="#notes">no</a>tes • <a href="#conventions">co</a>nventions • <a href="#options">op</a>tions <!-- GC common information --> <hr> diff --git a/html/qdelau_f.htm b/html/qdelau_f.htm index fe706e1..9afa73f 100644 --- a/html/qdelau_f.htm +++ b/html/qdelau_f.htm @@ -7,22 +7,22 @@ <body> <!-- Navigation links --> -<a name="TOP"><b>Up</b></a><b>:</b> +<a name="TOP"><b>Up</b></a><b>:</b> <a href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="index.htm#TOC">Qhull manual</a>: Table of Contents<br> <b>To:</b> <a href="qh-quick.htm#programs">Programs</a> -• <a href="qh-quick.htm#options">Options</a> -• <a href="qh-opto.htm#output">Output</a> -• <a href="qh-optf.htm#format">Formats</a> -• <a href="qh-optg.htm#geomview">Geomview</a> +• <a href="qh-quick.htm#options">Options</a> +• <a href="qh-opto.htm#output">Output</a> +• <a href="qh-optf.htm#format">Formats</a> +• <a href="qh-optg.htm#geomview">Geomview</a> • <a href="qh-optp.htm#print">Print</a> -• <a href="qh-optq.htm#qhull">Qhull</a> -• <a href="qh-optc.htm#prec">Precision</a> +• <a href="qh-optq.htm#qhull">Qhull</a> +• <a href="qh-optc.htm#prec">Precision</a> • <a href="qh-optt.htm#trace">Trace</a><br> -<b>To:</b> <a href="#synopsis">sy</a>nopsis -• <a href="#input">in</a>put • <a href="#outputs">ou</a>tputs -• <a href="#controls">co</a>ntrols • <a href="#graphics">gr</a>aphics -• <a href="#notes">no</a>tes • <a href="#conventions">co</a>nventions +<b>To:</b> <a href="#synopsis">sy</a>nopsis +• <a href="#input">in</a>put • <a href="#outputs">ou</a>tputs +• <a href="#controls">co</a>ntrols • <a href="#graphics">gr</a>aphics +• <a href="#notes">no</a>tes • <a href="#conventions">co</a>nventions • <a href="#options">op</a>tions <hr> @@ -65,10 +65,10 @@ href="qvoron_f.htm">furthest-site Voronoi diagram</a>. <a href="qh-optf.htm#Fv">Fv</a> <a href="qh-optt.htm#TO">TO result</a></dt> <dd>Compute the 2-d, furthest-site Delaunay triangulation of a triangle inside - a square. + a square. Write a summary to the console and unoriented regions to 'result'. Merge regions for cocircular input sites (e.g., the square). - The square is the only furthest-site + The square is the only furthest-site Delaunay region.</dd> </dl> </blockquote> @@ -87,18 +87,18 @@ example is points on the boundary of a lattice.</p> For example, the furthest-site Delaunay triangulation of a square inside a diamond ('rbox D2 c d G4 | qdelaunay Qu') consists of one region (the diamond). -<p>If you use '<a href="qh-optq.htm#Qt">Qt</a>' (triangulated output), -all furthest-site Delaunay regions will be simplicial (e.g., triangles in 2-d). +<p>If you use '<a href="qh-optq.htm#Qt">Qt</a>' (triangulated output), +all furthest-site Delaunay regions will be simplicial (e.g., triangles in 2-d). Some regions may be degenerate and have zero area. -<p>If you use '<a href="qh-optq.htm#QJn">QJ</a>' (joggled input), all furthest-site -Delaunay regions +<p>If you use '<a href="qh-optq.htm#QJn">QJ</a>' (joggled input), all furthest-site +Delaunay regions will be simplicial (e.g., triangles in 2-d). Joggled input is less accurate than triangulated output ('Qt'). See <a href="qh-impre.htm#joggle">Merged facets or joggled input</a>. </p> -<p>The output for 3-d, furthest-site Delaunay triangulations may be confusing if the +<p>The output for 3-d, furthest-site Delaunay triangulations may be confusing if the input contains cospherical data. See the FAQ item <a href=qh-faq.htm#extra>Why are there extra points in a 4-d or higher convex hull?</a> @@ -106,9 +106,9 @@ Avoid these problems with triangulated output ('<a href="qh-optq.htm#Qt">Qt</a>' joggled input ('<a href="qh-optq.htm#QJn">QJ</a>'). </p> -<p>The 'qdelaunay' program is equivalent to +<p>The 'qdelaunay' program is equivalent to '<a href=qhull.htm#outputs>qhull d</a> <a href=qh-optq.htm#Qbb>Qbb</a>' in 2-d to 3-d, and -'<a href=qhull.htm#outputs>qhull d</a> <a href=qh-optq.htm#Qbb>Qbb</a> <a href=qh-optq.htm#Qx>Qx</a>' +'<a href=qhull.htm#outputs>qhull d</a> <a href=qh-optq.htm#Qbb>Qbb</a> <a href=qh-optq.htm#Qx>Qx</a>' in 4-d and higher. It disables the following Qhull <a href=qh-quick.htm#options>options</a>: <i>d n v H U Qb QB Qc Qf Qg Qi Qm Qr QR Qv Qx TR E V FC Fi Fo Fp FV Q0,etc</i>. @@ -132,20 +132,20 @@ input</a></h3> <blockquote> <p>The input data on <tt>stdin</tt> consists of:</p> <ul> - <li>dimension + <li>dimension <li>number of points</li> <li>point coordinates</li> </ul> <p>Use I/O redirection (e.g., qdelaunay Qu < data.txt), a pipe (e.g., rbox 10 | qdelaunay Qu), -or the '<a href=qh-optt.htm#TI>TI</a>' option (e.g., qdelaunay Qu TI data.txt). +or the '<a href=qh-optt.htm#TI>TI</a>' option (e.g., qdelaunay Qu TI data.txt). -<p>For example, this is a square containing four random points. -Its furthest-site Delaunay +<p>For example, this is a square containing four random points. +Its furthest-site Delaunay triangulation contains one square. <p> <blockquote> -<tt>rbox c 4 D2 > data</tt> +<tt>rbox c 4 D2 > data</tt> <blockquote><pre> 2 RBOX c 4 D2 8 @@ -195,62 +195,62 @@ outputs</a></h3> <dd><b>furthest-site Delaunay regions</b></dd> <dt><a href="qh-opto.htm#i">i</a></dt> <dd>list input sites for each furthest-site Delaunay region. The first line is the number of regions. The - remaining lines list the input sites for each region. The regions are - oriented. In 3-d and + remaining lines list the input sites for each region. The regions are + oriented. In 3-d and higher, report cospherical sites by adding extra points. For the points-in-square example, - the square is the only furthest-site Delaunay region.</dd> + the square is the only furthest-site Delaunay region.</dd> <dt><a href="qh-optf.htm#Fv">Fv</a></dt> - <dd>list input sites for each furthest-site Delaunay region. The first line is the number of regions. - Each remaining line starts with the number of input sites. The regions - are unoriented. For the points-in-square example, - the square is the only furthest-site Delaunay region.</dd> + <dd>list input sites for each furthest-site Delaunay region. The first line is the number of regions. + Each remaining line starts with the number of input sites. The regions + are unoriented. For the points-in-square example, + the square is the only furthest-site Delaunay region.</dd> <dt><a href="qh-optf.htm#Ft">Ft</a></dt> <dd>print a triangulation of the furthest-site Delaunay regions in OFF format. The first line - is the dimension. The second line is the number of input sites and added points, - followed by the number of simplices and the number of ridges. + is the dimension. The second line is the number of input sites and added points, + followed by the number of simplices and the number of ridges. The input coordinates are next, followed by the centrum coordinates. There is - one centrum for each non-simplicial furthest-site Delaunay region. Each remaining line starts - with dimension+1. The - simplices are oriented. - For the points-in-square example, the square has a centrum at the - origin. It splits the square into four triangular regions.</dd> + one centrum for each non-simplicial furthest-site Delaunay region. Each remaining line starts + with dimension+1. The + simplices are oriented. + For the points-in-square example, the square has a centrum at the + origin. It splits the square into four triangular regions.</dd> <dt><a href="qh-optf.htm#Fn">Fn</a></dt> <dd>list neighboring regions for each furthest-site Delaunay region. The first line is the - number of regions. Each remaining line starts with the number of - neighboring regions. Negative indices (e.g., <em>-1</em>) indicate regions - outside of the furthest-site Delaunay triangulation. - For the points-in-square example, the four neighboring regions - are outside of the triangulation. They belong to the regular - Delaunay triangulation.</dd> + number of regions. Each remaining line starts with the number of + neighboring regions. Negative indices (e.g., <em>-1</em>) indicate regions + outside of the furthest-site Delaunay triangulation. + For the points-in-square example, the four neighboring regions + are outside of the triangulation. They belong to the regular + Delaunay triangulation.</dd> <dt><a href="qh-optf.htm#FN">FN</a></dt> <dd>list the furthest-site Delaunay regions for each input site. The first line is the - total number of input sites. Each remaining line starts with the number of - furthest-site Delaunay regions. Negative indices (e.g., <em>-1</em>) indicate regions - outside of the furthest-site Delaunay triangulation. - For the points-in-square example, the four random points belong to no region - while the square's vertices belong to region <em>0</em> and three - regions outside of the furthest-site Delaunay triangulation.</dd> + total number of input sites. Each remaining line starts with the number of + furthest-site Delaunay regions. Negative indices (e.g., <em>-1</em>) indicate regions + outside of the furthest-site Delaunay triangulation. + For the points-in-square example, the four random points belong to no region + while the square's vertices belong to region <em>0</em> and three + regions outside of the furthest-site Delaunay triangulation.</dd> <dt><a href="qh-optf.htm#Fa">Fa</a></dt> <dd>print area for each furthest-site Delaunay region. The first line is the number of regions. - The areas follow, one line per region. For the points-in-square example, the - square has unit area. </dd> + The areas follow, one line per region. For the points-in-square example, the + square has unit area. </dd> <dt> </dt> <dt> </dt> <dd><b>Input sites</b></dd> <dt><a href="qh-optf.htm#Fx">Fx</a></dt> <dd>list extreme points of the input sites. These points are vertices of the furthest-point - Delaunay triangulation. They are on the - boundary of the convex hull. The first line is the number of - extreme points. Each point is listed, one per line. The points-in-square example - has four extreme points.</dd> + Delaunay triangulation. They are on the + boundary of the convex hull. The first line is the number of + extreme points. Each point is listed, one per line. The points-in-square example + has four extreme points.</dd> <dt> </dt> <dt> </dt> <dd><b>General</b></dd> <dt><a href="qh-optf.htm#FA">FA</a></dt> <dd>compute total area for '<a href="qh-opto.htm#s">s</a>' and '<a href="qh-optf.htm#FS">FS</a>'. This is the - same as the area of the convex hull.</dd> + same as the area of the convex hull.</dd> <dt><a href="qh-opto.htm#o">o</a></dt> <dd>print upper facets of the corresponding convex hull (a paraboloid)</dd> @@ -293,7 +293,7 @@ controls</a></h3> <dd>input data from file. The filename may not use spaces or quotes.</dd> <dt><a href="qh-optt.htm#TO">TO file</a></dt> <dd>output results to file. Use single quotes if the filename - contains spaces (e.g., <tt>TO 'file with spaces.txt'</tt></dd> + contains spaces (e.g., <tt>TO 'file with spaces.txt'</tt></dd> <dt><a href="qh-optt.htm#TFn">TFn</a></dt> <dd>report progress after constructing <em>n</em> facets</dd> <dt><a href="qh-optp.htm#PDk">PDk:1</a></dt> @@ -309,7 +309,7 @@ controls</a></h3> graphics</a></h3> <blockquote> -See <a href="qdelaun.htm#graphics">Delaunay graphics</a>. +See <a href="qdelaun.htm#graphics">Delaunay graphics</a>. They are the same except for Mathematica and Maple output. </blockquote> @@ -363,9 +363,9 @@ and <a href="index.htm#structure">Qhull's data structures</a></p> corresponds to a unique input site. </li> <li><em>furthest-site Delaunay facet</em> - an upper facet of the paraboloid. The last coefficient of its normal is - clearly positive.</li> - <li><em>furthest-site Delaunay region</em> - a furthest-site Delaunay - facet projected to the input sites</li> + clearly positive.</li> + <li><em>furthest-site Delaunay region</em> - a furthest-site Delaunay + facet projected to the input sites</li> <li><em>non-simplicial facet</em> - more than <em>d</em> points are cocircular or cospherical</li> <li><em>good facet</em> - a furthest-site Delaunay facet with optional @@ -387,18 +387,18 @@ for furthest-site Delaunay triangulations. <p><b>Up:</b> <a href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="index.htm#TOC">Qhull manual</a>: Table of Contents<br> <b>To:</b> <a href="qh-quick.htm#programs">Programs</a> -• <a href="qh-quick.htm#options">Options</a> -• <a href="qh-opto.htm#output">Output</a> -• <a href="qh-optf.htm#format">Formats</a> -• <a href="qh-optg.htm#geomview">Geomview</a> +• <a href="qh-quick.htm#options">Options</a> +• <a href="qh-opto.htm#output">Output</a> +• <a href="qh-optf.htm#format">Formats</a> +• <a href="qh-optg.htm#geomview">Geomview</a> • <a href="qh-optp.htm#print">Print</a> -• <a href="qh-optq.htm#qhull">Qhull</a> -• <a href="qh-optc.htm#prec">Precision</a> +• <a href="qh-optq.htm#qhull">Qhull</a> +• <a href="qh-optc.htm#prec">Precision</a> • <a href="qh-optt.htm#trace">Trace</a><br> -<b>To:</b> <a href="#synopsis">sy</a>nopsis -• <a href="#input">in</a>put • <a href="#outputs">ou</a>tputs -• <a href="#controls">co</a>ntrols • <a href="#graphics">gr</a>aphics -• <a href="#notes">no</a>tes • <a href="#conventions">co</a>nventions +<b>To:</b> <a href="#synopsis">sy</a>nopsis +• <a href="#input">in</a>put • <a href="#outputs">ou</a>tputs +• <a href="#controls">co</a>ntrols • <a href="#graphics">gr</a>aphics +• <a href="#notes">no</a>tes • <a href="#conventions">co</a>nventions • <a href="#options">op</a>tions <!-- GC common information --> <hr> diff --git a/html/qdelaun.htm b/html/qdelaun.htm index e6492cc..c559066 100644 --- a/html/qdelaun.htm +++ b/html/qdelaun.htm @@ -53,7 +53,7 @@ by O'Rourke [<a href="index.htm#orou94">'94</a>]. </p> <a href="qh-optf.htm#Fv">Fv</a> <a href="qh-optq.htm#Qt">Qt</a></dt> <dd>Compute the 2-d Delaunay triangulation of a triangle and a small square. Write a summary and unoriented - regions to the console. Produce triangulated output.</dd> + regions to the console. Produce triangulated output.</dd> <dt> </dt> <dt><b>Example:</b> rbox 10 D2 | qdelaunay <a href="qh-optq.htm#QJn">QJ</a> <a href="qh-opto.htm#s">s</a> @@ -231,60 +231,60 @@ outputs</a></h3> <dd><b>Delaunay regions</b></dd> <dt><a href="qh-opto.htm#i">i</a></dt> <dd>list input sites for each Delaunay region. The first line is the number of regions. The - remaining lines list the input sites for each region. The regions are - oriented. In 3-d and + remaining lines list the input sites for each region. The regions are + oriented. In 3-d and higher, report cospherical sites by adding extra points. Use triangulated - output ('<a href="qh-optq.htm#Qt">Qt</a>') to avoid non-simpicial regions. For the circle-in-square example, - eight Delaunay regions are triangular and the ninth has four input sites.</dd> + output ('<a href="qh-optq.htm#Qt">Qt</a>') to avoid non-simpicial regions. For the circle-in-square example, + eight Delaunay regions are triangular and the ninth has four input sites.</dd> <dt><a href="qh-optf.htm#Fv">Fv</a></dt> <dd>list input sites for each Delaunay region. The first line is the number of regions. - Each remaining line starts with the number of input sites. The regions - are unoriented. For the circle-in-square example, - eight Delaunay regions are triangular and the ninth has four input sites.</dd> + Each remaining line starts with the number of input sites. The regions + are unoriented. For the circle-in-square example, + eight Delaunay regions are triangular and the ninth has four input sites.</dd> <dt><a href="qh-optf.htm#Fn">Fn</a></dt> <dd>list neighboring regions for each Delaunay region. The first line is the - number of regions. Each remaining line starts with the number of - neighboring regions. Negative indices (e.g., <em>-1</em>) indicate regions - outside of the Delaunay triangulation. - For the circle-in-square example, the four regions on the square are neighbors to - the region-at-infinity.</dd> + number of regions. Each remaining line starts with the number of + neighboring regions. Negative indices (e.g., <em>-1</em>) indicate regions + outside of the Delaunay triangulation. + For the circle-in-square example, the four regions on the square are neighbors to + the region-at-infinity.</dd> <dt><a href="qh-optf.htm#FN">FN</a></dt> <dd>list the Delaunay regions for each input site. The first line is the - total number of input sites. Each remaining line starts with the number of - Delaunay regions. Negative indices (e.g., <em>-1</em>) indicate regions - outside of the Delaunay triangulation. - For the circle-in-square example, each point on the circle belongs to four - Delaunay regions. Use '<a href="qh-optq.htm#Qc">Qc</a> FN' - to include coincident input sites and deleted vertices. </dd> + total number of input sites. Each remaining line starts with the number of + Delaunay regions. Negative indices (e.g., <em>-1</em>) indicate regions + outside of the Delaunay triangulation. + For the circle-in-square example, each point on the circle belongs to four + Delaunay regions. Use '<a href="qh-optq.htm#Qc">Qc</a> FN' + to include coincident input sites and deleted vertices. </dd> <dt><a href="qh-optf.htm#Fa">Fa</a></dt> <dd>print area for each Delaunay region. The first line is the number of regions. - The areas follow, one line per region. For the circle-in-square example, the - cocircular region has area 0.4. </dd> + The areas follow, one line per region. For the circle-in-square example, the + cocircular region has area 0.4. </dd> <dt> </dt> <dt> </dt> <dd><b>Input sites</b></dd> <dt><a href="qh-optf.htm#Fc">Fc</a></dt> <dd>list coincident input sites for each Delaunay region. - The first line is the number of regions. The remaining lines start with - the number of coincident sites and deleted vertices. Deleted vertices - indicate highly degenerate input (see'<A href="qh-optf.htm#Fs">Fs</a>'). - A coincident site is assigned to one Delaunay - region. Do not use '<a href="qh-optq.htm#QJn">QJ</a>' with 'Fc'; the joggle will separate - coincident sites.</dd> + The first line is the number of regions. The remaining lines start with + the number of coincident sites and deleted vertices. Deleted vertices + indicate highly degenerate input (see'<A href="qh-optf.htm#Fs">Fs</a>'). + A coincident site is assigned to one Delaunay + region. Do not use '<a href="qh-optq.htm#QJn">QJ</a>' with 'Fc'; the joggle will separate + coincident sites.</dd> <dt><a href="qh-optf.htm#FP">FP</a></dt> <dd>print coincident input sites with distance to nearest site (i.e., vertex). The first line is the - number of coincident sites. Each remaining line starts with the point ID of - an input site, followed by the point ID of a coincident point, its region, and distance. + number of coincident sites. Each remaining line starts with the point ID of + an input site, followed by the point ID of a coincident point, its region, and distance. Includes deleted vertices which - indicate highly degenerate input (see'<A href="qh-optf.htm#Fs">Fs</a>'). + indicate highly degenerate input (see'<A href="qh-optf.htm#Fs">Fs</a>'). Do not use '<a href="qh-optq.htm#QJn">QJ</a>' with 'FP'; the joggle will separate - coincident sites.</dd> + coincident sites.</dd> <dt><a href="qh-optf.htm#Fx">Fx</a></dt> <dd>list extreme points of the input sites. These points are on the - boundary of the convex hull. The first line is the number of - extreme points. Each point is listed, one per line. The circle-in-square example - has four extreme points.</dd> + boundary of the convex hull. The first line is the number of + extreme points. Each point is listed, one per line. The circle-in-square example + has four extreme points.</dd> <dt> </dt> <dt> </dt> <dd><b>General</b></dd> @@ -339,7 +339,7 @@ degenerate facets of zero area.</dd> <dd>input data from file. The filename may not use spaces or quotes.</dd> <dt><a href="qh-optt.htm#TO">TO file</a></dt> <dd>output results to file. Use single quotes if the filename - contains spaces (e.g., <tt>TO 'file with spaces.txt'</tt></dd> + contains spaces (e.g., <tt>TO 'file with spaces.txt'</tt></dd> <dt><a href="qh-optt.htm#TFn">TFn</a></dt> <dd>report progress after constructing <em>n</em> facets</dd> <dt><a href="qh-optp.htm#PDk">PDk:1</a></dt> @@ -463,7 +463,7 @@ conventions</a>.</p> site's coordinates</li> <li><em>coplanar point</em> - a <em>coincident</em> input site or a deleted vertex. Deleted vertices - indicate highly degenerate input.</li> + indicate highly degenerate input.</li> <li><em>vertex</em> - a point on the paraboloid. It corresponds to a unique input site. </li> <li><em>point-at-infinity</em> - a point added above the @@ -570,7 +570,7 @@ Geomview options (2-d and 3-d) Gi - inner planes only Gn - no planes Go - outer planes only - Gc - centrums + Gc - centrums Gh - hyperplane intersections Gr - ridges GDn - drop dimension n in 3-d and 4-d output diff --git a/html/qh-code.htm b/html/qh-code.htm index 6f5126f..502971c 100644 --- a/html/qh-code.htm +++ b/html/qh-code.htm @@ -48,25 +48,24 @@ Contents </a></h2> <li><a href="#performance">Performance</a> of Qhull</li> <li><a href="#cpp">Calling Qhull</a> from C++ programs <ul> - <li><a href="#coordinate-cpp">CoordinateIterator</a></li> - <li><a href="#qhull-cpp">Qhull</a></li> - <li><a href="#error-cpp">QhullError</a></li> - <li><a href="#facet-cpp">QhullFacet</a></li> - <li><a href="#facetlist-cpp">QhullFacetList</a></li> - <li><a href="#facetset-cpp">QhullFacetSet</a></li> - <li><a href="#iterator-cpp">QhullIterator</a></li> - <li><a href="#linkedlist-cpp">QhullLinkedList</a></li> - <li><a href="#point-cpp">QhullPoint</a></li> - <li><a href="#qh-cpp">QhullQh</a></li> - <li><a href="#pointset-cpp">QhullPointSet</a></li> - <li><a href="#ridge-cpp">QhullRidge</a></li> - <li><a href="#ridgeset-cpp">QhullRidgeSet</a></li> - <li><a href="#set-cpp">QhullSet</a></li> - <li><a href="#vertex-cpp">QhullVertex</a></li> - <li><a href="#vertexlist-cpp">QhullVertexList</a></li> - <li><a href="#vertexset-cpp">QhullVertexSet</a></li> - <li><a href="#rbox-cpp">RboxPoints</a></li> - <li><a href="#usingqhull-cpp">UsingLibQhull</a></li> + <li><a href="#coordinate-cpp">CoordinateIterator</a></li> + <li><a href="#qhull-cpp">Qhull</a></li> + <li><a href="#error-cpp">QhullError</a></li> <li><a href="#facet-cpp">QhullFacet</a></li> + <li><a href="#facetlist-cpp">QhullFacetList</a></li> + <li><a href="#facetset-cpp">QhullFacetSet</a></li> + <li><a href="#iterator-cpp">QhullIterator</a></li> + <li><a href="#linkedlist-cpp">QhullLinkedList</a></li> + <li><a href="#point-cpp">QhullPoint</a></li> + <li><a href="#qh-cpp">QhullQh</a></li> + <li><a href="#pointset-cpp">QhullPointSet</a></li> + <li><a href="#ridge-cpp">QhullRidge</a></li> + <li><a href="#ridgeset-cpp">QhullRidgeSet</a></li> + <li><a href="#set-cpp">QhullSet</a></li> + <li><a href="#vertex-cpp">QhullVertex</a></li> + <li><a href="#vertexlist-cpp">QhullVertexList</a></li> + <li><a href="#vertexset-cpp">QhullVertexSet</a></li> + <li><a href="#rbox-cpp">RboxPoints</a></li> + <li><a href="#usingqhull-cpp">UsingLibQhull</a></li> </ul> <li><a href="#library">Calling Qhull</a> from C programs <ul> @@ -78,7 +77,7 @@ Contents </a></h2> <li><a href="#inc">On-line construction</a> with qh_addpoint()</li> <li><a href="#mem">Sets and quick memory</a> allocation</li> - <li><a href="#tricoplanar">Tricoplanar facets</a> and option 'Qt'</li> + <li><a href="#tricoplanar">Tricoplanar facets</a> and option 'Qt'</li> <li><a href="#vneighbor">Vertex neighbors</a> of a vertex</li> <li><a href="#vertices">Voronoi vertices</a> of a region</li> <li><a href="#ridge">Voronoi vertices</a> of a ridge</li> diff --git a/html/qh-eg.htm b/html/qh-eg.htm index 31c3bce..7cf3d52 100644 --- a/html/qh-eg.htm +++ b/html/qh-eg.htm @@ -11,13 +11,13 @@ page</a> for Qhull <br> <b>Up:</b> <a href="index.htm#TOC">Qhull manual</a>: Table of Contents<br> <b>To:</b> <a href="qh-quick.htm#programs">Programs</a> -• <a href="qh-quick.htm#options">Options</a> -• <a href="qh-opto.htm#output">Output</a> -• <a href="qh-optf.htm#format">Formats</a> -• <a href="qh-optg.htm#geomview">Geomview</a> +• <a href="qh-quick.htm#options">Options</a> +• <a href="qh-opto.htm#output">Output</a> +• <a href="qh-optf.htm#format">Formats</a> +• <a href="qh-optg.htm#geomview">Geomview</a> • <a href="qh-optp.htm#print">Print</a> -• <a href="qh-optq.htm#qhull">Qhull</a> -• <a href="qh-optc.htm#prec">Precision</a> +• <a href="qh-optq.htm#qhull">Qhull</a> +• <a href="qh-optc.htm#prec">Precision</a> • <a href="qh-optt.htm#trace">Trace</a><br> <b>To: </b><a href="#TOC">Qhull examples: Table of Contents</a> (please wait while loading)<br> @@ -35,7 +35,7 @@ href="index.htm#geomview">Geomview</a>. You will need to use a Unix computer with a copy of Geomview. <p> If you are not running Unix, you can view <a -href="http://www.geom.uiuc.edu/graphics/pix/Special_Topics/Computational_Geometry/welcome.html">pictures</a> +href="http://www.geom.uiuc.edu/graphics/pix/Special_Topics/Computational_Geometry/welcome.html">pictures</a> for some of the examples. To understand Qhull without Geomview, try the examples in <a href="qh-quick.htm#programs">Programs</a> and <a href="qh-quick.htm#programs">Programs/input</a>. You can also try small @@ -90,7 +90,7 @@ Contents </a></h2> </ul> </li> <li><a href="#TOC">»</a> <a name="joggle">Triangulated output or joggled input</a> - <ul> + <ul> <li><a href="#15a">eg.15a.surface</a></li> <li><a href="#15b">eg.15b.triangle</a></li> <li><a href="#15c">eg.15c.joggle</a></li> @@ -228,7 +228,7 @@ vertices.</p> <p>This is a combination of the diamond distribution and the sphere.</p> -<h3><a href="#2d">»</a><a name="09">rbox 100 L3 G0.5 s | qconvex +<h3><a href="#2d">»</a><a name="09">rbox 100 L3 G0.5 s | qconvex G >eg.09.lens </a></h3> <p>Each half of the lens distribution lies on a sphere of radius @@ -304,7 +304,7 @@ does not work with facet merging.</p> <h3><a href="#joggle">»</a><a name="15a">rbox 500 W0 | qconvex QR0 Qc Gvp >eg.15a.surface</a></h3> <p>This is the convex hull of 500 points on the surface of -a cube. Note the large, non-simplicial facet for each face. +a cube. Note the large, non-simplicial facet for each face. Qhull merges non-convex facets. <p>If the facets were not merged, Qhull @@ -318,9 +318,9 @@ rbox 500 W0 | qhull QR0 Q0 <p> <h3><a href="#joggle">»</a><a name="15b">rbox 500 W0 | qconvex QR0 Qt Qc Gvp >eg.15b.triangle</a></h3> -<p>Like the previous examples, this is the convex hull of 500 points on the +<p>Like the previous examples, this is the convex hull of 500 points on the surface of a cube. Option '<a href="qh-optq.htm#Qt">Qt</a>' triangulates the -non-simplicial facets. Triangulated output is +non-simplicial facets. Triangulated output is particularly helpful for Delaunay triangulations. <p> @@ -340,7 +340,7 @@ this process until no precision problems occur. <p> Joggled input is a simple solution to precision problems in computational geometry. Qhull can also merge facets to handle -precision problems. See <a href="qh-impre.htm#joggle">Merged facets or joggled input</a>. +precision problems. See <a href="qh-impre.htm#joggle">Merged facets or joggled input</a>. <h2><a href="#TOC">»</a>Delaunay and Voronoi diagrams</h2> @@ -354,7 +354,7 @@ points centered on the square. <p>The Delaunay triangulation is the triangulation with empty circumcircles. The input for this example is unusual because it -includes six co-circular points. Every triangular subset of these +includes six co-circular points. Every triangular subset of these points has the same circumcircle. Option '<a href="qh-optq.htm#Qt">Qt</a>' triangulates the co-circular facet.</p> @@ -382,7 +382,7 @@ the Z-axis, you'll see that points and edges coincide.</p> <eg.data.17 Gna >eg.17d.voronoi.2</a></h3> <p>The Voronoi diagram is the dual of the Delaunay triangulation. -Here you see the original sites and the Voronoi vertices. +Here you see the original sites and the Voronoi vertices. Notice the each vertex is equidistant from three sites. The edges indicate the Voronoi region for a site. Qhull does not draw the unbounded @@ -393,8 +393,8 @@ rays from option '<a href="qh-optf.htm#Fo2">Fo</a>'. </p> <p>Instead -of triangulated output ('<a href="qh-optq.htm#Qt">Qt</a>'), this -example uses joggled input ('<a href="qh-optq.htm#QJn">QJ</a>'). +of triangulated output ('<a href="qh-optq.htm#Qt">Qt</a>'), this +example uses joggled input ('<a href="qh-optq.htm#QJn">QJ</a>'). Normally, you should use neither 'QJ' nor 'Qt' for Voronoi diagrams. <h3><a href="#delaunay">»</a><a name="17e">qvoronoi <eg.data.17 @@ -402,12 +402,12 @@ Gna >eg.17e.voronoi.2i </a></h3> <p>This looks the same as the previous diagrams, but take a look at the data. Run 'qvoronoi p <eg/eg.data.17'. This prints -the Voronoi vertices. +the Voronoi vertices. <p>With 'QJ', there are four nearly identical Voronoi vertices within 10^-11 of the origin. Option 'QJ' joggled the input. After the joggle, -the cocircular -input sites are no longer cocircular. The corresponding Voronoi vertices are +the cocircular +input sites are no longer cocircular. The corresponding Voronoi vertices are similar but not identical. <p>This example does not use options 'Qt' or 'QJ'. The cocircular @@ -514,11 +514,11 @@ This is because a random perturbation of '<a href="qh-optc.htm#Rn">R0.01 </a>' is equivalent to losing all but 1.8 digits of precision. The outer planes float above the points because Qhull needs to allow for the maximum roundoff error. </p> -<p> -If you start with a smaller random perturbation, you +<p> +If you start with a smaller random perturbation, you can use joggle ('<a href="qh-optq.htm#QJn">QJn</a>') to avoid precision problems. You need to set <i>n</i> significantly -larger than the random perturbation. For example, try +larger than the random perturbation. For example, try 'rbox 200 s | qconvex Qc R1e-4 QJ1e-1'. <h3><a href="#merge">»</a><a name="22a">rbox 1000 s| qconvex C0.01 @@ -667,13 +667,13 @@ third picture is a duplicate of the first. </p> page for Qhull</a> <br> <b>Up:</b> <a href="index.htm#TOC">Qhull manual: Table of Contents</a><br> <b>To:</b> <a href="qh-quick.htm#programs">Programs</a> -• <a href="qh-quick.htm#options">Options</a> -• <a href="qh-opto.htm#output">Output</a> -• <a href="qh-optf.htm#format">Formats</a> -• <a href="qh-optg.htm#geomview">Geomview</a> +• <a href="qh-quick.htm#options">Options</a> +• <a href="qh-opto.htm#output">Output</a> +• <a href="qh-optf.htm#format">Formats</a> +• <a href="qh-optg.htm#geomview">Geomview</a> • <a href="qh-optp.htm#print">Print</a> -• <a href="qh-optq.htm#qhull">Qhull</a> -• <a href="qh-optc.htm#prec">Precision</a> +• <a href="qh-optq.htm#qhull">Qhull</a> +• <a href="qh-optc.htm#prec">Precision</a> • <a href="qh-optt.htm#trace">Trace</a><br> <b>To: </b><a href="#TOC">Qhull examples: Table of Contents</a> (please wait while loading)<br> diff --git a/html/qh-faq.htm b/html/qh-faq.htm index c624d1a..7851b7e 100644 --- a/html/qh-faq.htm +++ b/html/qh-faq.htm @@ -97,26 +97,26 @@ first. </ul> <li>Delaunay and Voronoi diagram questions<ul> <li><a href="#maxsphere">How</a> do I get the radii of the empty - spheres for each Voronoi vertex? + spheres for each Voronoi vertex? - <li><A href="#flat">How</A> do I get rid of nearly flat Delaunay + <li><A href="#flat">How</A> do I get rid of nearly flat Delaunay triangles? - <li><A href="#square">What</A> is the Voronoi diagram of a square? + <li><A href="#square">What</A> is the Voronoi diagram of a square? - <li><A href="#vclosest">How</A> do I find the Delaunay triangle or Voronoi + <li><A href="#vclosest">How</A> do I find the Delaunay triangle or Voronoi region that is closest to a point? - <li><A href="#mesh">How</A> do I compute the Delaunay triangulation of a + <li><A href="#mesh">How</A> do I compute the Delaunay triangulation of a non-convex object? - <li><A href="#mesh">How</A> do I mesh a volume from a set of triangulated + <li><A href="#mesh">How</A> do I mesh a volume from a set of triangulated surface points? - <li><A href="#constrained">Can</A> Qhull produce a triangular mesh for an + <li><A href="#constrained">Can</A> Qhull produce a triangular mesh for an object? - <li><A href="#dridges">For</A> 3-d Delaunay triangulations, how do I + <li><A href="#dridges">For</A> 3-d Delaunay triangulations, how do I report the triangles of each tetrahedron? <li><A href="#vsphere">How</A> do I construct the Voronoi diagram of cospherical points? @@ -134,13 +134,13 @@ first. </ul> <li>Halfspace questions<ul> <li><A href="#halfspace">How</A> do I compute the - intersection of halfspaces with Qhull?</li> + intersection of halfspaces with Qhull?</li> </ul> <li><a name="library">Qhull library</a> questions<ul> - <li><A href="#math">Is</A> Qhull available for Mathematica, Matlab, or + <li><A href="#math">Is</A> Qhull available for Mathematica, Matlab, or Maple? - <li><A href="#ridges">Why</A> are there too few ridges? + <li><A href="#ridges">Why</A> are there too few ridges? <li><A href="#call">Can</A> Qhull use coordinates without placing them in a data file? <li><A href="#size">How</A> large are Qhull's data structures? @@ -320,7 +320,7 @@ problems. It can triangulate the output ('<A <h2><A href="#TOC">»</A><a name="convex">Convex hull questions</a></h2> <h4><A href="#TOC">»</A><a name="area">How</a> do I report just the area - and volume of a convex hull?</h4><blockquote> + and volume of a convex hull?</h4><blockquote> Use option 'FS'. For example, @@ -473,7 +473,7 @@ prevents coincident input sites. </p> diagram questions</a></h2> <h4><A href="#TOC">»</A><a name="maxsphere">How</a> do I get the radii of the empty - spheres for each Voronoi vertex?</h4><blockquote> + spheres for each Voronoi vertex?</h4><blockquote> Use option '<A href="qh-optf.htm#Fi">Fi</A>' to list each bisector (i.e. Delaunay ridge). Then compute the minimum distance for each Voronoi vertex. @@ -536,7 +536,7 @@ or triangulated output ('<A href="qh-optq.htm#Qt">Qt</A>'). </blockquote> <h4><A href="#TOC">»</A><a name="square">What</a> is the Voronoi diagram - of a square?</h4><blockquote> + of a square?</h4><blockquote> <p> Consider a square, @@ -725,22 +725,22 @@ every combination of 3 vertices. Each triangle is a <p>For example, </p> <pre> - rbox 10 | qdelaunay Qt i - 14 - 9 5 8 7 - 0 9 8 7 - 5 3 8 7 - 3 0 8 7 - 5 4 8 1 - 4 6 8 1 - 2 9 5 8 - 4 2 5 8 - 4 2 9 5 - 6 2 4 8 - 9 2 0 8 - 2 6 0 8 - 2 4 9 1 - 2 6 4 1 + rbox 10 | qdelaunay Qt i + 14 + 9 5 8 7 + 0 9 8 7 + 5 3 8 7 + 3 0 8 7 + 5 4 8 1 + 4 6 8 1 + 2 9 5 8 + 4 2 5 8 + 4 2 9 5 + 6 2 4 8 + 9 2 0 8 + 2 6 0 8 + 2 4 9 1 + 2 6 4 1 </pre> <p>is the Delaunay triangulation of 10 random points. Ridge 9-5-8 @@ -1084,7 +1084,7 @@ rbox 1000 | qconvex W0.05 C0.05 PA6 Fo <h2><A href="#TOC">»</A>Halfspace questions</h2> <h4><A href="#TOC">»</A><a name="halfspace">How</a> do I compute the - intersection of halfspaces with Qhull?</h4><blockquote> + intersection of halfspaces with Qhull?</h4><blockquote> <p>Qhull computes the halfspace intersection about a point. The point must be inside all of the halfspaces. Given a point, a @@ -1110,15 +1110,15 @@ questions</a></h2> <p>Z. You of <a href="http://www.mathworks.com">MathWorks</a> added qhull to MATLAB 6. See functions <a href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/convhulln.shtml" >convhulln</a>, - <a href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/delaunayn.shtml" + <a href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/delaunayn.shtml" >delaunayn</a>, - <a href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/griddata3.shtml" + <a href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/griddata3.shtml" >griddata3</a>, - <a href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/griddatan.shtml" + <a href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/griddatan.shtml" >griddatan</a>, - <a href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/tsearch.shtml" + <a href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/tsearch.shtml" >tsearch</a>, - <a href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/tsearchn.shtml" + <a href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/tsearchn.shtml" >tsearchn</a>, and <a href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/voronoin.shtml" >voronoin</a>. V. Brumberg update MATLAB R14 for Qhull 2003.1 and triangulated output. @@ -1170,15 +1170,15 @@ each ridge once (instead of twice). For example, qh_makeridges(facet); facet->visitId= qh visit_id; FOREACHridge_(facet->ridges) { - neighbor= otherfacet_(ridge, visible); - if (neighbor->visitid != qh visit_id) + neighbor= otherfacet_(ridge, visible); + if (neighbor->visitid != qh visit_id) printf(" ridge r%d between f%d and f%d\n", ridge->id, ridge->top->id, ridge->bottom->id); } } </pre></blockquote> </blockquote><h4><A href="#TOC">»</A><a name="call">Can</a> Qhull use coordinates without placing - them in a data file?</h4><blockquote> + them in a data file?</h4><blockquote> <p>Use qh_call_qhull(). See user_eg.c for an example. See the manual for an introduction to the Qhull library. @@ -1233,10 +1233,10 @@ facets. In pseudo-code: </p> <pre> for each facet of the triangulation - if the facet is Delaunay (i.e., part of the lower convex hull) - for each ridge of the facet - if the ridge's neighboring facet has not been visited - ... process a ridge of the Delaunay triangulation ... + if the facet is Delaunay (i.e., part of the lower convex hull) + for each ridge of the facet + if the ridge's neighboring facet has not been visited + ... process a ridge of the Delaunay triangulation ... </pre> <p>In undebugged, C code: </p> @@ -1244,26 +1244,26 @@ facets. In pseudo-code: </p> <pre> qh visit_id++; FORALLfacets_(facetlist) - if (!facet->upperdelaunay) { - facet->visitid= qh visit_id; - qh_makeridges(facet); - FOREACHridge_(facet->ridges) { - neighbor= otherfacet_(ridge, facet); - if (neighbor->visitid != qh visit_id) { - /* Print ridge here with facet-id and neighbor-id */ - /*fprintf(fp, "f%d\tf%d\t",facet->id,neighbor->ID);*/ - FOREACHvertex_(ridge->vertices) - fprintf(fp,"%d ",qh_pointid (vertex->point) ); - qh_printfacetNvertex_simplicial (fp, facet, format); - fprintf(fp," "); - if(neighbor->upperdelaunay) - fprintf(fp," -1 -1 -1 -1 "); - else - qh_printfacetNvertex_simplicial (fp, neighbor, format); - fprintf(fp,"\n"); - } - } - } + if (!facet->upperdelaunay) { + facet->visitid= qh visit_id; + qh_makeridges(facet); + FOREACHridge_(facet->ridges) { + neighbor= otherfacet_(ridge, facet); + if (neighbor->visitid != qh visit_id) { + /* Print ridge here with facet-id and neighbor-id */ + /*fprintf(fp, "f%d\tf%d\t",facet->id,neighbor->ID);*/ + FOREACHvertex_(ridge->vertices) + fprintf(fp,"%d ",qh_pointid (vertex->point) ); + qh_printfacetNvertex_simplicial (fp, facet, format); + fprintf(fp," "); + if(neighbor->upperdelaunay) + fprintf(fp," -1 -1 -1 -1 "); + else + qh_printfacetNvertex_simplicial (fp, neighbor, format); + fprintf(fp,"\n"); + } + } + } } </pre> @@ -1285,9 +1285,9 @@ visit each facet of the lower convex hull, use: </p> ... FORALLfacets { - if (!facet->upperdelaunay) { - ... only facets for Delaunay regions ... - } + if (!facet->upperdelaunay) { + ... only facets for Delaunay regions ... + } } </pre> @@ -1422,7 +1422,7 @@ vertex of the closest Delaunay triangle. </p> <pre> realT dist, bestdist= REALmax; - vertexT *bestvertex= NULL, *vertex, **vertexp; + vertexT *bestvertex= NULL, *vertex, **vertexp; /* 'facet' is the closest Delaunay triangle to 'point' */ diff --git a/html/qh-get.htm b/html/qh-get.htm index c336561..0608139 100644 --- a/html/qh-get.htm +++ b/html/qh-get.htm @@ -27,11 +27,11 @@ width="100" height="100"></a> Qhull Downloads</h1> convex hull. Qhull handles roundoff errors from floating point arithmetic. It can approximate a convex hull. </p> - <p>Visit <a href="http://www.qhull.org/news">Qhull News</a> - for news, bug reports, change history, and users.</p> + <p>Visit <a href="http://www.qhull.org/news">Qhull News</a> + for news, bug reports, change history, and users.</p> - <p>A serious bug was found in Qhull 2003.1. Please upgrade to 2010.1.</p> - </li> + <p>A serious bug was found in Qhull 2003.1. Please upgrade to 2010.1.</p> + </li> <li><a href="http://www.qhull.org/download/qhull-2010.1.zip">Download: Qhull 2010.1 for Windows</a> (2.4 Mbytes) <p>Type: console programs for @@ -39,30 +39,30 @@ width="100" height="100"></a> Qhull Downloads</h1> <p>Includes executables, documentation, sources files, and a cygwin Makefile. It runs in a DOS window.</p> </li> - <li><a href="http://www.qhull.org/download/qhull-2010.1-src.tgz">Download: Qhull 2010.1 for Unix</a> (660K) - <p>Type: C source code for 32-bit and 64-bit architectures</p> - <p>Includes documentation, source files, a simple Makefile, DevStudio project files, and Qt project files. - Includes preliminary C++ support. + <li><a href="http://www.qhull.org/download/qhull-2010.1-src.tgz">Download: Qhull 2010.1 for Unix</a> (660K) + <p>Type: C source code for 32-bit and 64-bit architectures</p> + <p>Includes documentation, source files, a simple Makefile, DevStudio project files, and Qt project files. + Includes preliminary C++ support. The C++ interface may change without notice. If using gcc 4.1, 4.2, or 4.3, please compile qset.s with -fno-strict-aliasing (otherwise qhull segfaults) [Karas, Krishnaswami]. See <a href=http://www.qhull.org/news/#bugs>Bugs</a> [Apr 2008] for a patch. </p> - <p>Debian, rpm, and Autoconf distributions will appear later</p> + <p>Debian, rpm, and Autoconf distributions will appear later</p> </li> - <li><a href="http://gitorious.org/qhull">Gitorious Qhull</a> (git://gitorious.org/qhull/qhull.git) - <p>Type: git repository for Qhull</b> - <p>Includes documentation, source files, C++ interface, - and test programs. The C++ interface may change without notice. - If using gcc 4.1, 4.2, or 4.3, please compile qset.s with + <li><a href="http://gitorious.org/qhull">Gitorious Qhull</a> (git://gitorious.org/qhull/qhull.git) + <p>Type: git repository for Qhull</b> + <p>Includes documentation, source files, C++ interface, + and test programs. The C++ interface may change without notice. + If using gcc 4.1, 4.2, or 4.3, please compile qset.s with -fno-strict-aliasing (otherwise qhull segfaults) [Karas, Krishnaswami]. See <a href=http://www.qhull.org/news/#bugs>Bugs</a> [Apr 2008] for a patch. </p> </li> <!--- - <li><a href="http://www.qhull.org/download/qhull-2010.1.tgz">Download: Qhull 2010.1 for Unix</a> (725K) - <p>Type: C source code for Unix systems</p> - <p>Includes documentation, source files, and Autoconf/Automake/Libtool + <li><a href="http://www.qhull.org/download/qhull-2010.1.tgz">Download: Qhull 2010.1 for Unix</a> (725K) + <p>Type: C source code for Unix systems</p> + <p>Includes documentation, source files, and Autoconf/Automake/Libtool support [R. Laboissiere]. Includes preliminary C++ support. If using gcc 4.1, 4.2, or 4.3, please compile qset.s with -fno-strict-aliasing (otherwise qhull segfaults) [Karas, Krishnaswami]. @@ -72,40 +72,40 @@ width="100" height="100"></a> Qhull Downloads</h1> <li><a href=http://savannah.nongnu.org/files/?group=qhull>Download: Qhull 2002.1 for Unix</a> - <p>Includes documentation, source files, and a configure Makefile. - Includes Debian configuration files. Includes downloads of Qhull's current and previous - versions.</p> + <p>Includes documentation, source files, and a configure Makefile. + Includes Debian configuration files. Includes downloads of Qhull's current and previous + versions.</p> - <p>B. Pearlmutter created a + <p>B. Pearlmutter created a <a href=http://packages.debian.org/stable/math/qhull-bin.html>Debian build</a> of Qhull 3.1 and upgraded it to 2002.1. </li> <li><a href="http://www.qhull.org/download/qhull-2003.1-1mdk.i686.rpm">Download: Qhull version 2003.1 i686 rpm</a> (670K) <p>Type: rpm build for Mandrake 9.2 and RedHat - [<a href="http://www.qhull.org/download/qhull.spec">qhull.spec</a>]</p> + [<a href="http://www.qhull.org/download/qhull.spec">qhull.spec</a>]</p> <p>For other Linux systems, use the <a href="http://www.qhull.org/download/qhull-2003.1-1mdk.src.rpm">src rpm</a> [L. Mazet] </li> <li><a href="http://packages.debian.org/search?keywords=qhull">Download: - Qhull 2003.1 for Debian</a> - <p>Type: Debian packages + Qhull 2003.1 for Debian</a> + <p>Type: Debian packages <p>Includes documentation, source files, and previous distributions [R. Laboissiere].</p> - </li> - --> + </li> + --> <li><a href=http://savannah.nongnu.org/projects/qhull/>Qhull@Savannah</a> - <p>Type: CVS repository</b> + <p>Type: CVS repository</b> - <p>CVS repositiory of Qhull sources, documentation, and Makefiles. No longer active. Use gitorious instead. - </p> + <p>CVS repositiory of Qhull sources, documentation, and Makefiles. No longer active. Use gitorious instead. + </p> </li> <li><a href=http://www6.uniovi.es/ftp/pub/mirrors/geom.umn.edu/software/ghindex.html>Spanish - mirror site</a> <p>Download Qhull's current and - previous versions from <a href=http://www.etsimo.uniovi.es/derechos.html>Servidor - WWW de la Escuela de Minas</a> of the Universidad de Oviedo.</p> + mirror site</a> <p>Download Qhull's current and + previous versions from <a href=http://www.etsimo.uniovi.es/derechos.html>Servidor + WWW de la Escuela de Minas</a> of the Universidad de Oviedo.</p> </li> <li><a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.117.405&rep=rep1&type=url&i=0">Download: diff --git a/html/qh-impre.htm b/html/qh-impre.htm index d9a9905..1aa5d8a 100644 --- a/html/qh-impre.htm +++ b/html/qh-impre.htm @@ -372,11 +372,11 @@ and nearly cocircular points. <p>For example, compare <pre> - rbox 1000 W0 t | qconvex Qb2:-1e-14B2:1e-14 + rbox 1000 W0 t | qconvex Qb2:-1e-14B2:1e-14 </pre> with <pre> - rbox 1000 W0 t | qconvex + rbox 1000 W0 t | qconvex </pre> The distributions are the same but the first is compressed to a 2e-14 slab. <p> @@ -391,7 +391,7 @@ further discussion.</p> facets. This is similar to 'Qx'. It may lead to serious precision errors, for example, <pre> - rbox 10000 W1e-13 | qhull Q6 Tv + rbox 10000 W1e-13 | qhull Q6 Tv </pre> <p> @@ -417,7 +417,7 @@ produce wide facets. turned off ('<a href="qh-optq.htm#Q10">Q10</a>'), qhull may produce a wide facet:</p> <pre> - RBOX 1000 L100000 s G1e-16 t1002074964 | QHULL Tv Q10 + RBOX 1000 L100000 s G1e-16 t1002074964 | QHULL Tv Q10 </pre> <p> @@ -427,8 +427,8 @@ approximation. For example, if you do not use qdelaunay nor option Delaunay triangulation of nearly cocircular points may produce a poor approximation: <pre> - RBOX s 5000 W1e-13 D2 t1002151341 | QHULL d Qt - RBOX 1000 s W1e-13 t1002231672 | QHULL d Tv + RBOX s 5000 W1e-13 D2 t1002151341 | QHULL d Qt + RBOX 1000 s W1e-13 t1002231672 | QHULL d Tv </pre> <p>During @@ -449,7 +449,7 @@ Use option '<a href="qh-optq.htm#Q10">Q10</a>' to try Qhull without special processing for narrow distributions. For example, special processing is needed for: <pre> - RBOX 1000 L100000 s G1e-16 t1002074964 | QHULL Tv Q10 + RBOX 1000 L100000 s G1e-16 t1002074964 | QHULL Tv Q10 </pre> <p>You may turn off the warning message by reducing @@ -463,9 +463,9 @@ A point may be left outside of the convex hull ('<a href="qh-optt.htm#Tv">Tv</a> Examples include the furthest-site Delaunay triangulation of nearly cocircular points plus the origin, and the convex hull of a cone of nearly cocircular points. The width of the band is 10^-13. <pre> - rbox s 1000 W1e-13 P0 D2 t996799242 | qhull d Tv - rbox 1000 s Z1 G1e-13 t1002152123 | qhull Tv - RBOX 1000 s Z1 G1e-13 t1002231668 | QHULL Tv + rbox s 1000 W1e-13 P0 D2 t996799242 | qhull d Tv + rbox 1000 s Z1 G1e-13 t1002152123 | qhull Tv + RBOX 1000 s Z1 G1e-13 t1002231668 | QHULL Tv </pre> <p> @@ -536,7 +536,7 @@ with option '<a href="qh-optc.htm#Cn">C-n</a>'. Delaunay triangulations, a new point may lead to no good facets. For example, try a strong convexity constraint: <pre> - rbox 1000 s t993602376 | qdelaunay C-1e-3 + rbox 1000 s t993602376 | qdelaunay C-1e-3 </pre> </ul> diff --git a/html/qh-optc.htm b/html/qh-optc.htm index 1b359af..453b607 100644 --- a/html/qh-optc.htm +++ b/html/qh-optc.htm @@ -10,13 +10,13 @@ <p><b>Up:</b> <a href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="index.htm#TOC">Qhull manual</a>: Table of Contents<br> <b>To:</b> <a href="qh-quick.htm#programs">Programs</a> -• <a href="qh-quick.htm#options">Options</a> -• <a href="qh-opto.htm#output">Output</a> -• <a href="qh-optf.htm#format">Formats</a> -• <a href="qh-optg.htm#geomview">Geomview</a> +• <a href="qh-quick.htm#options">Options</a> +• <a href="qh-opto.htm#output">Output</a> +• <a href="qh-optf.htm#format">Formats</a> +• <a href="qh-optg.htm#geomview">Geomview</a> • <a href="qh-optp.htm#print">Print</a> -• <a href="qh-optq.htm#qhull">Qhull</a> -• <a href="qh-optc.htm#prec">Precision</a> +• <a href="qh-optq.htm#qhull">Qhull</a> +• <a href="qh-optc.htm#prec">Precision</a> • <a href="qh-optt.htm#trace">Trace</a></p> <hr> @@ -34,13 +34,13 @@ indicated by an upper-case letter followed by a number. <hr> <p><a href="index.htm#TOC">»</a> <a href="qh-quick.htm#programs">Programs</a> -<a name="prec">•</a> <a href="qh-quick.htm#options">Options</a> -• <a href="qh-opto.htm#output">Output</a> -• <a href="qh-optf.htm#format">Formats</a> -• <a href="qh-optg.htm#geomview">Geomview</a> +<a name="prec">•</a> <a href="qh-quick.htm#options">Options</a> +• <a href="qh-opto.htm#output">Output</a> +• <a href="qh-optf.htm#format">Formats</a> +• <a href="qh-optg.htm#geomview">Geomview</a> • <a href="qh-optp.htm#print">Print</a> -• <a href="qh-optq.htm#qhull">Qhull</a> -• <a href="qh-optc.htm#prec">Precision</a> +• <a href="qh-optq.htm#qhull">Qhull</a> +• <a href="qh-optc.htm#prec">Precision</a> • <a href="qh-optt.htm#trace">Trace</a></p> <h2>Precision options</h2> @@ -53,8 +53,8 @@ of precision errors.</p> <p>By default, Qhull uses options '<a href="#C0">C-0</a>' for 2-d, 3-d and 4-d, and '<a href="qh-optq.htm#Qx">Qx</a>' for 5-d and higher. These options use facet merging to handle precision -errors. You may also use joggled input '<a href="qh-optq.htm#QJn">QJ</a>' -to avoid precision problems. +errors. You may also use joggled input '<a href="qh-optq.htm#QJn">QJ</a>' +to avoid precision problems. For more information see <a href="qh-impre.htm">Imprecision in Qhull</a>.</p> @@ -137,9 +137,9 @@ errors </a></h3> option handles all precision errors in 2-d, 3-d, and 4-d. It is set by default. It may be used in higher dimensions, but sometimes the facet width grows rapidly. It is usually better to -use '<a href="qh-optq.htm#Qx">Qx</a>' in 5-d and higher. +use '<a href="qh-optq.htm#Qx">Qx</a>' in 5-d and higher. Use '<a href="qh-optq.htm#QJn">QJ</a>' to joggle the input -instead of merging facets. +instead of merging facets. Use '<a href="qh-optq.htm#Q0">Q0</a>' to turn both options off.</p> @@ -267,13 +267,13 @@ distinguish coplanar points from interior points.</p> <p><b>Up:</b> <a href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="index.htm#TOC">Qhull manual</a>: Table of Contents<br> <b>To:</b> <a href="qh-quick.htm#programs">Programs</a> -• <a href="qh-quick.htm#options">Options</a> -• <a href="qh-opto.htm#output">Output</a> -• <a href="qh-optf.htm#format">Formats</a> -• <a href="qh-optg.htm#geomview">Geomview</a> +• <a href="qh-quick.htm#options">Options</a> +• <a href="qh-opto.htm#output">Output</a> +• <a href="qh-optf.htm#format">Formats</a> +• <a href="qh-optg.htm#geomview">Geomview</a> • <a href="qh-optp.htm#print">Print</a> -• <a href="qh-optq.htm#qhull">Qhull</a> -• <a href="qh-optc.htm#prec">Precision</a> +• <a href="qh-optq.htm#qhull">Qhull</a> +• <a href="qh-optc.htm#prec">Precision</a> • <a href="qh-optt.htm#trace">Trace</a></p> <!-- GC common information --> <hr> diff --git a/html/qh-optg.htm b/html/qh-optg.htm index 49c9989..baeff1a 100644 --- a/html/qh-optg.htm +++ b/html/qh-optg.htm @@ -10,13 +10,13 @@ <p><b>Up:</b> <a href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="index.htm#TOC">Qhull manual</a>: Table of Contents<br> <b>To:</b> <a href="qh-quick.htm#programs">Programs</a> -• <a href="qh-quick.htm#options">Options</a> -• <a href="qh-opto.htm#output">Output</a> -• <a href="qh-optf.htm#format">Formats</a> -• <a href="qh-optg.htm#geomview">Geomview</a> +• <a href="qh-quick.htm#options">Options</a> +• <a href="qh-opto.htm#output">Output</a> +• <a href="qh-optf.htm#format">Formats</a> +• <a href="qh-optg.htm#geomview">Geomview</a> • <a href="qh-optp.htm#print">Print</a> -• <a href="qh-optq.htm#qhull">Qhull</a> -• <a href="qh-optc.htm#prec">Precision</a> +• <a href="qh-optq.htm#qhull">Qhull</a> +• <a href="qh-optc.htm#prec">Precision</a> • <a href="qh-optt.htm#trace">Trace</a></p> <hr> @@ -28,7 +28,7 @@ src="qh--dt.gif" alt="[delaunay]" align="middle" width="100" height="100"></a> Qhull Geomview options (G)</h1> This section lists the Geomview options for Qhull. These options are -indicated by 'G' followed by a letter. See +indicated by 'G' followed by a letter. See <a href="qh-opto.htm#output">Output</a>, <a href="qh-optp.htm#print">Print</a>, and <a href="qh-optf.htm#format">Format</a> for other output options. @@ -38,13 +38,13 @@ and <a href="qh-optf.htm#format">Format</a> for other output options. <hr> <p><a href="index.htm#TOC">»</a> <a href="qh-quick.htm#programs">Programs</a> -<a name="geomview">•</a> <a href="qh-quick.htm#options">Options</a> -• <a href="qh-opto.htm#output">Output</a> -• <a href="qh-optf.htm#format">Formats</a> -• <a href="qh-optg.htm#geomview">Geomview</a> +<a name="geomview">•</a> <a href="qh-quick.htm#options">Options</a> +• <a href="qh-opto.htm#output">Output</a> +• <a href="qh-optf.htm#format">Formats</a> +• <a href="qh-optg.htm#geomview">Geomview</a> • <a href="qh-optp.htm#print">Print</a> -• <a href="qh-optq.htm#qhull">Qhull</a> -• <a href="qh-optc.htm#prec">Precision</a> +• <a href="qh-optq.htm#qhull">Qhull</a> +• <a href="qh-optc.htm#prec">Precision</a> • <a href="qh-optt.htm#trace">Trace</a></p> <h2>Geomview output options</h2> @@ -72,7 +72,7 @@ dual convex hull. </p> <dd>display transparent 3-d Delaunay triangulation</dd> <dt><a href="#GDn">GDn</a></dt> <dd>drop dimension n in 3-d and 4-d output </dd> - + <dt> </dt> <dt> </dt> <dd><b>Specific</b></dd> @@ -210,8 +210,8 @@ least 1/20'th of the maximum coordinate, and ignores post merging if pre-merging is done.</p> <p>If '<a href="qh-optg.htm#Gv">Gv</a>' (print vertices as -spheres) is also selected, option 'Gp' displays coplanar -points as radii. Select options <a href="qh-optq.htm#Qc">Qc</a>' +spheres) is also selected, option 'Gp' displays coplanar +points as radii. Select options <a href="qh-optq.htm#Qc">Qc</a>' and/or '<a href="qh-optq.htm#Qi">Qi</a>'. Options 'Qc Gpv' displays coplanar points while 'Qci Gpv' displays coplanar and interior points. Option 'Qc' is automatically selected if 'Qi' is not @@ -248,13 +248,13 @@ data. See '<a href="#Gp">Gp</a>' for determining the radius.</p> <p><b>Up:</b> <a href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="index.htm#TOC">Qhull manual</a>: Table of Contents<br> <b>To:</b> <a href="qh-quick.htm#programs">Programs</a> -• <a href="qh-quick.htm#options">Options</a> -• <a href="qh-opto.htm#output">Output</a> -• <a href="qh-optf.htm#format">Formats</a> -• <a href="qh-optg.htm#geomview">Geomview</a> +• <a href="qh-quick.htm#options">Options</a> +• <a href="qh-opto.htm#output">Output</a> +• <a href="qh-optf.htm#format">Formats</a> +• <a href="qh-optg.htm#geomview">Geomview</a> • <a href="qh-optp.htm#print">Print</a> -• <a href="qh-optq.htm#qhull">Qhull</a> -• <a href="qh-optc.htm#prec">Precision</a> +• <a href="qh-optq.htm#qhull">Qhull</a> +• <a href="qh-optc.htm#prec">Precision</a> • <a href="qh-optt.htm#trace">Trace</a></p> <!-- GC common information --> diff --git a/html/qh-opto.htm b/html/qh-opto.htm index d9e357a..ba7eae5 100644 --- a/html/qh-opto.htm +++ b/html/qh-opto.htm @@ -10,13 +10,13 @@ <p><b>Up:</b> <a href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="index.htm#TOC">Qhull manual</a>: Table of Contents<br> <b>To:</b> <a href="qh-quick.htm#programs">Programs</a> -• <a href="qh-quick.htm#options">Options</a> -• <a href="qh-opto.htm#output">Output</a> -• <a href="qh-optf.htm#format">Formats</a> -• <a href="qh-optg.htm#geomview">Geomview</a> +• <a href="qh-quick.htm#options">Options</a> +• <a href="qh-opto.htm#output">Output</a> +• <a href="qh-optf.htm#format">Formats</a> +• <a href="qh-optg.htm#geomview">Geomview</a> • <a href="qh-optp.htm#print">Print</a> -• <a href="qh-optq.htm#qhull">Qhull</a> -• <a href="qh-optc.htm#prec">Precision</a> +• <a href="qh-optq.htm#qhull">Qhull</a> +• <a href="qh-optc.htm#prec">Precision</a> • <a href="qh-optt.htm#trace">Trace</a></p> <hr> @@ -38,13 +38,13 @@ options. </p> <hr> <p><a href="index.htm#TOC">»</a> <a href="qh-quick.htm#programs">Programs</a> -<a name="output">•</a> <a href="qh-quick.htm#options">Options</a> -• <a href="qh-opto.htm#output">Output</a> -• <a href="qh-optf.htm#format">Formats</a> -• <a href="qh-optg.htm#geomview">Geomview</a> +<a name="output">•</a> <a href="qh-quick.htm#options">Options</a> +• <a href="qh-opto.htm#output">Output</a> +• <a href="qh-optf.htm#format">Formats</a> +• <a href="qh-optg.htm#geomview">Geomview</a> • <a href="qh-optp.htm#print">Print</a> -• <a href="qh-optq.htm#qhull">Qhull</a> -• <a href="qh-optc.htm#prec">Precision</a> +• <a href="qh-optq.htm#qhull">Qhull</a> +• <a href="qh-optc.htm#prec">Precision</a> • <a href="qh-optt.htm#trace">Trace</a></p> <h2>Output options</h2> @@ -89,7 +89,7 @@ all facets </a></h3> <p>Print <a href=../src/libqhull.h#facetT>all fields</a> of all facets. The facet is the primary <a href=index.htm#structure>data structure</a> for -Qhull. +Qhull. <p>Option 'f' is for debugging. Most of the fields are available via the '<a @@ -154,7 +154,7 @@ convex hull. <p>See <a href="qh-faq.htm#math">Is Qhull available for Mathematica?</a> for URLs. - + <h3><a href="#output">»</a><a name="n">n - print hyperplane normals with offsets </a></h3> @@ -232,7 +232,7 @@ coordinates of each Voronoi vertex.</p> <p>For <a href=qdelaun.htm>qdelaunay</a>, it prints the input sites as lifted to a paraboloid. For <a href=qhalf.htm>qhalf</a> -it prints the dual points. For both, option 'p' is the same as the first +it prints the dual points. For both, option 'p' is the same as the first section of option '<a href="qh-opto.htm#o">o</a>'.</p> <p>Use '<a href="qh-optf.htm#Fx">Fx</a>' to list the point ids of @@ -323,13 +323,13 @@ than 0.05. </p> <p><b>Up:</b> <a href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="index.htm#TOC">Qhull manual</a>: Table of Contents<br> <b>To:</b> <a href="qh-quick.htm#programs">Programs</a> -• <a href="qh-quick.htm#options">Options</a> -• <a href="qh-opto.htm#output">Output</a> -• <a href="qh-optf.htm#format">Formats</a> -• <a href="qh-optg.htm#geomview">Geomview</a> +• <a href="qh-quick.htm#options">Options</a> +• <a href="qh-opto.htm#output">Output</a> +• <a href="qh-optf.htm#format">Formats</a> +• <a href="qh-optg.htm#geomview">Geomview</a> • <a href="qh-optp.htm#print">Print</a> -• <a href="qh-optq.htm#qhull">Qhull</a> -• <a href="qh-optc.htm#prec">Precision</a> +• <a href="qh-optq.htm#qhull">Qhull</a> +• <a href="qh-optc.htm#prec">Precision</a> • <a href="qh-optt.htm#trace">Trace</a></p> <!-- GC common information --> <hr> diff --git a/html/qh-optp.htm b/html/qh-optp.htm index afb5eb6..f9a3917 100644 --- a/html/qh-optp.htm +++ b/html/qh-optp.htm @@ -10,13 +10,13 @@ <p><b>Up:</b> <a href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="index.htm#TOC">Qhull manual</a>: Table of Contents<br> <b>To:</b> <a href="qh-quick.htm#programs">Programs</a> -• <a href="qh-quick.htm#options">Options</a> -• <a href="qh-opto.htm#output">Output</a> -• <a href="qh-optf.htm#format">Formats</a> -• <a href="qh-optg.htm#geomview">Geomview</a> +• <a href="qh-quick.htm#options">Options</a> +• <a href="qh-opto.htm#output">Output</a> +• <a href="qh-optf.htm#format">Formats</a> +• <a href="qh-optg.htm#geomview">Geomview</a> • <a href="qh-optp.htm#print">Print</a> -• <a href="qh-optq.htm#qhull">Qhull</a> -• <a href="qh-optc.htm#prec">Precision</a> +• <a href="qh-optq.htm#qhull">Qhull</a> +• <a href="qh-optc.htm#prec">Precision</a> • <a href="qh-optt.htm#trace">Trace</a></p> <hr> @@ -27,7 +27,7 @@ src="qh--dt.gif" alt="[delaunay]" align="middle" width="100" height="100"></a> Qhull print options (P)</h1> This section lists the print options for Qhull. These options are -indicated by 'P' followed by a letter. See +indicated by 'P' followed by a letter. See <a href="qh-opto.htm#output">Output</a>, <a href="qh-optg.htm#geomview">Geomview</a>, and <a href="qh-optf.htm#format">Format</a> for other output options. @@ -104,7 +104,7 @@ part of a number. For example, use 'Pd0:0.5 Pd1:0.5' instead of normal[k] <= n</a></h3> <p>For a given output, print only those facets with <i>normal[k] <= n</i> -and <i>drop</i> the others. +and <i>drop</i> the others. For example, 'PD0:0.5' prints facets with <i>normal[0] <= 0.5 </i>. The default value of <i>n</i> is zero. For example in 3-d, 'PD0D1D2' displays facets in the negative octant. @@ -172,18 +172,18 @@ per facet. precision problems</a></h3> <p>Use options 'Po' and '<a href="qh-optq.htm#Q0">Q0</a>' if you -can not merge facets, triangulate the output ('<a href="qh-optq.htm#Qt">Qt</a>'), -or joggle the input (<a href="qh-optq.htm#QJn">QJ</a>). +can not merge facets, triangulate the output ('<a href="qh-optq.htm#Qt">Qt</a>'), +or joggle the input (<a href="qh-optq.htm#QJn">QJ</a>). <p>Option 'Po' can not force output when duplicate ridges or duplicate facets occur. It may produce erroneous results. For these reasons, merged facets, joggled input, or <a href="qh-impre.htm#exact">exact arithmetic</a> are better.</p> -<p>If you need a simplicial Delaunay triangulation, use +<p>If you need a simplicial Delaunay triangulation, use joggled input '<a href="qh-optq.htm#QJn">QJ</a>' or triangulated output '<a -href="qh-optf.htm#Ft">Ft</a>'. +href="qh-optf.htm#Ft">Ft</a>'. <p>Option 'Po' may be used without '<a href="qh-optq.htm#Q0">Q0</a>' to remove some steps from Qhull or to output the neighborhood of @@ -227,13 +227,13 @@ removes the narrow hull warning.</p> <p><b>Up:</b> <a href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="index.htm#TOC">Qhull manual</a>: Table of Contents<br> <b>To:</b> <a href="qh-quick.htm#programs">Programs</a> -• <a href="qh-quick.htm#options">Options</a> -• <a href="qh-opto.htm#output">Output</a> -• <a href="qh-optf.htm#format">Formats</a> -• <a href="qh-optg.htm#geomview">Geomview</a> +• <a href="qh-quick.htm#options">Options</a> +• <a href="qh-opto.htm#output">Output</a> +• <a href="qh-optf.htm#format">Formats</a> +• <a href="qh-optg.htm#geomview">Geomview</a> • <a href="qh-optp.htm#print">Print</a> -• <a href="qh-optq.htm#qhull">Qhull</a> -• <a href="qh-optc.htm#prec">Precision</a> +• <a href="qh-optq.htm#qhull">Qhull</a> +• <a href="qh-optc.htm#prec">Precision</a> • <a href="qh-optt.htm#trace">Trace</a></p> <!-- GC common information --> <hr> diff --git a/html/qh-optq.htm b/html/qh-optq.htm index 8eaf865..5047076 100644 --- a/html/qh-optq.htm +++ b/html/qh-optq.htm @@ -10,13 +10,13 @@ <p><b>Up:</b> <a href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="index.htm#TOC">Qhull manual</a>: Table of Contents<br> <b>To:</b> <a href="qh-quick.htm#programs">Programs</a> -• <a href="qh-quick.htm#options">Options</a> -• <a href="qh-opto.htm#output">Output</a> -• <a href="qh-optf.htm#format">Formats</a> -• <a href="qh-optg.htm#geomview">Geomview</a> +• <a href="qh-quick.htm#options">Options</a> +• <a href="qh-opto.htm#output">Output</a> +• <a href="qh-optf.htm#format">Formats</a> +• <a href="qh-optg.htm#geomview">Geomview</a> • <a href="qh-optp.htm#print">Print</a> -• <a href="qh-optq.htm#qhull">Qhull</a> -• <a href="qh-optc.htm#prec">Precision</a> +• <a href="qh-optq.htm#qhull">Qhull</a> +• <a href="qh-optc.htm#prec">Precision</a> • <a href="qh-optt.htm#trace">Trace</a></p> <hr> @@ -34,13 +34,13 @@ options are indicated by 'Q' followed by a letter. </p> <hr> <p><a href="index.htm#TOC">»</a> <a href="qh-quick.htm#programs">Programs</a> -<a name="qhull">•</a> <a href="qh-quick.htm#options">Options</a> -• <a href="qh-opto.htm#output">Output</a> -• <a href="qh-optf.htm#format">Formats</a> -• <a href="qh-optg.htm#geomview">Geomview</a> +<a name="qhull">•</a> <a href="qh-quick.htm#options">Options</a> +• <a href="qh-opto.htm#output">Output</a> +• <a href="qh-optf.htm#format">Formats</a> +• <a href="qh-optg.htm#geomview">Geomview</a> • <a href="qh-optp.htm#print">Print</a> -• <a href="qh-optq.htm#qhull">Qhull</a> -• <a href="qh-optc.htm#prec">Precision</a> +• <a href="qh-optq.htm#qhull">Qhull</a> +• <a href="qh-optc.htm#prec">Precision</a> • <a href="qh-optt.htm#trace">Trace</a></p> <h2>Qhull control options</h2> @@ -247,9 +247,9 @@ facets (needs 'QGn' 'QVn' or 'Pdk') </a></h3> facets. With the '<a href="#Qg">Qg</a>' option, Qhull will only build those facets that it needs to determine the good facets in the output. This may speed up Qhull in 2-d and 3-d. It is -useful for furthest-site Delaunay -triangulations (<a href=qdelau_f.htm>qdelaunay Qu</a>, -invoke with 'qhull d Qbb <a href="#Qu">Qu</a> Qg'). +useful for furthest-site Delaunay +triangulations (<a href=qdelau_f.htm>qdelaunay Qu</a>, +invoke with 'qhull d Qbb <a href="#Qu">Qu</a> Qg'). It is not effective in higher dimensions because many facets see a given point and contain a given vertex. It is not guaranteed to work for all combinations.</p> @@ -284,7 +284,7 @@ points. You will probably want '<a href="#Qc">Qc </a>' as well. </p> <p>Option 'Qi' is automatically set for '<a href=qdelaun.htm>qdelaunay</a> <a href="#Qc">Qc</a>' and '<a href=qvoronoi.htm>qvoronoi</a> -<a href="#Qc">Qc</a>'. If you use +<a href="#Qc">Qc</a>'. If you use '<a href=qdelaun.htm>qdelaunay</a> Qi' or '<a href=qvoronoi.htm>qvoronoi</a> Qi', option '<a href="qh-opto.htm#s">s</a>' reports all nearly incident points while option '<a href="qh-optf.htm#Fs">Fs</a>' @@ -334,7 +334,7 @@ href="qh-optq.htm#Qt">Qt</a>')</p> <p>By default, 'QJn' uses a fixed random number seed. To use time as the random number seed, select '<a href="qh-optq.htm#QRn">QR-1</a>'. The summary ('<a href="qh-opto.htm#s">s</a>') will show the -selected seed as 'QR-n'. +selected seed as 'QR-n'. <p>With 'QJn', Qhull does not error on degenerate hyperplane computations. Except for Delaunay and Voronoi computations, Qhull @@ -345,7 +345,7 @@ selected options. Option 'FO' displays the joggle and the joggle seed. If Qhull restarts, it will redisplay the options. </p> <p>Use option '<a href="qh-optt.htm#TRn">TRn</a>' to estimate the -probability that Qhull will fail for a given 'QJn'. +probability that Qhull will fail for a given 'QJn'. <h3><a href="#qhull">»</a><a name="Qm">Qm - only process points that increase the maximum outer plane </a></h3> @@ -379,7 +379,7 @@ because the randomization is inefficient. </p> <h3><a href="#qhull">»</a><a name="QRn">QRn - random rotation </a></h3> <p>Option 'QRn' randomly rotates the input. For Delaunay -triangulations (<a href=qdelaun.htm>qdelaunay</a> or <a href=qvoronoi.htm>qvoronoi</a>), +triangulations (<a href=qdelaun.htm>qdelaunay</a> or <a href=qvoronoi.htm>qvoronoi</a>), it rotates the lifted points about the last axis. </p> @@ -427,7 +427,7 @@ may be ignored due to precision errors. <h3><a href="#qhull">»</a><a name="Qu">Qu - compute upper hull for furthest-site Delaunay triangulation </a></h3> -<p>When computing a Delaunay triangulation (<a href=qdelaun.htm>qdelaunay</a> +<p>When computing a Delaunay triangulation (<a href=qdelaun.htm>qdelaunay</a> or <a href=qvoronoi.htm>qvoronoi</a>), Qhull computes both the the convex hull of points on a paraboloid. It normally prints facets of the lower hull. These @@ -440,8 +440,8 @@ and the <a href="qvoron_f.htm">furthest-site Voronoi diagram</a>.</p> 'Qu'. If you use the Qhull library, a faster method is 1) use Qhull to compute the convex hull of the input sites; 2) take the extreme points (vertices) of the convex hull; 3) add one interior -point (e.g., -'<a href="qh-optf.htm#FV">FV</a>', the average of <em>d</em> extreme points); 4) run +point (e.g., +'<a href="qh-optf.htm#FV">FV</a>', the average of <em>d</em> extreme points); 4) run 'qhull d Qbb Qu' or 'qhull v Qbb Qu' on these points.</p> <h3><a href="#qhull">»</a><a name="Qv">Qv - test vertex @@ -462,18 +462,18 @@ includes point n, -n if not </a></h3> '<a href="qh-optp.htm#Pg">Pg</a>') if one of its vertices is point n. If <i>n<0</i>, a good facet does not include point n. -<p>If options '<a href="qh-optp.htm#PG">PG</a>' +<p>If options '<a href="qh-optp.htm#PG">PG</a>' and '<a href="#Qg">Qg</a>' are not set, option '<a href="qh-optp.htm#Pg">Pg</a>' -(print only good) +(print only good) is automatically set. </p> <p>Option 'QVn' behaves oddly with options '<a href="qh-optf.htm#Fx">Fx</a>' and '<a href=qvoronoi.htm>qvoronoi</a> <a href="qh-optf.htm#Fv2">Fv</a>'. -<p>If used with option '<a href="#Qg">Qg</a>' (only process good facets), point n is +<p>If used with option '<a href="#Qg">Qg</a>' (only process good facets), point n is either in the initial simplex or it is the first -point added to the hull. Options 'QVn Qg' require either '<a href="#QJn">QJ</a>' or +point added to the hull. Options 'QVn Qg' require either '<a href="#QJn">QJ</a>' or '<a href="#Q0">Q0</a>' (no merging).</p> <h3><a href="#qhull">»</a><a name="Qx">Qx - exact pre-merges @@ -654,15 +654,15 @@ Option '<a href="#Qt">Qt</a>' triangulates non-simplicial facets into "tricoplanar" facets. Normally tricoplanar facets share the same normal, centrum, and Voronoi vertex. They can not be merged or replaced. With -option 'Q11', Qhull duplicates the normal and Voronoi vertex. -It recomputes the centrum. +option 'Q11', Qhull duplicates the normal and Voronoi vertex. +It recomputes the centrum. <p>Use 'Q11' if you use the Qhull library to add points -incrementally and call qh_triangulate() after each point. +incrementally and call qh_triangulate() after each point. Otherwise, Qhull will report an error when it tries to merge and replace a tricoplanar facet. -<p>With sufficient merging and new points, option 'Q11' may +<p>With sufficient merging and new points, option 'Q11' may lead to precision problems such as duplicate ridges and concave facets. For example, if qh_triangulate() is added to qh_addpoint(), RBOX 1000 s W1e-12 t1001813667 P0 | QHULL d Q11 Tv, @@ -674,13 +674,13 @@ reports an error due to a duplicate ridge. <p><b>Up:</b> <a href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="index.htm#TOC">Qhull manual</a>: Table of Contents<br> <b>To:</b> <a href="qh-quick.htm#programs">Programs</a> -• <a href="qh-quick.htm#options">Options</a> -• <a href="qh-opto.htm#output">Output</a> -• <a href="qh-optf.htm#format">Formats</a> -• <a href="qh-optg.htm#geomview">Geomview</a> +• <a href="qh-quick.htm#options">Options</a> +• <a href="qh-opto.htm#output">Output</a> +• <a href="qh-optf.htm#format">Formats</a> +• <a href="qh-optg.htm#geomview">Geomview</a> • <a href="qh-optp.htm#print">Print</a> -• <a href="qh-optq.htm#qhull">Qhull</a> -• <a href="qh-optc.htm#prec">Precision</a> +• <a href="qh-optq.htm#qhull">Qhull</a> +• <a href="qh-optc.htm#prec">Precision</a> • <a href="qh-optt.htm#trace">Trace</a></p> <!-- GC common information --> <hr> diff --git a/html/qh-optt.htm b/html/qh-optt.htm index 02fc053..d6d5df9 100644 --- a/html/qh-optt.htm +++ b/html/qh-optt.htm @@ -10,13 +10,13 @@ <p><b>Up:</b> <a href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="index.htm#TOC">Qhull manual</a>: Table of Contents<br> <b>To:</b> <a href="qh-quick.htm#programs">Programs</a> -• <a href="qh-quick.htm#options">Options</a> -• <a href="qh-opto.htm#output">Output</a> -• <a href="qh-optf.htm#format">Formats</a> -• <a href="qh-optg.htm#geomview">Geomview</a> +• <a href="qh-quick.htm#options">Options</a> +• <a href="qh-opto.htm#output">Output</a> +• <a href="qh-optf.htm#format">Formats</a> +• <a href="qh-optg.htm#geomview">Geomview</a> • <a href="qh-optp.htm#print">Print</a> -• <a href="qh-optq.htm#qhull">Qhull</a> -• <a href="qh-optc.htm#prec">Precision</a> +• <a href="qh-optq.htm#qhull">Qhull</a> +• <a href="qh-optc.htm#prec">Precision</a> • <a href="qh-optt.htm#trace">Trace</a></p> <hr> @@ -34,13 +34,13 @@ indicated by 'T' followed by a letter. <hr> <p><a href="index.htm#TOC">»</a> <a href="qh-quick.htm#programs">Programs</a> -<a name="trace">•</a> <a href="qh-quick.htm#options">Options</a> -• <a href="qh-opto.htm#output">Output</a> -• <a href="qh-optf.htm#format">Formats</a> -• <a href="qh-optg.htm#geomview">Geomview</a> +<a name="trace">•</a> <a href="qh-quick.htm#options">Options</a> +• <a href="qh-opto.htm#output">Output</a> +• <a href="qh-optf.htm#format">Formats</a> +• <a href="qh-optg.htm#geomview">Geomview</a> • <a href="qh-optp.htm#print">Print</a> -• <a href="qh-optq.htm#qhull">Qhull</a> -• <a href="qh-optc.htm#prec">Precision</a> +• <a href="qh-optq.htm#qhull">Qhull</a> +• <a href="qh-optc.htm#prec">Precision</a> • <a href="qh-optt.htm#trace">Trace</a></p> <h2>Trace options</h2> @@ -62,7 +62,7 @@ indicated by 'T' followed by a letter. <dd>rerun qhull n times</dd> <dt><a href="#Tv">Tv</a></dt> <dd>verify result: structure, convexity, and point inclusion</dd> - + <dt> </dt> <dt> </dt> <dd><b>Debugging</b></dd> @@ -113,7 +113,7 @@ hull. During post-merging, 'TFn' reports progress after more than <h3><a href="#trace">»</a><a name="TI">TI file - input data from file</a></h3> <p>Input data from 'file' instead of stdin. The filename may not -contain spaces or use single quotes. +contain spaces or use single quotes. You may use I/O redirection instead (e.g., 'rbox 10 | qdelaunay >results').</P> @@ -148,9 +148,9 @@ memory addresses which may change across executions. single quotes. Unix and Windows NT users may use I/O redirection instead (e.g., 'rbox 10 | qdelaunay >results').</P> <p> -Windows95 users should always use 'TO file'. If they use I/O redirection, +Windows95 users should always use 'TO file'. If they use I/O redirection, error output is not sent to the console. Qhull uses single quotes instead -of double quotes because a missing double quote can +of double quotes because a missing double quote can freeze Windows95 (e.g., do not run, rbox 10 | qhull TO "x)</p> <p> @@ -158,25 +158,25 @@ freeze Windows95 (e.g., do not run, rbox 10 | qhull TO "x)</p> when point n added to hull </a></h3> <p>Option 'TPn' turns on tracing when point n is added to -the hull. It also traces partitions of point n. This option +the hull. It also traces partitions of point n. This option reduces the output size when tracing. It is the normal method to determine the cause of a Qhull error. All Qhull errors -report the last point added. +report the last point added. -<p>Use options 'TPn <a href="qh-optt.htm#TVn">TVn</a>' to +<p>Use options 'TPn <a href="qh-optt.htm#TVn">TVn</a>' to trace the addition of point n to the convex hull and stop when done.</p> -<p>If used with option '<a href="qh-optt.htm#TWn">TWn</a>', +<p>If used with option '<a href="qh-optt.htm#TWn">TWn</a>', 'TPn' turns off tracing after adding point n to the hull. -Use options 'TPn TWn' to +Use options 'TPn TWn' to trace the addition of point n to the convex hull, partitions of point n, and wide merges.</p> <h3><a href="#trace">»</a><a name="TRn">TRn - rerun qhull n times</a></h3> -<p>Option 'TRn' reruns Qhull n times. It is usually used +<p>Option 'TRn' reruns Qhull n times. It is usually used with '<a href="qh-optq.htm#QJn">QJn</a>' to determine the probability -that a given joggle will fail. The summary +that a given joggle will fail. The summary ('<a href="qh-opto.htm#s">s</a>') lists the failure rate and the precision errors that occurred. Option '<a href="#Ts">Ts</a>' will report statistics for @@ -184,7 +184,7 @@ all of the runs. Trace and output options only apply to the last run. An event trace, '<a href="#Tn">T-1</a>' reports events for all runs. <p>Tracing applies to the last run of Qhull. If an error -is reported, the options list the run number as "_run". +is reported, the options list the run number as "_run". To trace this run, set 'TRn' to the same value.</p> <h3><a href="#trace">»</a><a name="Ts">Ts - print statistics </a></h3> @@ -217,12 +217,12 @@ prints a message to stderr unless option '<a href="qh-optp.htm#Pp">Pp</a>' is used. This allows the user to interrupt Qhull without changing the output. </p> -<p>With '<a href=qvoronoi.htm>qvoronoi</a> <a href="qh-optf.htm#Fi2">Fi</a>' +<p>With '<a href=qvoronoi.htm>qvoronoi</a> <a href="qh-optf.htm#Fi2">Fi</a>' and '<a href=qvoronoi.htm>qvoronoi</a> <a href="qh-optf.htm#Fo2">Fo</a>', option 'Tv' collects statistics that verify all Voronoi vertices lie -on the separating hyperplane, and for bounded regions, all +on the separating hyperplane, and for bounded regions, all separating hyperplanes are perpendicular bisectors. - + <h3><a href="#trace">»</a><a name="TVn">TV-n - stop qhull before adding point n</a></h3> @@ -253,13 +253,13 @@ stdout </a></h3> <p><b>Up:</b> <a href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="index.htm#TOC">Qhull manual</a>: Table of Contents<br> <b>To:</b> <a href="qh-quick.htm#programs">Programs</a> -• <a href="qh-quick.htm#options">Options</a> -• <a href="qh-opto.htm#output">Output</a> -• <a href="qh-optf.htm#format">Formats</a> -• <a href="qh-optg.htm#geomview">Geomview</a> +• <a href="qh-quick.htm#options">Options</a> +• <a href="qh-opto.htm#output">Output</a> +• <a href="qh-optf.htm#format">Formats</a> +• <a href="qh-optg.htm#geomview">Geomview</a> • <a href="qh-optp.htm#print">Print</a> -• <a href="qh-optq.htm#qhull">Qhull</a> -• <a href="qh-optc.htm#prec">Precision</a> +• <a href="qh-optq.htm#qhull">Qhull</a> +• <a href="qh-optc.htm#prec">Precision</a> • <a href="qh-optt.htm#trace">Trace</a></p> <!-- GC common information --> <hr> diff --git a/html/qh-quick.htm b/html/qh-quick.htm index 70103b7..fc424bb 100644 --- a/html/qh-quick.htm +++ b/html/qh-quick.htm @@ -57,77 +57,77 @@ This section lists all programs and options in Qhull. <dl> <dt><a href="qconvex.htm">qconvex</a> -- convex hull</dt> <dd><a href="qconvex.htm#synopsis">sy</a>nopsis • <a - href="qconvex.htm#input">in</a>put • <a + href="qconvex.htm#input">in</a>put • <a href="qconvex.htm#outputs">ou</a>tputs • <a href="qconvex.htm#controls">co</a>ntrols • <a href="qconvex.htm#graphics">gr</a>aphics • <a href="qconvex.htm#notes">no</a>tes • <a href="qconvex.htm#conventions">co</a>nventions • <a - href="qconvex.htm#options">op</a>tions</dd> + href="qconvex.htm#options">op</a>tions</dd> <dt> </dt> <dt><a href="qdelaun.htm">qdelaunay</a> -- Delaunay triangulation</dt> <dd><a href="qdelaun.htm#synopsis">sy</a>nopsis • <a - href="qdelaun.htm#input">in</a>put • <a + href="qdelaun.htm#input">in</a>put • <a href="qdelaun.htm#outputs">ou</a>tputs • <a - href="qdelaun.htm#controls">co</a>ntrols • <a + href="qdelaun.htm#controls">co</a>ntrols • <a href="qdelaun.htm#graphics">gr</a>aphics • <a href="qdelaun.htm#notes">no</a>tes • <a - href="qdelaun.htm#conventions">co</a>nventions • <a - href="qdelaun.htm#options">op</a>tions</dd> + href="qdelaun.htm#conventions">co</a>nventions • <a + href="qdelaun.htm#options">op</a>tions</dd> <dt> </dt> <dt><a href="qdelau_f.htm">qdelaunay Qu</a> -- furthest-site Delaunay triangulation</dt> <dd><a href="qdelau_f.htm#synopsis">sy</a>nopsis • <a - href="qdelau_f.htm#input">in</a>put • <a + href="qdelau_f.htm#input">in</a>put • <a href="qdelau_f.htm#outputs">ou</a>tputs • <a - href="qdelau_f.htm#controls">co</a>ntrols • <a + href="qdelau_f.htm#controls">co</a>ntrols • <a href="qdelau_f.htm#graphics">gr</a>aphics • <a href="qdelau_f.htm#notes">no</a>tes • <a - href="qdelau_f.htm#conventions">co</a>nventions • <a - href="qdelau_f.htm#options">op</a>tions</dd> + href="qdelau_f.htm#conventions">co</a>nventions • <a + href="qdelau_f.htm#options">op</a>tions</dd> <dt> </dt> <dt><a href="qhalf.htm">qhalf</a> -- halfspace intersection about a point</dt> <dd><a href="qhalf.htm#synopsis">sy</a>nopsis • <a - href="qhalf.htm#input">in</a>put • <a + href="qhalf.htm#input">in</a>put • <a href="qhalf.htm#outputs">ou</a>tputs • <a href="qhalf.htm#controls">co</a>ntrols • <a href="qhalf.htm#graphics">gr</a>aphics • <a href="qhalf.htm#notes">no</a>tes • <a href="qhalf.htm#conventions">co</a>nventions • <a - href="qhalf.htm#options">op</a>tions</dd> + href="qhalf.htm#options">op</a>tions</dd> <dt> </dt> <dt><a href="qvoronoi.htm">qvoronoi</a> -- Voronoi diagram</dt> <dd><a href="qvoronoi.htm#synopsis">sy</a>nopsis • <a - href="qvoronoi.htm#input">in</a>put • <a - href="qvoronoi.htm#outputs">ou</a>tputs • + href="qvoronoi.htm#input">in</a>put • <a + href="qvoronoi.htm#outputs">ou</a>tputs • <a href="qvoronoi.htm#controls">co</a>ntrols • <a href="qvoronoi.htm#graphics">gr</a>aphics • <a href="qvoronoi.htm#notes">no</a>tes • <a - href="qvoronoi.htm#conventions">co</a>nventions • <a - href="qvoronoi.htm#options">op</a>tions</dd> + href="qvoronoi.htm#conventions">co</a>nventions • <a + href="qvoronoi.htm#options">op</a>tions</dd> <dt> </dt> <dt><a href="qvoron_f.htm">qvoronoi Qu</a> -- furthest-site Voronoi diagram</dt> <dd><a href="qvoron_f.htm#synopsis">sy</a>nopsis • <a - href="qvoron_f.htm#input">in</a>put • <a + href="qvoron_f.htm#input">in</a>put • <a href="qvoron_f.htm#outputs">ou</a>tputs • <a - href="qvoron_f.htm#controls">co</a>ntrols • <a + href="qvoron_f.htm#controls">co</a>ntrols • <a href="qvoron_f.htm#graphics">gr</a>aphics • <a href="qvoron_f.htm#notes">no</a>tes • <a - href="qvoron_f.htm#conventions">co</a>nventions • <a - href="qvoron_f.htm#options">op</a>tions</dd> + href="qvoron_f.htm#conventions">co</a>nventions • <a + href="qvoron_f.htm#options">op</a>tions</dd> <dt> </dt> <dt><a href="rbox.htm">rbox</a> -- generate point distributions for qhull</dt> <dd><a href="rbox.htm#synopsis">sy</a>nopsis • <a - href="rbox.htm#outputs">ou</a>tputs • <a + href="rbox.htm#outputs">ou</a>tputs • <a href="rbox.htm#examples">ex</a>amples • <a href="rbox.htm#notes">no</a>tes • <a - href="rbox.htm#options">op</a>tions</dd> + href="rbox.htm#options">op</a>tions</dd> <dt> </dt> <dt><a href="qhull.htm">qhull</a> -- convex hull and related structures</dt> <dd><a href="qhull.htm#synopsis">sy</a>nopsis • <a - href="qhull.htm#input">in</a>put • <a + href="qhull.htm#input">in</a>put • <a href="qhull.htm#outputs">ou</a>tputs • <a href="qhull.htm#controls">co</a>ntrols • <a - href="qhull.htm#options">op</a>tions</dd> + href="qhull.htm#options">op</a>tions</dd> </dl> <a name="options"> </a> <hr> diff --git a/html/qhalf.htm b/html/qhalf.htm index 9dc39b3..b4c5b35 100644 --- a/html/qhalf.htm +++ b/html/qhalf.htm @@ -10,18 +10,18 @@ <p><a name="TOP"><b>Up</b></a><b>:</b> <a href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="index.htm#TOC">Qhull manual</a>: Table of Contents<br> <b>To:</b> <a href="qh-quick.htm#programs">Programs</a> -• <a href="qh-quick.htm#options">Options</a> -• <a href="qh-opto.htm#output">Output</a> -• <a href="qh-optf.htm#format">Formats</a> -• <a href="qh-optg.htm#geomview">Geomview</a> +• <a href="qh-quick.htm#options">Options</a> +• <a href="qh-opto.htm#output">Output</a> +• <a href="qh-optf.htm#format">Formats</a> +• <a href="qh-optg.htm#geomview">Geomview</a> • <a href="qh-optp.htm#print">Print</a> -• <a href="qh-optq.htm#qhull">Qhull</a> -• <a href="qh-optc.htm#prec">Precision</a> +• <a href="qh-optq.htm#qhull">Qhull</a> +• <a href="qh-optc.htm#prec">Precision</a> • <a href="qh-optt.htm#trace">Trace</a><br> -<b>To:</b> <a href="#synopsis">sy</a>nopsis -• <a href="#input">in</a>put • <a href="#outputs">ou</a>tputs -• <a href="#controls">co</a>ntrols • <a href="#graphics">gr</a>aphics -• <a href="#notes">no</a>tes • <a href="#conventions">co</a>nventions +<b>To:</b> <a href="#synopsis">sy</a>nopsis +• <a href="#input">in</a>put • <a href="#outputs">ou</a>tputs +• <a href="#controls">co</a>ntrols • <a href="#graphics">gr</a>aphics +• <a href="#notes">no</a>tes • <a href="#conventions">co</a>nventions • <a href="#options">op</a>tions <hr> @@ -42,64 +42,64 @@ programming. </p> <dt><b>Example:</b> rbox c | qconvex <a href="qh-optf.htm#FQ">FQ</a> <a href="qh-optf.htm#FV">FV</a> <a href="qh-opto.htm#n">n</a> | qhalf <a href="qh-optf.htm#Fp">Fp</a></dt> - <dd>Print the intersection of the facets of a cube. <tt>rbox c</tt> - generates the vertices of a cube. <tt>qconvex FV n</tt> returns of average - of the cube's vertices (in this case, the origin) and the halfspaces - that define the cube. <tt>qhalf Fp</tt> computes the intersection of - the halfspaces about the origin. The intersection is the vertices - of the original cube.</dd> + <dd>Print the intersection of the facets of a cube. <tt>rbox c</tt> + generates the vertices of a cube. <tt>qconvex FV n</tt> returns of average + of the cube's vertices (in this case, the origin) and the halfspaces + that define the cube. <tt>qhalf Fp</tt> computes the intersection of + the halfspaces about the origin. The intersection is the vertices + of the original cube.</dd> <dt><p><b>Example:</b> rbox c d G0.55 | qconvex <a href="qh-optf.htm#FQ">FQ</a> <a href="qh-optf.htm#FV">FV</a> <a href="qh-opto.htm#n">n</a> | qhalf <a href="qh-optf.htm#Fp">Fp</a></dt> <dd>Print the intersection of the facets of a cube and a diamond. There - are 24 facets and 14 intersection points. Four facets define each diamond - vertex. Six facets define each cube vertex. - </dd> + are 24 facets and 14 intersection points. Four facets define each diamond + vertex. Six facets define each cube vertex. + </dd> <dt><p><b>Example:</b> rbox c d G0.55 | qconvex <a href="qh-optf.htm#FQ">FQ</a> <a href="qh-optf.htm#FV">FV</a> <a href="qh-opto.htm#n">n</a> | qhalf <a href="qh-optf.htm#Fp">Fp</a> - <a href="qh-optq.htm#Qt">Qt</a></dt> + <a href="qh-optq.htm#Qt">Qt</a></dt> <dd>Same as above except triangulate before computing - the intersection points. Three facets define each intersection - point. There are two duplicates of the diamond and four duplicates of the cube. - </dd> + the intersection points. Three facets define each intersection + point. There are two duplicates of the diamond and four duplicates of the cube. + </dd> </dl> </blockquote> <p>Qhull computes a halfspace intersection by the geometric -duality between points and halfspaces. -See <a href="qh-eg.htm#half">halfspace examples</a>, +duality between points and halfspaces. +See <a href="qh-eg.htm#half">halfspace examples</a>, <a href="#notes">qhalf notes</a>, and option 'p' of <a href="#outputs">qhalf outputs</a>. </p> <p>By default, halfspace intersections may be defined by more than <i>d</i> halfspaces. See the previous cube and diamond example. -This is the expected output for halfspace intersection. +This is the expected output for halfspace intersection. <p>You can try triangulated output and joggled input. It demonstrates that triangulated output is more accurate than joggled input. <p>If you use '<a href="qh-optq.htm#Qt">Qt</a>' (triangulated output), all -halfspace intersections are simplicial (e.g., three halfspaces per +halfspace intersections are simplicial (e.g., three halfspaces per intersection in 3-d). In 3-d, if more than three halfspaces intersect -at the same point, triangulated output will produce +at the same point, triangulated output will produce duplicate intersections, one for each additional halfspace. See the previous cube and diamond example.</p> -<p>If you use '<a href="qh-optq.htm#QJn">QJ</a>' (joggled input), all halfspace +<p>If you use '<a href="qh-optq.htm#QJn">QJ</a>' (joggled input), all halfspace intersections are simplicial. This may lead to nearly identical intersections. For example, replace 'Qt' with 'QJ' above and compare the duplicated intersections. See <a href="qh-impre.htm#joggle">Merged facets or joggled input</a>. </p> -<p>The 'qhalf' program is equivalent to +<p>The 'qhalf' program is equivalent to '<a href=qhull.htm#outputs>qhull H</a>' in 2-d to 4-d, and -'<a href=qhull.htm#outputs>qhull H</a> <a href=qh-optq.htm#Qx>Qx</a>' +'<a href=qhull.htm#outputs>qhull H</a> <a href=qh-optq.htm#Qx>Qx</a>' in 5-d and higher. It disables the following Qhull -<a href=qh-quick.htm#options>options</a>: <i>d n v Qbb QbB Qf Qg Qm +<a href=qh-quick.htm#options>options</a>: <i>d n v Qbb QbB Qf Qg Qm Qr QR Qv Qx Qz TR E V Fa FA FC FD FS Ft FV Gt Q0,etc</i>. @@ -110,7 +110,7 @@ Qr QR Qv Qx Qz TR E V Fa FA FC FD FS Ft FV Gt Q0,etc</i>. <pre> qhalf- halfspace intersection about a point. input (stdin): [dim, 1, interior point] - dim+1, n + dim+1, n halfspace coefficients + offset comments start with a non-numeric character @@ -145,22 +145,22 @@ examples: <p>The input data on <tt>stdin</tt> consists of:</p> <ul> <li>[optional] interior point - <ul> - <li>dimension - <li>1 - <li>coordinates of interior point - </ul> + <ul> + <li>dimension + <li>1 + <li>coordinates of interior point + </ul> <li>dimension + 1 <li>number of halfspaces</li> <li>halfspace coefficients followed by offset</li> </ul> <p>Use I/O redirection (e.g., qhalf < data.txt), a pipe (e.g., rbox c | qconvex FV n | qhalf), -or the '<a href=qh-optt.htm#TI>TI</a>' option (e.g., qhalf TI data.txt). +or the '<a href=qh-optt.htm#TI>TI</a>' option (e.g., qhalf TI data.txt). <p>Qhull needs an interior point to compute the halfspace intersection. An interior point is inside all of the halfspaces <i>Hx+b -<= 0</i>. The interior point may be in the input. If not, option +<= 0</i>. The interior point may be in the input. If not, option 'Hn,n' defines the interior point as [n,n,0,...] where <em>0</em> is the default coordinate (e.g., 'H0' is the origin). Use linear programming if you do not know @@ -242,58 +242,58 @@ intersection.</p> <dt><a href="qh-optf.htm#FN">FN</a></dt> <dd>list intersection points for each non-redundant halfspace. The first line - is the number of non-redundant halfspaces. Each remaining - lines starts with the number of intersection points. For the cube - example, each halfspace has four intersection points.</dd> + is the number of non-redundant halfspaces. Each remaining + lines starts with the number of intersection points. For the cube + example, each halfspace has four intersection points.</dd> <dt><a href="qh-optf.htm#Fn">Fn</a></dt> <dd>list neighboring intersections for each intersection point. The first line - is the number of intersection points. Each remaining line - starts with the number of neighboring intersections. For the cube - example, each intersection point has three neighboring intersections. - In 3-d, a non-simplicial intersection has more than three neighboring - intersections. Use option '<a href="qh-optq.htm#QJn">QJ</a>' to - avoid non-simplicial intersections. - </dd> + is the number of intersection points. Each remaining line + starts with the number of neighboring intersections. For the cube + example, each intersection point has three neighboring intersections. + In 3-d, a non-simplicial intersection has more than three neighboring + intersections. Use option '<a href="qh-optq.htm#QJn">QJ</a>' to + avoid non-simplicial intersections. + </dd> <dt><a href="qh-optf.htm#Fp">Fp</a></dt> <dd>print intersection coordinates. The first line is the dimension and the - second line is the number of intersection points. The following lines are the - coordinates of each intersection.</dd> + second line is the number of intersection points. The following lines are the + coordinates of each intersection.</dd> <dt><a href="qh-optf.htm#FI">FI</a></dt> - <dd>list intersection IDs. The first line is the number of - intersections. The IDs follow, one per line.</dd> + <dd>list intersection IDs. The first line is the number of + intersections. The IDs follow, one per line.</dd> <dt> </dt> <dt> </dt> <dd><b>Halfspaces</b></dd> <dt><a href="qh-optf.htm#Fx">Fx</a></dt> - <dd>list non-redundant halfspaces. The first line is the number of - non-redundant halfspaces. The other lines list one halfspace per line. - A halfspace is <i>non-redundant</i> if it - defines a facet of the intersection. Redundant halfspaces are ignored. For - the cube example, all of the halfspaces are non-redundant. - </dd> + <dd>list non-redundant halfspaces. The first line is the number of + non-redundant halfspaces. The other lines list one halfspace per line. + A halfspace is <i>non-redundant</i> if it + defines a facet of the intersection. Redundant halfspaces are ignored. For + the cube example, all of the halfspaces are non-redundant. + </dd> <dt><a href="qh-optf.htm#Fv">Fv</a></dt> - <dd>list non-redundant halfspaces incident to each intersection point. - The first line is the number of - non-redundant halfspaces. Each remaining line starts with the number - of non-redundant halfspaces. For the - cube example, each intersection is incident to three halfspaces.</dd> + <dd>list non-redundant halfspaces incident to each intersection point. + The first line is the number of + non-redundant halfspaces. Each remaining line starts with the number + of non-redundant halfspaces. For the + cube example, each intersection is incident to three halfspaces.</dd> <dt><a href="qh-opto.htm#i">i</a></dt> <dd>list non-redundant halfspaces incident to each intersection point. The first - line is the number of intersection points. Each remaining line - lists the incident, non-redundant halfspaces. For the - cube example, each intersection is incident to three halfspaces. + line is the number of intersection points. Each remaining line + lists the incident, non-redundant halfspaces. For the + cube example, each intersection is incident to three halfspaces. </dd> <dt><a href="qh-optf.htm#Fc">Fc</a></dt> - <dd>list coplanar halfspaces for each intersection point. The first line is - the number of intersection points. Each remaining line starts with - the number of coplanar halfspaces. A coplanar halfspace is listed for - one intersection point even though it is coplanar to multiple intersection - points.</dd> + <dd>list coplanar halfspaces for each intersection point. The first line is + the number of intersection points. Each remaining line starts with + the number of coplanar halfspaces. A coplanar halfspace is listed for + one intersection point even though it is coplanar to multiple intersection + points.</dd> <dt><a href="qh-optq.htm#Qc">Qi</a> <a href="qh-optf.htm#Fc">Fc</a></dt> - <dd>list redundant halfspaces for each intersection point. The first line is - the number of intersection points. Each remaining line starts with - the number of redundant halfspaces. Use options '<a href="qh-optq.htm#Qc">Qc</a> Qi Fc' to list - coplanar and redundant halfspaces.</dd> + <dd>list redundant halfspaces for each intersection point. The first line is + the number of intersection points. Each remaining line starts with + the number of redundant halfspaces. Use options '<a href="qh-optq.htm#Qc">Qc</a> Qi Fc' to list + coplanar and redundant halfspaces.</dd> <dt> </dt> <dt> </dt> @@ -303,16 +303,16 @@ intersection.</p> href="qh-optf.htm#Fs">Fs</a>' if you need numeric data.</dd> <dt><a href="qh-opto.htm#o">o</a></dt> <dd>print vertices and facets of the dual convex hull. The - first line is the dimension. The second line is the number of - vertices, facets, and ridges. The vertex - coordinates are next, followed by the facets, one per line.</dd> + first line is the dimension. The second line is the number of + vertices, facets, and ridges. The vertex + coordinates are next, followed by the facets, one per line.</dd> <dt><a href="qh-opto.htm#p">p</a></dt> <dd>print vertex coordinates of the dual convex hull. Each vertex corresponds - to a non-redundant halfspace. Its coordinates are the negative of the hyperplane's coefficients - divided by the offset plus the inner product of the coefficients and - the interior point (-c/(b+a.p). - Options 'p <a href="qh-optq.htm#Qc">Qc</a>' includes coplanar halfspaces. - Options 'p <a href="qh-optq.htm#Qi">Qi</a>' includes redundant halfspaces.</dd> + to a non-redundant halfspace. Its coordinates are the negative of the hyperplane's coefficients + divided by the offset plus the inner product of the coefficients and + the interior point (-c/(b+a.p). + Options 'p <a href="qh-optq.htm#Qc">Qc</a>' includes coplanar halfspaces. + Options 'p <a href="qh-optq.htm#Qi">Qi</a>' includes redundant halfspaces.</dd> <dt><a href="qh-opto.htm#m">m</a></dt> <dd>Mathematica output for the dual convex hull in 2-d or 3-d.</dd> <dt><a href="qh-optf.htm#FM">FM</a></dt> @@ -336,7 +336,7 @@ intersection.</p> each extra hyperplane.</dd> <dt><a href="qh-optq.htm#QJn">QJ</a></dt> <dd>joggle the input instead of merging facets. In 3-d, this guarantees that - each intersection is defined by three hyperplanes.</dd> + each intersection is defined by three hyperplanes.</dd> <dt><a href="qh-opto.htm#f">f </a></dt> <dd>facet dump. Print the data structure for each intersection (i.e., facet)</dd> @@ -349,19 +349,19 @@ intersection.</p> <dt><a href="qh-optq.htm#QGn">QGn</a></dt> <dd>select intersection points that are visible to halfspace <em>n</em> (marked 'good'). Use <em>-n</em> for the remainder.</dd> - <dt><a href="qh-optq.htm#Qb0">Qbk:0Bk:0</a></dt> + <dt><a href="qh-optq.htm#Qb0">Qbk:0Bk:0</a></dt> <dd>remove the k-th coordinate from the input. This computes the - halfspace intersection in one lower dimension.</dd> + halfspace intersection in one lower dimension.</dd> <dt><a href="qh-optt.htm#Tv">Tv</a></dt> <dd>verify result</dd> <dt><a href="qh-optt.htm#TO">TI file</a></dt> <dd>input data from file. The filename may not use spaces or quotes.</dd> <dt><a href="qh-optt.htm#TO">TO file</a></dt> <dd>output results to file. Use single quotes if the filename - contains spaces (e.g., <tt>TO 'file with spaces.txt'</tt></dd> + contains spaces (e.g., <tt>TO 'file with spaces.txt'</tt></dd> <dt><a href="qh-optq.htm#Qs">Qs</a></dt> - <dd>search all points for the initial simplex. If Qhull can - not construct an initial simplex, it reports a + <dd>search all points for the initial simplex. If Qhull can + not construct an initial simplex, it reports a descriptive message. Usually, the point set is degenerate and one or more dimensions should be removed ('<a href="qh-optq.htm#Qb0">Qbk:0Bk:0</a>'). If not, use option 'Qs'. It performs an exhaustive search for the @@ -543,7 +543,7 @@ Geomview output (2-d, 3-d and 4-d; dual convex hull) Gi - inner planes (i.e., halfspace intersections) only Gn - no planes Go - outer planes only - Gc - centrums + Gc - centrums Gh - hyperplane intersections Gr - ridges GDn - drop dimension n in 3-d and 4-d output @@ -569,18 +569,18 @@ Print options: <p><b>Up:</b> <a href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="index.htm#TOC">Qhull manual</a>: Table of Contents<br> <b>To:</b> <a href="qh-quick.htm#programs">Programs</a> -• <a href="qh-quick.htm#options">Options</a> -• <a href="qh-opto.htm#output">Output</a> -• <a href="qh-optf.htm#format">Formats</a> -• <a href="qh-optg.htm#geomview">Geomview</a> +• <a href="qh-quick.htm#options">Options</a> +• <a href="qh-opto.htm#output">Output</a> +• <a href="qh-optf.htm#format">Formats</a> +• <a href="qh-optg.htm#geomview">Geomview</a> • <a href="qh-optp.htm#print">Print</a> -• <a href="qh-optq.htm#qhull">Qhull</a> -• <a href="qh-optc.htm#prec">Precision</a> +• <a href="qh-optq.htm#qhull">Qhull</a> +• <a href="qh-optc.htm#prec">Precision</a> • <a href="qh-optt.htm#trace">Trace</a><br> -<b>To:</b> <a href="#synopsis">sy</a>nopsis -• <a href="#input">in</a>put • <a href="#outputs">ou</a>tputs -• <a href="#controls">co</a>ntrols • <a href="#graphics">gr</a>aphics -• <a href="#notes">no</a>tes • <a href="#conventions">co</a>nventions +<b>To:</b> <a href="#synopsis">sy</a>nopsis +• <a href="#input">in</a>put • <a href="#outputs">ou</a>tputs +• <a href="#controls">co</a>ntrols • <a href="#graphics">gr</a>aphics +• <a href="#notes">no</a>tes • <a href="#conventions">co</a>nventions • <a href="#options">op</a>tions <!-- GC common information --> <hr> diff --git a/html/qhull.htm b/html/qhull.htm index 812874b..1782a50 100644 --- a/html/qhull.htm +++ b/html/qhull.htm @@ -10,16 +10,16 @@ <p><b><a name="TOP">Up</a></b><b>:</b> <a href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="index.htm#TOC">Qhull manual</a>: Table of Contents<br> <b>To:</b> <a href="qh-quick.htm#programs">Programs</a> -• <a href="qh-quick.htm#options">Options</a> -• <a href="qh-opto.htm#output">Output</a> -• <a href="qh-optf.htm#format">Formats</a> -• <a href="qh-optg.htm#geomview">Geomview</a> +• <a href="qh-quick.htm#options">Options</a> +• <a href="qh-opto.htm#output">Output</a> +• <a href="qh-optf.htm#format">Formats</a> +• <a href="qh-optg.htm#geomview">Geomview</a> • <a href="qh-optp.htm#print">Print</a> -• <a href="qh-optq.htm#qhull">Qhull</a> -• <a href="qh-optc.htm#prec">Precision</a> +• <a href="qh-optq.htm#qhull">Qhull</a> +• <a href="qh-optc.htm#prec">Precision</a> • <a href="qh-optt.htm#trace">Trace</a><br> -<b>To:</b> <a href="#synopsis">sy</a>nopsis • <a href="#input">in</a>put -• <a href="#outputs">ou</a>tputs • <a href="#controls">co</a>ntrols +<b>To:</b> <a href="#synopsis">sy</a>nopsis • <a href="#input">in</a>put +• <a href="#outputs">ou</a>tputs • <a href="#controls">co</a>ntrols • <a href="#options">op</a>tions <hr> <!-- Main text of document --> @@ -31,38 +31,38 @@ height="100"></a>qhull -- convex hull and related structures</h1> <p>The convex hull of a set of points is the smallest convex set containing the points. The Delaunay triangulation and furthest-site Delaunay triangulation are equivalent to a convex hull in one -higher dimension. Halfspace intersection about a point is +higher dimension. Halfspace intersection about a point is equivalent to a convex hull by polar duality. <p>The <tt>qhull</tt> program provides options to build these -structures and to experiment with the process. Use the +structures and to experiment with the process. Use the <a href=qconvex.htm>qconvex</a>, -<a href=qdelaun.htm>qdelaunay</a>, <a href=qhalf.htm>qhalf</a>, +<a href=qdelaun.htm>qdelaunay</a>, <a href=qhalf.htm>qhalf</a>, and <a href=qvoronoi.htm>qvoronoi</a> programs to build specific structures. You may use <tt>qhull</tt> instead. -It takes the same options and uses the same code. +It takes the same options and uses the same code. <blockquote> <dl> - <dt><b>Example:</b> rbox 1000 D3 | qhull - <a href="qh-optc.htm#Cn">C-1e-4</a> - <a href="qh-optf.htm#FO">FO</a> - <a href="qh-optt.htm#Ts">Ts</a> - </dt> + <dt><b>Example:</b> rbox 1000 D3 | qhull + <a href="qh-optc.htm#Cn">C-1e-4</a> + <a href="qh-optf.htm#FO">FO</a> + <a href="qh-optt.htm#Ts">Ts</a> + </dt> <dd>Compute the 3-d convex hull of 1000 random - points. - Centrums must be 10^-4 below neighboring - hyperplanes. Print the options and precision constants. - When done, print statistics. These options may be - used with any of the Qhull programs.</dd> + points. + Centrums must be 10^-4 below neighboring + hyperplanes. Print the options and precision constants. + When done, print statistics. These options may be + used with any of the Qhull programs.</dd> <dt> </dt> <dt><b>Example:</b> rbox 1000 D3 | qhull <a href=qhull.htm#outputs>d</a> - <a href="qh-optq.htm#Qbb">Qbb</a> - <a href="qh-optc.htm#Rn">R1e-4</a> - <a href="qh-optq.htm#Q0">Q0</a></dt> + <a href="qh-optq.htm#Qbb">Qbb</a> + <a href="qh-optc.htm#Rn">R1e-4</a> + <a href="qh-optq.htm#Q0">Q0</a></dt> <dd>Compute the 3-d Delaunay triangulation of 1000 random - points. Randomly perturb all calculations by - [0.9999,1.0001]. Do not correct precision problems. - This leads to serious precision errors.</dd> + points. Randomly perturb all calculations by + [0.9999,1.0001]. Do not correct precision problems. + This leads to serious precision errors.</dd> </dl> </blockquote> <p>Use the following equivalences when calling <tt>qhull</tt> in 2-d to 4-d (a 3-d @@ -99,12 +99,12 @@ Delaunay triangulation is a 5-d convex hull): <p>By default, Qhull merges coplanar facets. For example, the convex hull of a cube's vertices has six facets. -<p>If you use '<a href="qh-optq.htm#Qt">Qt</a>' (triangulated output), -all facets will be simplicial (e.g., triangles in 2-d). For the cube +<p>If you use '<a href="qh-optq.htm#Qt">Qt</a>' (triangulated output), +all facets will be simplicial (e.g., triangles in 2-d). For the cube example, it will have 12 facets. Some facets may be -degenerate and have zero area. +degenerate and have zero area. -<p>If you use '<a href="qh-optq.htm#QJn">QJ</a>' (joggled input), +<p>If you use '<a href="qh-optq.htm#QJn">QJ</a>' (joggled input), all facets will be simplicial. The corresponding vertices will be slightly perturbed. Joggled input is less accurate that triangulated output.See <a @@ -122,7 +122,7 @@ are there extra points in a 4-d or higher convex hull?</a><br> <h3><a href="#TOP">»</a><a name="synopsis">qhull synopsis</a></h3> <pre> -qhull- compute convex hulls and related structures. +qhull- compute convex hulls and related structures. input (stdin): dimension, n, point coordinates comments start with a non-numeric character halfspace: use dim+1 and put offsets after coefficients @@ -174,7 +174,7 @@ examples: </ul> <p>Use I/O redirection (e.g., qhull < data.txt), a pipe (e.g., rbox 10 | qhull), -or the '<a href=qh-optt.htm#TI>TI</a>' option (e.g., qhull TI data.txt). +or the '<a href=qh-optt.htm#TI>TI</a>' option (e.g., qhull TI data.txt). <p>Comments start with a non-numeric character. Error reporting is simpler if there is one point per line. Dimension @@ -240,20 +240,20 @@ individually or together.</p> <dd><b>General</b></dd> <dt><a name="d">qhull d</a></dt> <dd>compute the convex hull of the input points. - See <a href=qconvex.htm>qconvex</a>.</dd> + See <a href=qconvex.htm>qconvex</a>.</dd> <dt><a name="d">qhull d Qbb</a></dt> <dd>compute the Delaunay triangulation by lifting the points - to a paraboloid. Use option '<a href="qh-optq.htm#Qbb">Qbb</a>' - to scale the paraboloid and improve numeric precision. - See <a href=qdelaun.htm>qdelaunay</a>.</dd> + to a paraboloid. Use option '<a href="qh-optq.htm#Qbb">Qbb</a>' + to scale the paraboloid and improve numeric precision. + See <a href=qdelaun.htm>qdelaunay</a>.</dd> <dt><a name="v">qhull v Qbb</a></dt> <dd>compute the Voronoi diagram by computing the Delaunay - triangulation. Use option '<a href="qh-optq.htm#Qbb">Qbb</a>' - to scale the paraboloid and improve numeric precision. - See <a href=qvoronoi.htm>qvoronoi</a>.</dd> + triangulation. Use option '<a href="qh-optq.htm#Qbb">Qbb</a>' + to scale the paraboloid and improve numeric precision. + See <a href=qvoronoi.htm>qvoronoi</a>.</dd> <dt><a name="H">qhull H</a></dt> <dd>compute the halfspace intersection about a point via polar - duality. See <a href=qhalf.htm>qhalf</a>.</dd> + duality. See <a href=qhalf.htm>qhalf</a>.</dd> </dl> </blockquote> @@ -288,7 +288,7 @@ individually or together.</p> <pre> qhull- compute convex hulls and related structures. - http://www.qhull.org + http://www.qhull.org input (stdin): first lines: dimension and number of points (or vice-versa). @@ -329,7 +329,7 @@ Qhull control options: QGn - good facet if visible from point n, -n for not visible QVn - good facet if it includes point n, -n if not Q0 - turn off default p remerge with 'C-0'/'Qx' - Q1 - sort merges by type instead of angle + Q1 - sort merges by type instead of angle Q2 - merge all non-convex at once instead of independent sets Q3 - do not merge redundant vertices Q4 - avoid old>new merges @@ -339,7 +339,7 @@ Qhull control options: Q8 - do not process near-inside points Q9 - process furthest of furthest points Q10 - no special processing for narrow distributions - Q11 - copy normals and recompute centrums for tricoplanar facets + Q11 - copy normals and recompute centrums for tricoplanar facets Towpaths Trace options: T4 - trace at level n, 4=all, 5=mem/gauss, -1= events @@ -444,16 +444,16 @@ Print options: <p><b>Up:</b> <a href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="index.htm#TOC">Qhull manual</a>: Table of Contents<br> <b>To:</b> <a href="qh-quick.htm#programs">Programs</a> -• <a href="qh-quick.htm#options">Options</a> -• <a href="qh-opto.htm#output">Output</a> -• <a href="qh-optf.htm#format">Formats</a> -• <a href="qh-optg.htm#geomview">Geomview</a> +• <a href="qh-quick.htm#options">Options</a> +• <a href="qh-opto.htm#output">Output</a> +• <a href="qh-optf.htm#format">Formats</a> +• <a href="qh-optg.htm#geomview">Geomview</a> • <a href="qh-optp.htm#print">Print</a> -• <a href="qh-optq.htm#qhull">Qhull</a> -• <a href="qh-optc.htm#prec">Precision</a> +• <a href="qh-optq.htm#qhull">Qhull</a> +• <a href="qh-optc.htm#prec">Precision</a> • <a href="qh-optt.htm#trace">Trace</a><br> -<b>To:</b> <a href="#synopsis">sy</a>nopsis • <a href="#input">in</a>put -• <a href="#outputs">ou</a>tputs • <a href="#controls">co</a>ntrols +<b>To:</b> <a href="#synopsis">sy</a>nopsis • <a href="#input">in</a>put +• <a href="#outputs">ou</a>tputs • <a href="#controls">co</a>ntrols • <a href="#options">op</a>tions <!-- GC common information --> <hr> diff --git a/html/qvoron_f.htm b/html/qvoron_f.htm index 793173b..2702727 100644 --- a/html/qvoron_f.htm +++ b/html/qvoron_f.htm @@ -7,22 +7,22 @@ <body> <!-- Navigation links --> -<a name="TOP"><b>Up</b></a><b>:</b> +<a name="TOP"><b>Up</b></a><b>:</b> <a href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="index.htm#TOC">Qhull manual</a>: Table of Contents<br> <b>To:</b> <a href="qh-quick.htm#programs">Programs</a> -• <a href="qh-quick.htm#options">Options</a> -• <a href="qh-opto.htm#output">Output</a> -• <a href="qh-optf.htm#format">Formats</a> -• <a href="qh-optg.htm#geomview">Geomview</a> +• <a href="qh-quick.htm#options">Options</a> +• <a href="qh-opto.htm#output">Output</a> +• <a href="qh-optf.htm#format">Formats</a> +• <a href="qh-optg.htm#geomview">Geomview</a> • <a href="qh-optp.htm#print">Print</a> -• <a href="qh-optq.htm#qhull">Qhull</a> -• <a href="qh-optc.htm#prec">Precision</a> +• <a href="qh-optq.htm#qhull">Qhull</a> +• <a href="qh-optc.htm#prec">Precision</a> • <a href="qh-optt.htm#trace">Trace</a><br> -<b>To:</b> <a href="#synopsis">sy</a>nopsis -• <a href="#input">in</a>put • <a href="#outputs">ou</a>tputs -• <a href="#controls">co</a>ntrols • <a href="#graphics">gr</a>aphics -• <a href="#notes">no</a>tes • <a href="#conventions">co</a>nventions +<b>To:</b> <a href="#synopsis">sy</a>nopsis +• <a href="#input">in</a>put • <a href="#outputs">ou</a>tputs +• <a href="#controls">co</a>ntrols • <a href="#graphics">gr</a>aphics +• <a href="#notes">no</a>tes • <a href="#conventions">co</a>nventions • <a href="#options">op</a>tions <hr> @@ -56,15 +56,15 @@ href="qdelau_f.htm">furthest-site Delaunay triangulation</a>. <dl> <dt><b>Example:</b> rbox r y c G1 D2 | qvoronoi <a - href="qh-optq.htm#Qu">Qu</a> + href="qh-optq.htm#Qu">Qu</a> <a href="qh-opto.htm#s">s</a> <a href="qh-optf.htm#Fn">Fn</a> <a href="qh-optt.htm#TO">TO result</a></dt> <dd>Compute the 2-d furthest-site Voronoi diagram of a square and a small triangle. Write a summary to the console and the Voronoi - vertices for each input site to 'result'. + vertices for each input site to 'result'. The origin is the only furthest-site Voronoi vertex. The - negative indices indicate vertices-at-infinity.</dd> + negative indices indicate vertices-at-infinity.</dd> </dl> </blockquote> @@ -85,11 +85,11 @@ unexpected results. Cocircular and cospherical input sites will produce duplicate or nearly duplicate furthest-site Voronoi vertices. See also <a href="qh-impre.htm#joggle">Merged facets or joggled input</a>. </p> -<p>The 'qvonoroi' program is equivalent to +<p>The 'qvonoroi' program is equivalent to '<a href=qhull.htm#outputs>qhull v</a> <a href=qh-optq.htm#Qbb>Qbb</a>' in 2-d to 3-d, and -'<a href=qhull.htm#outputs>qhull v</a> <a href=qh-optq.htm#Qbb>Qbb</a> <a href=qh-optq.htm#Qx>Qx</a>' +'<a href=qhull.htm#outputs>qhull v</a> <a href=qh-optq.htm#Qbb>Qbb</a> <a href=qh-optq.htm#Qx>Qx</a>' in 4-d and higher. It disables the following Qhull -<a href=qh-quick.htm#options>options</a>: <i>d n m v H U Qb +<a href=qh-quick.htm#options>options</a>: <i>d n m v H U Qb QB Qc Qf Qg Qi Qm Qr QR Qv Qx TR E V Fa FA FC Fp FS Ft FV Gt Q0,etc</i>. @@ -110,20 +110,20 @@ input</a></h3> <blockquote> <p>The input data on <tt>stdin</tt> consists of:</p> <ul> - <li>dimension + <li>dimension <li>number of points</li> <li>point coordinates</li> </ul> <p>Use I/O redirection (e.g., qvoronoi Qu < data.txt), a pipe (e.g., rbox 10 | qvoronoi Qu), -or the '<a href=qh-optt.htm#TI>TI</a>' option (e.g., qvoronoi TI data.txt Qu). +or the '<a href=qh-optt.htm#TI>TI</a>' option (e.g., qvoronoi TI data.txt Qu). -<p>For example, this is a square containing four random points. +<p>For example, this is a square containing four random points. Its furthest-site Voronoi diagram has on vertex and four unbounded, separating hyperplanes (i.e., the coordinate axes) <p> <blockquote> -<tt>rbox c 4 D2 > data</tt> +<tt>rbox c 4 D2 > data</tt> <blockquote><pre> 2 RBOX c 4 D2 8 @@ -177,70 +177,70 @@ outputs</a></h3> <dd><b>furthest-site Voronoi vertices</b></dd> <dt><a href="qh-opto.htm#p">p</a></dt> <dd>print the coordinates of the furthest-site Voronoi vertices. The first line - is the dimension. The second line is the number of vertices. Each - remaining line is a furthest-site Voronoi vertex. The points-in-square example - has one furthest-site Voronoi vertex at the origin.</dd> + is the dimension. The second line is the number of vertices. Each + remaining line is a furthest-site Voronoi vertex. The points-in-square example + has one furthest-site Voronoi vertex at the origin.</dd> <dt><a href="qh-optf.htm#Fn">Fn</a></dt> <dd>list the neighboring furthest-site Voronoi vertices for each furthest-site Voronoi vertex. The first line is the number of Voronoi vertices. Each - remaining line starts with the number of neighboring vertices. Negative indices (e.g., <em>-1</em>) indicate vertices - outside of the Voronoi diagram. In the points-in-square example, the - Voronoi vertex at the origin has four neighbors-at-infinity.</dd> + remaining line starts with the number of neighboring vertices. Negative indices (e.g., <em>-1</em>) indicate vertices + outside of the Voronoi diagram. In the points-in-square example, the + Voronoi vertex at the origin has four neighbors-at-infinity.</dd> <dt><a href="qh-optf.htm#FN">FN</a></dt> - <dd>list the furthest-site Voronoi vertices for each furthest-site Voronoi region. The first line is - the number of Voronoi regions. Each remaining line starts with the - number of Voronoi vertices. Negative indices (e.g., <em>-1</em>) indicate vertices - outside of the Voronoi diagram. - In the points-in-square example, all regions share the Voronoi vertex - at the origin.</dd> + <dd>list the furthest-site Voronoi vertices for each furthest-site Voronoi region. The first line is + the number of Voronoi regions. Each remaining line starts with the + number of Voronoi vertices. Negative indices (e.g., <em>-1</em>) indicate vertices + outside of the Voronoi diagram. + In the points-in-square example, all regions share the Voronoi vertex + at the origin.</dd> <dt> </dt> <dt> </dt> <dd><b>furthest-site Voronoi regions</b></dd> <dt><a href="qh-opto.htm#o">o</a></dt> - <dd>print the furthest-site Voronoi regions in OFF format. The first line is the - dimension. The second line is the number of vertices, the number - of input sites, and "1". The third line represents the vertex-at-infinity. - Its coordinates are "-10.101". The next lines are the coordinates - of the furthest-site Voronoi vertices. Each remaining line starts with the number - of Voronoi vertices in a Voronoi region. In 2-d, the vertices are + <dd>print the furthest-site Voronoi regions in OFF format. The first line is the + dimension. The second line is the number of vertices, the number + of input sites, and "1". The third line represents the vertex-at-infinity. + Its coordinates are "-10.101". The next lines are the coordinates + of the furthest-site Voronoi vertices. Each remaining line starts with the number + of Voronoi vertices in a Voronoi region. In 2-d, the vertices are listed in adjacency order (unoriented). In 3-d and higher, the vertices are listed in numeric order. In the points-in-square - example, each unbounded region includes the Voronoi vertex at - the origin. Lines consisting of <em>0</em> indicate - interior input sites. </dd> + example, each unbounded region includes the Voronoi vertex at + the origin. Lines consisting of <em>0</em> indicate + interior input sites. </dd> <dt><a href="qh-optf.htm#Fi2">Fi</a></dt> <dd>print separating hyperplanes for inner, bounded furthest-site Voronoi regions. The first number is the number of separating - hyperplanes. Each remaining line starts with <i>3+dim</i>. The - next two numbers are adjacent input sites. The next <i>dim</i> - numbers are the coefficients of the separating hyperplane. The - last number is its offset. The are no bounded, separating hyperplanes - for the points-in-square example.</dd> + hyperplanes. Each remaining line starts with <i>3+dim</i>. The + next two numbers are adjacent input sites. The next <i>dim</i> + numbers are the coefficients of the separating hyperplane. The + last number is its offset. The are no bounded, separating hyperplanes + for the points-in-square example.</dd> <dt><a href="qh-optf.htm#Fo2">Fo</a></dt> <dd>print separating hyperplanes for outer, unbounded furthest-site Voronoi regions. The first number is the number of separating - hyperplanes. Each remaining line starts with <i>3+dim</i>. The - next two numbers are adjacent input sites on the convex hull. The - next <i>dim</i> - numbers are the coefficients of the separating hyperplane. The - last number is its offset. The points-in-square example has four - unbounded, separating hyperplanes.</dd> + hyperplanes. Each remaining line starts with <i>3+dim</i>. The + next two numbers are adjacent input sites on the convex hull. The + next <i>dim</i> + numbers are the coefficients of the separating hyperplane. The + last number is its offset. The points-in-square example has four + unbounded, separating hyperplanes.</dd> <dt> </dt> <dt> </dt> <dd><b>Input sites</b></dd> <dt><a href="qh-optf.htm#Fv2">Fv</a></dt> <dd>list ridges of furthest-site Voronoi vertices for pairs of input sites. The - first line is the number of ridges. Each remaining line starts with - two plus the number of Voronoi vertices in the ridge. The next - two numbers are two adjacent input sites. The remaining numbers list - the Voronoi vertices. As with option 'o', a <em>0</em> indicates - the vertex-at-infinity - and an unbounded, separating hyperplane. - The perpendicular bisector (separating hyperplane) - of the input sites is a flat through these vertices. - In the points-in-square example, the ridge for each edge of the square - is unbounded.</dd> + first line is the number of ridges. Each remaining line starts with + two plus the number of Voronoi vertices in the ridge. The next + two numbers are two adjacent input sites. The remaining numbers list + the Voronoi vertices. As with option 'o', a <em>0</em> indicates + the vertex-at-infinity + and an unbounded, separating hyperplane. + The perpendicular bisector (separating hyperplane) + of the input sites is a flat through these vertices. + In the points-in-square example, the ridge for each edge of the square + is unbounded.</dd> <dt> </dt> <dt> </dt> <dd><b>General</b></dd> @@ -249,14 +249,14 @@ vertices are listed in numeric order. In the points-in-square href="qh-optf.htm#Fs">Fs</a>' for numeric data.</dd> <dt><a href="qh-opto.htm#i">i</a></dt> <dd>list input sites for each <a href=qdelau_f.htm>furthest-site Delaunay region</a>. Use option '<a href="qh-optp.htm#Pp">Pp</a>' - to avoid the warning. The first line is the number of regions. The - remaining lines list the input sites for each region. The regions are - oriented. In the points-in-square example, the square region has four - input sites. In 3-d and higher, report cospherical sites by adding extra points. - </dd> + to avoid the warning. The first line is the number of regions. The + remaining lines list the input sites for each region. The regions are + oriented. In the points-in-square example, the square region has four + input sites. In 3-d and higher, report cospherical sites by adding extra points. + </dd> <dt><a href="qh-optg.htm#G">G</a></dt> <dd>Geomview output for 2-d furthest-site Voronoi diagrams.</dd> - </dl> + </dl> </blockquote> </blockquote> @@ -276,7 +276,7 @@ controls</a></h3> will contain two, identical furthest-site Voronoi vertices.</dd> <dt><a href="qh-optq.htm#QJn">QJ</a></dt> <dd>joggle the input to avoid furthest-site Voronoi vertices defined by more - than <i>dim+1</i> points. It is less accurate than triangulated output ('Qt'). + than <i>dim+1</i> points. It is less accurate than triangulated output ('Qt'). </dd> <dt><a href="qh-optq.htm#QVn">QVn</a></dt> <dd>select furthest-site Voronoi vertices for input site <em>n</em> </dd> @@ -286,15 +286,15 @@ controls</a></h3> <dd>input data from file. The filename may not use spaces or quotes.</dd> <dt><a href="qh-optt.htm#TO">TO file</a></dt> <dd>output results to file. Use single quotes if the filename - contains spaces (e.g., <tt>TO 'file with spaces.txt'</tt></dd> + contains spaces (e.g., <tt>TO 'file with spaces.txt'</tt></dd> <dt><a href="qh-optt.htm#TFn">TFn</a></dt> <dd>report progress after constructing <em>n</em> facets</dd> <dt><a href="qh-optp.htm#PDk">PDk:1</a></dt> <dd>include upper and lower facets in the output. Set <em>k</em> to the last dimension (e.g., 'PD2:1' for 2-d inputs). </dd> <dt><a href="qh-opto.htm#f">f </a></dt> - <dd>facet dump. Print the data structure for each facet (i.e., - furthest-site Voronoi vertex).</dd> + <dd>facet dump. Print the data structure for each facet (i.e., + furthest-site Voronoi vertex).</dd> </dl> </blockquote> @@ -347,7 +347,7 @@ conventions</a>, and <a href="index.htm#structure">Qhull's data structures</a>.< paraboloid. It corresponds to a unique input site. </li> <li><em>furthest-site Delaunay facet</em> - an upper facet of the paraboloid. The last coefficient of its normal is - clearly positive.</li> + clearly positive.</li> <li><em>furthest-site Voronoi vertex</em> - the circumcenter of a furthest-site Delaunay facet</li> <li><em>furthest-site Voronoi region</em> - the region of @@ -381,18 +381,18 @@ for furthest-site Voronoi diagrams. <p><b>Up:</b> <a href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="index.htm#TOC">Qhull manual</a>: Table of Contents<br> <b>To:</b> <a href="qh-quick.htm#programs">Programs</a> -• <a href="qh-quick.htm#options">Options</a> -• <a href="qh-opto.htm#output">Output</a> -• <a href="qh-optf.htm#format">Formats</a> -• <a href="qh-optg.htm#geomview">Geomview</a> +• <a href="qh-quick.htm#options">Options</a> +• <a href="qh-opto.htm#output">Output</a> +• <a href="qh-optf.htm#format">Formats</a> +• <a href="qh-optg.htm#geomview">Geomview</a> • <a href="qh-optp.htm#print">Print</a> -• <a href="qh-optq.htm#qhull">Qhull</a> -• <a href="qh-optc.htm#prec">Precision</a> +• <a href="qh-optq.htm#qhull">Qhull</a> +• <a href="qh-optc.htm#prec">Precision</a> • <a href="qh-optt.htm#trace">Trace</a><br> -<b>To:</b> <a href="#synopsis">sy</a>nopsis -• <a href="#input">in</a>put • <a href="#outputs">ou</a>tputs -• <a href="#controls">co</a>ntrols • <a href="#graphics">gr</a>aphics -• <a href="#notes">no</a>tes • <a href="#conventions">co</a>nventions +<b>To:</b> <a href="#synopsis">sy</a>nopsis +• <a href="#input">in</a>put • <a href="#outputs">ou</a>tputs +• <a href="#controls">co</a>ntrols • <a href="#graphics">gr</a>aphics +• <a href="#notes">no</a>tes • <a href="#conventions">co</a>nventions • <a href="#options">op</a>tions <!-- GC common information --> <hr> diff --git a/html/qvoronoi.htm b/html/qvoronoi.htm index e0f3edb..dd846e6 100644 --- a/html/qvoronoi.htm +++ b/html/qvoronoi.htm @@ -52,7 +52,7 @@ dual of the <a href=qdelaun.htm>Delaunay triangulation</a>. </p> <dt> </dt> <dt><b>Example:</b> rbox r y c G0.1 D2 | qvoronoi - <a href="qh-opto.htm#s">s</a> + <a href="qh-opto.htm#s">s</a> <a href="qh-opto.htm#o">o</a> <a href="qh-optt.htm#TO">TO result</a></dt> <dd>Compute the 2-d Voronoi diagram of a triangle and a small @@ -77,10 +77,10 @@ dual of the <a href=qdelaun.htm>Delaunay triangulation</a>. </p> <dt> </dt> <dt><b>Example:</b> rbox r y c G0.1 D2 | qvoronoi <a href="qh-optf.htm#Fi2">Fi</a></dt> <dd>Print the bounded, separating hyperplanes for the 2-d Voronoi diagram of a - triangle and a small + triangle and a small square. Note the four hyperplanes (i.e., lines) for Voronoi vertex - "8". It is at the origin. - </dd> + "8". It is at the origin. + </dd> </dl> </blockquote> @@ -232,56 +232,56 @@ outputs</a></h3> <dd><b>Voronoi vertices</b></dd> <dt><a href="qh-opto.htm#p">p</a></dt> <dd>print the coordinates of the Voronoi vertices. The first line - is the dimension. The second line is the number of vertices. Each - remaining line is a Voronoi vertex.</dd> + is the dimension. The second line is the number of vertices. Each + remaining line is a Voronoi vertex.</dd> <dt><a href="qh-optf.htm#Fn">Fn</a></dt> <dd>list the neighboring Voronoi vertices for each Voronoi vertex. The first line is the number of Voronoi vertices. Each - remaining line starts with the number of neighboring vertices. - Negative vertices (e.g., <em>-1</em>) indicate vertices - outside of the Voronoi diagram. + remaining line starts with the number of neighboring vertices. + Negative vertices (e.g., <em>-1</em>) indicate vertices + outside of the Voronoi diagram. In the circle-in-box example, the - Voronoi vertex at the origin has four neighbors.</dd> + Voronoi vertex at the origin has four neighbors.</dd> <dt><a href="qh-optf.htm#FN">FN</a></dt> <dd>list the Voronoi vertices for each Voronoi region. The first line is - the number of Voronoi regions. Each remaining line starts with the - number of Voronoi vertices. Negative indices (e.g., <em>-1</em>) indicate vertices - outside of the Voronoi diagram. - In the circle-in-box example, the four bounded regions are defined by four - Voronoi vertices.</dd> + the number of Voronoi regions. Each remaining line starts with the + number of Voronoi vertices. Negative indices (e.g., <em>-1</em>) indicate vertices + outside of the Voronoi diagram. + In the circle-in-box example, the four bounded regions are defined by four + Voronoi vertices.</dd> <dt> </dt> <dt> </dt> <dd><b>Voronoi regions</b></dd> <dt><a href="qh-opto.htm#o">o</a></dt> <dd>print the Voronoi regions in OFF format. The first line is the - dimension. The second line is the number of vertices, the number - of input sites, and "1". The third line represents the vertex-at-infinity. - Its coordinates are "-10.101". The next lines are the coordinates - of the Voronoi vertices. Each remaining line starts with the number - of Voronoi vertices in a Voronoi region. In 2-d, the vertices are + dimension. The second line is the number of vertices, the number + of input sites, and "1". The third line represents the vertex-at-infinity. + Its coordinates are "-10.101". The next lines are the coordinates + of the Voronoi vertices. Each remaining line starts with the number + of Voronoi vertices in a Voronoi region. In 2-d, the vertices are listed in adjacency order (unoriented). In 3-d and higher, the vertices are listed in numeric order. In the circle-in-square - example, each bounded region includes the Voronoi vertex at - the origin. Lines consisting of <em>0</em> indicate - coplanar input sites or '<a href="qh-optq.htm#Qz">Qz</a>'. </dd> + example, each bounded region includes the Voronoi vertex at + the origin. Lines consisting of <em>0</em> indicate + coplanar input sites or '<a href="qh-optq.htm#Qz">Qz</a>'. </dd> <dt><a href="qh-optf.htm#Fi2">Fi</a></dt> <dd>print separating hyperplanes for inner, bounded Voronoi regions. The first number is the number of separating - hyperplanes. Each remaining line starts with <i>3+dim</i>. The - next two numbers are adjacent input sites. The next <i>dim</i> - numbers are the coefficients of the separating hyperplane. The - last number is its offset. Use '<a href="qh-optt.htm#Tv">Tv</a>' to verify that the + hyperplanes. Each remaining line starts with <i>3+dim</i>. The + next two numbers are adjacent input sites. The next <i>dim</i> + numbers are the coefficients of the separating hyperplane. The + last number is its offset. Use '<a href="qh-optt.htm#Tv">Tv</a>' to verify that the hyperplanes are perpendicular bisectors. It will list relevant statistics to stderr. </dd> <dt><a href="qh-optf.htm#Fo2">Fo</a></dt> <dd>print separating hyperplanes for outer, unbounded Voronoi regions. The first number is the number of separating - hyperplanes. Each remaining line starts with <i>3+dim</i>. The - next two numbers are adjacent input sites on the convex hull. The - next <i>dim</i> - numbers are the coefficients of the separating hyperplane. The - last number is its offset. Use '<a href="qh-optt.htm#Tv">Tv</a>' to verify that the + hyperplanes. Each remaining line starts with <i>3+dim</i>. The + next two numbers are adjacent input sites on the convex hull. The + next <i>dim</i> + numbers are the coefficients of the separating hyperplane. The + last number is its offset. Use '<a href="qh-optt.htm#Tv">Tv</a>' to verify that the hyperplanes are perpendicular bisectors. It will list relevant statistics to stderr,</dd> <dt> </dt> @@ -289,33 +289,33 @@ statistics to stderr,</dd> <dd><b>Input sites</b></dd> <dt><a href="qh-optf.htm#Fv2">Fv</a></dt> <dd>list ridges of Voronoi vertices for pairs of input sites. The - first line is the number of ridges. Each remaining line starts with - two plus the number of Voronoi vertices in the ridge. The next - two numbers are two adjacent input sites. The remaining numbers list - the Voronoi vertices. As with option 'o', a <em>0</em> indicates - the vertex-at-infinity - and an unbounded, separating hyperplane. - The perpendicular bisector (separating hyperplane) - of the input sites is a flat through these vertices. - In the circle-in-square example, the ridge for each edge of the square - is unbounded.</dd> + first line is the number of ridges. Each remaining line starts with + two plus the number of Voronoi vertices in the ridge. The next + two numbers are two adjacent input sites. The remaining numbers list + the Voronoi vertices. As with option 'o', a <em>0</em> indicates + the vertex-at-infinity + and an unbounded, separating hyperplane. + The perpendicular bisector (separating hyperplane) + of the input sites is a flat through these vertices. + In the circle-in-square example, the ridge for each edge of the square + is unbounded.</dd> <dt><a href="qh-optf.htm#Fc">Fc</a></dt> <dd>list coincident input sites for each Voronoi vertex. - The first line is the number of vertices. The remaining lines start with - the number of coincident sites and deleted vertices. Deleted vertices - indicate highly degenerate input (see'<A href="qh-optf.htm#Fs">Fs</a>'). - A coincident site is assigned to one Voronoi - vertex. Do not use '<a href="qh-optq.htm#QJn">QJ</a>' with 'Fc'; the joggle will separate - coincident sites.</dd> + The first line is the number of vertices. The remaining lines start with + the number of coincident sites and deleted vertices. Deleted vertices + indicate highly degenerate input (see'<A href="qh-optf.htm#Fs">Fs</a>'). + A coincident site is assigned to one Voronoi + vertex. Do not use '<a href="qh-optq.htm#QJn">QJ</a>' with 'Fc'; the joggle will separate + coincident sites.</dd> <dt><a href="qh-optf.htm#FP">FP</a></dt> <dd>print coincident input sites with distance to nearest site (i.e., vertex). The first line is the - number of coincident sites. Each remaining line starts with the point ID of - an input site, followed by the point ID of a coincident point, its vertex, and distance. + number of coincident sites. Each remaining line starts with the point ID of + an input site, followed by the point ID of a coincident point, its vertex, and distance. Includes deleted vertices which - indicate highly degenerate input (see'<A href="qh-optf.htm#Fs">Fs</a>'). - Do not use '<a href="qh-optq.htm#QJn">QJ</a>' with 'FP'; the joggle will separate - coincident sites.</dd> + indicate highly degenerate input (see'<A href="qh-optf.htm#Fs">Fs</a>'). + Do not use '<a href="qh-optq.htm#QJn">QJ</a>' with 'FP'; the joggle will separate + coincident sites.</dd> <dt> </dt> <dt> </dt> <dd><b>General</b></dd> @@ -324,14 +324,14 @@ statistics to stderr,</dd> href="qh-optf.htm#Fs">Fs</a>' for numeric data.</dd> <dt><a href="qh-opto.htm#i">i</a></dt> <dd>list input sites for each <a href=qdelaun.htm>Delaunay region</a>. Use option '<a href="qh-optp.htm#Pp">Pp</a>' - to avoid the warning. The first line is the number of regions. The - remaining lines list the input sites for each region. The regions are - oriented. In the circle-in-square example, the cocircular region has four - edges. In 3-d and higher, report cospherical sites by adding extra points. - </dd> + to avoid the warning. The first line is the number of regions. The + remaining lines list the input sites for each region. The regions are + oriented. In the circle-in-square example, the cocircular region has four + edges. In 3-d and higher, report cospherical sites by adding extra points. + </dd> <dt><a href="qh-optg.htm#G">G</a></dt> <dd>Geomview output for 2-d Voronoi diagrams.</dd> - </dl> + </dl> </blockquote> </blockquote> <h3><a href="#TOP">»</a> <a name="controls">qvoronoi @@ -348,7 +348,7 @@ controls</a></h3> will contain two copies of the Voronoi vertex.</dd> <dt><a href="qh-optq.htm#QJn">QJ</a></dt> <dd>joggle the input to avoid Voronoi vertices defined by more - than <i>dim+1</i> points. It is less accurate than triangulated output ('Qt'). + than <i>dim+1</i> points. It is less accurate than triangulated output ('Qt'). </dd> <dt><a href="qh-optq.htm#Qu">Qu</a></dt> <dd>compute the <a href="qvoron_f.htm">furthest-site Voronoi diagram</a>.</dd> @@ -364,7 +364,7 @@ controls</a></h3> <dd>input data from file. The filename may not use spaces or quotes.</dd> <dt><a href="qh-optt.htm#TO">TO file</a></dt> <dd>output results to file. Use single quotes if the filename - contains spaces (e.g., <tt>TO 'file with spaces.txt'</tt></dd> + contains spaces (e.g., <tt>TO 'file with spaces.txt'</tt></dd> <dt><a href="qh-optt.htm#TFn">TFn</a></dt> <dd>report progress after constructing <em>n</em> facets</dd> <dt><a href="qh-optp.htm#PDk">PDk:1</a></dt> @@ -372,7 +372,7 @@ controls</a></h3> to the last dimension (e.g., 'PD2:1' for 2-d inputs). </dd> <dt><a href="qh-opto.htm#f">f </a></dt> <dd>facet dump. Print the data structure for each facet (i.e., - Voronoi vertex).</dd> + Voronoi vertex).</dd> </dl> </blockquote> @@ -523,7 +523,7 @@ href="qdelaun.htm#conventions">Delaunay conventions</a>, and paraboloid by option '<a href="qh-optq.htm#Qz">Qz</a>'</li> <li><em>Delaunay facet</em> - a lower facet of the paraboloid. The last coefficient of its normal is - clearly negative.</li> + clearly negative.</li> <li><em>Voronoi vertex</em> - the circumcenter of a Delaunay facet</li> <li><em>Voronoi region</em> - the Voronoi vertices for an @@ -622,7 +622,7 @@ Geomview options (2-d only) Gi - inner planes only Gn - no planes Go - outer planes only - Gc - centrums + Gc - centrums Gh - hyperplane intersections Gr - ridges GDn - drop dimension n in 3-d and 4-d output diff --git a/html/rbox.htm b/html/rbox.htm index 4b133b6..80698e0 100644 --- a/html/rbox.htm +++ b/html/rbox.htm @@ -10,16 +10,16 @@ <p><b><a name="TOP">Up:</a></b> <a href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="index.htm#TOC">Qhull manual</a>: Table of Contents<br> <b>To:</b> <a href="qh-quick.htm#programs">Programs</a> -• <a href="qh-quick.htm#options">Options</a> -• <a href="qh-opto.htm#output">Output</a> -• <a href="qh-optf.htm#format">Formats</a> -• <a href="qh-optg.htm#geomview">Geomview</a> +• <a href="qh-quick.htm#options">Options</a> +• <a href="qh-opto.htm#output">Output</a> +• <a href="qh-optf.htm#format">Formats</a> +• <a href="qh-optg.htm#geomview">Geomview</a> • <a href="qh-optp.htm#print">Print</a> -• <a href="qh-optq.htm#qhull">Qhull</a> -• <a href="qh-optc.htm#prec">Precision</a> +• <a href="qh-optq.htm#qhull">Qhull</a> +• <a href="qh-optc.htm#prec">Precision</a> • <a href="qh-optt.htm#trace">Trace</a><br> -<b>To:</b> <a href="#synopsis">sy</a>nopsis • <a href="#outputs">ou</a>tputs -• <a href="#examples">ex</a>amples • <a href="#notes">no</a>tes +<b>To:</b> <a href="#synopsis">sy</a>nopsis • <a href="#outputs">ou</a>tputs +• <a href="#examples">ex</a>amples • <a href="#notes">no</a>tes • <a href="#options">op</a>tions <hr> <!-- Main text of document --> @@ -29,17 +29,17 @@ src="qh--cone.gif" alt="[CONE]" align="middle" width="100" height="100"></a>rbox -- generate point distributions</h1> <blockquote> - rbox generates random or regular points according to the + rbox generates random or regular points according to the options given, and outputs the points to stdout. The points are generated in a cube, unless 's', 'x', or 'y' - are given. + are given. </blockquote> <h3><a href="#TOP">»</a><a name="synopsis">rbox synopsis</a></h3> <pre> rbox- generate various point distributions. Default is random in cube. -args (any order, space separated): +args (any order, space separated): 3000 number of random points in cube, lens, spiral, sphere or grid D3 dimension 3-d c add a unit cube to the output ('c G2.0' sets size) @@ -71,8 +71,8 @@ args (any order, space separated): <blockquote> The format of the output is the following: first line contains - the dimension and a comment, second line contains the - number of points, and the following lines contain the points, + the dimension and a comment, second line contains the + number of points, and the following lines contain the points, one point per line. Points are represented by their coordinate values. <p>For example, <tt>rbox c 10 D2</tt> generates @@ -103,64 +103,64 @@ The format of the output is the following: first line contains <pre> rbox 10 - 10 random points in the unit cube centered at the - origin. + 10 random points in the unit cube centered at the + origin. rbox 10 s D2 - 10 random points on a 2-d circle. + 10 random points on a 2-d circle. rbox 100 W0 - 100 random points on the surface of a cube. + 100 random points on the surface of a cube. rbox 1000 s D4 - 1000 random points on a 4-d sphere. + 1000 random points on a 4-d sphere. rbox c D5 O0.5 - a 5-d hypercube with one corner at the origin. + a 5-d hypercube with one corner at the origin. rbox d D10 - a 10-d diamond. + a 10-d diamond. rbox x 1000 r W0 - 100 random points on the surface of a fixed simplex + 100 random points on the surface of a fixed simplex rbox y D12 - a 12-d simplex. + a 12-d simplex. rbox l 10 - 10 random points along a spiral + 10 random points along a spiral rbox l 10 r - 10 regular points along a spiral plus two end - points + 10 regular points along a spiral plus two end + points rbox 1000 L10000 D4 s - 1000 random points on the surface of a narrow lens. + 1000 random points on the surface of a narrow lens. - rbox 1000 L100000 s G1e-6 - 1000 random points near the edge of a narrow lens + rbox 1000 L100000 s G1e-6 + 1000 random points near the edge of a narrow lens rbox c G2 d G3 - a cube with coordinates +2/-2 and a diamond with - coordinates +3/-3. + a cube with coordinates +2/-2 and a diamond with + coordinates +3/-3. rbox 64 M3,4 z - a rotated, {0,1,2,3} x {0,1,2,3} x {0,1,2,3} lat- - tice (Mesh) of integer points. + a rotated, {0,1,2,3} x {0,1,2,3} x {0,1,2,3} lat- + tice (Mesh) of integer points. rbox P0 P0 P0 P0 P0 - 5 copies of the origin in 3-d. Try 'rbox P0 P0 P0 - P0 P0 | qhull QJ'. + 5 copies of the origin in 3-d. Try 'rbox P0 P0 P0 + P0 P0 | qhull QJ'. r 100 s Z1 G0.1 - two cospherical 100-gons plus another cospherical - point. + two cospherical 100-gons plus another cospherical + point. 100 s Z1 - a cone of points. + a cone of points. 100 s Z1e-7 - a narrow cone of points with many precision errors. + a narrow cone of points with many precision errors. </pre> <h3><a href="#TOP">»</a><a name="notes">rbox notes</a></h3> @@ -180,65 +180,65 @@ Some combinations of arguments generate odd results. l spiral distribution, available only in 3-d Ln lens distribution of radius n. May be used with - 's', 'r', 'G', and 'W'. + 's', 'r', 'G', and 'W'. - Mn,m,r lattice (Mesh) rotated by {[n,-m,0], [m,n,0], - [0,0,r], ...}. Use 'Mm,n' for a rigid rotation - with r = sqrt(n^2+m^2). 'M1,0' is an orthogonal - lattice. For example, '27 M1,0' is {0,1,2} x - {0,1,2} x {0,1,2}. + Mn,m,r lattice (Mesh) rotated by {[n,-m,0], [m,n,0], + [0,0,r], ...}. Use 'Mm,n' for a rigid rotation + with r = sqrt(n^2+m^2). 'M1,0' is an orthogonal + lattice. For example, '27 M1,0' is {0,1,2} x + {0,1,2} x {0,1,2}. s cospherical points randomly generated in a cube and - projected to the unit sphere + projected to the unit sphere x simplicial distribution. It is fixed for option - 'r'. May be used with 'W'. + 'r'. May be used with 'W'. - y simplicial distribution plus a simplex. Both 'x' - and 'y' generate the same points. + y simplicial distribution plus a simplex. Both 'x' + and 'y' generate the same points. - Wn restrict points to distance n of the surface of a - sphere or a cube + Wn restrict points to distance n of the surface of a + sphere or a cube c add a unit cube to the output c Gm add a cube with all combinations of +m and -m to - the output + the output d add a unit diamond to the output. d Gm add a diamond made of 0, +m and -m to the output Pn,m,r add point [n,m,r] to the output first. Pad coordi- - nates with 0.0. + nates with 0.0. n Remove the command line from the first line of out- - put. + put. On offset the data by adding n to each coordinate. t use time in seconds as the random number seed - (default is command line). + (default is command line). tn set the random number seed to n. z generate integer coordinates. Use 'Bn' to change - the range. The default is 'B1e6' for six-digit - coordinates. In R^4, seven-digit coordinates will - overflow hyperplane normalization. + the range. The default is 'B1e6' for six-digit + coordinates. In R^4, seven-digit coordinates will + overflow hyperplane normalization. Zn s restrict points to a disk about the z+ axis and the - sphere (default Z1.0). Includes the opposite pole. - 'Z1e-6' generates degenerate points under single - precision. + sphere (default Z1.0). Includes the opposite pole. + 'Z1e-6' generates degenerate points under single + precision. Zn Gm s - same as Zn with an empty center (default G0.5). + same as Zn with an empty center (default G0.5). r s D2 generate a regular polygon r s Z1 G0.1 - generate a regular cone + generate a regular cone </pre> <!-- Navigation links --> @@ -247,16 +247,16 @@ Some combinations of arguments generate odd results. <p><b>Up:</b> <a href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="index.htm#TOC">Qhull manual</a>: Table of Contents<br> <b>To:</b> <a href="qh-quick.htm#programs">Programs</a> -• <a href="qh-quick.htm#options">Options</a> -• <a href="qh-opto.htm#output">Output</a> -• <a href="qh-optf.htm#format">Formats</a> -• <a href="qh-optg.htm#geomview">Geomview</a> +• <a href="qh-quick.htm#options">Options</a> +• <a href="qh-opto.htm#output">Output</a> +• <a href="qh-optf.htm#format">Formats</a> +• <a href="qh-optg.htm#geomview">Geomview</a> • <a href="qh-optp.htm#print">Print</a> -• <a href="qh-optq.htm#qhull">Qhull</a> -• <a href="qh-optc.htm#prec">Precision</a> +• <a href="qh-optq.htm#qhull">Qhull</a> +• <a href="qh-optc.htm#prec">Precision</a> • <a href="qh-optt.htm#trace">Trace</a><br> -<b>To:</b> <a href="#synopsis">sy</a>nopsis • <a href="#outputs">ou</a>tputs -• <a href="#examples">ex</a>amples • <a href="#notes">no</a>tes +<b>To:</b> <a href="#synopsis">sy</a>nopsis • <a href="#outputs">ou</a>tputs +• <a href="#examples">ex</a>amples • <a href="#notes">no</a>tes • <a href="#options">op</a>tions <!-- GC common information --> <hr> diff --git a/index.htm b/index.htm index 64eeda7..38f28c8 100644 --- a/index.htm +++ b/index.htm @@ -23,11 +23,11 @@ <!-- Main text of document --> <table> <tr><td valign=top> - <h1>Qhull</h1> - <a - href="http://www.geom.uiuc.edu/graphics/pix/Special_Topics/Computational_Geometry/cone.html"><img - src="html/qh--cone.gif" alt="[CONE]" align="middle" width="100" - height="100"></a> + <h1>Qhull</h1> + <a + href="http://www.geom.uiuc.edu/graphics/pix/Special_Topics/Computational_Geometry/cone.html"><img + src="html/qh--cone.gif" alt="[CONE]" align="middle" width="100" + height="100"></a> </td><td> Qhull computes the convex hull, Delaunay triangulation, Voronoi diagram, halfspace intersection about a point, furthest-site Delaunay @@ -50,42 +50,42 @@ and higher. </p> <input type=hidden name=num value=100> <ul> <li><a href="http://www.qhull.org/news">News</a> and - <a href="http://www.qhull.org/news/qhull-news.html#bugs">Bugs</a> - about Qhull 2010.1 2010/01/06</li> + <a href="http://www.qhull.org/news/qhull-news.html#bugs">Bugs</a> + about Qhull 2010.1 2010/01/07</li> <li><a href="http://www.qhull.org/download">Download</a> Qhull</li> <li><a href="http://www.geom.uiuc.edu/graphics/pix/Special_Topics/Computational_Geometry/welcome.html">Examples </a>of Qhull output </li> - <li><a href=http://gitorious.org/qhull/>Development</a> at Gitorious - <li><input name=as_q size=10 value=""> - <input type="submit" value="Search"> - www.qhull.org - <p> + <li><a href=http://gitorious.org/qhull/>Development</a> at Gitorious + <li><input name=as_q size=10 value=""> + <input type="submit" value="Search"> + www.qhull.org + <p> <li><a href="http://www.qhull.org/news/qhull-news.html#users">How</a> is Qhull used?</li> <li><a href="http://citeseerx.ist.psu.edu/showciting?doi=10.1.1.117.405&sort=cite">CiteSeer</a> references to Qhull </p> - <li> - <a href=http://www.google.com/search?as_q=qhull+-debian+-cvs+-gentoo+-pool+-mirrors&num=100>Google</a> Qhull, - Qhull <a href="http://images.google.com/images?q=qhull&num=100">Images</a>, - Qvoronoi <a href="http://home.scarlet.be/zoetrope/voronoi3d/index.htm">Models</a>, - Qhull in <a href=http://groups.google.com/groups?as_q=qhull&num=100&as_scoring=d>Newsgroups</a>, - and <a href=http://www.googlism.com/who_is/q/qhull/>Who is</a> Qhull? + <li> + <a href=http://www.google.com/search?as_q=qhull+-debian+-cvs+-gentoo+-pool+-mirrors&num=100>Google</a> Qhull, + Qhull <a href="http://images.google.com/images?q=qhull&num=100">Images</a>, + Qvoronoi <a href="http://home.scarlet.be/zoetrope/voronoi3d/index.htm">Models</a>, + Qhull in <a href=http://groups.google.com/groups?as_q=qhull&num=100&as_scoring=d>Newsgroups</a>, + and <a href=http://www.googlism.com/who_is/q/qhull/>Who is</a> Qhull? - <p> - <li><a href=http://www.mathworks.com/>MATLAB</a> uses Qhull for their computational geometry functions: <a href=http://www.mathworks.com/access/helpdesk/help/techdoc/ref/convhulln.shtml>convhulln</a> - <a href=http://www.mathworks.com/access/helpdesk/help/techdoc/ref/delaunayn.shtml>delaunayn</a> - <a href=http://www.mathworks.com/access/helpdesk/help/techdoc/ref/griddata3.shtml>griddata3</a> - <a href=http://www.mathworks.com/access/helpdesk/help/techdoc/ref/griddatan.shtml>griddatan</a> - <a href=http://www.mathworks.com/access/helpdesk/help/techdoc/ref/tsearch.shtml>tsearch</a> - <a href=http://www.mathworks.com/access/helpdesk/help/techdoc/ref/tsearchn.shtml>tsearchn</a> + <p> + <li><a href=http://www.mathworks.com/>MATLAB</a> uses Qhull for their computational geometry functions: <a href=http://www.mathworks.com/access/helpdesk/help/techdoc/ref/convhulln.shtml>convhulln</a> + <a href=http://www.mathworks.com/access/helpdesk/help/techdoc/ref/delaunayn.shtml>delaunayn</a> + <a href=http://www.mathworks.com/access/helpdesk/help/techdoc/ref/griddata3.shtml>griddata3</a> + <a href=http://www.mathworks.com/access/helpdesk/help/techdoc/ref/griddatan.shtml>griddatan</a> + <a href=http://www.mathworks.com/access/helpdesk/help/techdoc/ref/tsearch.shtml>tsearch</a> + <a href=http://www.mathworks.com/access/helpdesk/help/techdoc/ref/tsearchn.shtml>tsearchn</a> <a href=http://www.mathworks.com/access/helpdesk/help/techdoc/ref/voronoin.shtml>voronoin</a>. MATLAB R14 upgraded - to Qhull 2002.1 and triangulated output ('Qt'). + to Qhull 2002.1 and triangulated output ('Qt'). </li> - <li><a href=http://www.octave.org/>GNU Octave</a> uses Qhull for their - <a href=http://octave.sourceforge.net/index/analysis.html#Geometry>computational geometry</a> functions. - <li><a href=http://www.wolfram.com/products/mathematica/>Mathematica</a>'s Delaunay interface: <a href=http://library.wolfram.com/infocenter/MathSource/1160/>qh-math</a> - <li><a href=http://www.geomview.org>Geomview</a> for 3-D and 4-D visualization of Qhull output + <li><a href=http://www.octave.org/>GNU Octave</a> uses Qhull for their + <a href=http://octave.sourceforge.net/index/analysis.html#Geometry>computational geometry</a> functions. + <li><a href=http://www.wolfram.com/products/mathematica/>Mathematica</a>'s Delaunay interface: <a href=http://library.wolfram.com/infocenter/MathSource/1160/>qh-math</a> + <li><a href=http://www.geomview.org>Geomview</a> for 3-D and 4-D visualization of Qhull output </ul> </form> @@ -93,46 +93,46 @@ and higher. </p> <ul> <li><a href="http://www.cs.mcgill.ca/~fukuda/soft/polyfaq/polyfaq.html" - >Fukuda's introduction</a> to convex hulls, Delaunay + >Fukuda's introduction</a> to convex hulls, Delaunay triangulations, Voronoi diagrams, and linear programming</li> <li><a href="http://www.cse.unsw.edu.au/~lambert/java/3d/hull.html" - >Lambert's Java</a> visualization of convex hull algorithms </li> - <li><a + >Lambert's Java</a> visualization of convex hull algorithms </li> + <li><a href="http://www.algorithmic-solutions.info/leda_guide/geometryalgorithms.html" - >LEDA Guide</a> to geometry algorithms - <li><a - href="http://mathworld.wolfram.com/ComputationalGeometry.html" - >MathWorld's</a> Computational Geometry from Wolfram Research - <li><a - href="http://www.cs.sunysb.edu/~algorith/major_section/1.6.shtml" - >Skiena's</a> Computational Geometry from his <i>Algorithm Design Manual</i>. + >LEDA Guide</a> to geometry algorithms + <li><a + href="http://mathworld.wolfram.com/ComputationalGeometry.html" + >MathWorld's</a> Computational Geometry from Wolfram Research + <li><a + href="http://www.cs.sunysb.edu/~algorith/major_section/1.6.shtml" + >Skiena's</a> Computational Geometry from his <i>Algorithm Design Manual</i>. <li><a href="http://www.cs.sunysb.edu/~algorith/major_section/1.6.shtml" - >Stony Brook</a> Algorithm Repository, computational geometry</li> + >Stony Brook</a> Algorithm Repository, computational geometry</li> </ul> <p><b>Qhull Documentation and Support</b> <ul> <li><a href="html/index.htm">Manual</a> for Qhull and rbox <table><tr><td> - <ul> - <li><a href="html/qh-quick.htm#programs">Programs</a> and <a href="html/qh-quick.htm#options">Options</a> - <li><a href="html/qconvex.htm">qconvex</a> -- convex hull - <li><a href="html/qdelaun.htm">qdelaunay</a> -- Delaunay triangulation - <li><a href="html/qvoronoi.htm">qvoronoi</a> -- Voronoi diagram - <li><a href="html/qhalf.htm">qhalf</a> -- halfspace intersection about a point - <li><a href="html/rbox.htm">rbox</a> -- generate point distributions - </ul></td><td><ul> - <li><a href="html/index.htm#description">Description</a> of Qhull + <ul> + <li><a href="html/qh-quick.htm#programs">Programs</a> and <a href="html/qh-quick.htm#options">Options</a> + <li><a href="html/qconvex.htm">qconvex</a> -- convex hull + <li><a href="html/qdelaun.htm">qdelaunay</a> -- Delaunay triangulation + <li><a href="html/qvoronoi.htm">qvoronoi</a> -- Voronoi diagram + <li><a href="html/qhalf.htm">qhalf</a> -- halfspace intersection about a point + <li><a href="html/rbox.htm">rbox</a> -- generate point distributions + </ul></td><td><ul> + <li><a href="html/index.htm#description">Description</a> of Qhull <li><a href="COPYING.txt">COPYING.txt</a> - copyright notice<br> <li><a href="REGISTER.txt">REGISTER.txt</a> - registration<br> <li><a href="README.txt">README.txt</a> - installation instructions<br> <li><a href="src/Changes.txt">Changes.txt</a> - change history <br> - <li><a href="src/index.htm">Qhull functions</a>, macros, and data structures with source - </ul> - </td></tr></table> + <li><a href="src/index.htm">Qhull functions</a>, macros, and data structures with source + </ul> + </td></tr></table> <li><a href="http://www.qhull.org/html/qh-faq.htm">Frequently</a> asked questions about Qhull</li> <li>Send e-mail to <a href=mailto:qhull@qhull.org>qhull@qhull.org</a> </li> @@ -145,40 +145,40 @@ and higher. </p> <li><a href="http://www.geom.uiuc.edu/software/cglist">Amenta's directory</a> of computational geometry software </li> - <li><a href=http://www.boost.org/libs/graph/doc/table_of_contents.html>BGL</a> - Boost Graph Library provides C++ classes for graph data structures + <li><a href=http://www.boost.org/libs/graph/doc/table_of_contents.html>BGL</a> + Boost Graph Library provides C++ classes for graph data structures and algorithms, <li><a href="http://www.netlib.org/voronoi/hull.html">Clarkson's hull </a>program with exact arithmetic for convex hulls, Delaunay triangulations, - Voronoi volumes, and alpha shapes. </li> - <li><a href="http://compgeom.cs.uiuc.edu/~jeffe/compgeom/compgeom.html">Erickson's - Computational</a> Geometry Pages and - <a href="http://compgeom.cs.uiuc.edu/~jeffe/compgeom/code.html">Software</a> + Voronoi volumes, and alpha shapes. </li> + <li><a href="http://compgeom.cs.uiuc.edu/~jeffe/compgeom/compgeom.html">Erickson's + Computational</a> Geometry Pages and + <a href="http://compgeom.cs.uiuc.edu/~jeffe/compgeom/code.html">Software</a> <li><a href="http://www.cs.mcgill.ca/~fukuda/soft/cdd_home/cdd.html">Fukuda's cdd</a> program for halfspace intersection and convex hulls</li> - <li><a href="http://www.inf.ethz.ch/personal/gaertner/miniball.html">Gartner's - Miniball</a> for fast and robust smallest enclosing balls (up to 20-d) + <li><a href="http://www.inf.ethz.ch/personal/gaertner/miniball.html">Gartner's + Miniball</a> for fast and robust smallest enclosing balls (up to 20-d) - <li><a href=http://directory.google.com/Top/Science/Math/Geometry/Computational_Geometry/Software/>Google's directory</a> for - Science > Math > Geometry > Computational Geometry > Software + <li><a href=http://directory.google.com/Top/Science/Math/Geometry/Computational_Geometry/Software/>Google's directory</a> for + Science > Math > Geometry > Computational Geometry > Software <li><a href=http://www.algorithmic-solutions.com/enleda.htm>Leda</a> and <a href=http://www.cgal.org/>CGAL</a> libraries for writing computational geometry programs and other combinatorial algorithms - <li><a href=http://www.magic-software.com>Magic Software</a> source code for computer - graphics, image analysis, and numerical methods - <li><a href=http://www.mathtools.net/>Mathtools.net</a> of scientific and engineering - software + <li><a href=http://www.magic-software.com>Magic Software</a> source code for computer + graphics, image analysis, and numerical methods + <li><a href=http://www.mathtools.net/>Mathtools.net</a> of scientific and engineering + software <li><a href="http://www.andrew.cmu.edu/user/sowen/mesh.html">Owen's Meshing</a> Research Corner <li><a href="http://www-users.informatik.rwth-aachen.de/~roberts/meshgeneration.html">Schneiders' Finite Element</a> Mesh Generation page</li> <li><a href="http://www.cs.cmu.edu/~quake/triangle.html">Shewchuk's triangle </a>program for 2-d Delaunay</li> - <li><a href=ftp://ftp.zib.de/pub/Packages/mathprog/index.html>Skorobohatyj's Mathprog@ZIB</a> for - mathematical software - <li><a href=http://www.voronoi.com>Voronoi Web Site</a> for all things Voronoi + <li><a href=ftp://ftp.zib.de/pub/Packages/mathprog/index.html>Skorobohatyj's Mathprog@ZIB</a> for + mathematical software + <li><a href=http://www.voronoi.com>Voronoi Web Site</a> for all things Voronoi <li><a href="http://www.uic.nnov.ru/~zny/skeleton/">Zolotykh's Skeleton</a> generates all extreme rays of a polyhedral cone using the Double Description Method</li> </ul> @@ -187,15 +187,15 @@ geometry programs and other combinatorial algorithms <li><a href="http://exaflop.org/docs/cgafaq/">FAQ</a> for computer graphics algorithms - (<a href="http://exaflop.org/docs/cgafaq/cga6.html">geometric</a> structures) + (<a href="http://exaflop.org/docs/cgafaq/cga6.html">geometric</a> structures) </li> <li><a href="http://www-unix.mcs.anl.gov/otc/Guide/faq/linear-programming-faq.html">FAQ </a>for linear programming </li> <li><a href="news:comp.graphics.algorithms">Newsgroup</a>: comp.graphics.algorithms </li> - <li><a href="news:comp.soft-sys.matlab">Newsgroup</a>: - comp.soft-sys.matlab</li> + <li><a href="news:comp.soft-sys.matlab">Newsgroup</a>: + comp.soft-sys.matlab</li> <li><a href="news:sci.math.num-analysis">Newsgroup</a>: sci.math.num-analysis </li> <li><a href="news:sci.op-research">Newsgroup</a>: diff --git a/project/libqhull.vcproj b/project/libqhull.vcproj index e6098fd..6da46b9 100644 --- a/project/libqhull.vcproj +++ b/project/libqhull.vcproj @@ -1,635 +1,635 @@ <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="libqhull" - ProjectGUID="{D1377F6B-7868-460C-9FC5-489C32A3D08F}" - RootNamespace="qhull" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Release|Win32" - OutputDirectory="..\tmp\libqhull\Release" - IntermediateDirectory="..\tmp\libqhull\Release" - ConfigurationType="4" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories="../" - PreprocessorDefinitions="_LIB;UNICODE=1;WIN32;NDEBUG" - StringPooling="true" - RuntimeLibrary="0" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile="..\tmp\libqhull\Release/libqhull.pch" - AssemblerListingLocation="..\tmp\libqhull\Release/" - ObjectFile="..\tmp\libqhull\Release/" - ProgramDataBaseFileName="..\tmp\libqhull\Release/" - WarningLevel="4" - WarnAsError="true" - SuppressStartupBanner="true" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - CompileAs="0" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile="..\tmp\libqhull\Release\qhull.lib" - SuppressStartupBanner="true" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Debug|Win32" - OutputDirectory="..\tmp\libqhull\Debug" - IntermediateDirectory="..\tmp\libqhull\Debug" - ConfigurationType="4" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - PreprocessorDefinitions="_LIB;UNICODE=1;WIN32;_DEBUG" - ExceptionHandling="0" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - DisableLanguageExtensions="true" - RuntimeTypeInfo="false" - PrecompiledHeaderFile="..\tmp\libqhull\Debug/libqhull.pch" - AssemblerListingLocation="..\tmp\libqhull\Debug/" - ObjectFile="..\tmp\libqhull\Debug/" - ProgramDataBaseFileName="..\tmp\libqhull\Debug/" - WarningLevel="4" - WarnAsError="true" - SuppressStartupBanner="true" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - ShowIncludes="false" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile="..\tmp\libqhull\Debug\qhull.lib" - SuppressStartupBanner="true" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" - > - <File - RelativePath="..\src\geom.c" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - Optimization="0" - PreprocessorDefinitions="" - BasicRuntimeChecks="3" - /> - </FileConfiguration> - </File> - <File - RelativePath="..\src\geom2.c" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - Optimization="0" - PreprocessorDefinitions="" - BasicRuntimeChecks="3" - /> - </FileConfiguration> - </File> - <File - RelativePath="..\src\global.c" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - Optimization="0" - PreprocessorDefinitions="" - BasicRuntimeChecks="3" - /> - </FileConfiguration> - </File> - <File - RelativePath="..\src\io.c" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - Optimization="0" - PreprocessorDefinitions="" - BasicRuntimeChecks="3" - /> - </FileConfiguration> - </File> - <File - RelativePath="..\src\mem.c" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - Optimization="0" - PreprocessorDefinitions="" - BasicRuntimeChecks="3" - /> - </FileConfiguration> - </File> - <File - RelativePath="..\src\merge.c" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - Optimization="0" - PreprocessorDefinitions="" - BasicRuntimeChecks="3" - /> - </FileConfiguration> - </File> - <File - RelativePath="..\src\poly.c" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - Optimization="0" - PreprocessorDefinitions="" - BasicRuntimeChecks="3" - /> - </FileConfiguration> - </File> - <File - RelativePath="..\src\poly2.c" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - Optimization="0" - PreprocessorDefinitions="" - BasicRuntimeChecks="3" - /> - </FileConfiguration> - </File> - <File - RelativePath="..\src\libqhull.c" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - Optimization="0" - PreprocessorDefinitions="" - BasicRuntimeChecks="3" - /> - </FileConfiguration> - </File> - <File - RelativePath="..\src\qset.c" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - Optimization="0" - PreprocessorDefinitions="" - BasicRuntimeChecks="3" - /> - </FileConfiguration> - </File> - <File - RelativePath="..\src\random.c" - > - </File> - <File - RelativePath="..\src\rboxlib.c" - > - </File> - <File - RelativePath="..\src\stat.c" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - Optimization="0" - PreprocessorDefinitions="" - BasicRuntimeChecks="3" - /> - </FileConfiguration> - </File> - <File - RelativePath="..\src\user.c" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - Optimization="0" - PreprocessorDefinitions="" - BasicRuntimeChecks="3" - /> - </FileConfiguration> - </File> - <File - RelativePath="..\src\usermem.c" - > - </File> - <File - RelativePath="..\src\userprintf.c" - > - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl" - > - <File - RelativePath="..\src\geom.h" - > - </File> - <File - RelativePath="..\src\io.h" - > - </File> - <File - RelativePath="..\src\mem.h" - > - </File> - <File - RelativePath="..\src\merge.h" - > - </File> - <File - RelativePath="..\src\poly.h" - > - </File> - <File - RelativePath="..\src\qhull_a.h" - > - </File> - <File - RelativePath="..\src\libqhull.h" - > - </File> - <File - RelativePath="..\src\qset.h" - > - </File> - <File - RelativePath="..\src\random.h" - > - </File> - <File - RelativePath="..\src\stat.h" - > - </File> - <File - RelativePath="..\src\user.h" - > - </File> - </Filter> - <Filter - Name="Other Files" - Filter="txt,groovy,htm" - > - <File - RelativePath="..\src\index.htm" - > - </File> - <File - RelativePath="..\src\Make-config.sh" - > - </File> - <File - RelativePath="..\src\Makefile.txt" - > - </File> - <File - RelativePath="..\src\Mborland" - > - </File> - <File - RelativePath="..\src\qh-geom.htm" - > - </File> - <File - RelativePath="..\src\qh-globa.htm" - > - </File> - <File - RelativePath="..\html\qh-impre.htm" - DeploymentContent="true" - > - </File> - <File - RelativePath="..\html\qh-in.htm" - DeploymentContent="true" - > - </File> - <File - RelativePath="..\src\qh-io.htm" - > - </File> - <File - RelativePath="..\src\qh-mem.htm" - > - </File> - <File - RelativePath="..\src\qh-merge.htm" - > - </File> - <File - RelativePath="..\html\qh-optf.htm" - DeploymentContent="true" - > - </File> - <File - RelativePath="..\html\qh-opto.htm" - DeploymentContent="true" - > - </File> - <File - RelativePath="..\src\qh-poly.htm" - > - </File> - <File - RelativePath="..\src\qh-qhull.htm" - > - </File> - <File - RelativePath="..\src\qh-set.htm" - > - </File> - <File - RelativePath="..\src\qh-stat.htm" - > - </File> - <File - RelativePath="..\src\qh-user.htm" - > - </File> - <File - RelativePath="..\html\qhalf.htm" - DeploymentContent="true" - > - </File> - <File - RelativePath="..\html\qhull.htm" - DeploymentContent="true" - > - </File> - <File - RelativePath="..\news\update-msgcode.groovy" - > - </File> - </Filter> - <File - RelativePath="..\news\qhull-news.html" - > - </File> - </Files> - <Globals> - </Globals> + ProjectType="Visual C++" + Version="8.00" + Name="libqhull" + ProjectGUID="{D1377F6B-7868-460C-9FC5-489C32A3D08F}" + RootNamespace="qhull" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Release|Win32" + OutputDirectory="..\tmp\libqhull\Release" + IntermediateDirectory="..\tmp\libqhull\Release" + ConfigurationType="4" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="2" + InlineFunctionExpansion="1" + AdditionalIncludeDirectories="../" + PreprocessorDefinitions="_LIB;UNICODE=1;WIN32;NDEBUG" + StringPooling="true" + RuntimeLibrary="0" + EnableFunctionLevelLinking="true" + PrecompiledHeaderFile="..\tmp\libqhull\Release/libqhull.pch" + AssemblerListingLocation="..\tmp\libqhull\Release/" + ObjectFile="..\tmp\libqhull\Release/" + ProgramDataBaseFileName="..\tmp\libqhull\Release/" + WarningLevel="4" + WarnAsError="true" + SuppressStartupBanner="true" + Detect64BitPortabilityProblems="true" + DebugInformationFormat="3" + CompileAs="0" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\tmp\libqhull\Release\qhull.lib" + SuppressStartupBanner="true" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Debug|Win32" + OutputDirectory="..\tmp\libqhull\Debug" + IntermediateDirectory="..\tmp\libqhull\Debug" + ConfigurationType="4" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + PreprocessorDefinitions="_LIB;UNICODE=1;WIN32;_DEBUG" + ExceptionHandling="0" + BasicRuntimeChecks="3" + RuntimeLibrary="3" + DisableLanguageExtensions="true" + RuntimeTypeInfo="false" + PrecompiledHeaderFile="..\tmp\libqhull\Debug/libqhull.pch" + AssemblerListingLocation="..\tmp\libqhull\Debug/" + ObjectFile="..\tmp\libqhull\Debug/" + ProgramDataBaseFileName="..\tmp\libqhull\Debug/" + WarningLevel="4" + WarnAsError="true" + SuppressStartupBanner="true" + Detect64BitPortabilityProblems="true" + DebugInformationFormat="3" + ShowIncludes="false" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_DEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="..\tmp\libqhull\Debug\qhull.lib" + SuppressStartupBanner="true" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + > + <File + RelativePath="..\src\geom.c" + > + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + Optimization="2" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + Optimization="0" + PreprocessorDefinitions="" + BasicRuntimeChecks="3" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\src\geom2.c" + > + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + Optimization="2" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + Optimization="0" + PreprocessorDefinitions="" + BasicRuntimeChecks="3" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\src\global.c" + > + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + Optimization="2" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + Optimization="0" + PreprocessorDefinitions="" + BasicRuntimeChecks="3" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\src\io.c" + > + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + Optimization="2" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + Optimization="0" + PreprocessorDefinitions="" + BasicRuntimeChecks="3" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\src\mem.c" + > + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + Optimization="2" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + Optimization="0" + PreprocessorDefinitions="" + BasicRuntimeChecks="3" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\src\merge.c" + > + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + Optimization="2" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + Optimization="0" + PreprocessorDefinitions="" + BasicRuntimeChecks="3" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\src\poly.c" + > + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + Optimization="2" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + Optimization="0" + PreprocessorDefinitions="" + BasicRuntimeChecks="3" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\src\poly2.c" + > + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + Optimization="2" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + Optimization="0" + PreprocessorDefinitions="" + BasicRuntimeChecks="3" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\src\libqhull.c" + > + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + Optimization="2" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + Optimization="0" + PreprocessorDefinitions="" + BasicRuntimeChecks="3" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\src\qset.c" + > + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + Optimization="2" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + Optimization="0" + PreprocessorDefinitions="" + BasicRuntimeChecks="3" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\src\random.c" + > + </File> + <File + RelativePath="..\src\rboxlib.c" + > + </File> + <File + RelativePath="..\src\stat.c" + > + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + Optimization="2" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + Optimization="0" + PreprocessorDefinitions="" + BasicRuntimeChecks="3" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\src\user.c" + > + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + Optimization="2" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + Optimization="0" + PreprocessorDefinitions="" + BasicRuntimeChecks="3" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\src\usermem.c" + > + </File> + <File + RelativePath="..\src\userprintf.c" + > + </File> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl" + > + <File + RelativePath="..\src\geom.h" + > + </File> + <File + RelativePath="..\src\io.h" + > + </File> + <File + RelativePath="..\src\mem.h" + > + </File> + <File + RelativePath="..\src\merge.h" + > + </File> + <File + RelativePath="..\src\poly.h" + > + </File> + <File + RelativePath="..\src\qhull_a.h" + > + </File> + <File + RelativePath="..\src\libqhull.h" + > + </File> + <File + RelativePath="..\src\qset.h" + > + </File> + <File + RelativePath="..\src\random.h" + > + </File> + <File + RelativePath="..\src\stat.h" + > + </File> + <File + RelativePath="..\src\user.h" + > + </File> + </Filter> + <Filter + Name="Other Files" + Filter="txt,groovy,htm" + > + <File + RelativePath="..\src\index.htm" + > + </File> + <File + RelativePath="..\src\Make-config.sh" + > + </File> + <File + RelativePath="..\src\Makefile.txt" + > + </File> + <File + RelativePath="..\src\Mborland" + > + </File> + <File + RelativePath="..\src\qh-geom.htm" + > + </File> + <File + RelativePath="..\src\qh-globa.htm" + > + </File> + <File + RelativePath="..\html\qh-impre.htm" + DeploymentContent="true" + > + </File> + <File + RelativePath="..\html\qh-in.htm" + DeploymentContent="true" + > + </File> + <File + RelativePath="..\src\qh-io.htm" + > + </File> + <File + RelativePath="..\src\qh-mem.htm" + > + </File> + <File + RelativePath="..\src\qh-merge.htm" + > + </File> + <File + RelativePath="..\html\qh-optf.htm" + DeploymentContent="true" + > + </File> + <File + RelativePath="..\html\qh-opto.htm" + DeploymentContent="true" + > + </File> + <File + RelativePath="..\src\qh-poly.htm" + > + </File> + <File + RelativePath="..\src\qh-qhull.htm" + > + </File> + <File + RelativePath="..\src\qh-set.htm" + > + </File> + <File + RelativePath="..\src\qh-stat.htm" + > + </File> + <File + RelativePath="..\src\qh-user.htm" + > + </File> + <File + RelativePath="..\html\qhalf.htm" + DeploymentContent="true" + > + </File> + <File + RelativePath="..\html\qhull.htm" + DeploymentContent="true" + > + </File> + <File + RelativePath="..\news\update-msgcode.groovy" + > + </File> + </Filter> + <File + RelativePath="..\news\qhull-news.html" + > + </File> + </Files> + <Globals> + </Globals> </VisualStudioProject> diff --git a/project/qhulltest.vcproj b/project/qhulltest.vcproj index 63d063e..93b1e4b 100644 --- a/project/qhulltest.vcproj +++ b/project/qhulltest.vcproj @@ -81,7 +81,7 @@ AdditionalDependencies="../tmp/qhullcpp/Debug/qhullcpp.lib ../tmp/libqhull/Debug/qhull.lib $(QTDIR)\lib\QtTestd4.lib $(QTDIR)\lib\QtGuid4.lib $(QTDIR)\lib\QtCored4.lib" OutputFile="..\qhulltest.exe" SuppressStartupBanner="true" - AdditionalLibraryDirectories="c:\Qt\4.5.2\lib" + AdditionalLibraryDirectories="C:\Qt\4.6.0\lib" IgnoreAllDefaultLibraries="false" GenerateDebugInformation="true" ProgramDatabaseFile="" diff --git a/src/Changes.txt b/src/Changes.txt index 0a4d46c..80ac562 100644 --- a/src/Changes.txt +++ b/src/Changes.txt @@ -18,7 +18,6 @@ To do for documentation qhull_inuse==1 when qhull globals active [not useful?] rbox_inuse==1 when rbox globals active - Multithreaded -- call largest dimension for infinityPoint() and origin() - - Better documentation for qhmem totshort, freesize, etc. - Clean up qhull-news.html XML - how to change .h, .c, and .cpp to text/html. OK in Opera @@ -27,7 +26,6 @@ To do for documentation - Check globalAngleEpsilon - Deprecate save_qhull() - Review email for doc changes - - Add option Ta to qhull.man, etc. To do for suggestions C++ class for access to statistics, accumulate vs. add @@ -73,33 +71,30 @@ Qhull cpp questions To do - ConvexHull is a submodule to git. How to get rid of? - Review Warn64 - - review all #pragma - - review all FIXUP [^0-9] - - clean up warnings for libqhullcpp - Abandon savannah - - Review changes with Kent Williams - Keep size of qh_set as int, set.h, global.c - Keep size of qh_mem as int, mem.h, global.c - Measure performance of Qhull - qhulltest --all added to output - - Number the FIXUPS - Add test of user_eg3, etc. - - Review all ptr_intT - - Change tabs to spaces in src/*.c *.h - Check for wraparound of 64-bit ints -- e.g., a large set - - Reconsider old_qhstat data type (amorilia) - libqhull.h: qhstatT *old_qhstat; /* for saving qh_qhstat in save_qhull() and UsingLibQhull. Free with qh_free() */ - mem.h: setT *tempstack; /* stack of temporary memory, managed by users */ - - Add vcproj for qconvex, etc. Change qhullcpp to libqhull.dll - Add config directory to Qhull - Generate vcproj from qtpro files cd qtpro && qmake -spec win32-msvc2005 -tp vc -recursive sed -i 's/C\:\/bash\/local\/qhull\/qtpro\///' qhull-all.sln - - Add output of qhulltest to source + Change qhullcpp to libqhull.dll + Allow both builds on same host (keep /tmp separate) - Make distribution -- remove tmp, news, .git, leftovers from project, change CRLF + - review all #pragma + - review all FIXUP [^0-9] + - Number the FIXUPS + - Review ptr_intT in qh_matchvertices [poly.c] + - clean up warnings for libqhullcpp -qhull 2010.1 2010/01/06 +qhull 2010.1 2010/01/07 + - Assign type to qh.old_qhstat and memT.tempstack [amorilia] + - Replace tabs with spaces. + - Fix qh_pointid in case ptr_intT is unsigned +qhull 2010.1 2010/01/06 - Fixed serious bug in qh_gethash [poly.c] - Documentation and build system are incomplete (see above) - First release of C++ interface [qh-code.htm] @@ -118,6 +113,7 @@ Fixed bugs - qh_initqhull_outputflags [global.c]: warn about Qc only if QHULLfinished, otherwise set if needed qhull 2010.0.2 2010/01/04 + - Reviewed output of q_test and compared to results from 2003.1 Fixed bugs @@ -218,6 +214,8 @@ Fixed g++ and devstudio warnings - Fixed warnings at VC8, level 4 - Fix data types to remove conversion warnings [kwilliams] - Use size_t for calls to malloc,etc [kwilliams] + Retained int sizes for qset.h and mem.h. Follows Qt convention + and is easier to work with. int can be 64-bits if 2 billion facets - Change literal strings to const char* [kwilliams] - Added type casts to SETfirst and SETsecond [amorilia+alphax] - getid_() returns an int [kwilliams] diff --git a/src/Make-config.sh b/src/Make-config.sh index e84b64d..2e9e711 100644 --- a/src/Make-config.sh +++ b/src/Make-config.sh @@ -12,8 +12,8 @@ # #note: # 'configure; make' does not work under cygwin. -# src/unix.c:354: variable 'qh_qh' can't be auto-imported. -# Please read the documentation for ld's --enable-auto-import for details. +# src/unix.c:354: variable 'qh_qh' can't be auto-imported. +# Please read the documentation for ld's --enable-auto-import for details. ################################################### ########### ../configure.in ###################### @@ -114,7 +114,7 @@ cat >../html/Makefile.am <<\HERE-HTML ### Man pages (trick to get around .man extension) %.1: %.man - cp $< $@ + cp $< $@ CLEANFILES = *.1 man_MANS = rbox.1 qhull.1 diff --git a/src/Makefile.txt b/src/Makefile.txt index ab3cde4..6f8fe29 100644 --- a/src/Makefile.txt +++ b/src/Makefile.txt @@ -75,10 +75,10 @@ FILES= Makefile rbox.c user_eg.c ../eg/q_test ../eg/q_egtest ../eg/q_eg HTMFILES= qhull.man rbox.man qh-code.htm qh-optg.htm qh-optt.htm qh-optp.htm \ index.htm qh-quick.htm qh-impre.htm qh-eg.htm \ qh-optc.htm qh-opto.htm qh-optf.htm qh-optq.htm \ - qh-c.htm qh-faq.htm qhull.htm qconvex.htm qdelaun.htm \ - qh-geom.htm qh-globa.htm qh-io.htm qh-mem.htm qh-merge.htm \ - qh-poly.htm qh-qhull.htm qh-set.htm qh-stat.htm qh-user.htm \ - qdelau_f.htm qhalf.htm qvoronoi.htm qvoron_f.htm rbox.htm + qh-c.htm qh-faq.htm qhull.htm qconvex.htm qdelaun.htm \ + qh-geom.htm qh-globa.htm qh-io.htm qh-mem.htm qh-merge.htm \ + qh-poly.htm qh-qhull.htm qh-set.htm qh-stat.htm qh-user.htm \ + qdelau_f.htm qhalf.htm qvoronoi.htm qvoron_f.htm rbox.htm all: rbox qconvex qdelaunay qhalf qvoronoi qhull @@ -102,92 +102,92 @@ stat.o: $(HFILES) user.o: $(HFILES) .c.o: - $(CC) -c $(CCOPTS1) $< + $(CC) -c $(CCOPTS1) $< clean: - rm -f *.o ../core qconvex qdelaunay qhalf qvoronoi qhull libqhull.a \ - *.exe + rm -f *.o ../core qconvex qdelaunay qhalf qvoronoi qhull libqhull.a \ + *.exe cleanall: clean - rm -f *~ ../rbox ../qhull ../qhalf ../qconvex ../qdelaunay ../qhalf\ - ../qvoronoi ../user_eg ../user_eg2 ../*.exe >/dev/null + rm -f *~ ../rbox ../qhull ../qhalf ../qconvex ../qdelaunay ../qhalf\ + ../qvoronoi ../user_eg ../user_eg2 ../*.exe >/dev/null doc: - $(PRINTMAN) $(TXTFILES) $(DOCFILES) + $(PRINTMAN) $(TXTFILES) $(DOCFILES) install: all - cp ../qconvex $(BINDIR)/qconvex - cp ../qdelaunay $(BINDIR)/qdelaunay - cp ../qhalf $(BINDIR)/qhalf - cp ../qhull $(BINDIR)/qhull - cp ../qvoronoi $(BINDIR)/qvoronoi - cp ../rbox $(BINDIR)/rbox - cp ../html/qhull.man $(MANDIR)/qhull.1 - cp ../html/rbox.man $(MANDIR)/rbox.1 + cp ../qconvex $(BINDIR)/qconvex + cp ../qdelaunay $(BINDIR)/qdelaunay + cp ../qhalf $(BINDIR)/qhalf + cp ../qhull $(BINDIR)/qhull + cp ../qvoronoi $(BINDIR)/qvoronoi + cp ../rbox $(BINDIR)/rbox + cp ../html/qhull.man $(MANDIR)/qhull.1 + cp ../html/rbox.man $(MANDIR)/rbox.1 new: cleanall all printall: doc printh printc printf printh: - $(PRINTC) $(HFILES) + $(PRINTC) $(HFILES) printc: - $(PRINTC) $(CFILES) + $(PRINTC) $(CFILES) printf: - $(PRINTC) $(FILES) + $(PRINTC) $(FILES) libqhull.a: $(OBJS) - @echo if 'ar' or 'ranlib' fails, try 'make qhullx' - ar r libqhull.a $(OBJS) - @echo the next line may need to be removed. - -test -x /bin/ranlib -o -x /usr/bin/ranlib && ranlib libqhull.a + @echo if 'ar' or 'ranlib' fails, try 'make qhullx' + ar r libqhull.a $(OBJS) + @echo the next line may need to be removed. + -test -x /bin/ranlib -o -x /usr/bin/ranlib && ranlib libqhull.a # don't use ../qconvex. Does not work on Red Hat Linux qconvex: qconvex.o libqhull.a - $(CC) -o qconvex $(CCOPTS2) qconvex.o -L. -lqhull -lm - cp qconvex .. + $(CC) -o qconvex $(CCOPTS2) qconvex.o -L. -lqhull -lm + cp qconvex .. qdelaunay: qdelaun.o libqhull.a - $(CC) -o qdelaunay $(CCOPTS2) qdelaun.o -L. -lqhull -lm - cp qdelaunay .. + $(CC) -o qdelaunay $(CCOPTS2) qdelaun.o -L. -lqhull -lm + cp qdelaunay .. qhalf: qhalf.o libqhull.a - $(CC) -o qhalf $(CCOPTS2) qhalf.o -L. -lqhull -lm - cp qhalf .. + $(CC) -o qhalf $(CCOPTS2) qhalf.o -L. -lqhull -lm + cp qhalf .. qvoronoi: qvoronoi.o libqhull.a - $(CC) -o qvoronoi $(CCOPTS2) qvoronoi.o -L. -lqhull -lm - cp qvoronoi .. + $(CC) -o qvoronoi $(CCOPTS2) qvoronoi.o -L. -lqhull -lm + cp qvoronoi .. qhull: unix.o libqhull.a - $(CC) -o qhull $(CCOPTS2) unix.o -L. -lqhull -lm - cp qhull .. - -chmod +x ../eg/q_test ../eg/q_eg ../eg/q_egtest - -cd ..; ./rbox D4 | ./qhull + $(CC) -o qhull $(CCOPTS2) unix.o -L. -lqhull -lm + cp qhull .. + -chmod +x ../eg/q_test ../eg/q_eg ../eg/q_egtest + -cd ..; ./rbox D4 | ./qhull # compile qhull without using libqhull.a qhullx: qconvex.o qdelaun.o qhalf.o qvoronoi.o unix.o $(OBJS) - $(CC) -o qconvex $(CCOPTS2) qconvex.o $(OBJS) -lm - $(CC) -o qdelaunay $(CCOPTS2) qdelaun.o $(OBJS) -lm - $(CC) -o qhalf $(CCOPTS2) qhalf.o $(OBJS) -lm - $(CC) -o qvoronoi $(CCOPTS2) qvoronoi.o $(OBJS) -lm - $(CC) -o qhull $(CCOPTS2) unix.o $(OBJS) -lm - cp qconvex qdelaunay qhalf qvoronoi qhull .. - -chmod +x ../eg/q_test ../eg/q_eg ../eg/q_egtest - -cd ..; ./rbox D4 | ./qhull + $(CC) -o qconvex $(CCOPTS2) qconvex.o $(OBJS) -lm + $(CC) -o qdelaunay $(CCOPTS2) qdelaun.o $(OBJS) -lm + $(CC) -o qhalf $(CCOPTS2) qhalf.o $(OBJS) -lm + $(CC) -o qvoronoi $(CCOPTS2) qvoronoi.o $(OBJS) -lm + $(CC) -o qhull $(CCOPTS2) unix.o $(OBJS) -lm + cp qconvex qdelaunay qhalf qvoronoi qhull .. + -chmod +x ../eg/q_test ../eg/q_eg ../eg/q_egtest + -cd ..; ./rbox D4 | ./qhull rbox: rbox.o libqhull.a - $(CC) -o rbox rbox.o -L. -lqhull $(CCOPTS2) -lm - cp rbox .. + $(CC) -o rbox rbox.o -L. -lqhull $(CCOPTS2) -lm + cp rbox .. user_eg: user_eg.o libqhull.a - $(CC) -o user_eg $(CCOPTS2) user_eg.o -L. -lqhull -lm - cp user_eg .. + $(CC) -o user_eg $(CCOPTS2) user_eg.o -L. -lqhull -lm + cp user_eg .. user_eg2: user_eg2.o libqhull.a - $(CC) -o user_eg2 $(CCOPTS2) user_eg2.o -L. -lqhull -lm - cp user_eg2 .. + $(CC) -o user_eg2 $(CCOPTS2) user_eg2.o -L. -lqhull -lm + cp user_eg2 .. # end of Makefile diff --git a/src/Mborland b/src/Mborland index 7d52fa7..cf4b61e 100644 --- a/src/Mborland +++ b/src/Mborland @@ -16,19 +16,19 @@ CC = bcc32 # 32 bit compiler for DOS # bcc32i - Intel's compiler LINKER = $(CC) # bcc calls tlink32 with needed options -CFLAGS = -w- -A -O2 +CFLAGS = -w- -A -O2 # -w- no warnings, bcc doesn't handle assigns in conditions - # -A Ansi standard - # -X no auto-dependency outputs - # -v debugging, use CCOPTS for both - # -O2 optimization + # -A Ansi standard + # -X no auto-dependency outputs + # -v debugging, use CCOPTS for both + # -O2 optimization !if $d(_DPMI) LFLAGS = -WX -w- # -WX loads DPMI library !else LFLAGS = -lap -lx -lc - # -lap 32-bit console application - # -lx no map file - # -lc case is significant + # -lap 32-bit console application + # -lx no map file + # -lc case is significant !endif EXERB = rbox @@ -51,119 +51,119 @@ HFILES1 = libqhull.h stat.h qhull_a.h user.h # General rules .c.obj: - $(CC) -c $(CFLAGS) $< + $(CC) -c $(CFLAGS) $< # Default all: $(EXERB) $(EXEQH) $(EXEQC) $(EXEQD) $(EXEQV) $(EXEQF) test help: - @echo USAGE: - @echo "make all to produce qhull, rbox, qconvex, qdelaun, qvoronoi, qhalf" - @echo "make user_eg to produce user_eg" - @echo "make user_eg2 to produce user_eg2" - @echo "make new to rebuild qhull and rbox from source" - @echo "make clean to remove object files" - @echo "make cleanall to remove all generated file" - @echo "make test to test rbox and qhull" - @echo OPTIONS (default is 32-bit console app): - @echo "-D_DPMI for C++ 4.01 and DOS Power Pack" + @echo USAGE: + @echo "make all to produce qhull, rbox, qconvex, qdelaun, qvoronoi, qhalf" + @echo "make user_eg to produce user_eg" + @echo "make user_eg2 to produce user_eg2" + @echo "make new to rebuild qhull and rbox from source" + @echo "make clean to remove object files" + @echo "make cleanall to remove all generated file" + @echo "make test to test rbox and qhull" + @echo OPTIONS (default is 32-bit console app): + @echo "-D_DPMI for C++ 4.01 and DOS Power Pack" # Executables $(EXEQH): ..\$(EXEQH).exe - @echo Made ..\$(EXEQH).exe + @echo Made ..\$(EXEQH).exe ..\$(EXEQH).exe: unix.obj user.obj $(OBJS1) $(OBJS2) - @echo unix.obj user.obj > $(TMPFILE) - @echo $(OBJS1) >> $(TMPFILE) - @echo $(OBJS2) >> $(TMPFILE) - $(LINKER) -e$@ $(CFLAGS) $(LFLAGS) @$(TMPFILE) + @echo unix.obj user.obj > $(TMPFILE) + @echo $(OBJS1) >> $(TMPFILE) + @echo $(OBJS2) >> $(TMPFILE) + $(LINKER) -e$@ $(CFLAGS) $(LFLAGS) @$(TMPFILE) $(EXEQC): ..\$(EXEQC).exe - @echo Made ..\$(EXEQC).exe + @echo Made ..\$(EXEQC).exe ..\$(EXEQC).exe: qconvex.obj user.obj $(OBJS1) $(OBJS2) - @echo qconvex.obj user.obj > $(TMPFILE) - @echo $(OBJS1) >> $(TMPFILE) - @echo $(OBJS2) >> $(TMPFILE) - $(LINKER) -e$@ $(CFLAGS) $(LFLAGS) @$(TMPFILE) + @echo qconvex.obj user.obj > $(TMPFILE) + @echo $(OBJS1) >> $(TMPFILE) + @echo $(OBJS2) >> $(TMPFILE) + $(LINKER) -e$@ $(CFLAGS) $(LFLAGS) @$(TMPFILE) $(EXEQD): ..\$(EXEQD).exe - @echo Made ..\$(EXEQD).exe + @echo Made ..\$(EXEQD).exe ..\$(EXEQD).exe: qdelaun.obj user.obj $(OBJS1) $(OBJS2) - @echo qdelaun.obj user.obj > $(TMPFILE) - @echo $(OBJS1) >> $(TMPFILE) - @echo $(OBJS2) >> $(TMPFILE) - $(LINKER) -e$@ $(CFLAGS) $(LFLAGS) @$(TMPFILE) + @echo qdelaun.obj user.obj > $(TMPFILE) + @echo $(OBJS1) >> $(TMPFILE) + @echo $(OBJS2) >> $(TMPFILE) + $(LINKER) -e$@ $(CFLAGS) $(LFLAGS) @$(TMPFILE) $(EXEQV): ..\$(EXEQV).exe - @echo Made ..\$(EXEQV).exe + @echo Made ..\$(EXEQV).exe ..\$(EXEQV).exe: qvoronoi.obj user.obj $(OBJS1) $(OBJS2) - @echo qvoronoi.obj user.obj > $(TMPFILE) - @echo $(OBJS1) >> $(TMPFILE) - @echo $(OBJS2) >> $(TMPFILE) - $(LINKER) -e$@ $(CFLAGS) $(LFLAGS) @$(TMPFILE) + @echo qvoronoi.obj user.obj > $(TMPFILE) + @echo $(OBJS1) >> $(TMPFILE) + @echo $(OBJS2) >> $(TMPFILE) + $(LINKER) -e$@ $(CFLAGS) $(LFLAGS) @$(TMPFILE) $(EXEQF): ..\$(EXEQF).exe - @echo Made ..\$(EXEQF).exe + @echo Made ..\$(EXEQF).exe ..\$(EXEQF).exe: qhalf.obj user.obj $(OBJS1) $(OBJS2) - @echo qhalf.obj user.obj > $(TMPFILE) - @echo $(OBJS1) >> $(TMPFILE) - @echo $(OBJS2) >> $(TMPFILE) - $(LINKER) -e$@ $(CFLAGS) $(LFLAGS) @$(TMPFILE) + @echo qhalf.obj user.obj > $(TMPFILE) + @echo $(OBJS1) >> $(TMPFILE) + @echo $(OBJS2) >> $(TMPFILE) + $(LINKER) -e$@ $(CFLAGS) $(LFLAGS) @$(TMPFILE) $(EXEEG): ..\$(EXEEG).exe - @echo Made ..\$(EXEEG).exe + @echo Made ..\$(EXEEG).exe ..\$(EXEEG).exe: user_eg.obj $(OBJS1) $(OBJS2) - @echo user_eg.obj user.obj > $(TMPFILE) - @echo $(OBJS1) >> $(TMPFILE) - @echo $(OBJS2) >> $(TMPFILE) - $(LINKER) -e$@ $(CFLAGS) $(LFLAGS) @$(TMPFILE) + @echo user_eg.obj user.obj > $(TMPFILE) + @echo $(OBJS1) >> $(TMPFILE) + @echo $(OBJS2) >> $(TMPFILE) + $(LINKER) -e$@ $(CFLAGS) $(LFLAGS) @$(TMPFILE) $(EXEEG2): ..\$(EXEEG2).exe - @echo Made ..\$(EXEEG2).exe + @echo Made ..\$(EXEEG2).exe ..\$(EXEEG2).exe: user_eg2.obj $(OBJS1) $(OBJS2) - @echo user_eg2.obj > $(TMPFILE) - @echo $(OBJS1) >> $(TMPFILE) - @echo $(OBJS2) >> $(TMPFILE) - $(LINKER) -e$@ $(CFLAGS) $(LFLAGS) @$(TMPFILE) + @echo user_eg2.obj > $(TMPFILE) + @echo $(OBJS1) >> $(TMPFILE) + @echo $(OBJS2) >> $(TMPFILE) + $(LINKER) -e$@ $(CFLAGS) $(LFLAGS) @$(TMPFILE) $(EXERB): ..\$(EXERB).exe - @echo Made ..\$(EXERB).exe + @echo Made ..\$(EXERB).exe ..\$(EXERB).exe: rbox.obj - $(LINKER) -e$@ $(CFLAGS) $(LFLAGS) rbox.obj + $(LINKER) -e$@ $(CFLAGS) $(LFLAGS) rbox.obj # Test rbox and qhull test: - @..\rbox D4 > test.x - @..\qhull <test.x - @del test.x + @..\rbox D4 > test.x + @..\qhull <test.x + @del test.x # Clean up clean: - @del *.obj - @del $(TMPFILE) + @del *.obj + @del $(TMPFILE) cleanall: clean - @del ..\$(EXERB).exe - @del ..\$(EXEQC).exe - @del ..\$(EXEQD).exe - @del ..\$(EXEQF).exe - @del ..\$(EXEQH).exe - @del ..\$(EXEQV).exe - @del ..\$(EXEEG).exe - @del ..\$(EXEEG2).exe - @del ..\q_test.x - @del ..\q_test.log.1 + @del ..\$(EXERB).exe + @del ..\$(EXEQC).exe + @del ..\$(EXEQD).exe + @del ..\$(EXEQF).exe + @del ..\$(EXEQH).exe + @del ..\$(EXEQV).exe + @del ..\$(EXEEG).exe + @del ..\$(EXEEG2).exe + @del ..\q_test.x + @del ..\q_test.log.1 # Clean up and rebuild all diff --git a/src/geom.c b/src/geom.c index 5a050b8..9b68375 100644 --- a/src/geom.c +++ b/src/geom.c @@ -7,8 +7,8 @@ see qh-geom.htm and geom.h copyright (c) 1993-2010 The Geometry Center. - $Id: //product/qhull/main/rel/src/geom.c#28 $$Change: 1137 $ - $DateTime: 2010/01/02 21:58:11 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/geom.c#29 $$Change: 1164 $ + $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ infrequent code goes into geom2.c */ @@ -131,15 +131,15 @@ void qh_distplane(pointT *point, facetT *facet, realT *dist) { repeat while there are better facets for each neighbor of facet exit if outside facet found - test for better facet + test for better facet if point is inside and partitioning test for new facets with a "sharp" intersection if so, future calls go to qh_findbestnew() test horizon facets */ facetT *qh_findbest(pointT *point, facetT *startfacet, - boolT bestoutside, boolT isnewfacets, boolT noupper, - realT *dist, boolT *isoutside, int *numpart) { + boolT bestoutside, boolT isnewfacets, boolT noupper, + realT *dist, boolT *isoutside, int *numpart) { realT bestdist= -REALmax/2 /* avoid underflow */; facetT *facet, *neighbor, **neighborp; facetT *bestfacet= NULL, *lastfacet= NULL; @@ -153,7 +153,7 @@ facetT *qh_findbest(pointT *point, facetT *startfacet, if (qh TRACElevel > qh IStracing) qh IStracing= qh TRACElevel; qh_fprintf(qh ferr, 8004, "qh_findbest: point p%d starting at f%d isnewfacets? %d, unless %d exit if > %2.2g\n", - qh_pointid(point), startfacet->id, isnewfacets, bestoutside, qh MINoutside); + qh_pointid(point), startfacet->id, isnewfacets, bestoutside, qh MINoutside); qh_fprintf(qh ferr, 8005, " testhorizon? %d noupper? %d", testhorizon, noupper); qh_fprintf(qh ferr, 8006, " Last point added was p%d.", qh furthest_id); qh_fprintf(qh ferr, 8007, " Last merge was #%d. max_outside %2.2g\n", zzval_(Ztotmerge), qh max_outside); @@ -184,26 +184,26 @@ facetT *qh_findbest(pointT *point, facetT *startfacet, if (!neighbor->newfacet && isnewfacets) continue; if (neighbor->visitid == visitid) - continue; + continue; neighbor->visitid= visitid; if (!neighbor->flipped) { /* code duplicated above */ - (*numpart)++; - qh_distplane(point, neighbor, dist); - if (*dist > bestdist) { - if (!bestoutside && *dist >= qh MINoutside - && (!neighbor->upperdelaunay || !noupper)) { - bestfacet= neighbor; - goto LABELreturn_best; - } - if (!neighbor->upperdelaunay) { - bestfacet= neighbor; - bestdist= *dist; - break; /* switch to neighbor */ - }else if (!bestfacet) { - bestdist= *dist; - break; /* switch to neighbor */ - } - } /* end of *dist>bestdist */ + (*numpart)++; + qh_distplane(point, neighbor, dist); + if (*dist > bestdist) { + if (!bestoutside && *dist >= qh MINoutside + && (!neighbor->upperdelaunay || !noupper)) { + bestfacet= neighbor; + goto LABELreturn_best; + } + if (!neighbor->upperdelaunay) { + bestfacet= neighbor; + bestdist= *dist; + break; /* switch to neighbor */ + }else if (!bestfacet) { + bestdist= *dist; + break; /* switch to neighbor */ + } + } /* end of *dist>bestdist */ } /* end of !flipped */ } /* end of FOREACHneighbor */ facet= neighbor; /* non-NULL only if *dist>bestdist */ @@ -215,13 +215,13 @@ facetT *qh_findbest(pointT *point, facetT *startfacet, testhorizon= False; /* qh_findbestnew calls qh_findbesthorizon */ }else if (!qh findbest_notsharp && bestdist < - qh DISTround) { if (qh_sharpnewfacets()) { - /* seldom used, qh_findbestnew will retest all facets */ - zinc_(Zfindnewsharp); - bestfacet= qh_findbestnew(point, bestfacet, &bestdist, bestoutside, isoutside, &numpartnew); - testhorizon= False; /* qh_findbestnew calls qh_findbesthorizon */ - qh findbestnew= True; + /* seldom used, qh_findbestnew will retest all facets */ + zinc_(Zfindnewsharp); + bestfacet= qh_findbestnew(point, bestfacet, &bestdist, bestoutside, isoutside, &numpartnew); + testhorizon= False; /* qh_findbestnew calls qh_findbesthorizon */ + qh findbestnew= True; }else - qh findbest_notsharp= True; + qh findbest_notsharp= True; } } if (!bestfacet) @@ -306,42 +306,42 @@ facetT *qh_findbesthorizon(boolT ischeckmax, pointT* point, facetT *startfacet, facet= startfacet; while (True) { trace4((qh ferr, 4002, "qh_findbesthorizon: neighbors of f%d bestdist %2.2g f%d ischeckmax? %d noupper? %d minsearch %2.2g searchdist %2.2g\n", - facet->id, *bestdist, getid_(bestfacet), ischeckmax, noupper, - minsearch, searchdist)); + facet->id, *bestdist, getid_(bestfacet), ischeckmax, noupper, + minsearch, searchdist)); FOREACHneighbor_(facet) { if (neighbor->visitid == visitid) - continue; + continue; neighbor->visitid= visitid; if (!neighbor->flipped) { - qh_distplane(point, neighbor, &dist); - (*numpart)++; - if (dist > *bestdist) { - if (!neighbor->upperdelaunay || ischeckmax || (!noupper && dist >= qh MINoutside)) { - bestfacet= neighbor; - *bestdist= dist; - newbest= True; - if (!ischeckmax) { - minsearch= dist - searchdist; - if (dist > *bestdist + searchdist) { - zinc_(Zfindjump); /* everything in qh.coplanarfacetset at least searchdist below */ - coplanarfacetset_size= 0; - } - } - } - }else if (dist < minsearch) - continue; /* if ischeckmax, dist can't be positive */ + qh_distplane(point, neighbor, &dist); + (*numpart)++; + if (dist > *bestdist) { + if (!neighbor->upperdelaunay || ischeckmax || (!noupper && dist >= qh MINoutside)) { + bestfacet= neighbor; + *bestdist= dist; + newbest= True; + if (!ischeckmax) { + minsearch= dist - searchdist; + if (dist > *bestdist + searchdist) { + zinc_(Zfindjump); /* everything in qh.coplanarfacetset at least searchdist below */ + coplanarfacetset_size= 0; + } + } + } + }else if (dist < minsearch) + continue; /* if ischeckmax, dist can't be positive */ #if qh_MAXoutside - if (ischeckmax && dist > neighbor->maxoutside) - neighbor->maxoutside= dist; + if (ischeckmax && dist > neighbor->maxoutside) + neighbor->maxoutside= dist; #endif } /* end of !flipped */ if (nextfacet) { - if (!coplanarfacetset_size++) { - SETfirst_(qh coplanarfacetset)= nextfacet; - SETtruncate_(qh coplanarfacetset, 1); - }else - qh_setappend(&qh coplanarfacetset, nextfacet); /* Was needed for RBOX 1000 s W1e-13 P0 t996547055 | QHULL d Qbb Qc Tv - and RBOX 1000 s Z1 G1e-13 t996564279 | qhull Tv */ + if (!coplanarfacetset_size++) { + SETfirst_(qh coplanarfacetset)= nextfacet; + SETtruncate_(qh coplanarfacetset, 1); + }else + qh_setappend(&qh coplanarfacetset, nextfacet); /* Was needed for RBOX 1000 s W1e-13 P0 t996547055 | QHULL d Qbb Qc Tv + and RBOX 1000 s Z1 G1e-13 t996564279 | qhull Tv */ } nextfacet= neighbor; } /* end of EACHneighbor */ @@ -410,7 +410,7 @@ facetT *qh_findbesthorizon(boolT ischeckmax, pointT* point, facetT *startfacet, test horizon facets */ facetT *qh_findbestnew(pointT *point, facetT *startfacet, - realT *dist, boolT bestoutside, boolT *isoutside, int *numpart) { + realT *dist, boolT bestoutside, boolT *isoutside, int *numpart) { realT bestdist= -REALmax/2; facetT *bestfacet= NULL, *facet; int oldtrace= qh IStracing, i; @@ -424,7 +424,7 @@ facetT *qh_findbestnew(pointT *point, facetT *startfacet, qh_fprintf(qh ferr, 6001, "qhull precision error (qh_findbestnew): merging has formed and deleted a cone of new facets. Can not continue.\n"); else qh_fprintf(qh ferr, 6002, "qhull internal error (qh_findbestnew): no new facets for point p%d\n", - qh furthest_id); + qh furthest_id); qh_errexit(qh_ERRqhull, NULL, NULL); } zinc_(Zfindnew); @@ -441,7 +441,7 @@ facetT *qh_findbestnew(pointT *point, facetT *startfacet, if (qh TRACElevel > qh IStracing) qh IStracing= qh TRACElevel; qh_fprintf(qh ferr, 8008, "qh_findbestnew: point p%d facet f%d. Stop? %d if dist > %2.2g\n", - qh_pointid(point), startfacet->id, isdistoutside, distoutside); + qh_pointid(point), startfacet->id, isdistoutside, distoutside); qh_fprintf(qh ferr, 8009, " Last point added p%d visitid %d.", qh furthest_id, visitid); qh_fprintf(qh ferr, 8010, " Last merge was #%d.\n", zzval_(Ztotmerge)); } @@ -449,25 +449,25 @@ facetT *qh_findbestnew(pointT *point, facetT *startfacet, for (i=0, facet=startfacet; i < 2; i++, facet= qh newfacet_list) { FORALLfacet_(facet) { if (facet == startfacet && i) - break; + break; facet->visitid= visitid; if (!facet->flipped) { - qh_distplane(point, facet, dist); - (*numpart)++; - if (*dist > bestdist) { - if (!facet->upperdelaunay || *dist >= qh MINoutside) { - bestfacet= facet; - if (isdistoutside && *dist >= distoutside) - goto LABELreturn_bestnew; - bestdist= *dist; - } - } + qh_distplane(point, facet, dist); + (*numpart)++; + if (*dist > bestdist) { + if (!facet->upperdelaunay || *dist >= qh MINoutside) { + bestfacet= facet; + if (isdistoutside && *dist >= distoutside) + goto LABELreturn_bestnew; + bestdist= *dist; + } + } } /* end of !flipped */ } /* FORALLfacet from startfacet or qh newfacet_list */ } if (testhorizon || !bestfacet) bestfacet= qh_findbesthorizon(!qh_IScheckmax, point, bestfacet ? bestfacet : startfacet, - !qh_NOupper, &bestdist, numpart); + !qh_NOupper, &bestdist, numpart); *dist= bestdist; if (isoutside && *dist < qh MINoutside) *isoutside= False; @@ -519,7 +519,7 @@ LABELreturn_bestnew: set tail of normal to 0 */ void qh_backnormal(realT **rows, int numrow, int numcol, boolT sign, - coordT *normal, boolT *nearzero) { + coordT *normal, boolT *nearzero) { int i, j; coordT *normalp, *normal_tail, *ai, *ak; realT diagonal; @@ -542,11 +542,11 @@ void qh_backnormal(realT **rows, int numrow, int numcol, boolT sign, *normalp= qh_divzero(*normalp, diagonal, qh MINdenom_1_2, &waszero); if (waszero) { zerocol= i; - *(normalp--)= (sign ? -1.0 : 1.0); - for (normal_tail= normalp+2; normal_tail < normal + numcol; normal_tail++) - *normal_tail= 0.0; + *(normalp--)= (sign ? -1.0 : 1.0); + for (normal_tail= normalp+2; normal_tail < normal + numcol; normal_tail++) + *normal_tail= 0.0; }else - normalp--; + normalp--; } } if (zerocol != -1) { @@ -589,8 +589,8 @@ void qh_gausselim(realT **rows, int numrow, int numcol, boolT *sign, boolT *near pivoti= k; for (i=k+1; i < numrow; i++) { if ((temp= fabs_((rows[i])[k])) > pivot_abs) { - pivot_abs= temp; - pivoti= i; + pivot_abs= temp; + pivoti= i; } } if (pivoti != k) { @@ -603,13 +603,13 @@ void qh_gausselim(realT **rows, int numrow, int numcol, boolT *sign, boolT *near if (pivot_abs <= qh NEARzero[k]) { *nearzero= True; if (pivot_abs == 0.0) { /* remainder of column == 0 */ - if (qh IStracing >= 4) { - qh_fprintf(qh ferr, 8011, "qh_gausselim: 0 pivot at column %d. (%2.2g < %2.2g)\n", k, pivot_abs, qh DISTround); - qh_printmatrix(qh ferr, "Matrix:", rows, numrow, numcol); - } - zzinc_(Zgauss0); + if (qh IStracing >= 4) { + qh_fprintf(qh ferr, 8011, "qh_gausselim: 0 pivot at column %d. (%2.2g < %2.2g)\n", k, pivot_abs, qh DISTround); + qh_printmatrix(qh ferr, "Matrix:", rows, numrow, numcol); + } + zzinc_(Zgauss0); qh_precision("zero pivot for Gaussian elimination"); - goto LABELnextcol; + goto LABELnextcol; } } pivotrow= rows[k] + k; @@ -619,7 +619,7 @@ void qh_gausselim(realT **rows, int numrow, int numcol, boolT *sign, boolT *near ak= pivotrow; n= (*ai++)/pivot; /* divzero() not needed since |pivot| >= |*ai| */ for (j= numcol - (k+1); j--; ) - *ai++ -= n * *ak++; + *ai++ -= n * *ak++; } LABELnextcol: ; @@ -707,7 +707,7 @@ pointT *qh_getcentrum(facetT *facet) { centrum= qh_projectpoint(point, facet, dist); qh_memfree(point, qh normal_size); trace4((qh ferr, 4007, "qh_getcentrum: for f%d, %d vertices dist= %2.2g\n", - facet->id, qh_setsize(facet->vertices), dist)); + facet->id, qh_setsize(facet->vertices), dist)); return centrum; } /* getcentrum */ @@ -740,9 +740,9 @@ realT qh_getdistance(facetT *facet, facetT *neighbor, realT *mindist, realT *max zzinc_(Zbestdist); qh_distplane(vertex->point, neighbor, &dist); if (dist < mind) - mind= dist; + mind= dist; else if (dist > maxd) - maxd= dist; + maxd= dist; } } *mindist= mind; @@ -859,17 +859,17 @@ void qh_normalize2 (coordT *normal, int dim, boolT toporient, for (k=dim, colp=normal; k--; colp++) { /* k used below */ temp= qh_divzero(*colp, norm, qh MINdenom_1, &zerodiv); if (!zerodiv) - *colp= temp; + *colp= temp; else { - maxp= qh_maxabsval(normal, dim); - temp= ((*maxp * norm >= 0.0) ? 1.0 : -1.0); - for (k=dim, colp=normal; k--; colp++) - *colp= 0.0; - *maxp= temp; - zzinc_(Znearlysingular); - trace0((qh ferr, 1, "qh_normalize: norm=%2.2g too small during p%d\n", - norm, qh furthest_id)); - return; + maxp= qh_maxabsval(normal, dim); + temp= ((*maxp * norm >= 0.0) ? 1.0 : -1.0); + for (k=dim, colp=normal; k--; colp++) + *colp= 0.0; + *maxp= temp; + zzinc_(Znearlysingular); + trace0((qh ferr, 1, "qh_normalize: norm=%2.2g too small during p%d\n", + norm, qh furthest_id)); + return; } } } @@ -956,9 +956,9 @@ void qh_setfacetplane(facetT *facet) { gmcoord= qh gm_matrix; FOREACHvertex_(facet->vertices) { qh gm_row[i++]= gmcoord; - coord= vertex->point; - for (k=qh hull_dim; k--; ) - *(gmcoord++)= *coord++ * qh_randomfactor(qh RANDOMa, qh RANDOMb); + coord= vertex->point; + for (k=qh hull_dim; k--; ) + *(gmcoord++)= *coord++ * qh_randomfactor(qh RANDOMa, qh RANDOMb); } }else { FOREACHvertex_(facet->vertices) @@ -972,36 +972,36 @@ void qh_setfacetplane(facetT *facet) { gmcoord= qh gm_matrix; FOREACHvertex_(facet->vertices) { if (vertex->point != point0) { - qh gm_row[i++]= gmcoord; - coord= vertex->point; - point= point0; - for (k=qh hull_dim; k--; ) - *(gmcoord++)= *coord++ - *point++; + qh gm_row[i++]= gmcoord; + coord= vertex->point; + point= point0; + for (k=qh hull_dim; k--; ) + *(gmcoord++)= *coord++ - *point++; } } qh gm_row[i]= gmcoord; /* for areasimplex */ if (qh RANDOMdist) { gmcoord= qh gm_matrix; for (i=qh hull_dim-1; i--; ) { - for (k=qh hull_dim; k--; ) - *(gmcoord++) *= qh_randomfactor(qh RANDOMa, qh RANDOMb); + for (k=qh hull_dim; k--; ) + *(gmcoord++) *= qh_randomfactor(qh RANDOMa, qh RANDOMb); } } qh_sethyperplane_gauss(qh hull_dim, qh gm_row, point0, facet->toporient, - facet->normal, &facet->offset, &nearzero); + facet->normal, &facet->offset, &nearzero); if (nearzero) { if (qh_orientoutside(facet)) { - trace0((qh ferr, 2, "qh_setfacetplane: flipped orientation after testing interior_point during p%d\n", qh furthest_id)); + trace0((qh ferr, 2, "qh_setfacetplane: flipped orientation after testing interior_point during p%d\n", qh furthest_id)); /* this is part of using Gaussian Elimination. For example in 5-d - 1 1 1 1 0 - 1 1 1 1 1 - 0 0 0 1 0 - 0 1 0 0 0 - 1 0 0 0 0 - norm= 0.38 0.38 -0.76 0.38 0 - has a determinate of 1, but g.e. after subtracting pt. 0 has - 0's in the diagonal, even with full pivoting. It does work - if you subtract pt. 4 instead. */ + 1 1 1 1 0 + 1 1 1 1 1 + 0 0 0 1 0 + 0 1 0 0 0 + 1 0 0 0 0 + norm= 0.38 0.38 -0.76 0.38 0 + has a determinate of 1, but g.e. after subtracting pt. 0 has + 0's in the diagonal, even with full pivoting. It does work + if you subtract pt. 4 instead. */ } } } @@ -1020,33 +1020,33 @@ void qh_setfacetplane(facetT *facet) { qh RANDOMdist= False; FOREACHvertex_(facet->vertices) { if (vertex->point != point0) { - boolT istrace= False; - zinc_(Zdiststat); + boolT istrace= False; + zinc_(Zdiststat); qh_distplane(vertex->point, facet, &dist); dist= fabs_(dist); zinc_(Znewvertex); wadd_(Wnewvertex, dist); if (dist > wwval_(Wnewvertexmax)) { wwval_(Wnewvertexmax)= dist; - if (dist > qh max_outside) { - qh max_outside= dist; /* used by qh_maxouter() */ - if (dist > qh TRACEdist) - istrace= True; - } - }else if (-dist > qh TRACEdist) - istrace= True; - if (istrace) { - qh_fprintf(qh ferr, 8016, "qh_setfacetplane: ====== vertex p%d(v%d) increases max_outside to %2.2g for new facet f%d last p%d\n", - qh_pointid(vertex->point), vertex->id, dist, facet->id, qh furthest_id); - qh_errprint("DISTANT", facet, NULL, NULL, NULL); - } + if (dist > qh max_outside) { + qh max_outside= dist; /* used by qh_maxouter() */ + if (dist > qh TRACEdist) + istrace= True; + } + }else if (-dist > qh TRACEdist) + istrace= True; + if (istrace) { + qh_fprintf(qh ferr, 8016, "qh_setfacetplane: ====== vertex p%d(v%d) increases max_outside to %2.2g for new facet f%d last p%d\n", + qh_pointid(vertex->point), vertex->id, dist, facet->id, qh furthest_id); + qh_errprint("DISTANT", facet, NULL, NULL, NULL); + } } } qh RANDOMdist= qh old_randomdist; } if (qh IStracing >= 3) { qh_fprintf(qh ferr, 8017, "qh_setfacetplane: f%d offset %2.2g normal: ", - facet->id, facet->offset); + facet->id, facet->offset); for (k=0; k < qh hull_dim; k++) qh_fprintf(qh ferr, 8018, "%2.2g ", facet->normal[k]); qh_fprintf(qh ferr, 8019, "\n"); @@ -1081,7 +1081,7 @@ void qh_setfacetplane(facetT *facet) { Plan: exactly translate the facet so that V_0 is the origin exactly rotate the facet so that V_1 is on the x-axis and y_2=0. exactly rotate the effective perturbation to only effect n_0 - this introduces a factor of sqrt(3) + this introduces a factor of sqrt(3) n_0 = ((y_2-y_0)*(z_1-z_0) - (z_2-z_0)*(y_1-y_0)) / norm Let M_d be the max coordinate difference Let M_a be the greater of M_d and the max abs. coordinate @@ -1115,52 +1115,52 @@ void qh_sethyperplane_det(int dim, coordT **rows, coordT *point0, *nearzero= False; /* since nearzero norm => incident points */ }else if (dim == 3) { normal[0]= det2_(dY(2,0), dZ(2,0), - dY(1,0), dZ(1,0)); + dY(1,0), dZ(1,0)); normal[1]= det2_(dX(1,0), dZ(1,0), - dX(2,0), dZ(2,0)); + dX(2,0), dZ(2,0)); normal[2]= det2_(dX(2,0), dY(2,0), - dX(1,0), dY(1,0)); + dX(1,0), dY(1,0)); qh_normalize2 (normal, dim, toporient, NULL, NULL); *offset= -(point0[0]*normal[0] + point0[1]*normal[1] - + point0[2]*normal[2]); + + point0[2]*normal[2]); maxround= qh DISTround; for (i=dim; i--; ) { point= rows[i]; if (point != point0) { dist= *offset + (point[0]*normal[0] + point[1]*normal[1] - + point[2]*normal[2]); + + point[2]*normal[2]); if (dist > maxround || dist < -maxround) { - *nearzero= True; - break; - } + *nearzero= True; + break; + } } } }else if (dim == 4) { normal[0]= - det3_(dY(2,0), dZ(2,0), dW(2,0), - dY(1,0), dZ(1,0), dW(1,0), - dY(3,0), dZ(3,0), dW(3,0)); + dY(1,0), dZ(1,0), dW(1,0), + dY(3,0), dZ(3,0), dW(3,0)); normal[1]= det3_(dX(2,0), dZ(2,0), dW(2,0), - dX(1,0), dZ(1,0), dW(1,0), - dX(3,0), dZ(3,0), dW(3,0)); + dX(1,0), dZ(1,0), dW(1,0), + dX(3,0), dZ(3,0), dW(3,0)); normal[2]= - det3_(dX(2,0), dY(2,0), dW(2,0), - dX(1,0), dY(1,0), dW(1,0), - dX(3,0), dY(3,0), dW(3,0)); + dX(1,0), dY(1,0), dW(1,0), + dX(3,0), dY(3,0), dW(3,0)); normal[3]= det3_(dX(2,0), dY(2,0), dZ(2,0), - dX(1,0), dY(1,0), dZ(1,0), - dX(3,0), dY(3,0), dZ(3,0)); + dX(1,0), dY(1,0), dZ(1,0), + dX(3,0), dY(3,0), dZ(3,0)); qh_normalize2 (normal, dim, toporient, NULL, NULL); *offset= -(point0[0]*normal[0] + point0[1]*normal[1] - + point0[2]*normal[2] + point0[3]*normal[3]); + + point0[2]*normal[2] + point0[3]*normal[3]); maxround= qh DISTround; for (i=dim; i--; ) { point= rows[i]; if (point != point0) { dist= *offset + (point[0]*normal[0] + point[1]*normal[1] - + point[2]*normal[2] + point[3]*normal[3]); + + point[2]*normal[2] + point[3]*normal[3]); if (dist > maxround || dist < -maxround) { - *nearzero= True; - break; - } + *nearzero= True; + break; + } } } } @@ -1199,7 +1199,7 @@ void qh_sethyperplane_det(int dim, coordT **rows, coordT *point0, compute offset */ void qh_sethyperplane_gauss(int dim, coordT **rows, pointT *point0, - boolT toporient, coordT *normal, coordT *offset, boolT *nearzero) { + boolT toporient, coordT *normal, coordT *offset, boolT *nearzero) { coordT *pointcoord, *normalcoef; int k; boolT sign= toporient, nearzero2= False; diff --git a/src/geom.h b/src/geom.h index aa9d651..b9d7627 100644 --- a/src/geom.h +++ b/src/geom.h @@ -1,14 +1,14 @@ /*<html><pre> -<a href="qh-geom.htm" >-------------------------------</a><a name="TOP">-</a> - geom.h + geom.h header file for geometric routines see qh-geom.htm and geom.c copyright (c) 1993-2010 The Geometry Center. - $Id: //product/qhull/main/rel/src/geom.h#17 $$Change: 1137 $ - $DateTime: 2010/01/02 21:58:11 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/geom.h#18 $$Change: 1164 $ + $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ */ #ifndef qhDEFgeom @@ -20,15 +20,15 @@ /*-<a href="qh-geom.htm#TOC" >--------------------------------</a><a name="fabs_">-</a> - + fabs_(a) returns the absolute value of a */ #define fabs_( a ) ((( a ) < 0 ) ? -( a ):( a )) - + /*-<a href="qh-geom.htm#TOC" >--------------------------------</a><a name="fmax_">-</a> - + fmax_(a,b) returns the maximum value of a and b */ @@ -61,20 +61,20 @@ /*-<a href="qh-geom.htm#TOC" >--------------------------------</a><a name="det2_">-</a> - det2_(a1, a2, + det2_(a1, a2, b1, b2) - + compute a 2-d determinate */ #define det2_( a1,a2,b1,b2 ) (( a1 )*( b2 ) - ( a2 )*( b1 )) /*-<a href="qh-geom.htm#TOC" >--------------------------------</a><a name="det3_">-</a> - - det3_(a1, a2, a3, + + det3_(a1, a2, a3, b1, b2, b3, c1, c2, c3) - + compute a 3-d determinate */ #define det3_( a1,a2,a3,b1,b2,b3,c1,c2,c3 ) ( ( a1 )*det2_( b2,b3,c2,c3 ) \ @@ -82,11 +82,11 @@ /*-<a href="qh-geom.htm#TOC" >--------------------------------</a><a name="dX">-</a> - + dX( p1, p2 ) dY( p1, p2 ) dZ( p1, p2 ) - + given two indices into rows[], compute the difference between X, Y, or Z coordinates @@ -99,36 +99,36 @@ /*============= prototypes in alphabetical order, infrequent at end ======= */ void qh_backnormal(realT **rows, int numrow, int numcol, boolT sign, coordT *normal, boolT *nearzero); -void qh_distplane(pointT *point, facetT *facet, realT *dist); +void qh_distplane(pointT *point, facetT *facet, realT *dist); facetT *qh_findbest(pointT *point, facetT *startfacet, - boolT bestoutside, boolT isnewfacets, boolT noupper, - realT *dist, boolT *isoutside, int *numpart); -facetT *qh_findbesthorizon(boolT ischeckmax, pointT *point, - facetT *startfacet, boolT noupper, realT *bestdist, int *numpart); -facetT *qh_findbestnew(pointT *point, facetT *startfacet, realT *dist, - boolT bestoutside, boolT *isoutside, int *numpart); -void qh_gausselim(realT **rows, int numrow, int numcol, boolT *sign, boolT *nearzero); + boolT bestoutside, boolT isnewfacets, boolT noupper, + realT *dist, boolT *isoutside, int *numpart); +facetT *qh_findbesthorizon(boolT ischeckmax, pointT *point, + facetT *startfacet, boolT noupper, realT *bestdist, int *numpart); +facetT *qh_findbestnew(pointT *point, facetT *startfacet, realT *dist, + boolT bestoutside, boolT *isoutside, int *numpart); +void qh_gausselim(realT **rows, int numrow, int numcol, boolT *sign, boolT *nearzero); realT qh_getangle(pointT *vect1, pointT *vect2); pointT *qh_getcenter(setT *vertices); pointT *qh_getcentrum(facetT *facet); realT qh_getdistance(facetT *facet, facetT *neighbor, realT *mindist, realT *maxdist); void qh_normalize(coordT *normal, int dim, boolT toporient); -void qh_normalize2 (coordT *normal, int dim, boolT toporient, +void qh_normalize2 (coordT *normal, int dim, boolT toporient, realT *minnorm, boolT *ismin); pointT *qh_projectpoint(pointT *point, facetT *facet, realT dist); void qh_setfacetplane(facetT *newfacets); -void qh_sethyperplane_det(int dim, coordT **rows, coordT *point0, +void qh_sethyperplane_det(int dim, coordT **rows, coordT *point0, boolT toporient, coordT *normal, realT *offset, boolT *nearzero); -void qh_sethyperplane_gauss(int dim, coordT **rows, pointT *point0, - boolT toporient, coordT *normal, coordT *offset, boolT *nearzero); +void qh_sethyperplane_gauss(int dim, coordT **rows, pointT *point0, + boolT toporient, coordT *normal, coordT *offset, boolT *nearzero); boolT qh_sharpnewfacets(void); /*========= infrequently used code in geom2.c =============*/ coordT *qh_copypoints(coordT *points, int numpoints, int dimension); void qh_crossproduct(int dim, realT vecA[3], realT vecB[3], realT vecC[3]); -realT qh_determinant(realT **rows, int dim, boolT *nearzero); +realT qh_determinant(realT **rows, int dim, boolT *nearzero); realT qh_detjoggle(pointT *points, int numpoints, int dimension); void qh_detroundoff(void); realT qh_detsimplex(pointT *apex, setT *points, int dim, boolT *nearzero); @@ -136,7 +136,7 @@ realT qh_distnorm(int dim, pointT *point, pointT *normal, realT *offsetp); realT qh_distround(int dimension, realT maxabs, realT maxsumabs); realT qh_divzero(realT numer, realT denom, realT mindenom1, boolT *zerodiv); realT qh_facetarea(facetT *facet); -realT qh_facetarea_simplex(int dim, coordT *apex, setT *vertices, +realT qh_facetarea_simplex(int dim, coordT *apex, setT *vertices, vertexT *notvertex, boolT toporient, coordT *normal, realT *offset); pointT *qh_facetcenter(setT *vertices); facetT *qh_findgooddist(pointT *point, facetT *facetA, realT *distp, facetT **facetlist); @@ -156,16 +156,16 @@ coordT qh_pointdist(pointT *point1, pointT *point2, int dim); void qh_printmatrix(FILE *fp, const char *string, realT **rows, int numrow, int numcol); void qh_printpoints(FILE *fp, const char *string, setT *points); void qh_projectinput(void); -void qh_projectpoints(signed char *project, int n, realT *points, +void qh_projectpoints(signed char *project, int n, realT *points, int numpoints, int dim, realT *newpoints, int newdim); void qh_rotateinput(realT **rows); void qh_rotatepoints(realT *points, int numpoints, int dim, realT **rows); void qh_scaleinput(void); void qh_scalelast(coordT *points, int numpoints, int dim, coordT low, - coordT high, coordT newhigh); -void qh_scalepoints(pointT *points, int numpoints, int dim, - realT *newlows, realT *newhighs); -boolT qh_sethalfspace(int dim, coordT *coords, coordT **nextp, + coordT high, coordT newhigh); +void qh_scalepoints(pointT *points, int numpoints, int dim, + realT *newlows, realT *newhighs); +boolT qh_sethalfspace(int dim, coordT *coords, coordT **nextp, coordT *normal, coordT *offset, coordT *feasible); coordT *qh_sethalfspace_all(int dim, int count, coordT *halfspaces, pointT *feasible); pointT *qh_voronoi_center(int dim, setT *points); diff --git a/src/geom2.c b/src/geom2.c index 5150b91..33e2e4d 100644 --- a/src/geom2.c +++ b/src/geom2.c @@ -8,8 +8,8 @@ see qh-geom.htm and geom.h copyright (c) 1993-2010 The Geometry Center. - $Id: //product/qhull/main/rel/src/geom2.c#28 $$Change: 1137 $ - $DateTime: 2010/01/02 21:58:11 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/geom2.c#29 $$Change: 1164 $ + $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ frequently used code goes into geom.c */ @@ -53,11 +53,11 @@ void qh_crossproduct(int dim, realT vecA[3], realT vecB[3], realT vecC[3]){ if (dim == 3) { vecC[0]= det2_(vecA[1], vecA[2], - vecB[1], vecB[2]); + vecB[1], vecB[2]); vecC[1]= - det2_(vecA[0], vecA[2], - vecB[0], vecB[2]); + vecB[0], vecB[2]); vecC[2]= det2_(vecA[0], vecA[1], - vecB[0], vecB[1]); + vecB[0], vecB[1]); } } /* vcross */ @@ -88,13 +88,13 @@ realT qh_determinant(realT **rows, int dim, boolT *nearzero) { qh_errexit(qh_ERRqhull, NULL, NULL); }else if (dim == 2) { det= det2_(rows[0][0], rows[0][1], - rows[1][0], rows[1][1]); + rows[1][0], rows[1][1]); if (fabs_(det) < qh NEARzero[1]) /* not really correct, what should this be? */ *nearzero= True; }else if (dim == 3) { det= det3_(rows[0][0], rows[0][1], rows[0][2], - rows[1][0], rows[1][1], rows[1][2], - rows[2][0], rows[2][1], rows[2][2]); + rows[1][0], rows[1][1], rows[1][2], + rows[2][0], rows[2][1], rows[2][2]); if (fabs_(det) < qh NEARzero[2]) /* not really correct, what should this be? */ *nearzero= True; }else { @@ -141,7 +141,7 @@ realT qh_detjoggle(pointT *points, int numpoints, int dimension) { maxcoord= -REALmax; mincoord= REALmax; FORALLpoint_(points, numpoints) { - maximize_(maxcoord, point[k]); + maximize_(maxcoord, point[k]); minimize_(mincoord, point[k]); } maximize_(maxwidth, maxcoord-mincoord); @@ -236,7 +236,7 @@ void qh_detroundoff(void) { } qh NEARinside= qh ONEmerge * qh_RATIOnearinside; /* only used if qh KEEPnearinside */ if (qh JOGGLEmax < REALmax/2 && (qh KEEPcoplanar || qh KEEPinside)) { - realT maxdist; /* adjust qh.NEARinside for joggle */ + realT maxdist; /* adjust qh.NEARinside for joggle */ qh KEEPnearinside= True; maxdist= sqrt((realT)qh hull_dim) * qh JOGGLEmax + qh DISTround; maxdist= 2*maxdist; /* vertex and coplanar point can joggle in opposite directions */ @@ -277,7 +277,7 @@ void qh_detroundoff(void) { if (qh MINvisible > qh MINoutside + 3 * REALepsilon && !qh BESToutside && !qh FORCEoutput) qh_fprintf(qh ferr, 7001, "qhull input warning: minimum visibility V%.2g is greater than \nminimum outside W%.2g. Flipped facets are likely.\n", - qh MINvisible, qh MINoutside); + qh MINvisible, qh MINoutside); qh max_vertex= qh DISTround; qh min_vertex= -qh DISTround; /* numeric constants reported in printsummary */ @@ -324,7 +324,7 @@ realT qh_detsimplex(pointT *apex, setT *points, int dim, boolT *nearzero) { } det= qh_determinant(rows, dim, nearzero); trace2((qh ferr, 2002, "qh_detsimplex: det=%2.2g for point p%d, dim %d, nearzero? %d\n", - det, qh_pointid(apex), dim, *nearzero)); + det, qh_pointid(apex), dim, *nearzero)); return det; } /* detsimplex */ @@ -380,7 +380,7 @@ realT qh_distround(int dimension, realT maxabs, realT maxsumabs) { maxround= REALepsilon * (dimension * maxdistsum * 1.01 + maxabs); /* adds maxabs for offset */ trace4((qh ferr, 4008, "qh_distround: %2.2g maxabs %2.2g maxsumabs %2.2g maxdistsum %2.2g\n", - maxround, maxabs, maxsumabs, maxdistsum)); + maxround, maxabs, maxsumabs, maxdistsum)); return maxround; } /* distround */ @@ -533,19 +533,19 @@ realT qh_facetarea_simplex(int dim, coordT *apex, setT *vertices, normalp= normal; if (notvertex) { for (k=dim; k--; ) - *(gmcoord++)= *coordp++ - *coorda++; + *(gmcoord++)= *coordp++ - *coorda++; }else { dist= *offset; for (k=dim; k--; ) - dist += *coordp++ * *normalp++; + dist += *coordp++ * *normalp++; if (dist < -qh WIDEfacet) { - zinc_(Znoarea); - return 0.0; + zinc_(Znoarea); + return 0.0; } coordp= vertex->point; normalp= normal; for (k=dim; k--; ) - *(gmcoord++)= (*coordp++ - dist * *normalp++) - *coorda++; + *(gmcoord++)= (*coordp++ - dist * *normalp++) - *coorda++; } } if (i != dim-1) { @@ -571,7 +571,7 @@ realT qh_facetarea_simplex(int dim, coordT *apex, setT *vertices, area= -area; area *= qh AREAfactor; trace4((qh ferr, 4010, "qh_facetarea_simplex: area=%2.2g for point p%d, toporient %d, nearzero? %d\n", - area, qh_pointid(apex), toporient, nearzero)); + area, qh_pointid(apex), toporient, nearzero)); return area; } /* facetarea_simplex */ @@ -722,7 +722,7 @@ void qh_getarea(facetT *facetlist) { area= facet->f.area; if (qh DELAUNAY) { if (facet->upperdelaunay == qh UPPERdelaunay) - qh totarea += area; + qh totarea += area; }else { qh totarea += area; qh_distplane(qh interior_point, facet, &dist); @@ -734,7 +734,7 @@ void qh_getarea(facetT *facetlist) { wmin_(Wareamin, area); } } - qh hasAreaVolume= True; + qh hasAreaVolume= True; } /* getarea */ /*-<a href="qh-geom.htm#TOC" @@ -776,9 +776,9 @@ boolT qh_gram_schmidt(int dim, realT **row) { for (j=i+1; j < dim; j++) { rowj= row[j]; for (norm= 0.0, k=dim; k--; ) - norm += *rowi++ * *rowj++; + norm += *rowi++ * *rowj++; for (k=dim; k--; ) - *(--rowj) -= *(--rowi) * norm; + *(--rowj) -= *(--rowi) * norm; } } return True; @@ -820,8 +820,8 @@ boolT qh_inthresholds(coordT *normal, realT *angle) { if (normal[k] < threshold) within= False; if (angle) { - threshold -= normal[k]; - *angle += fabs_(threshold); + threshold -= normal[k]; + *angle += fabs_(threshold); } } if (qh upper_threshold[k] < REALmax/2) { @@ -829,8 +829,8 @@ boolT qh_inthresholds(coordT *normal, realT *angle) { if (normal[k] > threshold) within= False; if (angle) { - threshold -= normal[k]; - *angle += fabs_(threshold); + threshold -= normal[k]; + *angle += fabs_(threshold); } } } @@ -892,18 +892,18 @@ void qh_joggleinput(void) { }else { /* repeated call */ if (!qh RERUN && qh build_cnt > qh_JOGGLEretry) { if (((qh build_cnt-qh_JOGGLEretry-1) % qh_JOGGLEagain) == 0) { - realT maxjoggle= qh MAXwidth * qh_JOGGLEmaxincrease; - if (qh JOGGLEmax < maxjoggle) { - qh JOGGLEmax *= qh_JOGGLEincrease; - minimize_(qh JOGGLEmax, maxjoggle); - } + realT maxjoggle= qh MAXwidth * qh_JOGGLEmaxincrease; + if (qh JOGGLEmax < maxjoggle) { + qh JOGGLEmax *= qh_JOGGLEincrease; + minimize_(qh JOGGLEmax, maxjoggle); + } } } qh_option("QJoggle", NULL, &qh JOGGLEmax); } if (qh build_cnt > 1 && qh JOGGLEmax > fmax_(qh MAXwidth/4, 0.1)) { qh_fprintf(qh ferr, 6010, "qhull error: the current joggle for 'QJn', %.2g, is too large for the width\nof the input. If possible, recompile Qhull with higher-precision reals.\n", - qh JOGGLEmax); + qh JOGGLEmax); qh_errexit(qh_ERRqhull, NULL, NULL); } /* for some reason, using qh ROTATErandom and qh_RANDOMseed does not repeat the run. Use 'TRn' instead */ @@ -995,7 +995,7 @@ setT *qh_maxmin(pointT *points, int numpoints, int dimension) { else { qh_fprintf(qh ferr, 6011, "qhull error: floating point constants in user.h are wrong\n\ REALepsilon %g REALmin %g REALmax %g -REALmax %g\n", - REALepsilon, REALmin, REALmax, -REALmax); + REALepsilon, REALmin, REALmax, -REALmax); qh_errexit(qh_ERRinput, NULL, NULL); } set= qh_settemp(2*dimension); @@ -1006,11 +1006,11 @@ REALepsilon %g REALmin %g REALmax %g -REALmax %g\n", minimum= maximum= points; FORALLpoint_(points, numpoints) { if (point == qh GOODpointp) - continue; + continue; if (maximum[k] < point[k]) - maximum= point; + maximum= point; else if (minimum[k] > point[k]) - minimum= point; + minimum= point; } if (k == dimension-1) { qh MINlastcoord= minimum[k]; @@ -1107,23 +1107,23 @@ void qh_maxsimplex(int dim, setT *maxpoints, pointT *points, int numpoints, setT maxcoord= point[0]; maxx= point; } - if (mincoord > point[0]) { + if (mincoord > point[0]) { mincoord= point[0]; minx= point; } } }else { FORALLpoint_(points, numpoints) { - if (point == qh GOODpointp) - continue; + if (point == qh GOODpointp) + continue; if (maxcoord < point[0]) { - maxcoord= point[0]; + maxcoord= point[0]; maxx= point; } - if (mincoord > point[0]) { + if (mincoord > point[0]) { mincoord= point[0]; minx= point; - } + } } } qh_setunique(simplex, minx); @@ -1133,12 +1133,12 @@ void qh_maxsimplex(int dim, setT *maxpoints, pointT *points, int numpoints, setT if (sizinit < 2) { qh_precision("input has same x coordinate"); if (zzval_(Zsetplane) > qh hull_dim+1) { - qh_fprintf(qh ferr, 6012, "qhull precision error (qh_maxsimplex for voronoi_center):\n%d points with the same x coordinate.\n", - qh_setsize(maxpoints)+numpoints); - qh_errexit(qh_ERRprec, NULL, NULL); + qh_fprintf(qh ferr, 6012, "qhull precision error (qh_maxsimplex for voronoi_center):\n%d points with the same x coordinate.\n", + qh_setsize(maxpoints)+numpoints); + qh_errexit(qh_ERRprec, NULL, NULL); }else { - qh_fprintf(qh ferr, 6013, "qhull input error: input is less than %d-dimensional since it has the same x coordinate\n", qh hull_dim); - qh_errexit(qh_ERRinput, NULL, NULL); + qh_fprintf(qh ferr, 6013, "qhull input error: input is less than %d-dimensional since it has the same x coordinate\n", qh hull_dim); + qh_errexit(qh_ERRinput, NULL, NULL); } } } @@ -1149,9 +1149,9 @@ void qh_maxsimplex(int dim, setT *maxpoints, pointT *points, int numpoints, setT if (!qh_setin(*simplex, point)) { det= qh_detsimplex(point, *simplex, k, &nearzero); if ((det= fabs_(det)) > maxdet) { - maxdet= det; + maxdet= det; maxpoint= point; - maxnearzero= nearzero; + maxnearzero= nearzero; } } } @@ -1161,18 +1161,18 @@ void qh_maxsimplex(int dim, setT *maxpoints, pointT *points, int numpoints, setT trace0((qh ferr, 7, "qh_maxsimplex: searching all points for %d-th initial vertex.\n", k+1)); }else { trace0((qh ferr, 8, "qh_maxsimplex: searching all points for %d-th initial vertex, better than p%d det %2.2g\n", - k+1, qh_pointid(maxpoint), maxdet)); + k+1, qh_pointid(maxpoint), maxdet)); } FORALLpoint_(points, numpoints) { - if (point == qh GOODpointp) - continue; + if (point == qh GOODpointp) + continue; if (!qh_setin(*simplex, point)) { det= qh_detsimplex(point, *simplex, k, &nearzero); if ((det= fabs_(det)) > maxdet) { - maxdet= det; + maxdet= det; maxpoint= point; - maxnearzero= nearzero; - } + maxnearzero= nearzero; + } } } } /* !maxpoint */ @@ -1182,7 +1182,7 @@ void qh_maxsimplex(int dim, setT *maxpoints, pointT *points, int numpoints, setT } qh_setappend(simplex, maxpoint); trace1((qh ferr, 1002, "qh_maxsimplex: selected point p%d for %d`th initial vertex, det=%2.2g\n", - qh_pointid(maxpoint), k+1, maxdet)); + qh_pointid(maxpoint), k+1, maxdet)); } /* k */ } /* maxsimplex */ @@ -1463,7 +1463,7 @@ void qh_projectinput(void) { qh_errexit(qh_ERRqhull, NULL, NULL); } qh_projectpoints(project, qh input_dim, qh feasible_point, - 1, qh input_dim, qh feasible_point, newdim); + 1, qh input_dim, qh feasible_point, newdim); } qh_memfree(project, (qh input_dim+1)*sizeof(*project)); if (qh POINTSmalloc) @@ -1479,7 +1479,7 @@ void qh_projectinput(void) { paraboloid= 0.0; for (k=0; k < qh hull_dim-1; k++) { paraboloid += *coord * *coord; - infinity[k] += *coord; + infinity[k] += *coord; coord++; } *(coord++)= paraboloid; @@ -1539,11 +1539,11 @@ void qh_projectpoints(signed char *project, int n, realT *points, else { newp= newpoints+newk++; if (project[j] == +1) { - if (oldk >= dim) - continue; - oldp= points+oldk; + if (oldk >= dim) + continue; + oldp= points+oldk; }else - oldp= points+oldk++; + oldp= points+oldk++; for (i=numpoints; i--; ) { *newp= *oldp; newp += newdim; @@ -1666,7 +1666,7 @@ void qh_scaleinput(void) { apply to last coordinate of each point */ void qh_scalelast(coordT *points, int numpoints, int dim, coordT low, - coordT high, coordT newhigh) { + coordT high, coordT newhigh) { realT scale, shift; coordT *coord; int i; @@ -1684,7 +1684,7 @@ void qh_scalelast(coordT *points, int numpoints, int dim, coordT low, qh_fprintf(qh ferr, 6019, "qhull input error: can not scale last coordinate. Input is cocircular\n or cospherical. Use option 'Qz' to add a point at infinity.\n"); else qh_fprintf(qh ferr, 6020, "qhull input error: can not scale last coordinate. New bounds [0, %2.2g] are too wide for\nexisting bounds [%2.2g, %2.2g] (width %2.2g)\n", - newhigh, low, high, high-low); + newhigh, low, high, high-low); qh_errexit(qh_ERRinput, NULL, NULL); } shift= - low * newhigh / (high-low); @@ -1712,7 +1712,7 @@ void qh_scalelast(coordT *points, int numpoints, int dim, coordT low, enforce new low and high bound for all points */ void qh_scalepoints(pointT *points, int numpoints, int dim, - realT *newlows, realT *newhighs) { + realT *newlows, realT *newhighs) { int i,k; realT shift, scale, *coord, low, high, newlow, newhigh, mincoord, maxcoord; boolT nearzero= False; @@ -1734,7 +1734,7 @@ void qh_scalepoints(pointT *points, int numpoints, int dim, newlow= low; if (qh DELAUNAY && k == dim-1 && newhigh < newlow) { qh_fprintf(qh ferr, 6021, "qhull input error: 'Qb%d' or 'QB%d' inverts paraboloid since high bound %.2g < low bound %.2g\n", - k, k, newhigh, newlow); + k, k, newhigh, newlow); qh_errexit(qh_ERRinput, NULL, NULL); } scale= qh_divzero(newhigh - newlow, high - low, @@ -1956,7 +1956,7 @@ boolT qh_sharpnewfacets() { FORALLfacet_(qh newfacet_list) { if (facet == qh newfacet_list) { for (k=qh hull_dim; k--; ) - quadrant[ k]= (facet->normal[ k] > 0); + quadrant[ k]= (facet->normal[ k] > 0); }else { for (k=qh hull_dim; k--; ) { if (quadrant[ k] != (facet->normal[ k] > 0)) { @@ -2010,7 +2010,7 @@ pointT *qh_voronoi_center(int dim, setT *points) { simplex= points; else if (size < dim+1) { qh_fprintf(qh ferr, 6025, "qhull internal error (qh_voronoi_center):\n need at least %d points to construct a Voronoi center\n", - dim+1); + dim+1); qh_errexit(qh_ERRqhull, NULL, NULL); simplex= points; /* never executed -- avoids warning */ }else { @@ -2047,16 +2047,16 @@ pointT *qh_voronoi_center(int dim, setT *points) { gmcoord= qh gm_matrix; sum2p= sum2row; for (k=0; k < dim; k++) { - qh gm_row[k]= gmcoord; - if (k == i) { - for (j=dim; j--; ) - *(gmcoord++)= *sum2p++; - }else { - FOREACHpoint_(simplex) { - if (point != point0) - *(gmcoord++)= point[k] - point0[k]; - } - } + qh gm_row[k]= gmcoord; + if (k == i) { + for (j=dim; j--; ) + *(gmcoord++)= *sum2p++; + }else { + FOREACHpoint_(simplex) { + if (point != point0) + *(gmcoord++)= point[k] - point0[k]; + } + } } center[i]= qh_determinant(qh gm_row, dim, &nearzero)*factor + point0[i]; } @@ -2065,11 +2065,11 @@ pointT *qh_voronoi_center(int dim, setT *points) { qh_fprintf(qh ferr, 8033, "qh_voronoi_center: det %2.2g factor %2.2g ", det, factor); qh_printmatrix(qh ferr, "center:", ¢er, 1, dim); if (qh IStracing >= 5) { - qh_printpoints(qh ferr, "points", simplex); - FOREACHpoint_(simplex) - qh_fprintf(qh ferr, 8034, "p%d dist %.2g, ", qh_pointid(point), - qh_pointdist(point, center, dim)); - qh_fprintf(qh ferr, 8035, "\n"); + qh_printpoints(qh ferr, "points", simplex); + FOREACHpoint_(simplex) + qh_fprintf(qh ferr, 8034, "p%d dist %.2g, ", qh_pointid(point), + qh_pointdist(point, center, dim)); + qh_fprintf(qh ferr, 8035, "\n"); } } #endif diff --git a/src/global.c b/src/global.c index 73ee5d5..256d193 100644 --- a/src/global.c +++ b/src/global.c @@ -12,8 +12,8 @@ see qhull_a.h for internal functions copyright (c) 1993-2010 The Geometry Center. - $Id: //product/qhull/main/rel/src/global.c#56 $$Change: 1159 $ - $DateTime: 2010/01/06 22:14:43 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/global.c#57 $$Change: 1164 $ + $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ */ #include "qhull_a.h" @@ -23,14 +23,14 @@ int qhull_inuse= 0; /* not used */ #if qh_QHpointer -qhT *qh_qh= NULL; /* pointer to all global variables */ +qhT *qh_qh= NULL; /* pointer to all global variables */ #else -qhT qh_qh; /* all global variables. - Add "= {0}" if this causes a compiler error. - Also qh_qhstat in stat.c and qhmem in mem.c. */ +qhT qh_qh; /* all global variables. + Add "= {0}" if this causes a compiler error. + Also qh_qhstat in stat.c and qhmem in mem.c. */ #endif -/*-<a href ="qh-globa.htm#TOC" +/*-<a href ="qh-globa.htm#TOC" >--------------------------------</a><a name="qh_version">-</a> qh_version @@ -39,15 +39,15 @@ qhT qh_qh; /* all global variables. the revision increases on code changes only notes: - change date: Changes.txt, Announce.txt, README.txt, - qhull.man, qhull.txt, qhull-news.html, Eudora signatures, + change date: Changes.txt, Announce.txt, README.txt, + qhull.man, qhull.txt, qhull-news.html, Eudora signatures, change version: README.txt, qh-get.htm, File_id.diz, Makefile.txt change year: Copying.txt check download size recompile user_eg.c, rbox.c, libqhull.c, qconvex.c, qdelaun.c qvoronoi.c, qhalf.c */ -const char *qh_version = "2010.1 2010/01/06"; +const char *qh_version = "2010.1 2010/01/07"; /*-<a href="qh-globa.htm#TOC" >-------------------------------</a><a name="appendprint">-</a> @@ -67,10 +67,10 @@ void qh_appendprint(qh_PRINT format) { } } } /* appendprint */ - + /*-<a href="qh-globa.htm#TOC" >-------------------------------</a><a name="checkflags">-</a> - + qh_checkflags( commandStr, hiddenFlags ) errors if commandStr contains hiddenFlags hiddenFlags starts and ends with a space and is space deliminated (checked) @@ -78,7 +78,7 @@ void qh_appendprint(qh_PRINT format) { notes: ignores first word (e.g., "qconvex i") use qh_strtol/strtod since strtol/strtod may or may not skip trailing spaces - + see: qh_initflags() initializes Qhull according to commandStr */ @@ -94,7 +94,7 @@ void qh_checkflags(char *command, char *hiddenflags) { qh_fprintf(qh ferr, 6026, "qhull error (qh_checkflags): hiddenflags must start and end with a space: \"%s\"", hiddenflags); qh_errexit(qh_ERRinput, NULL, NULL); } - if (strpbrk(hiddenflags, ",\n\r\t")) { + if (strpbrk(hiddenflags, ",\n\r\t")) { qh_fprintf(qh ferr, 6027, "qhull error (qh_checkflags): hiddenflags contains commas, newlines, or tabs: \"%s\"", hiddenflags); qh_errexit(qh_ERRinput, NULL, NULL); } @@ -122,27 +122,27 @@ void qh_checkflags(char *command, char *hiddenflags) { chkopt[1]= key; chkopt2[1]= key; while (!chkerr && *s && !isspace(*s)) { - opt= *s++; - if (isalpha(opt)) { - chkopt[2]= opt; - if (strstr(hiddenflags, chkopt)) - chkerr= chkopt; - if (prevopt != ' ') { - chkopt2[2]= prevopt; - chkopt2[3]= opt; - if (strstr(hiddenflags, chkopt2)) - chkerr= chkopt2; - } - }else if (key == 'Q' && isdigit(opt) && prevopt != 'b' - && (prevopt == ' ' || islower(prevopt))) { - chkopt[2]= opt; - if (strstr(hiddenflags, chkopt)) - chkerr= chkopt; - }else { - qh_strtod(s-1, &t); - if (s < t) - s= t; - } + opt= *s++; + if (isalpha(opt)) { + chkopt[2]= opt; + if (strstr(hiddenflags, chkopt)) + chkerr= chkopt; + if (prevopt != ' ') { + chkopt2[2]= prevopt; + chkopt2[3]= opt; + if (strstr(hiddenflags, chkopt2)) + chkerr= chkopt2; + } + }else if (key == 'Q' && isdigit(opt) && prevopt != 'b' + && (prevopt == ' ' || islower(prevopt))) { + chkopt[2]= opt; + if (strstr(hiddenflags, chkopt)) + chkerr= chkopt; + }else { + qh_strtod(s-1, &t); + if (s < t) + s= t; + } prevopt= opt; } } @@ -153,13 +153,13 @@ void qh_checkflags(char *command, char *hiddenflags) { waserr= True; } } - if (waserr) + if (waserr) qh_errexit(qh_ERRinput, NULL, NULL); } /* checkflags */ - + /*-<a href="qh-globa.htm#TOC" >-------------------------------</a><a name="qh_clear_outputflags">-</a> - + qh_clear_outputflags() Clear output flags for QhullPoints */ @@ -213,20 +213,20 @@ void qh_clear_outputflags(void) { if (!qh qhull_commandsiz2) qh qhull_commandsiz2= (int)strlen(qh qhull_command); /* WARN64 */ - else { + else { qh qhull_command[qh qhull_commandsiz2]= '\0'; } if (!qh qhull_optionsiz2) qh qhull_optionsiz2= (int)strlen(qh qhull_options); /* WARN64 */ - else { + else { qh qhull_options[qh qhull_optionsiz2]= '\0'; qh qhull_optionlen= qh_OPTIONline; /* start a new line */ } } /* clear_outputflags */ - + /*-<a href="qh-globa.htm#TOC" >-------------------------------</a><a name="clock">-</a> - + qh_clock() return user CPU time in 100ths (qh_SECtick) only defined for qh_CLOCKtype == 2 @@ -367,10 +367,10 @@ void qh_freebuild(boolT allmem) { } FORALLfacets { if (facet->visible) { - FOREACHridge_(facet->ridges) { - if (!otherfacet_(ridge, facet)->visible) - ridge->seen= True; /* an unattached ridge */ - } + FOREACHridge_(facet->ridges) { + if (!otherfacet_(ridge, facet)->visible) + ridge->seen= True; /* an unattached ridge */ + } } } while ((facet= qh facet_list)) { @@ -667,45 +667,45 @@ void qh_initflags(char *command) { break; case 'A': if (!isdigit(*s) && *s != '.' && *s != '-') - qh_fprintf(qh ferr, 7002, "qhull warning: no maximum cosine angle given for option 'An'. Ignored.\n"); + qh_fprintf(qh ferr, 7002, "qhull warning: no maximum cosine angle given for option 'An'. Ignored.\n"); else { - if (*s == '-') { - qh premerge_cos= -qh_strtod(s, &s); + if (*s == '-') { + qh premerge_cos= -qh_strtod(s, &s); qh_option("Angle-premerge-", NULL, &qh premerge_cos); - qh PREmerge= True; - }else { - qh postmerge_cos= qh_strtod(s, &s); + qh PREmerge= True; + }else { + qh postmerge_cos= qh_strtod(s, &s); qh_option("Angle-postmerge", NULL, &qh postmerge_cos); - qh POSTmerge= True; - } - qh MERGING= True; + qh POSTmerge= True; + } + qh MERGING= True; } break; case 'C': if (!isdigit(*s) && *s != '.' && *s != '-') - qh_fprintf(qh ferr, 7003, "qhull warning: no centrum radius given for option 'Cn'. Ignored.\n"); + qh_fprintf(qh ferr, 7003, "qhull warning: no centrum radius given for option 'Cn'. Ignored.\n"); else { - if (*s == '-') { - qh premerge_centrum= -qh_strtod(s, &s); + if (*s == '-') { + qh premerge_centrum= -qh_strtod(s, &s); qh_option("Centrum-premerge-", NULL, &qh premerge_centrum); - qh PREmerge= True; - }else { - qh postmerge_centrum= qh_strtod(s, &s); + qh PREmerge= True; + }else { + qh postmerge_centrum= qh_strtod(s, &s); qh_option("Centrum-postmerge", NULL, &qh postmerge_centrum); - qh POSTmerge= True; - } - qh MERGING= True; + qh POSTmerge= True; + } + qh MERGING= True; } break; case 'E': if (*s == '-') - qh_fprintf(qh ferr, 7004, "qhull warning: negative maximum roundoff given for option 'An'. Ignored.\n"); + qh_fprintf(qh ferr, 7004, "qhull warning: negative maximum roundoff given for option 'An'. Ignored.\n"); else if (!isdigit(*s)) - qh_fprintf(qh ferr, 7005, "qhull warning: no maximum roundoff given for option 'En'. Ignored.\n"); + qh_fprintf(qh ferr, 7005, "qhull warning: no maximum roundoff given for option 'En'. Ignored.\n"); else { - qh DISTround= qh_strtod(s, &s); + qh DISTround= qh_strtod(s, &s); qh_option("Distance-roundoff", NULL, &qh DISTround); - qh SETroundoff= True; + qh SETroundoff= True; } break; case 'H': @@ -714,13 +714,13 @@ void qh_initflags(char *command) { qh_strtod(s, &t); while (t > s) { if (*t && !isspace(*t)) { - if (*t == ',') - t++; - else - qh_fprintf(qh ferr, 7006, "qhull warning: origin for Halfspace intersection should be 'Hn,n,n,...'\n"); - } + if (*t == ',') + t++; + else + qh_fprintf(qh ferr, 7006, "qhull warning: origin for Halfspace intersection should be 'Hn,n,n,...'\n"); + } s= t; - qh_strtod(s, &t); + qh_strtod(s, &t); } if (start < t) { if (!(qh feasible_string= (char*)calloc((size_t)(t-start+1), (size_t)1))) { @@ -735,36 +735,36 @@ void qh_initflags(char *command) { break; case 'R': if (!isdigit(*s)) - qh_fprintf(qh ferr, 7007, "qhull warning: missing random perturbation for option 'Rn'. Ignored\n"); + qh_fprintf(qh ferr, 7007, "qhull warning: missing random perturbation for option 'Rn'. Ignored\n"); else { - qh RANDOMfactor= qh_strtod(s, &s); + qh RANDOMfactor= qh_strtod(s, &s); qh_option("Random_perturb", NULL, &qh RANDOMfactor); qh RANDOMdist= True; } break; case 'V': if (!isdigit(*s) && *s != '-') - qh_fprintf(qh ferr, 7008, "qhull warning: missing visible distance for option 'Vn'. Ignored\n"); + qh_fprintf(qh ferr, 7008, "qhull warning: missing visible distance for option 'Vn'. Ignored\n"); else { - qh MINvisible= qh_strtod(s, &s); + qh MINvisible= qh_strtod(s, &s); qh_option("Visible", NULL, &qh MINvisible); } break; case 'U': if (!isdigit(*s) && *s != '-') - qh_fprintf(qh ferr, 7009, "qhull warning: missing coplanar distance for option 'Un'. Ignored\n"); + qh_fprintf(qh ferr, 7009, "qhull warning: missing coplanar distance for option 'Un'. Ignored\n"); else { - qh MAXcoplanar= qh_strtod(s, &s); + qh MAXcoplanar= qh_strtod(s, &s); qh_option("U-coplanar", NULL, &qh MAXcoplanar); } break; case 'W': if (*s == '-') - qh_fprintf(qh ferr, 7010, "qhull warning: negative outside width for option 'Wn'. Ignored.\n"); + qh_fprintf(qh ferr, 7010, "qhull warning: negative outside width for option 'Wn'. Ignored.\n"); else if (!isdigit(*s)) - qh_fprintf(qh ferr, 7011, "qhull warning: missing outside width for option 'Wn'. Ignored\n"); + qh_fprintf(qh ferr, 7011, "qhull warning: missing outside width for option 'Wn'. Ignored\n"); else { - qh MINoutside= qh_strtod(s, &s); + qh MINoutside= qh_strtod(s, &s); qh_option("W-outside", NULL, &qh MINoutside); qh APPROXhull= True; } @@ -772,16 +772,16 @@ void qh_initflags(char *command) { /************ sub menus ***************/ case 'F': while (*s && !isspace(*s)) { - switch (*s++) { - case 'a': - qh_option("Farea", NULL, NULL); - qh_appendprint(qh_PRINTarea); - qh GETarea= True; - break; - case 'A': - qh_option("FArea-total", NULL, NULL); - qh GETarea= True; - break; + switch (*s++) { + case 'a': + qh_option("Farea", NULL, NULL); + qh_appendprint(qh_PRINTarea); + qh GETarea= True; + break; + case 'A': + qh_option("FArea-total", NULL, NULL); + qh GETarea= True; + break; case 'c': qh_option("Fcoplanars", NULL, NULL); qh_appendprint(qh_PRINTcoplanars); @@ -790,18 +790,18 @@ void qh_initflags(char *command) { qh_option("FCentrums", NULL, NULL); qh_appendprint(qh_PRINTcentrums); break; - case 'd': + case 'd': qh_option("Fd-cdd-in", NULL, NULL); - qh CDDinput= True; - break; - case 'D': + qh CDDinput= True; + break; + case 'D': qh_option("FD-cdd-out", NULL, NULL); - qh CDDoutput= True; - break; - case 'F': - qh_option("FFacets-xridge", NULL, NULL); + qh CDDoutput= True; + break; + case 'F': + qh_option("FFacets-xridge", NULL, NULL); qh_appendprint(qh_PRINTfacets_xridge); - break; + break; case 'i': qh_option("Finner", NULL, NULL); qh_appendprint(qh_PRINTinner); @@ -830,25 +830,25 @@ void qh_initflags(char *command) { qh_option("Fouter", NULL, NULL); qh_appendprint(qh_PRINTouter); break; - case 'O': - if (qh PRINToptions1st) { - qh_option("FOptions", NULL, NULL); - qh_appendprint(qh_PRINToptions); - }else - qh PRINToptions1st= True; - break; - case 'p': - qh_option("Fpoint-intersect", NULL, NULL); - qh_appendprint(qh_PRINTpointintersect); - break; - case 'P': - qh_option("FPoint-nearest", NULL, NULL); - qh_appendprint(qh_PRINTpointnearest); - break; - case 'Q': - qh_option("FQhull", NULL, NULL); - qh_appendprint(qh_PRINTqhull); - break; + case 'O': + if (qh PRINToptions1st) { + qh_option("FOptions", NULL, NULL); + qh_appendprint(qh_PRINToptions); + }else + qh PRINToptions1st= True; + break; + case 'p': + qh_option("Fpoint-intersect", NULL, NULL); + qh_appendprint(qh_PRINTpointintersect); + break; + case 'P': + qh_option("FPoint-nearest", NULL, NULL); + qh_appendprint(qh_PRINTpointnearest); + break; + case 'Q': + qh_option("FQhull", NULL, NULL); + qh_appendprint(qh_PRINTqhull); + break; case 's': qh_option("Fsummary", NULL, NULL); qh_appendprint(qh_PRINTsummary); @@ -870,23 +870,23 @@ void qh_initflags(char *command) { qh_option("FVertex-average", NULL, NULL); qh_appendprint(qh_PRINTaverage); break; - case 'x': - qh_option("Fxtremes", NULL, NULL); - qh_appendprint(qh_PRINTextremes); - break; - default: - s--; - qh_fprintf(qh ferr, 7012, "qhull warning: unknown 'F' output option %c, rest ignored\n", (int)s[0]); - while (*++s && !isspace(*s)); - break; - } + case 'x': + qh_option("Fxtremes", NULL, NULL); + qh_appendprint(qh_PRINTextremes); + break; + default: + s--; + qh_fprintf(qh ferr, 7012, "qhull warning: unknown 'F' output option %c, rest ignored\n", (int)s[0]); + while (*++s && !isspace(*s)); + break; + } } break; case 'G': isgeom= True; qh_appendprint(qh_PRINTgeom); while (*s && !isspace(*s)) { - switch (*s++) { + switch (*s++) { case 'a': qh_option("Gall-points", NULL, NULL); qh PRINTdots= True; @@ -895,73 +895,73 @@ void qh_initflags(char *command) { qh_option("Gcentrums", NULL, NULL); qh PRINTcentrums= True; break; - case 'h': + case 'h': qh_option("Gintersections", NULL, NULL); - qh DOintersections= True; - break; - case 'i': + qh DOintersections= True; + break; + case 'i': qh_option("Ginner", NULL, NULL); - qh PRINTinner= True; - break; - case 'n': + qh PRINTinner= True; + break; + case 'n': qh_option("Gno-planes", NULL, NULL); - qh PRINTnoplanes= True; - break; - case 'o': + qh PRINTnoplanes= True; + break; + case 'o': qh_option("Gouter", NULL, NULL); - qh PRINTouter= True; - break; - case 'p': + qh PRINTouter= True; + break; + case 'p': qh_option("Gpoints", NULL, NULL); - qh PRINTcoplanar= True; - break; - case 'r': + qh PRINTcoplanar= True; + break; + case 'r': qh_option("Gridges", NULL, NULL); - qh PRINTridges= True; - break; - case 't': + qh PRINTridges= True; + break; + case 't': qh_option("Gtransparent", NULL, NULL); - qh PRINTtransparent= True; - break; - case 'v': + qh PRINTtransparent= True; + break; + case 'v': qh_option("Gvertices", NULL, NULL); - qh PRINTspheres= True; - break; - case 'D': - if (!isdigit(*s)) - qh_fprintf(qh ferr, 6035, "qhull input error: missing dimension for option 'GDn'\n"); - else { - if (qh DROPdim >= 0) - qh_fprintf(qh ferr, 7013, "qhull warning: can only drop one dimension. Previous 'GD%d' ignored\n", - qh DROPdim); - qh DROPdim= qh_strtol(s, &s); + qh PRINTspheres= True; + break; + case 'D': + if (!isdigit(*s)) + qh_fprintf(qh ferr, 6035, "qhull input error: missing dimension for option 'GDn'\n"); + else { + if (qh DROPdim >= 0) + qh_fprintf(qh ferr, 7013, "qhull warning: can only drop one dimension. Previous 'GD%d' ignored\n", + qh DROPdim); + qh DROPdim= qh_strtol(s, &s); qh_option("GDrop-dim", &qh DROPdim, NULL); } - break; - default: - s--; - qh_fprintf(qh ferr, 7014, "qhull warning: unknown 'G' print option %c, rest ignored\n", (int)s[0]); - while (*++s && !isspace(*s)); - break; - } + break; + default: + s--; + qh_fprintf(qh ferr, 7014, "qhull warning: unknown 'G' print option %c, rest ignored\n", (int)s[0]); + while (*++s && !isspace(*s)); + break; + } } break; case 'P': while (*s && !isspace(*s)) { - switch (*s++) { - case 'd': case 'D': /* see qh_initthresholds() */ - key= s[-1]; - i= qh_strtol(s, &s); - r= 0; - if (*s == ':') { - s++; - r= qh_strtod(s, &s); - } - if (key == 'd') - qh_option("Pdrop-facets-dim-less", &i, &r); - else - qh_option("PDrop-facets-dim-more", &i, &r); - break; + switch (*s++) { + case 'd': case 'D': /* see qh_initthresholds() */ + key= s[-1]; + i= qh_strtol(s, &s); + r= 0; + if (*s == ':') { + s++; + r= qh_strtod(s, &s); + } + if (key == 'd') + qh_option("Pdrop-facets-dim-less", &i, &r); + else + qh_option("PDrop-facets-dim-more", &i, &r); + break; case 'g': qh_option("Pgood-facets", NULL, NULL); qh PRINTgood= True; @@ -978,329 +978,329 @@ void qh_initflags(char *command) { qh_option("Pprecision-ignore", NULL, NULL); qh PRINTprecision= False; break; - case 'A': - if (!isdigit(*s)) - qh_fprintf(qh ferr, 6036, "qhull input error: missing facet count for keep area option 'PAn'\n"); - else { - qh KEEParea= qh_strtol(s, &s); + case 'A': + if (!isdigit(*s)) + qh_fprintf(qh ferr, 6036, "qhull input error: missing facet count for keep area option 'PAn'\n"); + else { + qh KEEParea= qh_strtol(s, &s); qh_option("PArea-keep", &qh KEEParea, NULL); qh GETarea= True; } - break; - case 'F': - if (!isdigit(*s)) - qh_fprintf(qh ferr, 6037, "qhull input error: missing facet area for option 'PFn'\n"); - else { - qh KEEPminArea= qh_strtod(s, &s); + break; + case 'F': + if (!isdigit(*s)) + qh_fprintf(qh ferr, 6037, "qhull input error: missing facet area for option 'PFn'\n"); + else { + qh KEEPminArea= qh_strtod(s, &s); qh_option("PFacet-area-keep", NULL, &qh KEEPminArea); qh GETarea= True; } - break; - case 'M': - if (!isdigit(*s)) - qh_fprintf(qh ferr, 6038, "qhull input error: missing merge count for option 'PMn'\n"); - else { - qh KEEPmerge= qh_strtol(s, &s); + break; + case 'M': + if (!isdigit(*s)) + qh_fprintf(qh ferr, 6038, "qhull input error: missing merge count for option 'PMn'\n"); + else { + qh KEEPmerge= qh_strtol(s, &s); qh_option("PMerge-keep", &qh KEEPmerge, NULL); } - break; - default: - s--; - qh_fprintf(qh ferr, 7015, "qhull warning: unknown 'P' print option %c, rest ignored\n", (int)s[0]); - while (*++s && !isspace(*s)); - break; - } + break; + default: + s--; + qh_fprintf(qh ferr, 7015, "qhull warning: unknown 'P' print option %c, rest ignored\n", (int)s[0]); + while (*++s && !isspace(*s)); + break; + } } break; case 'Q': lastproject= -1; while (*s && !isspace(*s)) { - switch (*s++) { - case 'b': case 'B': /* handled by qh_initthresholds */ - key= s[-1]; - if (key == 'b' && *s == 'B') { - s++; - r= qh_DEFAULTbox; - qh SCALEinput= True; - qh_option("QbBound-unit-box", NULL, &r); - break; - } - if (key == 'b' && *s == 'b') { - s++; - qh SCALElast= True; - qh_option("Qbbound-last", NULL, NULL); - break; - } - k= qh_strtol(s, &s); - r= 0.0; - wasproject= False; - if (*s == ':') { - s++; - if ((r= qh_strtod(s, &s)) == 0.0) { - t= s; /* need true dimension for memory allocation */ - while (*t && !isspace(*t)) { - if (toupper(*t++) == 'B' - && k == qh_strtol(t, &t) - && *t++ == ':' - && qh_strtod(t, &t) == 0.0) { - qh PROJECTinput++; - trace2((qh ferr, 2004, "qh_initflags: project dimension %d\n", k)); - qh_option("Qb-project-dim", &k, NULL); - wasproject= True; - lastproject= k; - break; - } - } - } - } - if (!wasproject) { - if (lastproject == k && r == 0.0) - lastproject= -1; /* doesn't catch all possible sequences */ - else if (key == 'b') { - qh SCALEinput= True; - if (r == 0.0) - r= -qh_DEFAULTbox; - qh_option("Qbound-dim-low", &k, &r); - }else { - qh SCALEinput= True; - if (r == 0.0) - r= qh_DEFAULTbox; - qh_option("QBound-dim-high", &k, &r); - } - } - break; - case 'c': - qh_option("Qcoplanar-keep", NULL, NULL); - qh KEEPcoplanar= True; - break; - case 'f': - qh_option("Qfurthest-outside", NULL, NULL); - qh BESToutside= True; - break; - case 'g': - qh_option("Qgood-facets-only", NULL, NULL); - qh ONLYgood= True; - break; - case 'i': - qh_option("Qinterior-keep", NULL, NULL); - qh KEEPinside= True; - break; - case 'm': - qh_option("Qmax-outside-only", NULL, NULL); - qh ONLYmax= True; - break; - case 'r': - qh_option("Qrandom-outside", NULL, NULL); - qh RANDOMoutside= True; - break; - case 's': - qh_option("Qsearch-initial-simplex", NULL, NULL); - qh ALLpoints= True; - break; - case 't': - qh_option("Qtriangulate", NULL, NULL); - qh TRIangulate= True; - break; - case 'T': - qh_option("QTestPoints", NULL, NULL); - if (!isdigit(*s)) - qh_fprintf(qh ferr, 6039, "qhull input error: missing number of test points for option 'QTn'\n"); - else { - qh TESTpoints= qh_strtol(s, &s); + switch (*s++) { + case 'b': case 'B': /* handled by qh_initthresholds */ + key= s[-1]; + if (key == 'b' && *s == 'B') { + s++; + r= qh_DEFAULTbox; + qh SCALEinput= True; + qh_option("QbBound-unit-box", NULL, &r); + break; + } + if (key == 'b' && *s == 'b') { + s++; + qh SCALElast= True; + qh_option("Qbbound-last", NULL, NULL); + break; + } + k= qh_strtol(s, &s); + r= 0.0; + wasproject= False; + if (*s == ':') { + s++; + if ((r= qh_strtod(s, &s)) == 0.0) { + t= s; /* need true dimension for memory allocation */ + while (*t && !isspace(*t)) { + if (toupper(*t++) == 'B' + && k == qh_strtol(t, &t) + && *t++ == ':' + && qh_strtod(t, &t) == 0.0) { + qh PROJECTinput++; + trace2((qh ferr, 2004, "qh_initflags: project dimension %d\n", k)); + qh_option("Qb-project-dim", &k, NULL); + wasproject= True; + lastproject= k; + break; + } + } + } + } + if (!wasproject) { + if (lastproject == k && r == 0.0) + lastproject= -1; /* doesn't catch all possible sequences */ + else if (key == 'b') { + qh SCALEinput= True; + if (r == 0.0) + r= -qh_DEFAULTbox; + qh_option("Qbound-dim-low", &k, &r); + }else { + qh SCALEinput= True; + if (r == 0.0) + r= qh_DEFAULTbox; + qh_option("QBound-dim-high", &k, &r); + } + } + break; + case 'c': + qh_option("Qcoplanar-keep", NULL, NULL); + qh KEEPcoplanar= True; + break; + case 'f': + qh_option("Qfurthest-outside", NULL, NULL); + qh BESToutside= True; + break; + case 'g': + qh_option("Qgood-facets-only", NULL, NULL); + qh ONLYgood= True; + break; + case 'i': + qh_option("Qinterior-keep", NULL, NULL); + qh KEEPinside= True; + break; + case 'm': + qh_option("Qmax-outside-only", NULL, NULL); + qh ONLYmax= True; + break; + case 'r': + qh_option("Qrandom-outside", NULL, NULL); + qh RANDOMoutside= True; + break; + case 's': + qh_option("Qsearch-initial-simplex", NULL, NULL); + qh ALLpoints= True; + break; + case 't': + qh_option("Qtriangulate", NULL, NULL); + qh TRIangulate= True; + break; + case 'T': + qh_option("QTestPoints", NULL, NULL); + if (!isdigit(*s)) + qh_fprintf(qh ferr, 6039, "qhull input error: missing number of test points for option 'QTn'\n"); + else { + qh TESTpoints= qh_strtol(s, &s); qh_option("QTestPoints", &qh TESTpoints, NULL); } - break; - case 'u': - qh_option("QupperDelaunay", NULL, NULL); - qh UPPERdelaunay= True; - break; - case 'v': - qh_option("Qvertex-neighbors-convex", NULL, NULL); - qh TESTvneighbors= True; - break; - case 'x': - qh_option("Qxact-merge", NULL, NULL); - qh MERGEexact= True; - break; - case 'z': - qh_option("Qz-infinity-point", NULL, NULL); - qh ATinfinity= True; - break; - case '0': - qh_option("Q0-no-premerge", NULL, NULL); - qh NOpremerge= True; - break; - case '1': - if (!isdigit(*s)) { - qh_option("Q1-no-angle-sort", NULL, NULL); - qh ANGLEmerge= False; - break; - } - switch (*s++) { - case '0': - qh_option("Q10-no-narrow", NULL, NULL); - qh NOnarrow= True; - break; - case '1': - qh_option("Q11-trinormals Qtriangulate", NULL, NULL); - qh TRInormals= True; - qh TRIangulate= True; - break; - default: - s--; - qh_fprintf(qh ferr, 7016, "qhull warning: unknown 'Q' qhull option 1%c, rest ignored\n", (int)s[0]); - while (*++s && !isspace(*s)); - break; - } - break; - case '2': - qh_option("Q2-no-merge-independent", NULL, NULL); - qh MERGEindependent= False; - goto LABELcheckdigit; - break; /* no warnings */ - case '3': - qh_option("Q3-no-merge-vertices", NULL, NULL); - qh MERGEvertices= False; - LABELcheckdigit: - if (isdigit(*s)) - qh_fprintf(qh ferr, 7017, "qhull warning: can not follow '1', '2', or '3' with a digit. '%c' skipped.\n", - *s++); - break; - case '4': - qh_option("Q4-avoid-old-into-new", NULL, NULL); - qh AVOIDold= True; - break; - case '5': - qh_option("Q5-no-check-outer", NULL, NULL); - qh SKIPcheckmax= True; - break; - case '6': - qh_option("Q6-no-concave-merge", NULL, NULL); - qh SKIPconvex= True; - break; - case '7': - qh_option("Q7-no-breadth-first", NULL, NULL); - qh VIRTUALmemory= True; - break; - case '8': - qh_option("Q8-no-near-inside", NULL, NULL); - qh NOnearinside= True; - break; - case '9': - qh_option("Q9-pick-furthest", NULL, NULL); - qh PICKfurthest= True; - break; - case 'G': - i= qh_strtol(s, &t); - if (qh GOODpoint) - qh_fprintf(qh ferr, 7018, "qhull warning: good point already defined for option 'QGn'. Ignored\n"); + break; + case 'u': + qh_option("QupperDelaunay", NULL, NULL); + qh UPPERdelaunay= True; + break; + case 'v': + qh_option("Qvertex-neighbors-convex", NULL, NULL); + qh TESTvneighbors= True; + break; + case 'x': + qh_option("Qxact-merge", NULL, NULL); + qh MERGEexact= True; + break; + case 'z': + qh_option("Qz-infinity-point", NULL, NULL); + qh ATinfinity= True; + break; + case '0': + qh_option("Q0-no-premerge", NULL, NULL); + qh NOpremerge= True; + break; + case '1': + if (!isdigit(*s)) { + qh_option("Q1-no-angle-sort", NULL, NULL); + qh ANGLEmerge= False; + break; + } + switch (*s++) { + case '0': + qh_option("Q10-no-narrow", NULL, NULL); + qh NOnarrow= True; + break; + case '1': + qh_option("Q11-trinormals Qtriangulate", NULL, NULL); + qh TRInormals= True; + qh TRIangulate= True; + break; + default: + s--; + qh_fprintf(qh ferr, 7016, "qhull warning: unknown 'Q' qhull option 1%c, rest ignored\n", (int)s[0]); + while (*++s && !isspace(*s)); + break; + } + break; + case '2': + qh_option("Q2-no-merge-independent", NULL, NULL); + qh MERGEindependent= False; + goto LABELcheckdigit; + break; /* no warnings */ + case '3': + qh_option("Q3-no-merge-vertices", NULL, NULL); + qh MERGEvertices= False; + LABELcheckdigit: + if (isdigit(*s)) + qh_fprintf(qh ferr, 7017, "qhull warning: can not follow '1', '2', or '3' with a digit. '%c' skipped.\n", + *s++); + break; + case '4': + qh_option("Q4-avoid-old-into-new", NULL, NULL); + qh AVOIDold= True; + break; + case '5': + qh_option("Q5-no-check-outer", NULL, NULL); + qh SKIPcheckmax= True; + break; + case '6': + qh_option("Q6-no-concave-merge", NULL, NULL); + qh SKIPconvex= True; + break; + case '7': + qh_option("Q7-no-breadth-first", NULL, NULL); + qh VIRTUALmemory= True; + break; + case '8': + qh_option("Q8-no-near-inside", NULL, NULL); + qh NOnearinside= True; + break; + case '9': + qh_option("Q9-pick-furthest", NULL, NULL); + qh PICKfurthest= True; + break; + case 'G': + i= qh_strtol(s, &t); + if (qh GOODpoint) + qh_fprintf(qh ferr, 7018, "qhull warning: good point already defined for option 'QGn'. Ignored\n"); else if (s == t) - qh_fprintf(qh ferr, 7019, "qhull warning: missing good point id for option 'QGn'. Ignored\n"); - else if (i < 0 || *s == '-') { - qh GOODpoint= i-1; - qh_option("QGood-if-dont-see-point", &i, NULL); - }else { - qh GOODpoint= i+1; - qh_option("QGood-if-see-point", &i, NULL); - } - s= t; - break; - case 'J': + qh_fprintf(qh ferr, 7019, "qhull warning: missing good point id for option 'QGn'. Ignored\n"); + else if (i < 0 || *s == '-') { + qh GOODpoint= i-1; + qh_option("QGood-if-dont-see-point", &i, NULL); + }else { + qh GOODpoint= i+1; + qh_option("QGood-if-see-point", &i, NULL); + } + s= t; + break; + case 'J': if (!isdigit(*s) && *s != '-') - qh JOGGLEmax= 0.0; - else { - qh JOGGLEmax= (realT) qh_strtod(s, &s); + qh JOGGLEmax= 0.0; + else { + qh JOGGLEmax= (realT) qh_strtod(s, &s); qh_option("QJoggle", NULL, &qh JOGGLEmax); - } - break; - case 'R': + } + break; + case 'R': if (!isdigit(*s) && *s != '-') - qh_fprintf(qh ferr, 7020, "qhull warning: missing random seed for option 'QRn'. Ignored\n"); - else { - qh ROTATErandom= i= qh_strtol(s, &s); - if (i > 0) - qh_option("QRotate-id", &i, NULL ); - else if (i < -1) - qh_option("QRandom-seed", &i, NULL ); + qh_fprintf(qh ferr, 7020, "qhull warning: missing random seed for option 'QRn'. Ignored\n"); + else { + qh ROTATErandom= i= qh_strtol(s, &s); + if (i > 0) + qh_option("QRotate-id", &i, NULL ); + else if (i < -1) + qh_option("QRandom-seed", &i, NULL ); } - break; - case 'V': - i= qh_strtol(s, &t); - if (qh GOODvertex) - qh_fprintf(qh ferr, 7021, "qhull warning: good vertex already defined for option 'QVn'. Ignored\n"); + break; + case 'V': + i= qh_strtol(s, &t); + if (qh GOODvertex) + qh_fprintf(qh ferr, 7021, "qhull warning: good vertex already defined for option 'QVn'. Ignored\n"); else if (s == t) - qh_fprintf(qh ferr, 7022, "qhull warning: no good point id given for option 'QVn'. Ignored\n"); - else if (i < 0) { - qh GOODvertex= i - 1; - qh_option("QV-good-facets-not-point", &i, NULL); - }else { - qh_option("QV-good-facets-point", &i, NULL); - qh GOODvertex= i + 1; + qh_fprintf(qh ferr, 7022, "qhull warning: no good point id given for option 'QVn'. Ignored\n"); + else if (i < 0) { + qh GOODvertex= i - 1; + qh_option("QV-good-facets-not-point", &i, NULL); + }else { + qh_option("QV-good-facets-point", &i, NULL); + qh GOODvertex= i + 1; } - s= t; - break; - default: - s--; - qh_fprintf(qh ferr, 7023, "qhull warning: unknown 'Q' qhull option %c, rest ignored\n", (int)s[0]); - while (*++s && !isspace(*s)); - break; - } + s= t; + break; + default: + s--; + qh_fprintf(qh ferr, 7023, "qhull warning: unknown 'Q' qhull option %c, rest ignored\n", (int)s[0]); + while (*++s && !isspace(*s)); + break; + } } break; case 'T': while (*s && !isspace(*s)) { - if (isdigit(*s) || *s == '-') - qh IStracing= qh_strtol(s, &s); - else switch (*s++) { - case 'a': + if (isdigit(*s) || *s == '-') + qh IStracing= qh_strtol(s, &s); + else switch (*s++) { + case 'a': qh_option("Tannotate-output", NULL, NULL); - qh ANNOTATEoutput= True; - break; - case 'c': + qh ANNOTATEoutput= True; + break; + case 'c': qh_option("Tcheck-frequently", NULL, NULL); - qh CHECKfrequently= True; - break; - case 's': + qh CHECKfrequently= True; + break; + case 's': qh_option("Tstatistics", NULL, NULL); - qh PRINTstatistics= True; - break; - case 'v': + qh PRINTstatistics= True; + break; + case 'v': qh_option("Tverify", NULL, NULL); - qh VERIFYoutput= True; - break; - case 'z': + qh VERIFYoutput= True; + break; + case 'z': if (qh ferr == qh_FILEstderr) { /* The C++ interface captures the output in qh_fprint_qhull() */ qh_option("Tz-stdout", NULL, NULL); qh USEstdout= True; - }else if (!qh fout) - qh_fprintf(qh ferr, 7024, "qhull warning: output file undefined(stdout). Option 'Tz' ignored.\n"); - else { - qh_option("Tz-stdout", NULL, NULL); + }else if (!qh fout) + qh_fprintf(qh ferr, 7024, "qhull warning: output file undefined(stdout). Option 'Tz' ignored.\n"); + else { + qh_option("Tz-stdout", NULL, NULL); qh USEstdout= True; - qh ferr= qh fout; - qhmem.ferr= qh fout; - } - break; - case 'C': - if (!isdigit(*s)) - qh_fprintf(qh ferr, 7025, "qhull warning: missing point id for cone for trace option 'TCn'. Ignored\n"); - else { - i= qh_strtol(s, &s); - qh_option("TCone-stop", &i, NULL); - qh STOPcone= i + 1; + qh ferr= qh fout; + qhmem.ferr= qh fout; } - break; - case 'F': - if (!isdigit(*s)) - qh_fprintf(qh ferr, 7026, "qhull warning: missing frequency count for trace option 'TFn'. Ignored\n"); - else { - qh REPORTfreq= qh_strtol(s, &s); + break; + case 'C': + if (!isdigit(*s)) + qh_fprintf(qh ferr, 7025, "qhull warning: missing point id for cone for trace option 'TCn'. Ignored\n"); + else { + i= qh_strtol(s, &s); + qh_option("TCone-stop", &i, NULL); + qh STOPcone= i + 1; + } + break; + case 'F': + if (!isdigit(*s)) + qh_fprintf(qh ferr, 7026, "qhull warning: missing frequency count for trace option 'TFn'. Ignored\n"); + else { + qh REPORTfreq= qh_strtol(s, &s); qh_option("TFacet-log", &qh REPORTfreq, NULL); - qh REPORTfreq2= qh REPORTfreq/2; /* for tracemerging() */ - } - break; - case 'I': + qh REPORTfreq2= qh REPORTfreq/2; /* for tracemerging() */ + } + break; + case 'I': if (!isspace(*s)) qh_fprintf(qh ferr, 7027, "qhull warning: missing space between 'TI' and filename, %s\n", s); while (isspace(*s)) @@ -1311,16 +1311,16 @@ void qh_initflags(char *command) { qh_copyfilename(filename, (int)sizeof(filename), s, (int)(t-s)); /* WARN64 */ s= t; - if (!freopen(filename, "r", stdin)) { - qh_fprintf(qh ferr, 6041, "qhull error: could not open file \"%s\".", filename); - qh_errexit(qh_ERRinput, NULL, NULL); - }else { - qh_option("TInput-file", NULL, NULL); - qh_option(filename, NULL, NULL); - } + if (!freopen(filename, "r", stdin)) { + qh_fprintf(qh ferr, 6041, "qhull error: could not open file \"%s\".", filename); + qh_errexit(qh_ERRinput, NULL, NULL); + }else { + qh_option("TInput-file", NULL, NULL); + qh_option(filename, NULL, NULL); + } } - break; - case 'O': + break; + case 'O': if (!isspace(*s)) qh_fprintf(qh ferr, 7028, "qhull warning: missing space between 'TO' and filename, %s\n", s); while (isspace(*s)) @@ -1331,78 +1331,78 @@ void qh_initflags(char *command) { qh_copyfilename(filename, (int)sizeof(filename), s, (int)(t-s)); /* WARN64 */ s= t; - if (!freopen(filename, "w", stdout)) { - qh_fprintf(qh ferr, 6044, "qhull error: could not open file \"%s\".", filename); - qh_errexit(qh_ERRinput, NULL, NULL); - }else { - qh_option("TOutput-file", NULL, NULL); - qh_option(filename, NULL, NULL); - } - } - break; - case 'P': - if (!isdigit(*s)) - qh_fprintf(qh ferr, 7029, "qhull warning: missing point id for trace option 'TPn'. Ignored\n"); - else { - qh TRACEpoint= qh_strtol(s, &s); + if (!freopen(filename, "w", stdout)) { + qh_fprintf(qh ferr, 6044, "qhull error: could not open file \"%s\".", filename); + qh_errexit(qh_ERRinput, NULL, NULL); + }else { + qh_option("TOutput-file", NULL, NULL); + qh_option(filename, NULL, NULL); + } + } + break; + case 'P': + if (!isdigit(*s)) + qh_fprintf(qh ferr, 7029, "qhull warning: missing point id for trace option 'TPn'. Ignored\n"); + else { + qh TRACEpoint= qh_strtol(s, &s); qh_option("Trace-point", &qh TRACEpoint, NULL); } - break; - case 'M': - if (!isdigit(*s)) - qh_fprintf(qh ferr, 7030, "qhull warning: missing merge id for trace option 'TMn'. Ignored\n"); - else { - qh TRACEmerge= qh_strtol(s, &s); + break; + case 'M': + if (!isdigit(*s)) + qh_fprintf(qh ferr, 7030, "qhull warning: missing merge id for trace option 'TMn'. Ignored\n"); + else { + qh TRACEmerge= qh_strtol(s, &s); qh_option("Trace-merge", &qh TRACEmerge, NULL); } - break; - case 'R': - if (!isdigit(*s)) - qh_fprintf(qh ferr, 7031, "qhull warning: missing rerun count for trace option 'TRn'. Ignored\n"); - else { - qh RERUN= qh_strtol(s, &s); + break; + case 'R': + if (!isdigit(*s)) + qh_fprintf(qh ferr, 7031, "qhull warning: missing rerun count for trace option 'TRn'. Ignored\n"); + else { + qh RERUN= qh_strtol(s, &s); qh_option("TRerun", &qh RERUN, NULL); } - break; - case 'V': - i= qh_strtol(s, &t); - if (s == t) - qh_fprintf(qh ferr, 7032, "qhull warning: missing furthest point id for trace option 'TVn'. Ignored\n"); - else if (i < 0) { - qh STOPpoint= i - 1; + break; + case 'V': + i= qh_strtol(s, &t); + if (s == t) + qh_fprintf(qh ferr, 7032, "qhull warning: missing furthest point id for trace option 'TVn'. Ignored\n"); + else if (i < 0) { + qh STOPpoint= i - 1; qh_option("TV-stop-before-point", &i, NULL); - }else { - qh STOPpoint= i + 1; + }else { + qh STOPpoint= i + 1; qh_option("TV-stop-after-point", &i, NULL); } s= t; - break; - case 'W': - if (!isdigit(*s)) - qh_fprintf(qh ferr, 7033, "qhull warning: missing max width for trace option 'TWn'. Ignored\n"); - else { - qh TRACEdist= (realT) qh_strtod(s, &s); + break; + case 'W': + if (!isdigit(*s)) + qh_fprintf(qh ferr, 7033, "qhull warning: missing max width for trace option 'TWn'. Ignored\n"); + else { + qh TRACEdist= (realT) qh_strtod(s, &s); qh_option("TWide-trace", NULL, &qh TRACEdist); } - break; - default: - s--; - qh_fprintf(qh ferr, 7034, "qhull warning: unknown 'T' trace option %c, rest ignored\n", (int)s[0]); - while (*++s && !isspace(*s)); - break; - } + break; + default: + s--; + qh_fprintf(qh ferr, 7034, "qhull warning: unknown 'T' trace option %c, rest ignored\n", (int)s[0]); + while (*++s && !isspace(*s)); + break; + } } break; default: qh_fprintf(qh ferr, 7035, "qhull warning: unknown flag %c(%x)\n", (int)s[-1], - (int)s[-1]); + (int)s[-1]); break; } if (s-1 == prev_s && *s && !isspace(*s)) { qh_fprintf(qh ferr, 7036, "qhull warning: missing space after flag %c(%x); reserved for menu. Skipped.\n", - (int)*prev_s, (int)*prev_s); + (int)*prev_s, (int)*prev_s); while (*s && !isspace(*s)) - s++; + s++; } } if (qh STOPcone && qh JOGGLEmax < REALmax/2) @@ -1498,7 +1498,7 @@ void qh_initqhull_globals(coordT *points, int numpoints, int dim, boolT ismalloc qh MERGEexact= True; qh_option("Qxact_merge", NULL, NULL); } - }else if (qh MERGEexact) + }else if (qh MERGEexact) qh MERGING= True; if (!qh NOpremerge && qh JOGGLEmax > REALmax/2) { #ifdef qh_NOmerge @@ -1545,7 +1545,7 @@ void qh_initqhull_globals(coordT *points, int numpoints, int dim, boolT ismalloc if (qh SCALElast && !qh DELAUNAY && qh PRINTprecision) qh_fprintf(qh ferr, 7040, "qhull input warning: option 'Qbb' (scale-last-coordinate) is normally used with 'd' or 'v'\n"); qh DOcheckmax= (!qh SKIPcheckmax && qh MERGING ); - qh KEEPnearinside= (qh DOcheckmax && !(qh KEEPinside && qh KEEPcoplanar) + qh KEEPnearinside= (qh DOcheckmax && !(qh KEEPinside && qh KEEPcoplanar) && !qh NOnearinside); if (qh MERGING) qh CENTERtype= qh_AScentrum; @@ -1571,7 +1571,7 @@ void qh_initqhull_globals(coordT *points, int numpoints, int dim, boolT ismalloc factorial *= k; qh AREAfactor= 1.0 / factorial; trace2((qh ferr, 2005, "qh_initqhull_globals: initialize globals. dim %d numpoints %d malloc? %d projected %d to hull_dim %d\n", - dim, numpoints, ismalloc, qh PROJECTinput, qh hull_dim)); + dim, numpoints, ismalloc, qh PROJECTinput, qh hull_dim)); qh normal_size= qh hull_dim * sizeof(coordT); qh center_size= qh normal_size - sizeof(coordT); pointsneeded= qh hull_dim+1; @@ -1618,7 +1618,7 @@ void qh_initqhull_globals(coordT *points, int numpoints, int dim, boolT ismalloc qh_fprintf(qh ferr, 8036, "\ qhull configuration error (qh_RANDOMmax in user.h):\n\ random integer %d > qh_RANDOMmax(%.8g)\n", - randi, qh_RANDOMmax); + randi, qh_RANDOMmax); qh_errexit(qh_ERRinput, NULL, NULL); } } @@ -1630,7 +1630,7 @@ qhull configuration error (qh_RANDOMmax in user.h):\n\ qhull configuration warning (qh_RANDOMmax in user.h):\n\ average of 1000 random integers (%.2g) is much different than expected (%.2g).\n\ Is qh_RANDOMmax (%.2g) wrong?\n", - randr, qh_RANDOMmax * 0.5, qh_RANDOMmax); + randr, qh_RANDOMmax * 0.5, qh_RANDOMmax); qh RANDOMa= 2.0 * qh RANDOMfactor/qh_RANDOMmax; qh RANDOMb= 1.0 - qh RANDOMfactor; if (qh_HASHfactor < 1.1) { @@ -1640,12 +1640,12 @@ qhull configuration warning (qh_RANDOMmax in user.h):\n\ } if (numpoints+extra < pointsneeded) { qh_fprintf(qh ferr, 6214, "qhull input error: not enough points(%d) to construct initial simplex(need %d)\n", - numpoints, pointsneeded); + numpoints, pointsneeded); qh_errexit(qh_ERRinput, NULL, NULL); } qh_initqhull_outputflags(); } /* initqhull_globals */ - + /*-<a href="qh-globa.htm#TOC" >-------------------------------</a><a name="initqhull_mem">-</a> @@ -1709,7 +1709,7 @@ void qh_initqhull_outputflags(void) { trace3((qh ferr, 3024, "qh_initqhull_outputflags: %s\n", qh qhull_command)); if (!(qh PRINTgood || qh PRINTneighbors)) { if (qh KEEParea || qh KEEPminArea < REALmax/2 || qh KEEPmerge || qh DELAUNAY - || (!qh ONLYgood && (qh GOODvertex || qh GOODpoint))) { + || (!qh ONLYgood && (qh GOODvertex || qh GOODpoint))) { qh PRINTgood= True; qh_option("Pgood", NULL, NULL); } @@ -1743,12 +1743,12 @@ void qh_initqhull_outputflags(void) { }else if (qh PRINTout[i] == qh_PRINTvertices) { if (qh VORONOI) qh_option("Fvoronoi", NULL, NULL); - else + else qh_option("Fvertices", NULL, NULL); } } if (printcoplanar && qh DELAUNAY && qh JOGGLEmax < REALmax/2) { - if (qh PRINTprecision) + if (qh PRINTprecision) qh_fprintf(qh ferr, 7041, "qhull input warning: 'QJ' (joggle) will usually prevent coincident input sites for options 'Fc' and 'FP'\n"); } if (printmath && (qh hull_dim > 3 || qh VORONOI)) { @@ -1771,7 +1771,7 @@ void qh_initqhull_outputflags(void) { } /* can not warn about furthest-site Geomview output: no lower_threshold */ if (qh hull_dim == 4 && qh DROPdim == -1 && - (qh PRINTcoplanar || qh PRINTspheres || qh PRINTcentrums)) { + (qh PRINTcoplanar || qh PRINTspheres || qh PRINTcentrums)) { qh_fprintf(qh ferr, 7042, "qhull input warning: coplanars, vertices, and centrums output not\n\ available for 4-d output(ignored). Could use 'GDn' instead.\n"); qh PRINTcoplanar= qh PRINTspheres= qh PRINTcentrums= False; @@ -1831,10 +1831,10 @@ void qh_initqhull_start(FILE *infile, FILE *outfile, FILE *errfile) { initialize statistics, stdio, default values for global variables assumes qh_qh is defined notes: - report errors elsewhere, error handling and g_qhull_output [Qhull.cpp, QhullQh()] not in initialized + report errors elsewhere, error handling and g_qhull_output [Qhull.cpp, QhullQh()] not in initialized see: qh_maxmin() determines the precision constants - qh_freeqhull2() + qh_freeqhull2() */ void qh_initqhull_start2(FILE *infile, FILE *outfile, FILE *errfile) { time_t timedata; @@ -1924,69 +1924,69 @@ void qh_initthresholds(char *command) { if (*s == 'P') { s++; while (*s && !isspace(key= *s++)) { - if (key == 'd' || key == 'D') { - if (!isdigit(*s)) { - qh_fprintf(qh ferr, 7044, "qhull warning: no dimension given for Print option '%c' at: %s. Ignored\n", - key, s-1); - continue; - } - idx= qh_strtol(s, &s); - if (idx >= qh hull_dim) { - qh_fprintf(qh ferr, 7045, "qhull warning: dimension %d for Print option '%c' is >= %d. Ignored\n", - idx, key, qh hull_dim); - continue; - } - if (*s == ':') { - s++; - value= qh_strtod(s, &s); - if (fabs((double)value) > 1.0) { - qh_fprintf(qh ferr, 7046, "qhull warning: value %2.4g for Print option %c is > +1 or < -1. Ignored\n", - value, key); - continue; - } - }else - value= 0.0; - if (key == 'd') - qh lower_threshold[idx]= value; - else - qh upper_threshold[idx]= value; - } + if (key == 'd' || key == 'D') { + if (!isdigit(*s)) { + qh_fprintf(qh ferr, 7044, "qhull warning: no dimension given for Print option '%c' at: %s. Ignored\n", + key, s-1); + continue; + } + idx= qh_strtol(s, &s); + if (idx >= qh hull_dim) { + qh_fprintf(qh ferr, 7045, "qhull warning: dimension %d for Print option '%c' is >= %d. Ignored\n", + idx, key, qh hull_dim); + continue; + } + if (*s == ':') { + s++; + value= qh_strtod(s, &s); + if (fabs((double)value) > 1.0) { + qh_fprintf(qh ferr, 7046, "qhull warning: value %2.4g for Print option %c is > +1 or < -1. Ignored\n", + value, key); + continue; + } + }else + value= 0.0; + if (key == 'd') + qh lower_threshold[idx]= value; + else + qh upper_threshold[idx]= value; + } } }else if (*s == 'Q') { s++; while (*s && !isspace(key= *s++)) { - if (key == 'b' && *s == 'B') { - s++; - for (k=maxdim; k--; ) { - qh lower_bound[k]= -qh_DEFAULTbox; - qh upper_bound[k]= qh_DEFAULTbox; - } - }else if (key == 'b' && *s == 'b') - s++; - else if (key == 'b' || key == 'B') { - if (!isdigit(*s)) { - qh_fprintf(qh ferr, 7047, "qhull warning: no dimension given for Qhull option %c. Ignored\n", - key); - continue; - } - idx= qh_strtol(s, &s); - if (idx >= maxdim) { - qh_fprintf(qh ferr, 7048, "qhull warning: dimension %d for Qhull option %c is >= %d. Ignored\n", - idx, key, maxdim); - continue; - } - if (*s == ':') { - s++; - value= qh_strtod(s, &s); - }else if (key == 'b') - value= -qh_DEFAULTbox; - else - value= qh_DEFAULTbox; - if (key == 'b') - qh lower_bound[idx]= value; - else - qh upper_bound[idx]= value; - } + if (key == 'b' && *s == 'B') { + s++; + for (k=maxdim; k--; ) { + qh lower_bound[k]= -qh_DEFAULTbox; + qh upper_bound[k]= qh_DEFAULTbox; + } + }else if (key == 'b' && *s == 'b') + s++; + else if (key == 'b' || key == 'B') { + if (!isdigit(*s)) { + qh_fprintf(qh ferr, 7047, "qhull warning: no dimension given for Qhull option %c. Ignored\n", + key); + continue; + } + idx= qh_strtol(s, &s); + if (idx >= maxdim) { + qh_fprintf(qh ferr, 7048, "qhull warning: dimension %d for Qhull option %c is >= %d. Ignored\n", + idx, key, maxdim); + continue; + } + if (*s == ':') { + s++; + value= qh_strtod(s, &s); + }else if (key == 'b') + value= -qh_DEFAULTbox; + else + value= qh_DEFAULTbox; + if (key == 'b') + qh lower_bound[idx]= value; + else + qh upper_bound[idx]= value; + } } }else { while (*s && !isspace(*s)) diff --git a/src/index.htm b/src/index.htm index 16c73bf..8948f9c 100644 --- a/src/index.htm +++ b/src/index.htm @@ -12,13 +12,13 @@ content="text/html; charset=iso-8859-1"> href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="../html/index.htm#TOC">Qhull manual</a>: Table of Contents <br> <b>Up:</b> <a href="../html/qh-quick.htm#programs">Programs</a> -• <a href="../html/qh-quick.htm#options">Options</a> -• <a href="../html/qh-opto.htm#output">Output</a> -• <a href="../html/qh-optf.htm#format">Formats</a> -• <a href="../html/qh-optg.htm#geomview">Geomview</a> +• <a href="../html/qh-quick.htm#options">Options</a> +• <a href="../html/qh-opto.htm#output">Output</a> +• <a href="../html/qh-optf.htm#format">Formats</a> +• <a href="../html/qh-optg.htm#geomview">Geomview</a> • <a href="../html/qh-optp.htm#print">Print</a> -• <a href="../html/qh-optq.htm#qhull">Qhull</a> -• <a href="../html/qh-optc.htm#prec">Precision</a> +• <a href="../html/qh-optq.htm#qhull">Qhull</a> +• <a href="../html/qh-optc.htm#prec">Precision</a> • <a href="../html/qh-optt.htm#trace">Trace</a><br> <b>Up:</b> <a href="../html/qh-code.htm#TOC">Qhull code</a><br> <b>To:</b> <a href="#TOC">Qhull files</a><br> @@ -34,8 +34,8 @@ href="http://www.qhull.org">Home page</a> for Qhull<br> <h1>Qhull functions, macros, and data structures</h1> <blockquote> <p>The following sections provide an overview and index to -Qhull's functions, macros, and data structures. Each -section starts with an introduction. Also see <a href=../html/qh-code.htm#library>Calling +Qhull's functions, macros, and data structures. Each +section starts with an introduction. Also see <a href=../html/qh-code.htm#library>Calling Qhull from C programs</a> and <a href="../html/qh-code.htm#cpp">Calling Qhull from C++ programs</a>.</p> <p>Qhull uses the following conventions:</p> @@ -58,13 +58,13 @@ Qhull from C programs</a> and <a href="../html/qh-code.htm#cpp">Calling Qhull fr </ul> </blockquote> <p> -When reading the code, please note that the +When reading the code, please note that the global data structure, 'qh', is a macro. It either expands to "qh_qh." or to "qh_qh->". The later is used for applications which run concurrent calls to qh_qhull(). <p> -When reading code with an editor, a search for +When reading code with an editor, a search for <i>"procedure</i> will locate the header of <i>qh_procedure</i>. A search for <i>* procedure</i> will locate the tail of <i>qh_procedure</i>. @@ -76,10 +76,10 @@ determine the corresponding <a href="libqhull.h#qh_PRINT">qh_PRINT...</a> consta Search <a href="io.c">io.c</a> to learn how the print function is implemented.</p> <p>If your web browser loads .c and .h files with an external application, -change the MIME type of .c and .h files to "text/html". +change the MIME type of .c and .h files to "text/html". Opera does not always work since it treats '<' characters as HTML tags. <p> -Please report documentation and link errors +Please report documentation and link errors to <a href="mailto:qhull-bug@qhull.org">qhull-bug@qhull.org</a>. <p> <i>Brad Barber, Cambridge MA, June 1, 2002</i> @@ -102,7 +102,7 @@ refer to these files for detailed information.</p> <dd>Include file for the Qhull library, <tt>qhull.a</tt>. Data structures are documented under <a href="qh-poly.htm">Poly</a>. Global variables are documented under <a href="qh-globa.htm">Global</a>. -Other data structures and variables are documented under +Other data structures and variables are documented under <a href="qh-qhull.htm#TOC">Qhull</a> or <a href="qh-geom.htm"><b>Geom</b></a><b>.</b></dd> <dt> </dt> @@ -124,7 +124,7 @@ in <tt>geom.c</tt> while infrequent ones are in <tt>geom2.c</tt>. <a href="libqhull.h"><b>libqhull.h</b></a> </dt> <dd>Global routines. Qhull uses a global data structure, <tt>qh</tt>, to store globally defined constants, lists, sets, and -variables. +variables. <tt>global.c</tt> initializes and frees these structures. </dd> @@ -207,22 +207,22 @@ the code with defined constants and specialized routines. </blockquote> <p><!-- Navigation links --> </p> <hr> -<p><b>Up:</b> +<p><b>Up:</b> <a href="http://www.qhull.org">Home page for Qhull</a> <br> <b>Up:</b> <a href="../html/index.htm#TOC">Qhull manual: Table of Contents</a> <br> <b>Up:</b> <a href="../html/qh-quick.htm#programs">Programs</a> -• <a href="../html/qh-quick.htm#options">Options</a> -• <a href="../html/qh-opto.htm#output">Output</a> -• <a href="../html/qh-optf.htm#format">Formats</a> -• <a href="../html/qh-optg.htm#geomview">Geomview</a> +• <a href="../html/qh-quick.htm#options">Options</a> +• <a href="../html/qh-opto.htm#output">Output</a> +• <a href="../html/qh-optf.htm#format">Formats</a> +• <a href="../html/qh-optg.htm#geomview">Geomview</a> • <a href="../html/qh-optp.htm#print">Print</a> -• <a href="../html/qh-optq.htm#qhull">Qhull</a> -• <a href="../html/qh-optc.htm#prec">Precision</a> +• <a href="../html/qh-optq.htm#qhull">Qhull</a> +• <a href="../html/qh-optc.htm#prec">Precision</a> • <a href="../html/qh-optt.htm#trace">Trace</a><br> <b>Up:</b> <a href="../html/qh-code.htm#TOC">Qhull code: Table of Contents</a> <br> <b>To:</b> <a href="#TOC">Qhull files</a><br> -<b>To:</b> <a href="qh-geom.htm">Geom</a> • +<b>To:</b> <a href="qh-geom.htm">Geom</a> • <a href="qh-globa.htm">Global</a> • <a href="qh-io.htm">Io</a> • <a href="qh-mem.htm">Mem</a> • <a href="qh-merge.htm">Merge</a> • <a href="qh-poly.htm">Poly</a> • <a href="qh-qhull.htm#TOC">Qhull</a> diff --git a/src/io.c b/src/io.c index 3cafbf7..337c6e2 100644 --- a/src/io.c +++ b/src/io.c @@ -14,8 +14,8 @@ This allows the user to avoid loading io.o from qhull.a copyright (c) 1993-2010 The Geometry Center. - $Id: //product/qhull/main/rel/src/io.c#34 $$Change: 1144 $ - $DateTime: 2010/01/04 18:23:37 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/io.c#35 $$Change: 1164 $ + $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ */ #include "qhull_a.h" @@ -37,20 +37,20 @@ prints output in qh.PRINTout order */ void qh_produce_output(void) { - int tempsize= qh_setsize((setT*)qhmem.tempstack); + int tempsize= qh_setsize(qhmem.tempstack); qh_prepare_output(); qh_produce_output2(); - if (qh_setsize((setT*)qhmem.tempstack) != tempsize) { + if (qh_setsize(qhmem.tempstack) != tempsize) { qh_fprintf(qh ferr, 6206, "qhull internal error (qh_produce_output): temporary sets not empty(%d)\n", - qh_setsize((setT*)qhmem.tempstack)); + qh_setsize(qhmem.tempstack)); qh_errexit(qh_ERRqhull, NULL, NULL); } } /* produce_output */ void qh_produce_output2(void) { - int i, tempsize= qh_setsize((setT*)qhmem.tempstack), d_1; + int i, tempsize= qh_setsize(qhmem.tempstack), d_1; if (qh PRINTsummary) qh_printsummary(qh ferr); @@ -74,9 +74,9 @@ void qh_produce_output2(void) { (int)sizeof(vertexT), (int)sizeof(facetT), qh normal_size, d_1, d_1 + SETelemsize); } - if (qh_setsize((setT*)qhmem.tempstack) != tempsize) { + if (qh_setsize(qhmem.tempstack) != tempsize) { qh_fprintf(qh ferr, 6065, "qhull internal error (qh_produce_output2): temporary sets not empty(%d)\n", - qh_setsize((setT*)qhmem.tempstack)); + qh_setsize(qhmem.tempstack)); qh_errexit(qh_ERRqhull, NULL, NULL); } } /* produce_output2 */ @@ -1081,7 +1081,7 @@ void qh_prepare_output(void) { qh_getarea(qh facet_list); if (qh KEEParea || qh KEEPmerge || qh KEEPminArea < REALmax/2) qh_markkeep (qh facet_list); - if (qh PRINTstatistics) + if (qh PRINTstatistics) qh_collectstatistics(); } @@ -4032,13 +4032,13 @@ boolT qh_skipfacet(facetT *facet) { skips leading spaces ends with spacing or eol if starts with ' or " ends with the same, skipping \' or \" - For qhull, qh_argv_to_command() only uses double quotes + For qhull, qh_argv_to_command() only uses double quotes */ char *qh_skipfilename(char *filename) { char *s= filename; /* non-const due to return */ char c; - while (*s && isspace(*s)) + while (*s && isspace(*s)) s++; c= *s++; if (c == '\0') { diff --git a/src/io.h b/src/io.h index e622463..eb78b75 100644 --- a/src/io.h +++ b/src/io.h @@ -1,14 +1,14 @@ /*<html><pre> -<a href="qh-io.htm" >-------------------------------</a><a name="TOP">-</a> - io.h + io.h declarations of Input/Output functions see README, libqhull.h and io.c copyright (c) 1993-2010 The Geometry Center. - $Id: //product/qhull/main/rel/src/io.h#24 $$Change: 1137 $ - $DateTime: 2010/01/02 21:58:11 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/io.h#25 $$Change: 1164 $ + $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ */ #ifndef qhDEFio @@ -20,7 +20,7 @@ /*-<a href="qh-io.htm#TOC" >--------------------------------</a><a name="qh_MAXfirst">-</a> - + qh_MAXfirst maximum length of first two lines of stdin */ @@ -28,7 +28,7 @@ /*-<a href="qh-io.htm#TOC" >--------------------------------</a><a name="qh_MINradius">-</a> - + qh_MINradius min radius for Gp and Gv, fraction of maxcoord */ @@ -36,16 +36,16 @@ /*-<a href="qh-io.htm#TOC" >--------------------------------</a><a name="qh_GEOMepsilon">-</a> - + qh_GEOMepsilon - adjust outer planes for 'lines closer' and geomview roundoff. + adjust outer planes for 'lines closer' and geomview roundoff. This prevents bleed through. */ #define qh_GEOMepsilon 2e-3 /*-<a href="qh-io.htm#TOC" >--------------------------------</a><a name="qh_WHITESPACE">-</a> - + qh_WHITESPACE possible values of white space */ @@ -54,7 +54,7 @@ /*-<a href="qh-io.htm#TOC" >--------------------------------</a><a name="RIDGE">-</a> - + qh_RIDGE to select which ridges to print in qh_eachvoronoi */ @@ -66,7 +66,7 @@ qh_RIDGE; /*-<a href="qh-io.htm#TOC" >--------------------------------</a><a name="printvridgeT">-</a> - + printvridgeT prints results of qh_printvdiagram @@ -79,81 +79,81 @@ typedef void (*printvridgeT)(FILE *fp, vertexT *vertex, vertexT *vertexA, setT * void dfacet(unsigned id); void dvertex(unsigned id); -int qh_compare_facetarea(const void *p1, const void *p2); -int qh_compare_facetmerge(const void *p1, const void *p2); -int qh_compare_facetvisit(const void *p1, const void *p2); -int qh_compare_vertexpoint(const void *p1, const void *p2); /* not used */ +int qh_compare_facetarea(const void *p1, const void *p2); +int qh_compare_facetmerge(const void *p1, const void *p2); +int qh_compare_facetvisit(const void *p1, const void *p2); +int qh_compare_vertexpoint(const void *p1, const void *p2); /* not used */ void qh_copyfilename(char *filename, int size, const char* source, int length); -void qh_countfacets(facetT *facetlist, setT *facets, boolT printall, - int *numfacetsp, int *numsimplicialp, int *totneighborsp, +void qh_countfacets(facetT *facetlist, setT *facets, boolT printall, + int *numfacetsp, int *numsimplicialp, int *totneighborsp, int *numridgesp, int *numcoplanarsp, int *numnumtricoplanarsp); pointT *qh_detvnorm(vertexT *vertex, vertexT *vertexA, setT *centers, realT *offsetp); setT *qh_detvridge(vertexT *vertex); setT *qh_detvridge3 (vertexT *atvertex, vertexT *vertex); int qh_eachvoronoi(FILE *fp, printvridgeT printvridge, vertexT *atvertex, boolT visitall, qh_RIDGE innerouter, boolT inorder); int qh_eachvoronoi_all(FILE *fp, printvridgeT printvridge, boolT isUpper, qh_RIDGE innerouter, boolT inorder); -void qh_facet2point(facetT *facet, pointT **point0, pointT **point1, realT *mindist); +void qh_facet2point(facetT *facet, pointT **point0, pointT **point1, realT *mindist); setT *qh_facetvertices(facetT *facetlist, setT *facets, boolT allfacets); void qh_geomplanes(facetT *facet, realT *outerplane, realT *innerplane); void qh_markkeep(facetT *facetlist); setT *qh_markvoronoi(facetT *facetlist, setT *facets, boolT printall, boolT *isLowerp, int *numcentersp); void qh_order_vertexneighbors(vertexT *vertex); void qh_prepare_output(void); -void qh_printafacet(FILE *fp, qh_PRINT format, facetT *facet, boolT printall); +void qh_printafacet(FILE *fp, qh_PRINT format, facetT *facet, boolT printall); void qh_printbegin(FILE *fp, qh_PRINT format, facetT *facetlist, setT *facets, boolT printall); -void qh_printcenter(FILE *fp, qh_PRINT format, const char *string, facetT *facet); +void qh_printcenter(FILE *fp, qh_PRINT format, const char *string, facetT *facet); void qh_printcentrum(FILE *fp, facetT *facet, realT radius); void qh_printend(FILE *fp, qh_PRINT format, facetT *facetlist, setT *facets, boolT printall); void qh_printend4geom(FILE *fp, facetT *facet, int *num, boolT printall); void qh_printextremes(FILE *fp, facetT *facetlist, setT *facets, boolT printall); void qh_printextremes_2d(FILE *fp, facetT *facetlist, setT *facets, boolT printall); void qh_printextremes_d(FILE *fp, facetT *facetlist, setT *facets, boolT printall); -void qh_printfacet(FILE *fp, facetT *facet); -void qh_printfacet2math(FILE *fp, facetT *facet, qh_PRINT format, int notfirst); -void qh_printfacet2geom(FILE *fp, facetT *facet, realT color[3]); +void qh_printfacet(FILE *fp, facetT *facet); +void qh_printfacet2math(FILE *fp, facetT *facet, qh_PRINT format, int notfirst); +void qh_printfacet2geom(FILE *fp, facetT *facet, realT color[3]); void qh_printfacet2geom_points(FILE *fp, pointT *point1, pointT *point2, - facetT *facet, realT offset, realT color[3]); -void qh_printfacet3math(FILE *fp, facetT *facet, qh_PRINT format, int notfirst); -void qh_printfacet3geom_nonsimplicial(FILE *fp, facetT *facet, realT color[3]); -void qh_printfacet3geom_points(FILE *fp, setT *points, facetT *facet, realT offset, realT color[3]); -void qh_printfacet3geom_simplicial(FILE *fp, facetT *facet, realT color[3]); -void qh_printfacet3vertex(FILE *fp, facetT *facet, qh_PRINT format); -void qh_printfacet4geom_nonsimplicial(FILE *fp, facetT *facet, realT color[3]); -void qh_printfacet4geom_simplicial(FILE *fp, facetT *facet, realT color[3]); -void qh_printfacetNvertex_nonsimplicial(FILE *fp, facetT *facet, int id, qh_PRINT format); -void qh_printfacetNvertex_simplicial(FILE *fp, facetT *facet, qh_PRINT format); + facetT *facet, realT offset, realT color[3]); +void qh_printfacet3math(FILE *fp, facetT *facet, qh_PRINT format, int notfirst); +void qh_printfacet3geom_nonsimplicial(FILE *fp, facetT *facet, realT color[3]); +void qh_printfacet3geom_points(FILE *fp, setT *points, facetT *facet, realT offset, realT color[3]); +void qh_printfacet3geom_simplicial(FILE *fp, facetT *facet, realT color[3]); +void qh_printfacet3vertex(FILE *fp, facetT *facet, qh_PRINT format); +void qh_printfacet4geom_nonsimplicial(FILE *fp, facetT *facet, realT color[3]); +void qh_printfacet4geom_simplicial(FILE *fp, facetT *facet, realT color[3]); +void qh_printfacetNvertex_nonsimplicial(FILE *fp, facetT *facet, int id, qh_PRINT format); +void qh_printfacetNvertex_simplicial(FILE *fp, facetT *facet, qh_PRINT format); void qh_printfacetheader(FILE *fp, facetT *facet); void qh_printfacetridges(FILE *fp, facetT *facet); -void qh_printfacets(FILE *fp, qh_PRINT format, facetT *facetlist, setT *facets, boolT printall); -void qh_printhyperplaneintersection(FILE *fp, facetT *facet1, facetT *facet2, - setT *vertices, realT color[3]); -void qh_printneighborhood(FILE *fp, qh_PRINT format, facetT *facetA, facetT *facetB, boolT printall); +void qh_printfacets(FILE *fp, qh_PRINT format, facetT *facetlist, setT *facets, boolT printall); +void qh_printhyperplaneintersection(FILE *fp, facetT *facet1, facetT *facet2, + setT *vertices, realT color[3]); +void qh_printneighborhood(FILE *fp, qh_PRINT format, facetT *facetA, facetT *facetB, boolT printall); void qh_printline3geom(FILE *fp, pointT *pointA, pointT *pointB, realT color[3]); -void qh_printpoint(FILE *fp, const char *string, pointT *point); -void qh_printpointid(FILE *fp, const char *string, int dim, pointT *point, int id); +void qh_printpoint(FILE *fp, const char *string, pointT *point); +void qh_printpointid(FILE *fp, const char *string, int dim, pointT *point, int id); void qh_printpoint3 (FILE *fp, pointT *point); void qh_printpoints_out(FILE *fp, facetT *facetlist, setT *facets, boolT printall); void qh_printpointvect(FILE *fp, pointT *point, coordT *normal, pointT *center, realT radius, realT color[3]); void qh_printpointvect2 (FILE *fp, pointT *point, coordT *normal, pointT *center, realT radius); -void qh_printridge(FILE *fp, ridgeT *ridge); +void qh_printridge(FILE *fp, ridgeT *ridge); void qh_printspheres(FILE *fp, setT *vertices, realT radius); void qh_printvdiagram(FILE *fp, qh_PRINT format, facetT *facetlist, setT *facets, boolT printall); int qh_printvdiagram2 (FILE *fp, printvridgeT printvridge, setT *vertices, qh_RIDGE innerouter, boolT inorder); -void qh_printvertex(FILE *fp, vertexT *vertex); -void qh_printvertexlist(FILE *fp, const char* string, facetT *facetlist, +void qh_printvertex(FILE *fp, vertexT *vertex); +void qh_printvertexlist(FILE *fp, const char* string, facetT *facetlist, setT *facets, boolT printall); -void qh_printvertices(FILE *fp, const char* string, setT *vertices); +void qh_printvertices(FILE *fp, const char* string, setT *vertices); void qh_printvneighbors(FILE *fp, facetT* facetlist, setT *facets, boolT printall); void qh_printvoronoi(FILE *fp, qh_PRINT format, facetT *facetlist, setT *facets, boolT printall); void qh_printvnorm(FILE *fp, vertexT *vertex, vertexT *vertexA, setT *centers, boolT unbounded); void qh_printvridge(FILE *fp, vertexT *vertex, vertexT *vertexA, setT *centers, boolT unbounded); -void qh_produce_output(void); -void qh_produce_output2(void); +void qh_produce_output(void); +void qh_produce_output2(void); void qh_projectdim3 (pointT *source, pointT *destination); int qh_readfeasible(int dim, const char *curline); coordT *qh_readpoints(int *numpoints, int *dimension, boolT *ismalloc); void qh_setfeasible(int dim); -boolT qh_skipfacet(facetT *facet); +boolT qh_skipfacet(facetT *facet); char *qh_skipfilename(char *filename); #endif /* qhDEFio */ diff --git a/src/libqhull.c b/src/libqhull.c index 47c5b06..0854b0a 100644 --- a/src/libqhull.c +++ b/src/libqhull.c @@ -11,17 +11,17 @@ see qhull_a.h for internal functions copyright (c) 1993-2010 The Geometry Center. - $Id: //product/qhull/main/rel/src/libqhull.c#6 $$Change: 1151 $ - $DateTime: 2010/01/05 19:34:31 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/libqhull.c#7 $$Change: 1164 $ + $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ */ -#include "qhull_a.h" +#include "qhull_a.h" /*============= functions in alphabetic order after qhull() =======*/ /*-<a href="qh-qhull.htm#TOC" >-------------------------------</a><a name="qhull">-</a> - + qh_qhull() compute DIM3 convex hull of qh.num_points starting at qh.first_point qh contains all global options and variables @@ -29,21 +29,21 @@ returns: returns polyhedron qh.facet_list, qh.num_facets, qh.vertex_list, qh.num_vertices, - + returns global variables qh.hulltime, qh.max_outside, qh.interior_point, qh.max_vertex, qh.min_vertex - + returns precision constants qh.ANGLEround, centrum_radius, cos_max, DISTround, MAXabs_coord, ONEmerge notes: unless needed for output qh.max_vertex and qh.min_vertex are max/min due to merges - + see: to add individual points to either qh.num_points use qh_addpoint() - + if qh.GETarea qh_produceoutput() returns qh.totarea and qh.totvol via qh_getarea() @@ -61,7 +61,7 @@ void qh_qhull(void) { int numoutside; qh hulltime= qh_CPUclock; - if (qh RERUN || qh JOGGLEmax < REALmax/2) + if (qh RERUN || qh JOGGLEmax < REALmax/2) qh_build_withrestart(); else { qh_initbuild(); @@ -75,13 +75,13 @@ void qh_qhull(void) { qh DOcheckmax= False; }else { if (qh MERGEexact || (qh hull_dim > qh_DIMreduceBuild && qh PREmerge)) - qh_postmerge("First post-merge", qh premerge_centrum, qh premerge_cos, + qh_postmerge("First post-merge", qh premerge_centrum, qh premerge_cos, (qh POSTmerge ? False : qh TESTvneighbors)); - else if (!qh POSTmerge && qh TESTvneighbors) + else if (!qh POSTmerge && qh TESTvneighbors) qh_postmerge("For testing vertex neighbors", qh premerge_centrum, - qh premerge_cos, True); + qh premerge_cos, True); if (qh POSTmerge) - qh_postmerge("For post-merging", qh postmerge_centrum, + qh_postmerge("For post-merging", qh postmerge_centrum, qh postmerge_cos, qh TESTvneighbors); if (qh visible_list == qh facet_list) { /* i.e., merging done */ qh findbestnew= True; @@ -93,17 +93,17 @@ void qh_qhull(void) { } if (qh DOcheckmax){ if (qh REPORTfreq) { - qh_buildtracing(NULL, NULL); - qh_fprintf(qh ferr, 8115, "\nTesting all coplanar points.\n"); + qh_buildtracing(NULL, NULL); + qh_fprintf(qh ferr, 8115, "\nTesting all coplanar points.\n"); } qh_check_maxout(); } - if (qh KEEPnearinside && !qh maxoutdone) + if (qh KEEPnearinside && !qh maxoutdone) qh_nearcoplanar(); } - if (qh_setsize((setT*)qhmem.tempstack) != 0) { + if (qh_setsize(qhmem.tempstack) != 0) { qh_fprintf(qh ferr, 6164, "qhull internal error (qh_qhull): temporary sets not empty(%d)\n", - qh_setsize((setT*)qhmem.tempstack)); + qh_setsize(qhmem.tempstack)); qh_errexit(qh_ERRqhull, NULL, NULL); } qh hulltime= qh_CPUclock - qh hulltime; @@ -113,18 +113,18 @@ void qh_qhull(void) { /*-<a href="qh-qhull.htm#TOC" >-------------------------------</a><a name="addpoint">-</a> - + qh_addpoint( furthest, facet, checkdist ) - add point (usually furthest point) above facet to hull - if checkdist, + add point (usually furthest point) above facet to hull + if checkdist, check that point is above facet. if point is not outside of the hull, uses qh_partitioncoplanar() assumes that facet is defined by qh_findbestfacet() else if facet specified, assumes that point is above facet (major damage if below) - for Delaunay triangulations, + for Delaunay triangulations, Use qh_setdelaunay() to lift point to paraboloid and scale by 'Qbb' if needed - Do not use options 'Qbk', 'QBk', or 'QbB' since they scale the coordinates. + Do not use options 'Qbk', 'QBk', or 'QbB' since they scale the coordinates. returns: returns False if user requested an early termination @@ -133,7 +133,7 @@ void qh_qhull(void) { clear qh.maxoutdone (will need to call qh_check_maxout() for facet->maxoutside) if unknown point, adds a pointer to qh.other_points do not deallocate the point's coordinates - + notes: assumes point is near its best facet and not at a local minimum of a lens distributions. Use qh_findbestfacet to avoid this case. @@ -146,7 +146,7 @@ void qh_qhull(void) { add point to other_points if needed if checkdist if point not above facet - partition coplanar point + partition coplanar point exit exit if pre STOPpoint requested find horizon and visible facets for point @@ -182,7 +182,7 @@ boolT qh_addpoint(pointT *furthest, facetT *facet, boolT checkdist) { } if (checkdist) { facet= qh_findbest(furthest, facet, !qh_ALL, !qh_ISnewfacets, !qh_NOupper, - &dist, &isoutside, &numpart); + &dist, &isoutside, &numpart); zzadd_(Zpartition, numpart); if (!isoutside) { zinc_(Znotmax); /* last point of outsideset is no longer furthest. */ @@ -196,9 +196,9 @@ boolT qh_addpoint(pointT *furthest, facetT *facet, boolT checkdist) { facet->notfurthest= True; return False; } - qh_findhorizon(furthest, facet, &goodvisible, &goodhorizon); + qh_findhorizon(furthest, facet, &goodvisible, &goodhorizon); if (qh ONLYgood && !(goodvisible+goodhorizon) && !qh GOODclosest) { - zinc_(Znotgood); + zinc_(Znotgood); facet->notfurthest= True; /* last point of outsideset is no longer furthest. This is ok since all points of the outside are likely to be bad */ @@ -214,9 +214,9 @@ boolT qh_addpoint(pointT *furthest, facetT *facet, boolT checkdist) { * qh hull_dim/qh num_vertices; wadd_(Wnewbalance, newbalance); wadd_(Wnewbalance2, newbalance * newbalance); - if (qh ONLYgood + if (qh ONLYgood && !qh_findgood(qh newfacet_list, goodhorizon) && !qh GOODclosest) { - FORALLnew_facets + FORALLnew_facets qh_delfacet(newfacet); qh_delvertex(vertex); qh_resetlists(True, qh_RESETvisible /*qh visible_list newvertex_list newfacet_list */); @@ -239,10 +239,10 @@ boolT qh_addpoint(pointT *furthest, facetT *facet, boolT checkdist) { qh findbestnew= True; else { FORALLnew_facets { - if (!newfacet->simplicial) { - qh findbestnew= True; /* use qh_findbestnew instead of qh_findbest*/ - break; - } + if (!newfacet->simplicial) { + qh findbestnew= True; /* use qh_findbestnew instead of qh_findbest*/ + break; + } } } }else if (qh BESToutside) @@ -269,8 +269,8 @@ boolT qh_addpoint(pointT *furthest, facetT *facet, boolT checkdist) { else qh_checkpolygon(qh newfacet_list); } - if (qh STOPpoint > 0 && qh furthest_id == qh STOPpoint-1) - return False; + if (qh STOPpoint > 0 && qh furthest_id == qh STOPpoint-1) + return False; qh_resetlists(True, qh_RESETvisible /*qh visible_list newvertex_list newfacet_list */); /* qh_triangulate(); to test qh.TRInormals */ trace2((qh ferr, 2056, "qh_addpoint: added p%d new facets %d new balance %2.2g point balance %2.2g\n", @@ -280,7 +280,7 @@ boolT qh_addpoint(pointT *furthest, facetT *facet, boolT checkdist) { /*-<a href="qh-qhull.htm#TOC" >-------------------------------</a><a name="build_withrestart">-</a> - + qh_build_withrestart() allow restarts due to qh.JOGGLEmax while calling qh_buildhull() qh.FIRSTpoint/qh.NUMpoints is point array @@ -300,14 +300,14 @@ void qh_build_withrestart(void) { } if (!qh RERUN && qh JOGGLEmax < REALmax/2) { if (qh build_cnt > qh_JOGGLEmaxretry) { - qh_fprintf(qh ferr, 6229, "qhull precision error: %d attempts to construct a convex hull\n\ + qh_fprintf(qh ferr, 6229, "qhull precision error: %d attempts to construct a convex hull\n\ with joggled input. Increase joggle above 'QJ%2.2g'\n\ - or modify qh_JOGGLE... parameters in user.h\n", - qh build_cnt, qh JOGGLEmax); - qh_errexit(qh_ERRqhull, NULL, NULL); + or modify qh_JOGGLE... parameters in user.h\n", + qh build_cnt, qh JOGGLEmax); + qh_errexit(qh_ERRqhull, NULL, NULL); } if (qh build_cnt && !restart) - break; + break; }else if (qh build_cnt && qh build_cnt >= qh RERUN) break; qh STOPcone= 0; @@ -315,7 +315,7 @@ void qh_build_withrestart(void) { qh build_cnt++; if (!qh qhull_optionsiz) qh qhull_optionsiz= (int)strlen(qh qhull_options); /* WARN64 */ - else { + else { qh qhull_options [qh qhull_optionsiz]= '\0'; qh qhull_optionlen= qh_OPTIONline; /* starts a new line */ } @@ -340,12 +340,12 @@ void qh_build_withrestart(void) { /*-<a href="qh-qhull.htm#TOC" >-------------------------------</a><a name="buildhull">-</a> - + qh_buildhull() construct a convex hull by adding outside points one at a time returns: - + notes: may be called multiple times checks facet and vertex lists for incorrect flags @@ -365,12 +365,12 @@ void qh_buildhull(void) { pointT *furthest; vertexT *vertex; int id; - + trace1((qh ferr, 1037, "qh_buildhull: start build hull\n")); FORALLfacets { if (facet->visible || facet->newfacet) { qh_fprintf(qh ferr, 6165, "qhull internal error (qh_buildhull): visible or new facet f%d in facet list\n", - facet->id); + facet->id); qh_errexit(qh_ERRqhull, facet, NULL); } } @@ -383,8 +383,8 @@ void qh_buildhull(void) { } id= qh_pointid(vertex->point); if ((qh STOPpoint>0 && id == qh STOPpoint-1) || - (qh STOPpoint<0 && id == -qh STOPpoint-1) || - (qh STOPcone>0 && id == qh STOPcone-1)) { + (qh STOPpoint<0 && id == -qh STOPpoint-1) || + (qh STOPcone>0 && id == qh STOPcone-1)) { trace1((qh ferr, 1038,"qh_buildhull: stop point or cone P%d in initial hull\n", id)); return; } @@ -403,11 +403,11 @@ void qh_buildhull(void) { } trace1((qh ferr, 1039, "qh_buildhull: completed the hull construction\n")); } /* buildhull */ - + /*-<a href="qh-qhull.htm#TOC" >-------------------------------</a><a name="buildtracing">-</a> - + qh_buildtracing( furthest, facet ) trace an iteration of qh_buildhull() for furthest point and facet if !furthest, prints progress message @@ -506,7 +506,7 @@ At %02d:%02d:%02d & %2.5g CPU secs, qhull has created %d facets and merged %d.\n /*-<a href="qh-qhull.htm#TOC" >-------------------------------</a><a name="errexit2">-</a> - + qh_errexit2( exitcode, facet, otherfacet ) return exitcode to system after an error report two facets @@ -518,7 +518,7 @@ At %02d:%02d:%02d & %2.5g CPU secs, qhull has created %d facets and merged %d.\n normally use qh_errexit() in user.c(reports a facet and a ridge) */ void qh_errexit2(int exitcode, facetT *facet, facetT *otherfacet) { - + qh_errprint("ERRONEOUS", facet, otherfacet, NULL, NULL); qh_errexit(exitcode, NULL, NULL); } /* errexit2 */ @@ -526,14 +526,14 @@ void qh_errexit2(int exitcode, facetT *facet, facetT *otherfacet) { /*-<a href="qh-qhull.htm#TOC" >-------------------------------</a><a name="findhorizon">-</a> - + qh_findhorizon( point, facet, goodvisible, goodhorizon ) given a visible facet, find the point's horizon and visible facets for all facets, !facet-visible returns: - returns qh.visible_list/num_visible with all visible facets - marks visible facets with ->visible + returns qh.visible_list/num_visible with all visible facets + marks visible facets with ->visible updates count of good visible and good horizon facets updates qh.max_outside, qh.max_vertex, facet->maxoutside @@ -550,13 +550,13 @@ void qh_errexit2(int exitcode, facetT *facet, facetT *otherfacet) { else if point is coplanar with neighbor update qh.max_outside, qh.max_vertex, neighbor->maxoutside mark neighbor coplanar (will create a samecycle later) - update horizon statistics + update horizon statistics */ void qh_findhorizon(pointT *point, facetT *facet, int *goodvisible, int *goodhorizon) { facetT *neighbor, **neighborp, *visible; int numhorizon= 0, coplanar= 0; realT dist; - + trace1((qh ferr, 1040,"qh_findhorizon: find horizon for point p%d facet f%d\n",qh_pointid(point),facet->id)); *goodvisible= *goodhorizon= 0; zinc_(Ztotvisible); @@ -578,46 +578,46 @@ void qh_findhorizon(pointT *point, facetT *facet, int *goodvisible, int *goodhor } visible->visitid= qh visit_id; FOREACHneighbor_(visible) { - if (neighbor->visitid == qh visit_id) + if (neighbor->visitid == qh visit_id) continue; neighbor->visitid= qh visit_id; zzinc_(Znumvisibility); qh_distplane(point, neighbor, &dist); if (dist > qh MINvisible) { zinc_(Ztotvisible); - qh_removefacet(neighbor); /* append to end of qh visible_list */ - qh_appendfacet(neighbor); - neighbor->visible= True; + qh_removefacet(neighbor); /* append to end of qh visible_list */ + qh_appendfacet(neighbor); + neighbor->visible= True; neighbor->f.replace= NULL; - qh num_visible++; - if (neighbor->good) - (*goodvisible)++; + qh num_visible++; + if (neighbor->good) + (*goodvisible)++; if (qh IStracing >=4) qh_errprint("visible", neighbor, NULL, NULL, NULL); }else { - if (dist > - qh MAXcoplanar) { - neighbor->coplanar= True; + if (dist > - qh MAXcoplanar) { + neighbor->coplanar= True; zzinc_(Zcoplanarhorizon); qh_precision("coplanar horizon"); - coplanar++; - if (qh MERGING) { - if (dist > 0) { - maximize_(qh max_outside, dist); - maximize_(qh max_vertex, dist); + coplanar++; + if (qh MERGING) { + if (dist > 0) { + maximize_(qh max_outside, dist); + maximize_(qh max_vertex, dist); #if qh_MAXoutside - maximize_(neighbor->maxoutside, dist); + maximize_(neighbor->maxoutside, dist); #endif - }else - minimize_(qh min_vertex, dist); /* due to merge later */ - } - trace2((qh ferr, 2057, "qh_findhorizon: point p%d is coplanar to horizon f%d, dist=%2.7g < qh MINvisible(%2.7g)\n", - qh_pointid(point), neighbor->id, dist, qh MINvisible)); - }else - neighbor->coplanar= False; - zinc_(Ztothorizon); + }else + minimize_(qh min_vertex, dist); /* due to merge later */ + } + trace2((qh ferr, 2057, "qh_findhorizon: point p%d is coplanar to horizon f%d, dist=%2.7g < qh MINvisible(%2.7g)\n", + qh_pointid(point), neighbor->id, dist, qh MINvisible)); + }else + neighbor->coplanar= False; + zinc_(Ztothorizon); numhorizon++; - if (neighbor->good) - (*goodhorizon)++; + if (neighbor->good) + (*goodhorizon)++; if (qh IStracing >=4) qh_errprint("horizon", neighbor, NULL, NULL, NULL); } @@ -630,15 +630,15 @@ QhullPoint p%d was above all facets.\n", qh_pointid(point)); qh_printfacetlist(qh facet_list, NULL, True); qh_errexit(qh_ERRprec, NULL, NULL); } - trace1((qh ferr, 1041, "qh_findhorizon: %d horizon facets(good %d), %d visible(good %d), %d coplanar\n", + trace1((qh ferr, 1041, "qh_findhorizon: %d horizon facets(good %d), %d visible(good %d), %d coplanar\n", numhorizon, *goodhorizon, qh num_visible, *goodvisible, coplanar)); - if (qh IStracing >= 4 && qh num_facets < 50) + if (qh IStracing >= 4 && qh num_facets < 50) qh_printlists(); } /* findhorizon */ /*-<a href="qh-qhull.htm#TOC" >-------------------------------</a><a name="nextfurthest">-</a> - + qh_nextfurthest( visible ) returns next furthest point and visible facet for qh_addpoint() starts search at qh.facet_next @@ -646,7 +646,7 @@ QhullPoint p%d was above all facets.\n", qh_pointid(point)); returns: removes furthest point from outside set NULL if none available - advances qh.facet_next over facets with empty outside sets + advances qh.facet_next over facets with empty outside sets design: for each facet from qh.facet_next @@ -676,8 +676,8 @@ pointT *qh_nextfurthest(facetT **visible) { continue; } if (qh NARROWhull) { - if (facet->notfurthest) - qh_furthestout(facet); + if (facet->notfurthest) + qh_furthestout(facet); furthest= (pointT*)qh_setlast(facet->outsideset); #if qh_COMPUTEfurthest qh_distplane(furthest, facet, &dist); @@ -686,14 +686,14 @@ pointT *qh_nextfurthest(facetT **visible) { dist= facet->furthestdist; #endif if (dist < qh MINoutside) { /* remainder of outside set is coplanar for qh_outcoplanar */ - qh facet_next= facet->next; - continue; + qh facet_next= facet->next; + continue; } } if (!qh RANDOMoutside && !qh VIRTUALmemory) { if (qh PICKfurthest) { - qh_furthestnext(/* qh facet_list */); - facet= qh facet_next; + qh_furthestnext(/* qh facet_list */); + facet= qh facet_next; } *visible= facet; return((pointT*)qh_setdellast(facet->outsideset)); @@ -702,11 +702,11 @@ pointT *qh_nextfurthest(facetT **visible) { int outcoplanar = 0; if (qh NARROWhull) { FORALLfacets { - if (facet == qh facet_next) - break; - if (facet->outsideset) - outcoplanar += qh_setsize( facet->outsideset); - } + if (facet == qh facet_next) + break; + if (facet->outsideset) + outcoplanar += qh_setsize( facet->outsideset); + } } randr= qh_RANDOMint; randr= randr/(qh_RANDOMmax+1); @@ -744,7 +744,7 @@ pointT *qh_nextfurthest(facetT **visible) { /*-<a href="qh-qhull.htm#TOC" >-------------------------------</a><a name="partitionall">-</a> - + qh_partitionall( vertices, points, numpoints ) partitions all points in points/numpoints to the outsidesets of facets vertices= vertices in qh.facet_list(!partitioned) @@ -752,7 +752,7 @@ pointT *qh_nextfurthest(facetT **visible) { returns: builds facet->outsideset does not partition qh.GOODpoint - if qh.ONLYgood && !qh.MERGING, + if qh.ONLYgood && !qh.MERGING, does not partition qh.GOODvertex notes: @@ -780,7 +780,7 @@ void qh_partitionall(setT *vertices, pointT *points, int numpoints){ int size, point_i, point_n, point_end, remaining, i, id; facetT *facet; realT bestdist= -REALmax, dist, distoutside; - + trace1((qh ferr, 1042, "qh_partitionall: partition all points into outside sets\n")); pointset= qh_settemp(numpoints); qh num_outside= 0; @@ -816,7 +816,7 @@ void qh_partitionall(setT *vertices, pointT *points, int numpoints){ if (dist < distoutside) SETelem_(pointset, point_end++)= point; else { - qh num_outside++; + qh num_outside++; if (!bestpoint) { bestpoint= point; bestdist= dist; @@ -824,7 +824,7 @@ void qh_partitionall(setT *vertices, pointT *points, int numpoints){ qh_setappend(&facet->outsideset, bestpoint); bestpoint= point; bestdist= dist; - }else + }else qh_setappend(&facet->outsideset, point); } } @@ -832,7 +832,7 @@ void qh_partitionall(setT *vertices, pointT *points, int numpoints){ if (bestpoint) { qh_setappend(&facet->outsideset, bestpoint); #if !qh_COMPUTEfurthest - facet->furthestdist= bestdist; + facet->furthestdist= bestdist; #endif }else qh_setfree(&facet->outsideset); @@ -842,7 +842,7 @@ void qh_partitionall(setT *vertices, pointT *points, int numpoints){ /* if !qh BESToutside, pointset contains points not assigned to outsideset */ if (qh BESToutside || qh MERGING || qh KEEPcoplanar || qh KEEPinside) { qh findbestnew= True; - FOREACHpoint_i_(pointset) { + FOREACHpoint_i_(pointset) { if (point) qh_partitionpoint(point, qh facet_list); } @@ -858,20 +858,20 @@ void qh_partitionall(setT *vertices, pointT *points, int numpoints){ /*-<a href="qh-qhull.htm#TOC" >-------------------------------</a><a name="partitioncoplanar">-</a> - + qh_partitioncoplanar( point, facet, dist ) partition coplanar point to a facet dist is distance from point to facet - if dist NULL, + if dist NULL, searches for bestfacet and does nothing if inside - if qh.findbestnew set, + if qh.findbestnew set, searches new facets instead of using qh_findbest() returns: qh.max_ouside updated if qh.KEEPcoplanar or qh.KEEPinside point assigned to best coplanarset - + notes: facet->maxoutside is updated at end by qh_check_maxout @@ -904,21 +904,21 @@ void qh_partitioncoplanar(pointT *point, facetT *facet, realT *dist) { if (qh findbestnew) bestfacet= qh_findbestnew(point, facet, &bestdist, qh_ALL, &isoutside, &numpart); else - bestfacet= qh_findbest(point, facet, qh_ALL, !qh_ISnewfacets, qh DELAUNAY, + bestfacet= qh_findbest(point, facet, qh_ALL, !qh_ISnewfacets, qh DELAUNAY, &bestdist, &isoutside, &numpart); zinc_(Ztotpartcoplanar); zzadd_(Zpartcoplanar, numpart); if (!qh DELAUNAY && !qh KEEPinside) { /* for 'd', bestdist skips upperDelaunay facets */ if (qh KEEPnearinside) { - if (bestdist < -qh NEARinside) { + if (bestdist < -qh NEARinside) { zinc_(Zcoplanarinside); - trace4((qh ferr, 4062, "qh_partitioncoplanar: point p%d is more than near-inside facet f%d dist %2.2g findbestnew %d\n", - qh_pointid(point), bestfacet->id, bestdist, qh findbestnew)); + trace4((qh ferr, 4062, "qh_partitioncoplanar: point p%d is more than near-inside facet f%d dist %2.2g findbestnew %d\n", + qh_pointid(point), bestfacet->id, bestdist, qh findbestnew)); return; } }else if (bestdist < -qh MAXcoplanar) { - trace4((qh ferr, 4063, "qh_partitioncoplanar: point p%d is inside facet f%d dist %2.2g findbestnew %d\n", - qh_pointid(point), bestfacet->id, bestdist, qh findbestnew)); + trace4((qh ferr, 4063, "qh_partitioncoplanar: point p%d is inside facet f%d dist %2.2g findbestnew %d\n", + qh_pointid(point), bestfacet->id, bestdist, qh findbestnew)); zinc_(Zcoplanarinside); return; } @@ -928,26 +928,26 @@ void qh_partitioncoplanar(pointT *point, facetT *facet, realT *dist) { bestdist= *dist; } if (bestdist > qh max_outside) { - if (!dist && facet != bestfacet) { + if (!dist && facet != bestfacet) { zinc_(Zpartangle); angle= qh_getangle(facet->normal, bestfacet->normal); if (angle < 0) { - /* typically due to deleted vertex and coplanar facets, e.g., - RBOX 1000 s Z1 G1e-13 t1001185205 | QHULL Tv */ - zinc_(Zpartflip); - trace2((qh ferr, 2058, "qh_partitioncoplanar: repartition point p%d from f%d. It is above flipped facet f%d dist %2.2g\n", - qh_pointid(point), facet->id, bestfacet->id, bestdist)); - oldfindbest= qh findbestnew; + /* typically due to deleted vertex and coplanar facets, e.g., + RBOX 1000 s Z1 G1e-13 t1001185205 | QHULL Tv */ + zinc_(Zpartflip); + trace2((qh ferr, 2058, "qh_partitioncoplanar: repartition point p%d from f%d. It is above flipped facet f%d dist %2.2g\n", + qh_pointid(point), facet->id, bestfacet->id, bestdist)); + oldfindbest= qh findbestnew; qh findbestnew= False; - qh_partitionpoint(point, bestfacet); + qh_partitionpoint(point, bestfacet); qh findbestnew= oldfindbest; - return; + return; } } qh max_outside= bestdist; if (bestdist > qh TRACEdist) { qh_fprintf(qh ferr, 8122, "qh_partitioncoplanar: ====== p%d from f%d increases max_outside to %2.2g of f%d last p%d\n", - qh_pointid(point), facet->id, bestdist, bestfacet->id, qh furthest_id); + qh_pointid(point), facet->id, bestdist, bestfacet->id, qh furthest_id); qh_errprint("DISTANT", facet, bestfacet, NULL, NULL); } } @@ -957,30 +957,30 @@ void qh_partitioncoplanar(pointT *point, facetT *facet, realT *dist) { zinc_(Zcomputefurthest); qh_distplane(oldfurthest, bestfacet, &dist2); } - if (!oldfurthest || dist2 < bestdist) + if (!oldfurthest || dist2 < bestdist) qh_setappend(&bestfacet->coplanarset, point); - else + else qh_setappend2ndlast(&bestfacet->coplanarset, point); } trace4((qh ferr, 4064, "qh_partitioncoplanar: point p%d is coplanar with facet f%d(or inside) dist %2.2g\n", - qh_pointid(point), bestfacet->id, bestdist)); + qh_pointid(point), bestfacet->id, bestdist)); } /* partitioncoplanar */ /*-<a href="qh-qhull.htm#TOC" >-------------------------------</a><a name="partitionpoint">-</a> - + qh_partitionpoint( point, facet ) assigns point to an outside set, coplanar set, or inside set (i.e., dropt) if qh.findbestnew uses qh_findbestnew() to search all new facets else uses qh_findbest() - + notes: after qh_distplane(), this and qh_findbest() are most expensive in 3-d design: - find best facet for point + find best facet for point (either exhaustive search of new facets or directed search from facet) if qh.NARROWhull retain coplanar and nearinside points as outside points @@ -995,10 +995,10 @@ void qh_partitioncoplanar(pointT *point, facetT *facet, realT *dist) { else if point is coplanar to bestfacet if keeping coplanar points or need to update qh.max_outside partition coplanar point into bestfacet - else if near-inside point + else if near-inside point partition as coplanar point into bestfacet else is an inside point - if keeping inside points + if keeping inside points partition as coplanar point into bestfacet */ void qh_partitionpoint(pointT *point, facetT *facet) { @@ -1014,7 +1014,7 @@ void qh_partitionpoint(pointT *point, facetT *facet) { bestfacet= qh_findbestnew(point, facet, &bestdist, qh BESToutside, &isoutside, &numpart); else bestfacet= qh_findbest(point, facet, qh BESToutside, qh_ISnewfacets, !qh_NOupper, - &bestdist, &isoutside, &numpart); + &bestdist, &isoutside, &numpart); zinc_(Ztotpartition); zzadd_(Zpartition, numpart); if (qh NARROWhull) { @@ -1022,13 +1022,13 @@ void qh_partitionpoint(pointT *point, facetT *facet) { qh_precision("nearly incident point(narrow hull)"); if (qh KEEPnearinside) { if (bestdist >= -qh NEARinside) - isoutside= True; + isoutside= True; }else if (bestdist >= -qh MAXcoplanar) isoutside= True; } if (isoutside) { - if (!bestfacet->outsideset + if (!bestfacet->outsideset || !qh_setlast(bestfacet->outsideset)) { qh_setappend(&(bestfacet->outsideset), point); if (!bestfacet->newfacet) { @@ -1042,30 +1042,30 @@ void qh_partitionpoint(pointT *point, facetT *facet) { #if qh_COMPUTEfurthest zinc_(Zcomputefurthest); qh_distplane(oldfurthest, bestfacet, &dist); - if (dist < bestdist) - qh_setappend(&(bestfacet->outsideset), point); + if (dist < bestdist) + qh_setappend(&(bestfacet->outsideset), point); else - qh_setappend2ndlast(&(bestfacet->outsideset), point); + qh_setappend2ndlast(&(bestfacet->outsideset), point); #else if (bestfacet->furthestdist < bestdist) { - qh_setappend(&(bestfacet->outsideset), point); - bestfacet->furthestdist= bestdist; + qh_setappend(&(bestfacet->outsideset), point); + bestfacet->furthestdist= bestdist; }else - qh_setappend2ndlast(&(bestfacet->outsideset), point); + qh_setappend2ndlast(&(bestfacet->outsideset), point); #endif } qh num_outside++; trace4((qh ferr, 4065, "qh_partitionpoint: point p%d is outside facet f%d new? %d(or narrowhull)\n", - qh_pointid(point), bestfacet->id, bestfacet->newfacet)); + qh_pointid(point), bestfacet->id, bestfacet->newfacet)); }else if (qh DELAUNAY || bestdist >= -qh MAXcoplanar) { /* for 'd', bestdist skips upperDelaunay facets */ zzinc_(Zcoplanarpart); if (qh DELAUNAY) qh_precision("nearly incident point"); - if ((qh KEEPcoplanar + qh KEEPnearinside) || bestdist > qh max_outside) + if ((qh KEEPcoplanar + qh KEEPnearinside) || bestdist > qh max_outside) qh_partitioncoplanar(point, bestfacet, &bestdist); else { trace4((qh ferr, 4066, "qh_partitionpoint: point p%d is coplanar to facet f%d(dropped)\n", - qh_pointid(point), bestfacet->id)); + qh_pointid(point), bestfacet->id)); } }else if (qh KEEPnearinside && bestdist > -qh NEARinside) { zinc_(Zpartnear); @@ -1073,7 +1073,7 @@ void qh_partitionpoint(pointT *point, facetT *facet) { }else { zinc_(Zpartinside); trace4((qh ferr, 4067, "qh_partitionpoint: point p%d is inside all facets, closest to f%d dist %2.2g\n", - qh_pointid(point), bestfacet->id, bestdist)); + qh_pointid(point), bestfacet->id, bestdist)); if (qh KEEPinside) qh_partitioncoplanar(point, bestfacet, &bestdist); } @@ -1081,7 +1081,7 @@ void qh_partitionpoint(pointT *point, facetT *facet) { /*-<a href="qh-qhull.htm#TOC" >-------------------------------</a><a name="partitionvisible">-</a> - + qh_partitionvisible( allpoints, numoutside ) partitions points in visible facets to qh.newfacet_list qh.visible_list= visible facets @@ -1093,7 +1093,7 @@ void qh_partitionpoint(pointT *point, facetT *facet) { returns: updates outside sets and coplanar sets of qh.newfacet_list updates qh.num_outside (count of outside points) - + notes: qh.findbest_notsharp should be clear (extra work if set) @@ -1119,7 +1119,7 @@ void qh_partitionvisible(/*visible_list*/ boolT allpoints, int *numoutside) { int coplanar=0, size; unsigned count; vertexT *vertex, **vertexp; - + if (qh ONLYmax) maximize_(qh MINoutside, qh max_vertex); *numoutside= 0; @@ -1131,7 +1131,7 @@ void qh_partitionvisible(/*visible_list*/ boolT allpoints, int *numoutside) { while (newfacet && newfacet->visible) { newfacet= newfacet->f.replace; if (count++ > qh facet_id) - qh_infiniteloop(visible); + qh_infiniteloop(visible); } if (!newfacet) newfacet= qh newfacet_list; @@ -1143,7 +1143,7 @@ void qh_partitionvisible(/*visible_list*/ boolT allpoints, int *numoutside) { size= qh_setsize(visible->outsideset); *numoutside += size; qh num_outside -= size; - FOREACHpoint_(visible->outsideset) + FOREACHpoint_(visible->outsideset) qh_partitionpoint(point, newfacet); } if (visible->coplanarset && (qh KEEPcoplanar + qh KEEPinside + qh KEEPnearinside)) { @@ -1172,7 +1172,7 @@ void qh_partitionvisible(/*visible_list*/ boolT allpoints, int *numoutside) { /*-<a href="qh-qhull.htm#TOC" >-------------------------------</a><a name="precision">-</a> - + qh_precision( reason ) restart on precision errors if not merging and if 'QJn' */ @@ -1188,7 +1188,7 @@ void qh_precision(const char *reason) { /*-<a href="qh-qhull.htm#TOC" >-------------------------------</a><a name="printsummary">-</a> - + qh_printsummary( fp ) prints summary to fp @@ -1218,10 +1218,10 @@ void qh_printsummary(FILE *fp) { numcoplanars += qh_setsize( facet->coplanarset); if (facet->good) { if (facet->simplicial) { - if (facet->keepcentrum && facet->tricoplanar) - numtricoplanars++; + if (facet->keepcentrum && facet->tricoplanar) + numtricoplanars++; }else if (qh_setsize(facet->vertices) != qh hull_dim) - nonsimplicial++; + nonsimplicial++; } } if (id >=0 && qh STOPcone-1 != id && -qh STOPpoint-1 != id) @@ -1245,15 +1245,15 @@ Voronoi diagram by the convex hull of %d points in %d-d:\n\n", size, qh hull_dim qh_fprintf(fp, 9291, " Number of Voronoi regions%s: %d\n", qh ATinfinity ? " and at-infinity" : "", numvertices); if (numdel) - qh_fprintf(fp, 9292, " Total number of deleted points due to merging: %d\n", numdel); - if (numcoplanars - numdel > 0) - qh_fprintf(fp, 9293, " Number of nearly incident points: %d\n", numcoplanars - numdel); - else if (size - numvertices - numdel > 0) - qh_fprintf(fp, 9294, " Total number of nearly incident points: %d\n", size - numvertices - numdel); - qh_fprintf(fp, 9295, " Number of%s Voronoi vertices: %d\n", + qh_fprintf(fp, 9292, " Total number of deleted points due to merging: %d\n", numdel); + if (numcoplanars - numdel > 0) + qh_fprintf(fp, 9293, " Number of nearly incident points: %d\n", numcoplanars - numdel); + else if (size - numvertices - numdel > 0) + qh_fprintf(fp, 9294, " Total number of nearly incident points: %d\n", size - numvertices - numdel); + qh_fprintf(fp, 9295, " Number of%s Voronoi vertices: %d\n", goodused ? " 'good'" : "", qh num_good); - if (nonsimplicial) - qh_fprintf(fp, 9296, " Number of%s non-simplicial Voronoi vertices: %d\n", + if (nonsimplicial) + qh_fprintf(fp, 9296, " Number of%s non-simplicial Voronoi vertices: %d\n", goodused ? " 'good'" : "", nonsimplicial); }else if (qh DELAUNAY) { if (qh UPPERdelaunay) @@ -1262,18 +1262,18 @@ Furthest-site Delaunay triangulation by the convex hull of %d points in %d-d:\n\ else qh_fprintf(fp, 9298, "\n\ Delaunay triangulation by the convex hull of %d points in %d-d:\n\n", size, qh hull_dim); - qh_fprintf(fp, 9299, " Number of input sites%s: %d\n", + qh_fprintf(fp, 9299, " Number of input sites%s: %d\n", qh ATinfinity ? " and at-infinity" : "", numvertices); if (numdel) - qh_fprintf(fp, 9300, " Total number of deleted points due to merging: %d\n", numdel); - if (numcoplanars - numdel > 0) - qh_fprintf(fp, 9301, " Number of nearly incident points: %d\n", numcoplanars - numdel); + qh_fprintf(fp, 9300, " Total number of deleted points due to merging: %d\n", numdel); + if (numcoplanars - numdel > 0) + qh_fprintf(fp, 9301, " Number of nearly incident points: %d\n", numcoplanars - numdel); else if (size - numvertices - numdel > 0) - qh_fprintf(fp, 9302, " Total number of nearly incident points: %d\n", size - numvertices - numdel); - qh_fprintf(fp, 9303, " Number of%s Delaunay regions: %d\n", + qh_fprintf(fp, 9302, " Total number of nearly incident points: %d\n", size - numvertices - numdel); + qh_fprintf(fp, 9303, " Number of%s Delaunay regions: %d\n", goodused ? " 'good'" : "", qh num_good); - if (nonsimplicial) - qh_fprintf(fp, 9304, " Number of%s non-simplicial Delaunay regions: %d\n", + if (nonsimplicial) + qh_fprintf(fp, 9304, " Number of%s non-simplicial Delaunay regions: %d\n", goodused ? " 'good'" : "", nonsimplicial); }else if (qh HALFspace) { qh_fprintf(fp, 9305, "\n\ @@ -1282,18 +1282,18 @@ Halfspace intersection by the convex hull of %d points in %d-d:\n\n", size, qh h qh_fprintf(fp, 9307, " Number of non-redundant halfspaces: %d\n", numvertices); if (numcoplanars) { if (qh KEEPinside && qh KEEPcoplanar) - s= "similar and redundant"; + s= "similar and redundant"; else if (qh KEEPinside) s= "redundant"; else - s= "similar"; + s= "similar"; qh_fprintf(fp, 9308, " Number of %s halfspaces: %d\n", s, numcoplanars); - } + } qh_fprintf(fp, 9309, " Number of intersection points: %d\n", qh num_facets - qh num_visible); if (goodused) qh_fprintf(fp, 9310, " Number of 'good' intersection points: %d\n", qh num_good); - if (nonsimplicial) - qh_fprintf(fp, 9311, " Number of%s non-simplicial intersection points: %d\n", + if (nonsimplicial) + qh_fprintf(fp, 9311, " Number of%s non-simplicial intersection points: %d\n", goodused ? " 'good'" : "", nonsimplicial); }else { qh_fprintf(fp, 9312, "\n\ @@ -1301,23 +1301,23 @@ Convex hull of %d points in %d-d:\n\n", size, qh hull_dim); qh_fprintf(fp, 9313, " Number of vertices: %d\n", numvertices); if (numcoplanars) { if (qh KEEPinside && qh KEEPcoplanar) - s= "coplanar and interior"; + s= "coplanar and interior"; else if (qh KEEPinside) s= "interior"; else - s= "coplanar"; + s= "coplanar"; qh_fprintf(fp, 9314, " Number of %s points: %d\n", s, numcoplanars); - } + } qh_fprintf(fp, 9315, " Number of facets: %d\n", qh num_facets - qh num_visible); if (goodused) qh_fprintf(fp, 9316, " Number of 'good' facets: %d\n", qh num_good); - if (nonsimplicial) - qh_fprintf(fp, 9317, " Number of%s non-simplicial facets: %d\n", + if (nonsimplicial) + qh_fprintf(fp, 9317, " Number of%s non-simplicial facets: %d\n", goodused ? " 'good'" : "", nonsimplicial); } if (numtricoplanars) qh_fprintf(fp, 9318, " Number of triangulated facets: %d\n", numtricoplanars); - qh_fprintf(fp, 9319, "\nStatistics for: %s | %s", + qh_fprintf(fp, 9319, "\nStatistics for: %s | %s", qh rbox_command, qh qhull_command); if (qh ROTATErandom != INT_MIN) qh_fprintf(fp, 9320, " QR%d\n\n", qh ROTATErandom); @@ -1332,13 +1332,13 @@ Convex hull of %d points in %d-d:\n\n", size, qh hull_dim); #if 0 /* NOTE: must print before printstatistics() */ {realT stddev, ave; qh_fprintf(fp, 9326, " average new facet balance: %2.2g\n", - wval_(Wnewbalance)/zval_(Zprocessed)); - stddev= qh_stddev(zval_(Zprocessed), wval_(Wnewbalance), + wval_(Wnewbalance)/zval_(Zprocessed)); + stddev= qh_stddev(zval_(Zprocessed), wval_(Wnewbalance), wval_(Wnewbalance2), &ave); qh_fprintf(fp, 9327, " new facet standard deviation: %2.2g\n", stddev); qh_fprintf(fp, 9328, " average partition balance: %2.2g\n", - wval_(Wpbalance)/zval_(Zpbalance)); - stddev= qh_stddev(zval_(Zpbalance), wval_(Wpbalance), + wval_(Wpbalance)/zval_(Zpbalance)); + stddev= qh_stddev(zval_(Zpbalance), wval_(Wpbalance), wval_(Wpbalance2), &ave); qh_fprintf(fp, 9329, " partition standard deviation: %2.2g\n", stddev); } @@ -1359,7 +1359,7 @@ Convex hull of %d points in %d-d:\n\n", size, qh hull_dim); if (qh RERUN) { if (!qh PREmerge && !qh MERGEexact) qh_fprintf(fp, 9334, " Percentage of runs with precision errors: %4.1f\n", - zzval_(Zretry)*100.0/qh build_cnt); /* careful of order */ + zzval_(Zretry)*100.0/qh build_cnt); /* careful of order */ }else if (qh JOGGLEmax < REALmax/2) { if (zzval_(Zretry)) qh_fprintf(fp, 9335, " After %d retries, input joggled by: %2.2g\n", @@ -1367,17 +1367,17 @@ Convex hull of %d points in %d-d:\n\n", size, qh hull_dim); else qh_fprintf(fp, 9336, " Input joggled by: %2.2g\n", qh JOGGLEmax); } - if (qh totarea != 0.0) - qh_fprintf(fp, 9337, " %s facet area: %2.8g\n", - zzval_(Ztotmerge) ? "Approximate" : "Total", qh totarea); - if (qh totvol != 0.0) - qh_fprintf(fp, 9338, " %s volume: %2.8g\n", - zzval_(Ztotmerge) ? "Approximate" : "Total", qh totvol); + if (qh totarea != 0.0) + qh_fprintf(fp, 9337, " %s facet area: %2.8g\n", + zzval_(Ztotmerge) ? "Approximate" : "Total", qh totarea); + if (qh totvol != 0.0) + qh_fprintf(fp, 9338, " %s volume: %2.8g\n", + zzval_(Ztotmerge) ? "Approximate" : "Total", qh totvol); if (qh MERGING) { qh_outerinner(NULL, &outerplane, &innerplane); if (outerplane > 2 * qh DISTround) { - qh_fprintf(fp, 9339, " Maximum distance of %spoint above facet: %2.2g", - (qh QHULLfinished ? "" : "merged "), outerplane); + qh_fprintf(fp, 9339, " Maximum distance of %spoint above facet: %2.2g", + (qh QHULLfinished ? "" : "merged "), outerplane); ratio= outerplane/(qh ONEmerge + qh DISTround); /* don't report ratio if MINoutside is large */ if (ratio > 0.05 && 2* qh ONEmerge > qh MINoutside && qh JOGGLEmax > REALmax/2) @@ -1386,8 +1386,8 @@ Convex hull of %d points in %d-d:\n\n", size, qh hull_dim); qh_fprintf(fp, 9341, "\n"); } if (innerplane < -2 * qh DISTround) { - qh_fprintf(fp, 9342, " Maximum distance of %svertex below facet: %2.2g", - (qh QHULLfinished ? "" : "merged "), innerplane); + qh_fprintf(fp, 9342, " Maximum distance of %svertex below facet: %2.2g", + (qh QHULLfinished ? "" : "merged "), innerplane); ratio= -innerplane/(qh ONEmerge+qh DISTround); if (ratio > 0.05 && qh JOGGLEmax > REALmax/2) qh_fprintf(fp, 9343, " (%.1fx)\n", ratio); diff --git a/src/libqhull.h b/src/libqhull.h index e620031..e56e719 100644 --- a/src/libqhull.h +++ b/src/libqhull.h @@ -7,8 +7,8 @@ see qh-qhull.htm, qhull_a.h copyright (c) 1993-2010 The Geometry Center. - $Id: //product/qhull/main/rel/src/libqhull.h#5 $$Change: 1151 $ - $DateTime: 2010/01/05 19:34:31 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/libqhull.h#6 $$Change: 1164 $ + $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ NOTE: access to qh_qh is via the 'qh' macro. This allows qh_qh to be either a pointer or a structure. An example @@ -41,7 +41,7 @@ #if __MWERKS__ && __POWERPC__ #include <SIOUX.h> #include <Files.h> -#include <Desk.h> +#include <Desk.h> #endif #ifndef __STDC__ @@ -242,67 +242,67 @@ struct facetT { #endif #if qh_MAXoutside coordT maxoutside; /* max computed distance of point to facet - Before QHULLfinished this is an approximation - since maxdist not always set for mergefacet - Actual outer plane is +DISTround and - computed outer plane is +2*DISTround */ + Before QHULLfinished this is an approximation + since maxdist not always set for mergefacet + Actual outer plane is +DISTround and + computed outer plane is +2*DISTround */ #endif coordT offset; /* exact offset of hyperplane from origin */ coordT *normal; /* normal of hyperplane, hull_dim coefficients */ - /* if tricoplanar, shared with a neighbor */ + /* if tricoplanar, shared with a neighbor */ union { /* in order of testing */ realT area; /* area of facet, only in io.c if ->isarea */ - facetT *replace; /* replacement facet if ->visible and NEWfacets - is NULL only if qh_mergedegen_redundant or interior */ + facetT *replace; /* replacement facet if ->visible and NEWfacets + is NULL only if qh_mergedegen_redundant or interior */ facetT *samecycle; /* cycle of facets from the same visible/horizon intersection, - if ->newfacet */ + if ->newfacet */ facetT *newcycle; /* in horizon facet, current samecycle of new facets */ facetT *trivisible; /* visible facet for ->tricoplanar facets during qh_triangulate() */ facetT *triowner; /* owner facet for ->tricoplanar, !isarea facets w/ ->keepcentrum */ }f; coordT *center; /* centrum for convexity, qh CENTERtype == qh_AScentrum */ - /* Voronoi center, qh CENTERtype == qh_ASvoronoi */ - /* if tricoplanar, shared with a neighbor */ + /* Voronoi center, qh CENTERtype == qh_ASvoronoi */ + /* if tricoplanar, shared with a neighbor */ facetT *previous; /* previous facet in the facet_list */ facetT *next; /* next facet in the facet_list */ setT *vertices; /* vertices for this facet, inverse sorted by ID if simplicial, 1st vertex was apex/furthest */ setT *ridges; /* explicit ridges for nonsimplicial facets. - for simplicial facets, neighbors defines ridge */ + for simplicial facets, neighbors defines ridge */ setT *neighbors; /* neighbors of the facet. If simplicial, the kth - neighbor is opposite the kth vertex, and the first - neighbor is the horizon facet for the first vertex*/ + neighbor is opposite the kth vertex, and the first + neighbor is the horizon facet for the first vertex*/ setT *outsideset; /* set of points outside this facet - if non-empty, last point is furthest - if NARROWhull, includes coplanars for partitioning*/ + if non-empty, last point is furthest + if NARROWhull, includes coplanars for partitioning*/ setT *coplanarset; /* set of points coplanar with this facet - > qh.min_vertex and <= facet->max_outside + > qh.min_vertex and <= facet->max_outside a point is assigned to the furthest facet - if non-empty, last point is furthest away */ + if non-empty, last point is furthest away */ unsigned visitid; /* visit_id, for visiting all neighbors, - all uses are independent */ - unsigned id; /* unique identifier from qh facet_id */ + all uses are independent */ + unsigned id; /* unique identifier from qh facet_id */ unsigned nummerge:9; /* number of merges */ #define qh_MAXnummerge 511 /* 2^9-1, 32 flags total, see "flags:" in io.c */ flagT tricoplanar:1; /* True if TRIangulate and simplicial and coplanar with a neighbor */ - /* all tricoplanars share the same ->center, ->normal, ->offset, ->maxoutside */ - /* all tricoplanars share the same apex */ + /* all tricoplanars share the same ->center, ->normal, ->offset, ->maxoutside */ + /* all tricoplanars share the same apex */ /* if ->degenerate, does not span facet (one logical ridge) */ /* one tricoplanar has ->keepcentrum and ->coplanarset */ /* during qh_triangulate, f.trivisible points to original facet */ - flagT newfacet:1; /* True if facet on qh newfacet_list (new or merged) */ - flagT visible:1; /* True if visible facet (will be deleted) */ + flagT newfacet:1; /* True if facet on qh newfacet_list (new or merged) */ + flagT visible:1; /* True if visible facet (will be deleted) */ flagT toporient:1; /* True if created with top orientation - after merging, use ridge orientation */ + after merging, use ridge orientation */ flagT simplicial:1;/* True if simplicial facet, ->ridges may be implicit */ flagT seen:1; /* used to perform operations only once, like visitid */ flagT seen2:1; /* used to perform operations only once, like visitid */ - flagT flipped:1; /* True if facet is flipped */ + flagT flipped:1; /* True if facet is flipped */ flagT upperdelaunay:1; /* True if facet is upper envelope of Delaunay triangulation */ flagT notfurthest:1; /* True if last point of outsideset is not furthest*/ /*-------- flags primarily for output ---------*/ - flagT good:1; /* True if a facet marked good for output */ + flagT good:1; /* True if a facet marked good for output */ flagT isarea:1; /* True if facet->f.area is defined */ /*-------- flags for merging ------------------*/ @@ -312,12 +312,12 @@ struct facetT { flagT mergeridge2:1; /* True if neighbor contains a qh_MERGEridge (mark_dupridges */ flagT coplanar:1; /* True if horizon facet is coplanar at last use */ flagT mergehorizon:1; /* True if will merge into horizon (->coplanar) */ - flagT cycledone:1;/* True if mergecycle_all already done */ + flagT cycledone:1;/* True if mergecycle_all already done */ flagT tested:1; /* True if facet convexity has been tested (false after merge */ flagT keepcentrum:1; /* True if keep old centrum after a merge, or marks owner for ->tricoplanar */ - flagT newmerge:1; /* True if facet is newly merged for reducevertices */ - flagT degenerate:1; /* True if facet is degenerate (degen_mergeset or ->tricoplanar) */ - flagT redundant:1; /* True if facet is redundant (degen_mergeset) */ + flagT newmerge:1; /* True if facet is newly merged for reducevertices */ + flagT degenerate:1; /* True if facet is degenerate (degen_mergeset or ->tricoplanar) */ + flagT redundant:1; /* True if facet is redundant (degen_mergeset) */ }; @@ -350,7 +350,7 @@ struct ridgeT { flagT seen:1; /* used to perform operations only once */ flagT tested:1; /* True when ridge is tested for convexity */ flagT nonconvex:1; /* True if getmergeset detected a non-convex neighbor - only one ridge between neighbors may have nonconvex */ + only one ridge between neighbors may have nonconvex */ }; /*-<a href="qh-poly.htm#TOC" @@ -371,7 +371,7 @@ struct vertexT { vertexT *previous; /* previous vertex in vertex_list */ pointT *point; /* hull_dim coordinates (coordT) */ setT *neighbors; /* neighboring facets of vertex, qh_vertexneighbors() - inits in io.c or after first merge */ + inits in io.c or after first merge */ unsigned visitid:31; /* for use with qh vertex_visit, size must match */ flagT seen2:1; /* another seen flag */ unsigned id:24; /* unique identifier, bit field matches qh.vertex_id */ @@ -379,7 +379,7 @@ struct vertexT { /* =>room for 4 flags */ flagT seen:1; /* used to perform operations only once */ flagT delridge:1; /* vertex was part of a deleted ridge */ - flagT deleted:1; /* true if vertex on qh del_vertices */ + flagT deleted:1; /* true if vertex on qh del_vertices */ flagT newlist:1; /* true if vertex on qh newvertex_list */ }; @@ -400,7 +400,7 @@ struct vertexT { All global variables for qhull are in qh, qhmem, and qhstat qh must be unique for each instance of qhull qhstat may be shared between qhull instances. - qhmem may be shared across multiple instances of Qhull. + qhmem may be shared across multiple instances of Qhull. Rbox uses global variables rbox_inuse and rbox, but does not persist data across calls. notes: @@ -431,7 +431,7 @@ struct qhT { copied into qh by qh_setflags(). qh-quick.htm#options defines the flags. */ boolT ALLpoints; /* true 'Qs' if search all points for initial simplex */ - boolT ANGLEmerge; /* true 'Qa' if sort potential merges by angle */ + boolT ANGLEmerge; /* true 'Qa' if sort potential merges by angle */ boolT APPROXhull; /* true 'Wn' if MINoutside set */ realT MINoutside; /* 'Wn' min. distance for an outside point */ boolT ANNOTATEoutput; /* true 'Ta' if annotate output with message codes */ @@ -451,7 +451,7 @@ struct qhT { int GOODpoint; /* 1+n for 'QGn', good facet if visible/not(-) from point n*/ pointT *GOODpointp; /* the actual point */ boolT GOODthreshold; /* true if qh lower_threshold/upper_threshold defined - false if qh SPLITthreshold */ + false if qh SPLITthreshold */ int GOODvertex; /* 1+n, good facet if vertex for point n */ pointT *GOODvertexp; /* the actual point */ boolT HALFspace; /* true 'Hn,n,n' if halfspace intersection */ @@ -459,36 +459,36 @@ struct qhT { int KEEParea; /* 'PAn' number of largest facets to keep */ boolT KEEPcoplanar; /* true 'Qc' if keeping nearest facet for coplanar points */ boolT KEEPinside; /* true 'Qi' if keeping nearest facet for inside points - set automatically if 'd Qc' */ + set automatically if 'd Qc' */ int KEEPmerge; /* 'PMn' number of facets to keep with most merges */ realT KEEPminArea; /* 'PFn' minimum facet area to keep */ realT MAXcoplanar; /* 'Un' max distance below a facet to be coplanar*/ - boolT MERGEexact; /* true 'Qx' if exact merges (coplanar, degen, dupridge, flipped) */ + boolT MERGEexact; /* true 'Qx' if exact merges (coplanar, degen, dupridge, flipped) */ boolT MERGEindependent; /* true 'Q2' if merging independent sets */ boolT MERGING; /* true if exact-, pre- or post-merging, with angle and centrum tests */ realT premerge_centrum; /* 'C-n' centrum_radius when pre merging. Default is round-off */ realT postmerge_centrum; /* 'Cn' centrum_radius when post merging. Default is round-off */ - boolT MERGEvertices; /* true 'Q3' if merging redundant vertices */ + boolT MERGEvertices; /* true 'Q3' if merging redundant vertices */ realT MINvisible; /* 'Vn' min. distance for a facet to be visible */ boolT NOnarrow; /* true 'Q10' if no special processing for narrow distributions */ boolT NOnearinside; /* true 'Q8' if ignore near-inside points when partitioning */ boolT NOpremerge; /* true 'Q0' if no defaults for C-0 or Qx */ - boolT ONLYgood; /* true 'Qg' if process points with good visible or horizon facets */ - boolT ONLYmax; /* true 'Qm' if only process points that increase max_outside */ + boolT ONLYgood; /* true 'Qg' if process points with good visible or horizon facets */ + boolT ONLYmax; /* true 'Qm' if only process points that increase max_outside */ boolT PICKfurthest; /* true 'Q9' if process furthest of furthest points*/ boolT POSTmerge; /* true if merging after buildhull (Cn or An) */ boolT PREmerge; /* true if merging during buildhull (C-n or A-n) */ - /* NOTE: some of these names are similar to qh_PRINT names */ - boolT PRINTcentrums; /* true 'Gc' if printing centrums */ + /* NOTE: some of these names are similar to qh_PRINT names */ + boolT PRINTcentrums; /* true 'Gc' if printing centrums */ boolT PRINTcoplanar; /* true 'Gp' if printing coplanar points */ - int PRINTdim; /* print dimension for Geomview output */ + int PRINTdim; /* print dimension for Geomview output */ boolT PRINTdots; /* true 'Ga' if printing all points as dots */ boolT PRINTgood; /* true 'Pg' if printing good facets */ - boolT PRINTinner; /* true 'Gi' if printing inner planes */ - boolT PRINTneighbors; /* true 'PG' if printing neighbors of good facets */ - boolT PRINTnoplanes; /* true 'Gn' if printing no planes */ + boolT PRINTinner; /* true 'Gi' if printing inner planes */ + boolT PRINTneighbors; /* true 'PG' if printing neighbors of good facets */ + boolT PRINTnoplanes; /* true 'Gn' if printing no planes */ boolT PRINToptions1st; /* true 'FO' if printing options to stderr */ - boolT PRINTouter; /* true 'Go' if printing outer planes */ + boolT PRINTouter; /* true 'Go' if printing outer planes */ boolT PRINTprecision; /* false 'Pp' if not reporting precision problems */ qh_PRINT PRINTout[qh_PRINTEND]; /* list of output formats to print */ boolT PRINTridges; /* true 'Gr' if print ridges */ @@ -497,75 +497,75 @@ struct qhT { boolT PRINTsummary; /* true 's' if printing summary to stderr */ boolT PRINTtransparent; /* true 'Gt' if print transparent outer ridges */ boolT PROJECTdelaunay; /* true if DELAUNAY, no readpoints() and - need projectinput() for Delaunay in qh_init_B */ + need projectinput() for Delaunay in qh_init_B */ int PROJECTinput; /* number of projected dimensions 'bn:0Bn:0' */ - boolT QUICKhelp; /* true if quick help message for degen input */ + boolT QUICKhelp; /* true if quick help message for degen input */ boolT RANDOMdist; /* true if randomly change distplane and setfacetplane */ - realT RANDOMfactor; /* maximum random perturbation */ + realT RANDOMfactor; /* maximum random perturbation */ realT RANDOMa; /* qh_randomfactor is randr * RANDOMa + RANDOMb */ realT RANDOMb; boolT RANDOMoutside; /* true if select a random outside point */ - int REPORTfreq; /* buildtracing reports every n facets */ - int REPORTfreq2; /* tracemerging reports every REPORTfreq/2 facets */ - int RERUN; /* 'TRn' rerun qhull n times (qh.build_cnt) */ - int ROTATErandom; /* 'QRn' seed, 0 time, >= rotate input */ + int REPORTfreq; /* buildtracing reports every n facets */ + int REPORTfreq2; /* tracemerging reports every REPORTfreq/2 facets */ + int RERUN; /* 'TRn' rerun qhull n times (qh.build_cnt) */ + int ROTATErandom; /* 'QRn' seed, 0 time, >= rotate input */ boolT SCALEinput; /* true 'Qbk' if scaling input */ boolT SCALElast; /* true 'Qbb' if scale last coord to max prev coord */ boolT SETroundoff; /* true 'E' if qh DISTround is predefined */ - boolT SKIPcheckmax; /* true 'Q5' if skip qh_check_maxout */ + boolT SKIPcheckmax; /* true 'Q5' if skip qh_check_maxout */ boolT SKIPconvex; /* true 'Q6' if skip convexity testing during pre-merge */ boolT SPLITthresholds; /* true if upper_/lower_threshold defines a region used only for printing (!for qh ONLYgood) */ - int STOPcone; /* 'TCn' 1+n for stopping after cone for point n */ - /* also used by qh_build_withresart for err exit*/ - int STOPpoint; /* 'TVn' 'TV-n' 1+n for stopping after/before(-) - adding point n */ - int TESTpoints; /* 'QTn' num of test points after qh.num_points. Test points always coplanar. */ + int STOPcone; /* 'TCn' 1+n for stopping after cone for point n */ + /* also used by qh_build_withresart for err exit*/ + int STOPpoint; /* 'TVn' 'TV-n' 1+n for stopping after/before(-) + adding point n */ + int TESTpoints; /* 'QTn' num of test points after qh.num_points. Test points always coplanar. */ boolT TESTvneighbors; /* true 'Qv' if test vertex neighbors at end */ int TRACElevel; /* 'Tn' conditional IStracing level */ - int TRACElastrun; /* qh.TRACElevel applies to last qh.RERUN */ + int TRACElastrun; /* qh.TRACElevel applies to last qh.RERUN */ int TRACEpoint; /* 'TPn' start tracing when point n is a vertex */ realT TRACEdist; /* 'TWn' start tracing when merge distance too big */ int TRACEmerge; /* 'TMn' start tracing before this merge */ - boolT TRIangulate; /* true 'Qt' if triangulate non-simplicial facets */ - boolT TRInormals; /* true 'Q11' if triangulate duplicates normals (sets Qt) */ + boolT TRIangulate; /* true 'Qt' if triangulate non-simplicial facets */ + boolT TRInormals; /* true 'Q11' if triangulate duplicates normals (sets Qt) */ boolT UPPERdelaunay; /* true 'Qu' if computing furthest-site Delaunay */ boolT USEstdout; /* true 'Tz' if using stdout instead of stderr */ boolT VERIFYoutput; /* true 'Tv' if verify output at end of qhull */ boolT VIRTUALmemory; /* true 'Q7' if depth-first processing in buildhull */ - boolT VORONOI; /* true 'v' if computing Voronoi diagram */ + boolT VORONOI; /* true 'v' if computing Voronoi diagram */ /*--------input constants ---------*/ realT AREAfactor; /* 1/(hull_dim-1)! for converting det's to area */ boolT DOcheckmax; /* true if calling qh_check_maxout (qh_initqhull_globals) */ - char *feasible_string; /* feasible point 'Hn,n,n' for halfspace intersection */ + char *feasible_string; /* feasible point 'Hn,n,n' for halfspace intersection */ coordT *feasible_point; /* as coordinates, both malloc'd */ boolT GETarea; /* true 'Fa', 'FA', 'FS', 'PAn', 'PFn' if compute facet area/Voronoi volume in io.c */ boolT KEEPnearinside; /* true if near-inside points in coplanarset */ - int hull_dim; /* dimension of hull, set by initbuffers */ - int input_dim; /* dimension of input, set by initbuffers */ - int num_points; /* number of input points */ + int hull_dim; /* dimension of hull, set by initbuffers */ + int input_dim; /* dimension of input, set by initbuffers */ + int num_points; /* number of input points */ pointT *first_point; /* array of input points, see POINTSmalloc */ boolT POINTSmalloc; /* true if qh first_point/num_points allocated */ pointT *input_points; /* copy of original qh.first_point for input points for qh_joggleinput */ boolT input_malloc; /* true if qh input_points malloc'd */ - char qhull_command[256];/* command line that invoked this program */ + char qhull_command[256];/* command line that invoked this program */ int qhull_commandsiz2; /* size of qhull_command at qh_clear_outputflags */ - char rbox_command[256]; /* command line that produced the input points */ + char rbox_command[256]; /* command line that produced the input points */ char qhull_options[512];/* descriptive list of options */ int qhull_optionlen; /* length of last line */ int qhull_optionsiz; /* size of qhull_options at qh_build_withrestart */ int qhull_optionsiz2; /* size of qhull_options at qh_clear_outputflags */ - int run_id; /* non-zero, random identifier for this instance of qhull */ + int run_id; /* non-zero, random identifier for this instance of qhull */ boolT VERTEXneighbors; /* true if maintaining vertex neighbors */ boolT ZEROcentrum; /* true if 'C-0' or 'C-0 Qx'. sets ZEROall_ok */ realT *upper_threshold; /* don't print if facet->normal[k]>=upper_threshold[k] must set either GOODthreshold or SPLITthreshold - if Delaunay, default is 0.0 for upper envelope */ + if Delaunay, default is 0.0 for upper envelope */ realT *lower_threshold; /* don't print if facet->normal[k] <=lower_threshold[k] */ realT *upper_bound; /* scale point[k] to new upper bound */ realT *lower_bound; /* scale point[k] to new lower bound - project if both upper_ and lower_bound == 0 */ + project if both upper_ and lower_bound == 0 */ /*-<a href="qh-globa.htm#TOC" >--------------------------------</a><a name="qh-prec">-</a> @@ -580,7 +580,7 @@ struct qhT { */ realT ANGLEround; /* max round off error for angles */ realT centrum_radius; /* max centrum radius for convexity (roundoff added) */ - realT cos_max; /* max cosine for convexity (roundoff added) */ + realT cos_max; /* max cosine for convexity (roundoff added) */ realT DISTround; /* max round off error for distances, 'E' overrides */ realT MAXabs_coord; /* max absolute coordinate */ realT MAXlastcoord; /* max last coordinate for qh_scalelast */ @@ -598,7 +598,7 @@ struct qhT { realT outside_err; /* application's epsilon for coplanar points qh_check_bestdist() qh_check_points() reports error if point outside */ realT WIDEfacet; /* size of wide facet for skipping ridge in - area computation and locking centrum */ + area computation and locking centrum */ /*-<a href="qh-globa.htm#TOC" >--------------------------------</a><a name="qh-codetern">-</a> @@ -631,7 +631,7 @@ struct qhT { facetT *facet_list; /* first facet */ facetT *facet_tail; /* end of facet_list (dummy facet) */ facetT *facet_next; /* next facet for buildhull() - previous facets do not have outside sets + previous facets do not have outside sets NARROWhull: previous facets may have coplanar outside sets for qh_outcoplanar */ facetT *newfacet_list; /* list of new facets to end of facet_list */ facetT *visible_list; /* list of visible facets preceeding newfacet_list, @@ -645,9 +645,9 @@ struct qhT { vertexT *vertex_tail; /* end of vertex_list (dummy vertex) */ vertexT *newvertex_list; /* list of vertices in newfacet_list, to vertex_tail all vertices have 'newlist' set */ - int num_facets; /* number of facets in facet_list - includes visble faces (num_visible) */ - int num_vertices; /* number of vertices in facet_list */ + int num_facets; /* number of facets in facet_list + includes visble faces (num_visible) */ + int num_vertices; /* number of vertices in facet_list */ int num_outside; /* number of points in outsidesets (for tracing and RANDOMoutside) includes coplanar outsideset points for NARROWhull/qh_outcoplanar() */ int num_good; /* number of good facets (after findgood_all) */ @@ -668,32 +668,32 @@ struct qhT { boolT ALLOWrestart; /* true if qh_precision can use qh.restartexit */ int build_cnt; /* number of calls to qh_initbuild */ qh_CENTER CENTERtype; /* current type of facet->center, qh_CENTER */ - int furthest_id; /* pointid of furthest point, for tracing */ + int furthest_id; /* pointid of furthest point, for tracing */ facetT *GOODclosest; /* closest facet to GOODthreshold in qh_findgood */ boolT hasAreaVolume; /* true if totarea, totvol was defined by qh_getarea */ boolT hasTriangulation; /* true if triangulation created by qh_triangulate */ realT JOGGLEmax; /* set 'QJn' if randomly joggle input */ boolT maxoutdone; /* set qh_check_maxout(), cleared by qh_addpoint() */ realT max_outside; /* maximum distance from a point to a facet, - before roundoff, not simplicial vertices - actual outer plane is +DISTround and - computed outer plane is +2*DISTround */ + before roundoff, not simplicial vertices + actual outer plane is +DISTround and + computed outer plane is +2*DISTround */ realT max_vertex; /* maximum distance (>0) from vertex to a facet, - before roundoff, due to a merge */ + before roundoff, due to a merge */ realT min_vertex; /* minimum distance (<0) from vertex to a facet, - before roundoff, due to a merge - if qh.JOGGLEmax, qh_makenewplanes sets it - recomputed if qh.DOcheckmax, default -qh.DISTround */ + before roundoff, due to a merge + if qh.JOGGLEmax, qh_makenewplanes sets it + recomputed if qh.DOcheckmax, default -qh.DISTround */ boolT NEWfacets; /* true while visible facets invalid due to new or merge - from makecone/attachnewfacets to deletevisible */ - boolT findbestnew; /* true if partitioning calls qh_findbestnew */ + from makecone/attachnewfacets to deletevisible */ + boolT findbestnew; /* true if partitioning calls qh_findbestnew */ boolT findbest_notsharp; /* true if new facets are at least 90 degrees */ boolT NOerrexit; /* true if qh.errexit is not available */ realT PRINTcradius; /* radius for printing centrums */ realT PRINTradius; /* radius for printing vertex spheres and points */ boolT POSTmerging; /* true when post merging */ - int printoutvar; /* temporary variable for qh_printbegin, etc. */ - int printoutnum; /* number of facets printed */ + int printoutvar; /* temporary variable for qh_printbegin, etc. */ + int printoutnum; /* number of facets printed */ boolT QHULLfinished; /* True after qhull() is finished */ realT totarea; /* 'FA': total facet area computed by qh_getarea, hasAreaVolume */ realT totvol; /* 'FA': total volume computed by qh_getarea, hasAreaVolume */ @@ -711,7 +711,7 @@ struct qhT { */ setT *facet_mergeset; /* temporary set of merges to be done */ setT *degen_mergeset; /* temporary set of degenerate and redundant merges */ - setT *hash_table; /* hash table for matching ridges in qh_matchfacets + setT *hash_table; /* hash table for matching ridges in qh_matchfacets size is setsize() */ setT *other_points; /* additional points */ setT *del_vertices; /* vertices to partition and delete with visible @@ -743,7 +743,7 @@ struct qhT { do not assume zero initialization, 'QPn' may cause a restart */ boolT ERREXITcalled; /* true during qh_errexit (prevents duplicate calls */ - boolT firstcentrum; /* for qh_printcentrum */ + boolT firstcentrum; /* for qh_printcentrum */ boolT old_randomdist; /* save RANDOMdist flag during io, tracing, or statistics */ setT *coplanarfacetset; /* set of coplanar facets for searching qh_findbesthorizon() */ realT last_low; /* qh_scalelast parameters for qh_setdelaunay */ @@ -751,7 +751,7 @@ struct qhT { realT last_newhigh; unsigned lastreport; /* for qh_buildtracing */ int mergereport; /* for qh_tracemerging */ - void *old_qhstat; /* for saving qh_qhstat in save_qhull() and UsingLibQhull. Free with qh_free() */ + qhstatT *old_qhstat; /* for saving qh_qhstat in save_qhull() and UsingLibQhull. Free with qh_free() */ setT *old_tempstack; /* for saving qhmem.tempstack in save_qhull */ int ridgeoutnum; /* number of ridges for 4OFF output (qh_printbegin,etc) */ }; @@ -985,19 +985,19 @@ struct qhT { void qh_qhull(void); boolT qh_addpoint(pointT *furthest, facetT *facet, boolT checkdist); -void qh_printsummary(FILE *fp); +void qh_printsummary(FILE *fp); /********* -user.c prototypes (alphabetical) **********************/ -void qh_errexit(int exitcode, facetT *facet, ridgeT *ridge); -void qh_errprint(const char* string, facetT *atfacet, facetT *otherfacet, ridgeT *atridge, vertexT *atvertex); +void qh_errexit(int exitcode, facetT *facet, ridgeT *ridge); +void qh_errprint(const char* string, facetT *atfacet, facetT *otherfacet, ridgeT *atridge, vertexT *atvertex); int qh_new_qhull(int dim, int numpoints, coordT *points, boolT ismalloc, - char *qhull_cmd, FILE *outfile, FILE *errfile); + char *qhull_cmd, FILE *outfile, FILE *errfile); void qh_printfacetlist(facetT *facetlist, setT *facets, boolT printall); -void qh_printhelp_degenerate(FILE *fp); -void qh_printhelp_narrowhull(FILE *fp, realT minangle); -void qh_printhelp_singular(FILE *fp); -void qh_user_memsizes(void); +void qh_printhelp_degenerate(FILE *fp); +void qh_printhelp_narrowhull(FILE *fp, realT minangle); +void qh_printhelp_singular(FILE *fp); +void qh_user_memsizes(void); /********* -usermem.c prototypes (alphabetical) **********************/ void qh_exit(int exitcode); @@ -1005,19 +1005,19 @@ void qh_free(void *mem); void *qh_malloc(size_t size); /********* -userprintf.c prototypes (alphabetical) **********************/ -void qh_fprintf(FILE *fp, int msgcode, const char *fmt, ... ); -void qh_fprintf_rbox(FILE *fp, int msgcode, const char *fmt, ... ); +void qh_fprintf(FILE *fp, int msgcode, const char *fmt, ... ); +void qh_fprintf_rbox(FILE *fp, int msgcode, const char *fmt, ... ); /***** -geom.c/geom2.c/random.c prototypes (duplicated from geom.h, random.h) ****************/ facetT *qh_findbest(pointT *point, facetT *startfacet, - boolT bestoutside, boolT newfacets, boolT noupper, - realT *dist, boolT *isoutside, int *numpart); + boolT bestoutside, boolT newfacets, boolT noupper, + realT *dist, boolT *isoutside, int *numpart); facetT *qh_findbestnew(pointT *point, facetT *startfacet, realT *dist, boolT bestoutside, boolT *isoutside, int *numpart); boolT qh_gram_schmidt(int dim, realT **rows); void qh_outerinner(facetT *facet, realT *outerplane, realT *innerplane); -void qh_printsummary(FILE *fp); +void qh_printsummary(FILE *fp); void qh_projectinput(void); void qh_randommatrix(realT *buffer, int dim, realT **row); void qh_rotateinput(realT **rows); @@ -1028,26 +1028,26 @@ coordT *qh_sethalfspace_all(int dim, int count, coordT *halfspaces, pointT *fea /***** -global.c prototypes (alphabetical) ***********************/ unsigned long qh_clock(void); -void qh_checkflags(char *command, char *hiddenflags); +void qh_checkflags(char *command, char *hiddenflags); void qh_clear_outputflags(void); -void qh_freebuffers(void); +void qh_freebuffers(void); void qh_freeqhull(boolT allmem); void qh_freeqhull2(boolT allmem); void qh_init_A(FILE *infile, FILE *outfile, FILE *errfile, int argc, char *argv[]); void qh_init_B(coordT *points, int numpoints, int dim, boolT ismalloc); -void qh_init_qhull_command(int argc, char *argv[]); +void qh_init_qhull_command(int argc, char *argv[]); void qh_initbuffers(coordT *points, int numpoints, int dim, boolT ismalloc); -void qh_initflags(char *command); -void qh_initqhull_buffers(void); -void qh_initqhull_globals(coordT *points, int numpoints, int dim, boolT ismalloc); +void qh_initflags(char *command); +void qh_initqhull_buffers(void); +void qh_initqhull_globals(coordT *points, int numpoints, int dim, boolT ismalloc); void qh_initqhull_mem(void); void qh_initqhull_outputflags(void); -void qh_initqhull_start(FILE *infile, FILE *outfile, FILE *errfile); -void qh_initqhull_start2(FILE *infile, FILE *outfile, FILE *errfile); -void qh_initthresholds(char *command); +void qh_initqhull_start(FILE *infile, FILE *outfile, FILE *errfile); +void qh_initqhull_start2(FILE *infile, FILE *outfile, FILE *errfile); +void qh_initthresholds(char *command); void qh_option(const char *option, int *i, realT *r); #if qh_QHpointer -void qh_restore_qhull(qhT **oldqh); +void qh_restore_qhull(qhT **oldqh); qhT *qh_save_qhull(void); #endif @@ -1055,8 +1055,8 @@ qhT *qh_save_qhull(void); void dfacet( unsigned id); void dvertex( unsigned id); -void qh_printneighborhood(FILE *fp, qh_PRINT format, facetT *facetA, facetT *facetB, boolT printall); -void qh_produce_output(void); +void qh_printneighborhood(FILE *fp, qh_PRINT format, facetT *facetA, facetT *facetB, boolT printall); +void qh_produce_output(void); coordT *qh_readpoints(int *numpoints, int *dimension, boolT *ismalloc); @@ -1078,7 +1078,7 @@ setT *qh_pointfacet(void /*qh.facet_list*/); int qh_pointid(pointT *point); setT *qh_pointvertex(void /*qh.facet_list*/); void qh_setvoronoi_all(void); -void qh_triangulate(void /*qh facet_list*/); +void qh_triangulate(void /*qh facet_list*/); /********* -rboxpoints.c prototypes **********************/ int qh_rboxpoints(FILE* fout, FILE* ferr, char* rbox_command); diff --git a/src/mem.c b/src/mem.c index 9c6946e..c1a533b 100644 --- a/src/mem.c +++ b/src/mem.c @@ -1,37 +1,37 @@ /*<html><pre> -<a href="qh-mem.htm" >-------------------------------</a><a name="TOP">-</a> - mem.c + mem.c memory management routines for qhull This is a standalone program. - + To initialize memory: - qh_meminit(stderr); + qh_meminit(stderr); qh_meminitbuffers(qh IStracing, qh_MEMalign, 7, qh_MEMbufsize,qh_MEMinitbuf); qh_memsize((int)sizeof(facetT)); qh_memsize((int)sizeof(facetT)); ... qh_memsetup(); - + To free up all memory buffers: qh_memfreeshort(&curlong, &totlong); - + if qh_NOmem, malloc/free is used instead of mem.c - notes: + notes: uses Quickfit algorithm (freelists for commonly allocated sizes) assumes small sizes for freelists (it discards the tail of memory buffers) - + see: qh-mem.htm and mem.h - global.c (qh_initbuffers) for an example of using mem.c - + global.c (qh_initbuffers) for an example of using mem.c + copyright (c) 1993-2010 The Geometry Center. - $Id: //product/qhull/main/rel/src/mem.c#31 $$Change: 1150 $ - $DateTime: 2010/01/04 22:43:14 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/mem.c#32 $$Change: 1164 $ + $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ */ #include "mem.h" @@ -48,7 +48,7 @@ typedef struct facetT facetT; #endif void qh_errexit(int exitcode, facetT *, ridgeT *); void qh_exit(int exitcode); -void qh_fprintf(FILE *fp, int msgcode, const char *fmt, ... ); +void qh_fprintf(FILE *fp, int msgcode, const char *fmt, ... ); void qh_free(void *mem); void *qh_malloc(size_t size); #endif @@ -64,14 +64,14 @@ qhmemT qhmem= {0,0,0,0,0,0,0,0,0,0,0, #ifndef qh_NOmem /*============= internal functions ==============*/ - + static int qh_intcompare(const void *i, const void *j); /*========== functions in alphabetical order ======== */ /*-<a href="qh-mem.htm#TOC" >-------------------------------</a><a name="intcompare">-</a> - + qh_intcompare( i, j ) used by qsort and bsearch to compare two integers */ @@ -82,13 +82,13 @@ static int qh_intcompare(const void *i, const void *j) { /*-<a href="qh-mem.htm#TOC" >--------------------------------</a><a name="memalloc">-</a> - - qh_memalloc( insize ) + + qh_memalloc( insize ) returns object of insize bytes - qhmem is the global memory structure - + qhmem is the global memory structure + returns: - pointer to allocated memory + pointer to allocated memory errors if insufficient memory notes: @@ -96,7 +96,7 @@ static int qh_intcompare(const void *i, const void *j) { actual object may be larger than insize use qh_memalloc_() for inline code for quick allocations logs allocations if 'T5' - + design: if size < qhmem.LASTsize if qhmem.freelists[size] non-empty @@ -120,12 +120,12 @@ void *qh_memalloc(int insize) { qhmem.totshort += outsize; freelistp= qhmem.freelists+idx; if ((object= *freelistp)) { - qhmem.cntquick++; + qhmem.cntquick++; qhmem.totfree -= outsize; *freelistp= *((void **)*freelistp); /* replace freelist with next object */ #ifdef qh_TRACEshort n= qhmem.cntshort+qhmem.cntquick+qhmem.freeshort; - if (qhmem.IStracing >= 5) + if (qhmem.IStracing >= 5) qh_fprintf(qhmem.ferr, 8141, "qh_mem %p n %8d alloc quick: %d bytes (tot %d cnt %d)\n", object, n, outsize, qhmem.totshort, qhmem.cntshort+qhmem.cntquick-qhmem.freeshort); #endif return(object); @@ -133,20 +133,20 @@ void *qh_memalloc(int insize) { qhmem.cntshort++; if (outsize > qhmem .freesize) { qhmem .totdropped += qhmem .freesize; - if (!qhmem.curbuffer) - bufsize= qhmem.BUFinit; + if (!qhmem.curbuffer) + bufsize= qhmem.BUFinit; else - bufsize= qhmem.BUFsize; + bufsize= qhmem.BUFsize; if (!(newbuffer= qh_malloc((size_t)bufsize))) { - qh_fprintf(qhmem.ferr, 6080, "qhull error (qh_memalloc): insufficient memory to allocate short memory buffer (%d bytes)\n", bufsize); - qh_errexit(qhmem_ERRmem, NULL, NULL); - } - *((void **)newbuffer)= qhmem.curbuffer; /* prepend newbuffer to curbuffer - list */ - qhmem.curbuffer= newbuffer; + qh_fprintf(qhmem.ferr, 6080, "qhull error (qh_memalloc): insufficient memory to allocate short memory buffer (%d bytes)\n", bufsize); + qh_errexit(qhmem_ERRmem, NULL, NULL); + } + *((void **)newbuffer)= qhmem.curbuffer; /* prepend newbuffer to curbuffer + list */ + qhmem.curbuffer= newbuffer; size= (sizeof(void **) + qhmem.ALIGNmask) & ~qhmem.ALIGNmask; - qhmem.freemem= (void *)((char *)newbuffer+size); - qhmem.freesize= bufsize - size; + qhmem.freemem= (void *)((char *)newbuffer+size); + qhmem.freesize= bufsize - size; qhmem.totbuffer += bufsize - size; /* easier to check */ /* Periodically test totbuffer. It matches at beginning and exit of every call */ n = qhmem.totshort + qhmem.totfree + qhmem.totdropped + qhmem.freesize - outsize; @@ -161,7 +161,7 @@ void *qh_memalloc(int insize) { qhmem.totunused += outsize - insize; #ifdef qh_TRACEshort n= qhmem.cntshort+qhmem.cntquick+qhmem.freeshort; - if (qhmem.IStracing >= 5) + if (qhmem.IStracing >= 5) qh_fprintf(qhmem.ferr, 8140, "qh_mem %p n %8d alloc short: %d bytes (tot %d cnt %d)\n", object, n, outsize, qhmem.totshort, qhmem.cntshort+qhmem.cntquick-qhmem.freeshort); #endif return object; @@ -189,8 +189,8 @@ void *qh_memalloc(int insize) { /*-<a href="qh-mem.htm#TOC" >--------------------------------</a><a name="memfree">-</a> - - qh_memfree( object, insize ) + + qh_memfree( object, insize ) free up an object of size bytes size is insize from qh_memalloc @@ -198,7 +198,7 @@ void *qh_memalloc(int insize) { object may be NULL type checking warns if using (void **)object use qh_memfree_() for quick free's of small objects - + design: if size <= qhmem.LASTsize append object to corresponding freelist @@ -222,7 +222,7 @@ void qh_memfree(void *object, int insize) { *freelistp= object; #ifdef qh_TRACEshort idx= qhmem.cntshort+qhmem.cntquick+qhmem.freeshort; - if (qhmem.IStracing >= 5) + if (qhmem.IStracing >= 5) qh_fprintf(qhmem.ferr, 8142, "qh_mem %p n %8d free short: %d bytes (tot %d cnt %d)\n", object, idx, outsize, qhmem.totshort, qhmem.cntshort+qhmem.cntquick-qhmem.freeshort); #endif }else { @@ -237,7 +237,7 @@ void qh_memfree(void *object, int insize) { /*-<a href="qh-mem.htm#TOC" >-------------------------------</a><a name="memfreeshort">-</a> - + qh_memfreeshort( curlong, totlong ) frees up all short and qhmem memory allocations @@ -272,12 +272,12 @@ void qh_memfreeshort(int *curlong, int *totlong) { /*-<a href="qh-mem.htm#TOC" >--------------------------------</a><a name="meminit">-</a> - + qh_meminit( ferr ) initialize qhmem and test sizeof( void*) */ void qh_meminit(FILE *ferr) { - + memset((char *)&qhmem, 0, sizeof(qhmem)); /* every field is 0, FALSE, NULL */ qhmem.ferr= ferr; if (sizeof(void*) < sizeof(int)) { @@ -292,7 +292,7 @@ void qh_meminit(FILE *ferr) { /*-<a href="qh-mem.htm#TOC" >-------------------------------</a><a name="meminitbuffers">-</a> - + qh_meminitbuffers( tracelevel, alignment, numsizes, bufsize, bufinit ) initialize qhmem if tracelevel >= 5, trace memory allocations @@ -324,7 +324,7 @@ void qh_meminitbuffers(int tracelevel, int alignment, int numsizes, int bufsize, /*-<a href="qh-mem.htm#TOC" >-------------------------------</a><a name="memsetup">-</a> - + qh_memsetup() set up memory after running memsize() */ @@ -355,7 +355,7 @@ void qh_memsetup(void) { /*-<a href="qh-mem.htm#TOC" >-------------------------------</a><a name="memsize">-</a> - + qh_memsize( size ) define a free list for this size */ @@ -380,7 +380,7 @@ void qh_memsize(int size) { /*-<a href="qh-mem.htm#TOC" >-------------------------------</a><a name="memstatistics">-</a> - + qh_memstatistics( fp ) print out memory statistics @@ -389,7 +389,7 @@ void qh_memsize(int size) { void qh_memstatistics(FILE *fp) { int i, count, totfree= 0; void *object; - + for (i=0; i < qhmem.TABLEsize; i++) { count=0; for (object= qhmem .freelists[i]; object; object= *((void **)object)) @@ -414,12 +414,12 @@ void qh_memstatistics(FILE *fp) { %7d bytes of long memory in use (in %d pieces)\n\ %7d bytes of short memory buffers (minus links)\n\ %7d bytes per short memory buffer (initially %d bytes)\n", - qhmem .cntquick, qhmem .cntshort, qhmem .cntlong, - qhmem .freeshort, qhmem .freelong, - qhmem .totshort, qhmem .totfree, + qhmem .cntquick, qhmem .cntshort, qhmem .cntlong, + qhmem .freeshort, qhmem .freelong, + qhmem .totshort, qhmem .totfree, qhmem .totdropped + qhmem .freesize, qhmem .totunused, - qhmem .maxlong, qhmem .totlong, qhmem .cntlong - qhmem .freelong, - qhmem .totbuffer, qhmem .BUFsize, qhmem .BUFinit); + qhmem .maxlong, qhmem .totlong, qhmem .cntlong - qhmem .freelong, + qhmem .totbuffer, qhmem .BUFsize, qhmem .BUFinit); if (qhmem.cntlarger) { qh_fprintf(fp, 9279, "%7d calls to qh_setlarger\n%7.2g average copy size\n", qhmem.cntlarger, ((float)qhmem.totlarger)/(float)qhmem.cntlarger); @@ -437,7 +437,7 @@ void qh_memstatistics(FILE *fp) { /*-<a href="qh-mem.htm#TOC" >-------------------------------</a><a name="NOmem">-</a> - + qh_NOmem turn off quick-fit memory allocation @@ -509,9 +509,9 @@ void qh_memstatistics(FILE *fp) { %7d long frees\n\ %7d bytes of long memory allocated (max, except for input)\n\ %7d bytes of long memory in use (in %d pieces)\n", - qhmem .cntlong, - qhmem .freelong, - qhmem .maxlong, qhmem .totlong, qhmem .cntlong - qhmem .freelong); + qhmem .cntlong, + qhmem .freelong, + qhmem .maxlong, qhmem .totlong, qhmem .cntlong - qhmem .freelong); } #endif /* qh_NOmem */ @@ -520,7 +520,7 @@ void qh_memstatistics(FILE *fp) { >-------------------------------</a><a name="memtotlong">-</a> qh_memtotal( totlong, curlong, totshort, curshort, maxlong, totbuffer ) - Return the total, allocated long and short memory + Return the total, allocated long and short memory returns: Returns the total current bytes of long and short allocations diff --git a/src/mem.h b/src/mem.h index 8bd98f7..90ca632 100644 --- a/src/mem.h +++ b/src/mem.h @@ -1,7 +1,7 @@ /*<html><pre> -<a href="qh-mem.htm" >-------------------------------</a><a name="TOP">-</a> - mem.h + mem.h prototypes for memory management functions see qh-mem.htm, mem.c and qset.h @@ -12,8 +12,8 @@ qh_errexit(qhmem_ERRqhull, NULL, NULL) otherwise copyright (c) 1993-2010 The Geometry Center. - $Id: //product/qhull/main/rel/src/mem.h#27 $$Change: 1148 $ - $DateTime: 2010/01/04 21:34:40 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/mem.h#28 $$Change: 1164 $ + $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ */ #ifndef qhDEFmem @@ -23,7 +23,7 @@ /*-<a href="qh-mem.htm#TOC" >-------------------------------</a><a name="NOmem">-</a> - + qh_NOmem turn off quick-fit memory allocation @@ -51,9 +51,9 @@ Trace short and quick memory allocations at T5 its own memory, we need to explicitly specify alignment in qh_meminitbuffers(). - A safe choice is sizeof(double). sizeof(float) may be used if doubles + A safe choice is sizeof(double). sizeof(float) may be used if doubles do not occur in data structures and pointers are the same size. Be careful - of machines (e.g., DEC Alpha) with large pointers. If gcc is available, + of machines (e.g., DEC Alpha) with large pointers. If gcc is available, use __alignof__(double) or fmax_(__alignof__(float), __alignof__(void *)). see <a href="user.h#MEMalign">qh_MEMalign</a> in user.h for qhull's alignment @@ -64,34 +64,35 @@ Trace short and quick memory allocations at T5 /*-<a href="qh-mem.htm#TOC" >--------------------------------</a><a name="ptr_intT">-</a> - + ptr_intT for casting a void * to an integer-type that holds a pointer Used for integer expressions (e.g., computing qh_gethash() in poly.c) - + notes: WARN64 -- these notes indicate 64-bit issues - On 64-bit machines, a pointer may be larger than an 'int'. + On 64-bit machines, a pointer may be larger than an 'int'. qh_meminit()/mem.c checks that 'ptr_intT' holds a 'void*' ptr_intT is not defined as 'long long' for portability to older compilers - ptr_intT is typically a signed value, but not necessarily so + ptr_intT is typically a signed value, but not necessarily so size_t is typically unsigned, but should match the parameter type Qhull uses int instead of size_t except for system calls such as malloc, qsort, qh_malloc, etc. + This matches Qt convention and is easier to work with. */ typedef long ptr_intT; /*-<a href="qh-mem.htm#TOC" >--------------------------------</a><a name="qhmemT">-</a> - + qhmemT global memory structure for mem.c - + notes: users should ignore qhmem except for writing extensions - qhmem is allocated in mem.c - + qhmem is allocated in mem.c + qhmem could be swapable like qh and qhstat, but then - multiple qh's and qhmem's would need to keep in synch. + multiple qh's and qhmem's would need to keep in synch. A swapable qhmem would also waste memory buffers. As long as memory operations are atomic, there is no problem with multiple qh structures being active at the same time. @@ -99,31 +100,36 @@ typedef long ptr_intT; contents of qhmem. */ typedef struct qhmemT qhmemT; -extern qhmemT qhmem; +extern qhmemT qhmem; + +#ifndef DEFsetT +#define DEFsetT 1 +typedef struct setT setT; /* defined in qset.h */ +#endif /* Update qhmem in mem.c if add or remove fields */ struct qhmemT { /* global memory management variables */ - int BUFsize; /* size of memory allocation buffer */ - int BUFinit; /* initial size of memory allocation buffer */ + int BUFsize; /* size of memory allocation buffer */ + int BUFinit; /* initial size of memory allocation buffer */ int TABLEsize; /* actual number of sizes in free list table */ int NUMsizes; /* maximum number of sizes in free list table */ int LASTsize; /* last size in free list table */ int ALIGNmask; /* worst-case alignment, must be 2^n-1 */ - void **freelists; /* free list table, linked by offset 0 */ + void **freelists; /* free list table, linked by offset 0 */ int *sizetable; /* size of each freelist */ int *indextable; /* size->index table */ void *curbuffer; /* current buffer, linked by offset 0 */ void *freemem; /* free memory in curbuffer */ - int freesize; /* size of freemem in bytes */ - void *tempstack; /* stack of temporary memory, managed by users */ + int freesize; /* size of freemem in bytes */ + setT *tempstack; /* stack of temporary memory, managed by users */ FILE *ferr; /* file for reporting errors, only user is qh_fprintf() */ int IStracing; /* =5 if tracing memory allocations */ int cntquick; /* count of quick allocations */ /* Note: removing statistics doesn't effect speed */ int cntshort; /* count of short allocations */ int cntlong; /* count of long allocations */ - int freeshort; /* count of short memfrees */ - int freelong; /* count of long memfrees */ + int freeshort; /* count of short memfrees */ + int freelong; /* count of long memfrees */ int totbuffer; /* total short memory buffers minus buffer links */ int totdropped; /* total dropped memory at end of short memory buffers (e.g., freesize) */ int totfree; /* total size of free, short memory on freelists */ @@ -140,10 +146,10 @@ struct qhmemT { /* global memory management variables */ /*-<a href="qh-mem.htm#TOC" >--------------------------------</a><a name="memalloc_">-</a> - - qh_memalloc_(insize, object, type) - returns object of size bytes - assumes size<=qhmem.LASTsize and void **freelistp is a temp + + qh_memalloc_(insize, object, type) + returns object of size bytes + assumes size<=qhmem.LASTsize and void **freelistp is a temp */ #if defined qh_NOmem @@ -167,8 +173,8 @@ struct qhmemT { /* global memory management variables */ /*-<a href="qh-mem.htm#TOC" >--------------------------------</a><a name="memfree_">-</a> - - qh_memfree_(object, insize) + + qh_memfree_(object, insize) free up an object notes: @@ -201,7 +207,7 @@ void qh_memfree(void *object, int insize); void qh_memfreeshort(int *curlong, int *totlong); void qh_meminit(FILE *ferr); void qh_meminitbuffers(int tracelevel, int alignment, int numsizes, - int bufsize, int bufinit); + int bufsize, int bufinit); void qh_memsetup(void); void qh_memsize(int size); void qh_memstatistics(FILE *fp); diff --git a/src/merge.c b/src/merge.c index 172e959..8fcc1bb 100644 --- a/src/merge.c +++ b/src/merge.c @@ -1,7 +1,7 @@ /*<html><pre> -<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="TOP">-</a> - merge.c + merge.c merges non-convex facets see qh-merge.htm and merge.h @@ -13,7 +13,7 @@ To remove deleted facets and vertices (qhull() in libqhull.c): qh_partitionvisible(!qh_ALL, &numoutside); // visible_list, newfacet_list qh_deletevisible(); // qh.visible_list - qh_resetlists(False, qh_RESETvisible); // qh.visible_list newvertex_list newfacet_list + qh_resetlists(False, qh_RESETvisible); // qh.visible_list newvertex_list newfacet_list assumes qh.CENTERtype= centrum @@ -21,8 +21,8 @@ vertex->neighbors not set until the first merge occurs copyright (c) 1993-2010 C.B. Barber. - $Id: //product/qhull/main/rel/src/merge.c#26 $$Change: 1144 $ - $DateTime: 2010/01/04 18:23:37 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/merge.c#27 $$Change: 1164 $ + $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ */ #include "qhull_a.h" @@ -33,7 +33,7 @@ /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="premerge">-</a> - + qh_premerge( apex, maxcentrum ) pre-merge nonconvex facets in qh.newfacet_list for apex maxcentrum defines coplanar and concave (qh_test_appendmerge) @@ -56,24 +56,24 @@ void qh_premerge(vertexT *apex, realT maxcentrum, realT maxangle) { boolT othermerge= False; facetT *newfacet; - + if (qh ZEROcentrum && qh_checkzero(!qh_ALL)) - return; + return; trace2((qh ferr, 2008, "qh_premerge: premerge centrum %2.2g angle %2.2g for apex v%d facetlist f%d\n", - maxcentrum, maxangle, apex->id, getid_(qh newfacet_list))); + maxcentrum, maxangle, apex->id, getid_(qh newfacet_list))); if (qh IStracing >= 4 && qh num_facets < 50) qh_printlists(); qh centrum_radius= maxcentrum; qh cos_max= maxangle; qh degen_mergeset= qh_settemp(qh TEMPsize); qh facet_mergeset= qh_settemp(qh TEMPsize); - if (qh hull_dim >=3) { + if (qh hull_dim >=3) { qh_mark_dupridges(qh newfacet_list); /* facet_mergeset */ qh_mergecycle_all(qh newfacet_list, &othermerge); - qh_forcedmerges(&othermerge /* qh facet_mergeset */); + qh_forcedmerges(&othermerge /* qh facet_mergeset */); FORALLnew_facets { /* test samecycle merges */ if (!newfacet->simplicial && !newfacet->mergeridge) - qh_degen_redundant_neighbors(newfacet, NULL); + qh_degen_redundant_neighbors(newfacet, NULL); } if (qh_merge_degenredundant()) othermerge= True; @@ -89,20 +89,20 @@ void qh_premerge(vertexT *apex, realT maxcentrum, realT maxangle) { qh_settempfree(&qh facet_mergeset); qh_settempfree(&qh degen_mergeset); } /* premerge */ - + /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="postmerge">-</a> - + qh_postmerge( reason, maxcentrum, maxangle, vneighbors ) post-merge nonconvex facets as defined by maxcentrum and maxangle 'reason' is for reporting progress - if vneighbors, - calls qh_test_vneighbors at end of qh_all_merge - if firstmerge, + if vneighbors, + calls qh_test_vneighbors at end of qh_all_merge + if firstmerge, calls qh_reducevertices before qh_getmergeset returns: - if first call (qh.visible_list != qh.facet_list), + if first call (qh.visible_list != qh.facet_list), builds qh.facet_newlist, qh.newvertex_list deleted facets added to qh.visible_list with facet->visible qh.visible_list == qh.facet_list @@ -121,12 +121,12 @@ void qh_premerge(vertexT *apex, realT maxcentrum, realT maxangle) { set vertex->delridge {will retest the ridge} if qh.MERGEexact call qh_reducevertices() - if no pre-merging + if no pre-merging merge flipped facets determine non-convex facets merge all non-convex facets */ -void qh_postmerge(const char *reason, realT maxcentrum, realT maxangle, +void qh_postmerge(const char *reason, realT maxcentrum, realT maxangle, boolT vneighbors) { facetT *newfacet; boolT othermerges= False; @@ -135,13 +135,13 @@ void qh_postmerge(const char *reason, realT maxcentrum, realT maxangle, if (qh REPORTfreq || qh IStracing) { qh_buildtracing(NULL, NULL); qh_printsummary(qh ferr); - if (qh PRINTstatistics) + if (qh PRINTstatistics) qh_printallstatistics(qh ferr, "reason"); - qh_fprintf(qh ferr, 8062, "\n%s with 'C%.2g' and 'A%.2g'\n", + qh_fprintf(qh ferr, 8062, "\n%s with 'C%.2g' and 'A%.2g'\n", reason, maxcentrum, maxangle); } trace2((qh ferr, 2009, "qh_postmerge: postmerge. test vneighbors? %d\n", - vneighbors)); + vneighbors)); qh centrum_radius= maxcentrum; qh cos_max= maxangle; qh POSTmerging= True; @@ -161,13 +161,13 @@ void qh_postmerge(const char *reason, realT maxcentrum, realT maxangle, vertex->newlist= True; if (qh VERTEXneighbors) { /* a merge has occurred */ FORALLvertices - vertex->delridge= True; /* test for redundant, needed? */ + vertex->delridge= True; /* test for redundant, needed? */ if (qh MERGEexact) { - if (qh hull_dim <= qh_DIMreduceBuild) - qh_reducevertices(); /* was skipped during pre-merging */ + if (qh hull_dim <= qh_DIMreduceBuild) + qh_reducevertices(); /* was skipped during pre-merging */ } } - if (!qh PREmerge && !qh MERGEexact) + if (!qh PREmerge && !qh MERGEexact) qh_flippedmerges(qh newfacet_list, &othermerges); } qh_getmergeset_initial(qh newfacet_list); @@ -178,24 +178,24 @@ void qh_postmerge(const char *reason, realT maxcentrum, realT maxangle, /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="all_merges">-</a> - + qh_all_merges( othermerge, vneighbors ) merge all non-convex facets - + set othermerge if already merged facets (for qh_reducevertices) if vneighbors tests vertex neighbors for convexity at end qh.facet_mergeset lists the non-convex ridges in qh_newfacet_list qh.degen_mergeset is defined - if qh.MERGEexact && !qh.POSTmerging, + if qh.MERGEexact && !qh.POSTmerging, does not merge coplanar facets returns: deleted facets added to qh.visible_list with facet->visible deleted vertices added qh.delvertex_list with vertex->delvertex - + notes: - unless !qh.MERGEindependent, + unless !qh.MERGEindependent, merges facets in independent sets uses qh.newfacet_list as argument since merges call qh_removefacet() @@ -220,60 +220,60 @@ void qh_all_merges(boolT othermerge, boolT vneighbors) { vertexT *vertex; mergeType mergetype; int numcoplanar=0, numconcave=0, numdegenredun= 0, numnewmerges= 0; - + trace2((qh ferr, 2010, "qh_all_merges: starting to merge facets beginning from f%d\n", - getid_(qh newfacet_list))); + getid_(qh newfacet_list))); while (True) { wasmerge= False; while (qh_setsize(qh facet_mergeset)) { while ((merge= (mergeT*)qh_setdellast(qh facet_mergeset))) { - facet1= merge->facet1; - facet2= merge->facet2; - mergetype= merge->type; - qh_memfree_(merge, (int)sizeof(mergeT), freelistp); - if (facet1->visible || facet2->visible) /*deleted facet*/ - continue; - if ((facet1->newfacet && !facet1->tested) - || (facet2->newfacet && !facet2->tested)) { - if (qh MERGEindependent && mergetype <= MRGanglecoplanar) - continue; /* perform independent sets of merges */ - } - qh_merge_nonconvex(facet1, facet2, mergetype); + facet1= merge->facet1; + facet2= merge->facet2; + mergetype= merge->type; + qh_memfree_(merge, (int)sizeof(mergeT), freelistp); + if (facet1->visible || facet2->visible) /*deleted facet*/ + continue; + if ((facet1->newfacet && !facet1->tested) + || (facet2->newfacet && !facet2->tested)) { + if (qh MERGEindependent && mergetype <= MRGanglecoplanar) + continue; /* perform independent sets of merges */ + } + qh_merge_nonconvex(facet1, facet2, mergetype); numdegenredun += qh_merge_degenredundant(); numnewmerges++; wasmerge= True; - if (mergetype == MRGconcave) - numconcave++; - else /* MRGcoplanar or MRGanglecoplanar */ - numcoplanar++; + if (mergetype == MRGconcave) + numconcave++; + else /* MRGcoplanar or MRGanglecoplanar */ + numcoplanar++; } /* while setdellast */ - if (qh POSTmerging && qh hull_dim <= qh_DIMreduceBuild + if (qh POSTmerging && qh hull_dim <= qh_DIMreduceBuild && numnewmerges > qh_MAXnewmerges) { - numnewmerges= 0; - qh_reducevertices(); /* otherwise large post merges too slow */ + numnewmerges= 0; + qh_reducevertices(); /* otherwise large post merges too slow */ } qh_getmergeset(qh newfacet_list); /* facet_mergeset */ } /* while mergeset */ if (qh VERTEXneighbors) { isreduce= False; if (qh hull_dim >=4 && qh POSTmerging) { - FORALLvertices - vertex->delridge= True; - isreduce= True; + FORALLvertices + vertex->delridge= True; + isreduce= True; } - if ((wasmerge || othermerge) && (!qh MERGEexact || qh POSTmerging) - && qh hull_dim <= qh_DIMreduceBuild) { - othermerge= False; - isreduce= True; + if ((wasmerge || othermerge) && (!qh MERGEexact || qh POSTmerging) + && qh hull_dim <= qh_DIMreduceBuild) { + othermerge= False; + isreduce= True; } if (isreduce) { - if (qh_reducevertices()) { - qh_getmergeset(qh newfacet_list); /* facet_mergeset */ - continue; - } + if (qh_reducevertices()) { + qh_getmergeset(qh newfacet_list); /* facet_mergeset */ + continue; + } } } - if (vneighbors && qh_test_vneighbors(/* qh newfacet_list */)) + if (vneighbors && qh_test_vneighbors(/* qh newfacet_list */)) continue; break; } /* while (True) */ @@ -293,7 +293,7 @@ void qh_all_merges(boolT othermerge, boolT vneighbors) { /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="appendmergeset">-</a> - + qh_appendmergeset( facet, neighbor, mergetype, angle ) appends an entry to qh.facet_mergeset or qh.degen_mergeset @@ -302,7 +302,7 @@ void qh_all_merges(boolT othermerge, boolT vneighbors) { returns: merge appended to facet_mergeset or degen_mergeset sets ->degenerate or ->redundant if degen_mergeset - + see: qh_test_appendmerge() @@ -311,11 +311,11 @@ void qh_all_merges(boolT othermerge, boolT vneighbors) { if regular merge append to qh.facet_mergeset else if degenerate merge and qh.facet_mergeset is all degenerate - append to qh.degen_mergeset + append to qh.degen_mergeset else if degenerate merge - prepend to qh.degen_mergeset + prepend to qh.degen_mergeset else if redundant merge - append to qh.degen_mergeset + append to qh.degen_mergeset */ void qh_appendmergeset(facetT *facet, facetT *neighbor, mergeType mergetype, realT *angle) { mergeT *merge, *lastmerge; @@ -335,7 +335,7 @@ void qh_appendmergeset(facetT *facet, facetT *neighbor, mergeType mergetype, rea qh_setappend(&(qh facet_mergeset), merge); else if (mergetype == MRGdegen) { facet->degenerate= True; - if (!(lastmerge= (mergeT*)qh_setlast(qh degen_mergeset)) + if (!(lastmerge= (mergeT*)qh_setlast(qh degen_mergeset)) || lastmerge->type == MRGdegen) qh_setappend(&(qh degen_mergeset), merge); else @@ -346,12 +346,12 @@ void qh_appendmergeset(facetT *facet, facetT *neighbor, mergeType mergetype, rea }else /* mergetype == MRGmirror */ { if (facet->redundant || neighbor->redundant) { qh_fprintf(qh ferr, 6092, "qhull error (qh_appendmergeset): facet f%d or f%d is already a mirrored facet\n", - facet->id, neighbor->id); + facet->id, neighbor->id); qh_errexit2 (qh_ERRqhull, facet, neighbor); } if (!qh_setequal(facet->vertices, neighbor->vertices)) { qh_fprintf(qh ferr, 6093, "qhull error (qh_appendmergeset): mirrored facets f%d and f%d do not have the same vertices\n", - facet->id, neighbor->id); + facet->id, neighbor->id); qh_errexit2 (qh_ERRqhull, facet, neighbor); } facet->redundant= True; @@ -363,7 +363,7 @@ void qh_appendmergeset(facetT *facet, facetT *neighbor, mergeType mergetype, rea /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="basevertices">-</a> - + qh_basevertices( samecycle ) return temporary set of base vertices for samecycle samecycle is first facet in the cycle @@ -379,13 +379,13 @@ void qh_appendmergeset(facetT *facet, facetT *neighbor, mergeType mergetype, rea design: for each facet in samecycle for each unseen vertex in facet->vertices - append to result + append to result */ setT *qh_basevertices(facetT *samecycle) { facetT *same; vertexT *apex, *vertex, **vertexp; setT *vertices= qh_settemp(qh TEMPsize); - + apex= SETfirstt_(samecycle->vertices, vertexT); apex->visitid= ++qh vertex_visit; FORALLsame_cycle_(samecycle) { @@ -399,18 +399,18 @@ setT *qh_basevertices(facetT *samecycle) { } } } - trace4((qh ferr, 4019, "qh_basevertices: found %d vertices\n", + trace4((qh ferr, 4019, "qh_basevertices: found %d vertices\n", qh_setsize(vertices))); return vertices; } /* basevertices */ /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="checkconnect">-</a> - + qh_checkconnect() check that new facets are connected new facets are on qh.newfacet_list - + notes: this is slow and it changes the order of the facets uses qh.visit_id @@ -451,16 +451,16 @@ void qh_checkconnect(void /* qh newfacet_list */) { /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="checkzero">-</a> - + qh_checkzero( testall ) check that facets are clearly convex for qh.DISTround with qh.MERGEexact - if testall, + if testall, test all facets for qh.MERGEexact post-merging - else + else test qh.newfacet_list - - if qh.MERGEexact, + + if qh.MERGEexact, allows coplanar ridges skips convexity test while qh.ZEROall_ok @@ -468,7 +468,7 @@ void qh_checkconnect(void /* qh newfacet_list */) { True if all facets !flipped, !dupridge, normal if all horizon facets are simplicial if all vertices are clearly below neighbor - if all opposite vertices of horizon are below + if all opposite vertices of horizon are below clears qh.ZEROall_ok if any problems or coplanar facets notes: @@ -492,7 +492,7 @@ boolT qh_checkzero(boolT testall) { vertexT *vertex, **vertexp; realT dist; - if (testall) + if (testall) facetlist= qh facet_list; else { facetlist= qh newfacet_list; @@ -515,7 +515,7 @@ boolT qh_checkzero(boolT testall) { FOREACHneighbor_(facet) { if (!neighbor_i && !testall) { horizon= neighbor; - neighbor_i++; + neighbor_i++; continue; /* horizon facet tested in qh_findhorizon */ } vertex= SETelemt_(facet->vertices, neighbor_i++, vertexT); @@ -530,21 +530,21 @@ boolT qh_checkzero(boolT testall) { } if (!testall) { FOREACHvertex_(horizon->vertices) { - if (vertex->visitid != qh vertex_visit) { - zzinc_(Zdistzero); - qh_distplane(vertex->point, facet, &dist); - if (dist >= -qh DISTround) { - qh ZEROall_ok= False; - if (!qh MERGEexact || dist > qh DISTround) - goto LABELnonconvex; - } - break; - } + if (vertex->visitid != qh vertex_visit) { + zzinc_(Zdistzero); + qh_distplane(vertex->point, facet, &dist); + if (dist >= -qh DISTround) { + qh ZEROall_ok= False; + if (!qh MERGEexact || dist > qh DISTround) + goto LABELnonconvex; + } + break; + } } } } trace2((qh ferr, 2012, "qh_checkzero: testall %d, facets are %s\n", testall, - (qh MERGEexact && !testall) ? + (qh MERGEexact && !testall) ? "not concave, flipped, or duplicate ridged" : "clearly convex")); return True; @@ -562,43 +562,43 @@ boolT qh_checkzero(boolT testall) { /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="compareangle">-</a> - + qh_compareangle( angle1, angle2 ) used by qsort() to order merges by angle */ int qh_compareangle(const void *p1, const void *p2) { const mergeT *a= *((mergeT *const*)p1), *b= *((mergeT *const*)p2); - + return((a->angle > b->angle) ? 1 : -1); } /* compareangle */ /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="comparemerge">-</a> - + qh_comparemerge( merge1, merge2 ) used by qsort() to order merges */ int qh_comparemerge(const void *p1, const void *p2) { const mergeT *a= *((mergeT *const*)p1), *b= *((mergeT *const*)p2); - + return(a->type - b->type); } /* comparemerge */ /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="comparevisit">-</a> - + qh_comparevisit( vertex1, vertex2 ) used by qsort() to order vertices by their visitid */ int qh_comparevisit(const void *p1, const void *p2) { const vertexT *a= *((vertexT *const*)p1), *b= *((vertexT *const*)p2); - + return(a->visitid - b->visitid); } /* comparevisit */ /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="copynonconvex">-</a> - + qh_copynonconvex( atridge ) set non-convex flag on other ridges (if any) between same neighbors @@ -620,7 +620,7 @@ void qh_copynonconvex(ridgeT *atridge) { if (otherfacet == otherfacet_(ridge, facet) && ridge != atridge) { ridge->nonconvex= True; trace4((qh ferr, 4020, "qh_copynonconvex: moved nonconvex flag from r%d to r%d\n", - atridge->id, ridge->id)); + atridge->id, ridge->id)); break; } } @@ -628,7 +628,7 @@ void qh_copynonconvex(ridgeT *atridge) { /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="degen_redundant_facet">-</a> - + qh_degen_redundant_facet( facet ) check facet for degen. or redundancy @@ -649,18 +649,18 @@ void qh_degen_redundant_facet(facetT *facet) { facetT *neighbor, **neighborp; trace4((qh ferr, 4021, "qh_degen_redundant_facet: test facet f%d for degen/redundant\n", - facet->id)); + facet->id)); FOREACHneighbor_(facet) { qh vertex_visit++; FOREACHvertex_(neighbor->vertices) vertex->visitid= qh vertex_visit; FOREACHvertex_(facet->vertices) { if (vertex->visitid != qh vertex_visit) - break; + break; } if (!vertex) { qh_appendmergeset(facet, neighbor, MRGredundant, NULL); - trace2((qh ferr, 2015, "qh_degen_redundant_facet: f%d is contained in f%d. merge\n", facet->id, neighbor->id)); + trace2((qh ferr, 2015, "qh_degen_redundant_facet: f%d is contained in f%d. merge\n", facet->id, neighbor->id)); return; } } @@ -673,10 +673,10 @@ void qh_degen_redundant_facet(facetT *facet) { /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="degen_redundant_neighbors">-</a> - + qh_degen_redundant_neighbors( facet, delfacet, ) append degenerate and redundant neighbors to facet_mergeset - if delfacet, + if delfacet, only checks neighbors of both delfacet and facet also checks current facet for degeneracy @@ -691,7 +691,7 @@ void qh_degen_redundant_facet(facetT *facet) { a redundant facet's vertices is a subset of its neighbor's vertices tests for redundant merges first (appendmergeset is nop for others) in a merge, only needs to test neighbors of merged facet - + see: qh_merge_degenredundant() and qh_degen_redundant_facet() @@ -705,8 +705,8 @@ void qh_degen_redundant_neighbors(facetT *facet, facetT *delfacet) { facetT *neighbor, **neighborp; int size; - trace4((qh ferr, 4022, "qh_degen_redundant_neighbors: test neighbors of f%d with delfacet f%d\n", - facet->id, getid_(delfacet))); + trace4((qh ferr, 4022, "qh_degen_redundant_neighbors: test neighbors of f%d with delfacet f%d\n", + facet->id, getid_(delfacet))); if ((size= qh_setsize(facet->neighbors)) < qh hull_dim) { qh_appendmergeset(facet, facet, MRGdegen, NULL); trace2((qh ferr, 2017, "qh_degen_redundant_neighbors: f%d is degenerate with %d neighbors.\n", facet->id, size)); @@ -726,7 +726,7 @@ void qh_degen_redundant_neighbors(facetT *facet, facetT *delfacet) { } if (!vertex) { qh_appendmergeset(neighbor, facet, MRGredundant, NULL); - trace2((qh ferr, 2018, "qh_degen_redundant_neighbors: f%d is contained in f%d. merge\n", neighbor->id, facet->id)); + trace2((qh ferr, 2018, "qh_degen_redundant_neighbors: f%d is contained in f%d. merge\n", neighbor->id, facet->id)); } } FOREACHneighbor_(delfacet) { /* redundant merges occur first */ @@ -734,7 +734,7 @@ void qh_degen_redundant_neighbors(facetT *facet, facetT *delfacet) { continue; if ((size= qh_setsize(neighbor->neighbors)) < qh hull_dim) { qh_appendmergeset(neighbor, neighbor, MRGdegen, NULL); - trace2((qh ferr, 2019, "qh_degen_redundant_neighbors: f%d is degenerate with %d neighbors. Neighbor of f%d.\n", neighbor->id, size, facet->id)); + trace2((qh ferr, 2019, "qh_degen_redundant_neighbors: f%d is degenerate with %d neighbors. Neighbor of f%d.\n", neighbor->id, size, facet->id)); } } } /* degen_redundant_neighbors */ @@ -742,7 +742,7 @@ void qh_degen_redundant_neighbors(facetT *facet, facetT *delfacet) { /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="find_newvertex">-</a> - + qh_find_newvertex( oldvertex, vertices, ridges ) locate new vertex for renaming old vertex vertices is a set of possible new vertices @@ -752,7 +752,7 @@ void qh_degen_redundant_neighbors(facetT *facet, facetT *delfacet) { newvertex or NULL each ridge includes both vertex and oldvertex vertices sorted by number of deleted ridges - + notes: modifies vertex->visitid new vertex is in one of the ridges @@ -763,7 +763,7 @@ void qh_degen_redundant_neighbors(facetT *facet, facetT *delfacet) { design: for each vertex in vertices set vertex->visitid to number of references in ridges - remove unvisited vertices + remove unvisited vertices set qh.vertex_visit above all possible values sort vertices by number of references in ridges add each ridge to qh.hash_table @@ -780,18 +780,18 @@ vertexT *qh_find_newvertex(vertexT *oldvertex, setT *vertices, setT *ridges) { #ifndef qh_NOtrace if (qh IStracing >= 4) { qh_fprintf(qh ferr, 8063, "qh_find_newvertex: find new vertex for v%d from ", - oldvertex->id); - FOREACHvertex_(vertices) + oldvertex->id); + FOREACHvertex_(vertices) qh_fprintf(qh ferr, 8064, "v%d ", vertex->id); FOREACHridge_(ridges) qh_fprintf(qh ferr, 8065, "r%d ", ridge->id); qh_fprintf(qh ferr, 8066, "\n"); } #endif - FOREACHvertex_(vertices) + FOREACHvertex_(vertices) vertex->visitid= 0; FOREACHridge_(ridges) { - FOREACHvertex_(ridge->vertices) + FOREACHvertex_(ridge->vertices) vertex->visitid++; } FOREACHvertex_(vertices) { @@ -803,11 +803,11 @@ vertexT *qh_find_newvertex(vertexT *oldvertex, setT *vertices, setT *ridges) { qh vertex_visit += (unsigned int)qh_setsize(ridges); if (!qh_setsize(vertices)) { trace4((qh ferr, 4023, "qh_find_newvertex: vertices not in ridges for v%d\n", - oldvertex->id)); + oldvertex->id)); return NULL; } qsort(SETaddr_(vertices, vertexT), (size_t)qh_setsize(vertices), - sizeof(vertexT *), qh_comparevisit); + sizeof(vertexT *), qh_comparevisit); /* can now use qh vertex_visit */ if (qh PRINTstatistics) { size= qh_setsize(vertices); @@ -822,8 +822,8 @@ vertexT *qh_find_newvertex(vertexT *oldvertex, setT *vertices, setT *ridges) { newridges= qh_vertexridges(vertex); FOREACHridge_(newridges) { if (qh_hashridge_find(qh hash_table, hashsize, ridge, vertex, oldvertex, &hash)) { - zinc_(Zdupridge); - break; + zinc_(Zdupridge); + break; } } qh_settempfree(&newridges); @@ -845,12 +845,12 @@ vertexT *qh_find_newvertex(vertexT *oldvertex, setT *vertices, setT *ridges) { /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="findbest_test">-</a> - + qh_findbest_test( testcentrum, facet, neighbor, bestfacet, dist, mindist, maxdist ) test neighbor of facet for qh_findbestneighbor() if testcentrum, tests centrum (assumes it is defined) - else + else tests vertices returns: @@ -885,13 +885,13 @@ void qh_findbest_test(boolT testcentrum, facetT *facet, facetT *neighbor, /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="findbestneighbor">-</a> - + qh_findbestneighbor( facet, dist, mindist, maxdist ) finds best neighbor (least dist) of a facet for merging returns: returns min and max distances and their max absolute value - + notes: avoids merging old into new assumes ridge->nonconvex only set on one ridge between a pair of facets @@ -926,23 +926,23 @@ facetT *qh_findbestneighbor(facetT *facet, realT *distp, realT *mindistp, realT FOREACHridge_(facet->ridges) { if (ridge->nonconvex) { neighbor= otherfacet_(ridge, facet); - qh_findbest_test(testcentrum, facet, neighbor, - &bestfacet, distp, mindistp, maxdistp); + qh_findbest_test(testcentrum, facet, neighbor, + &bestfacet, distp, mindistp, maxdistp); } } } - if (!bestfacet) { + if (!bestfacet) { nonconvex= False; FOREACHneighbor_(facet) qh_findbest_test(testcentrum, facet, neighbor, - &bestfacet, distp, mindistp, maxdistp); + &bestfacet, distp, mindistp, maxdistp); } if (!bestfacet) { qh_fprintf(qh ferr, 6095, "qhull internal error (qh_findbestneighbor): no neighbors for f%d\n", facet->id); - + qh_errexit(qh_ERRqhull, facet, NULL); } - if (testcentrum) + if (testcentrum) qh_getdistance(facet, bestfacet, mindistp, maxdistp); trace3((qh ferr, 3002, "qh_findbestneighbor: f%d is best neighbor for f%d testcentrum? %d nonconvex? %d dist %2.2g min %2.2g max %2.2g\n", bestfacet->id, facet->id, testcentrum, nonconvex, *distp, *mindistp, *maxdistp)); @@ -952,7 +952,7 @@ facetT *qh_findbestneighbor(facetT *facet, realT *distp, realT *mindistp, realT /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="flippedmerges">-</a> - + qh_flippedmerges( facetlist, wasmerge ) merge flipped facets into best neighbor assumes qh.facet_mergeset at top of temporary stack @@ -983,7 +983,7 @@ void qh_flippedmerges(facetT *facetlist, boolT *wasmerge) { trace4((qh ferr, 4024, "qh_flippedmerges: begin\n")); FORALLfacet_(facetlist) { - if (facet->flipped && !facet->visible) + if (facet->flipped && !facet->visible) qh_appendmergeset(facet, facet, MRGflip, NULL); } othermerges= qh_settemppop(); /* was facet_mergeset */ @@ -991,7 +991,7 @@ void qh_flippedmerges(facetT *facetlist, boolT *wasmerge) { qh_settemppush(othermerges); FOREACHmerge_(othermerges) { facet1= merge->facet1; - if (merge->type != MRGflip || facet1->visible) + if (merge->type != MRGflip || facet1->visible) continue; if (qh TRACEmerge-1 == zzval_(Ztotmerge)) qhmem.IStracing= qh IStracing= qh TRACElevel; @@ -1022,7 +1022,7 @@ void qh_flippedmerges(facetT *facetlist, boolT *wasmerge) { /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="forcedmerges">-</a> - + qh_forcedmerges( wasmerge ) merge duplicated ridges @@ -1032,7 +1032,7 @@ void qh_flippedmerges(facetT *facetlist, boolT *wasmerge) { qh.facet_mergeset may include non-forced merges(none for now) qh.degen_mergeset includes degen/redun merges - notes: + notes: duplicate ridges occur when the horizon is pinched, i.e. a subridge occurs in more than two horizon ridges. could rename vertices that pinch the horizon @@ -1056,16 +1056,16 @@ void qh_forcedmerges(boolT *wasmerge) { if (qh TRACEmerge-1 == zzval_(Ztotmerge)) qhmem.IStracing= qh IStracing= qh TRACElevel; - trace4((qh ferr, 4025, "qh_forcedmerges: begin\n")); + trace4((qh ferr, 4025, "qh_forcedmerges: begin\n")); othermerges= qh_settemppop(); /* was facet_mergeset */ qh facet_mergeset= qh_settemp(qh TEMPsize); qh_settemppush(othermerges); FOREACHmerge_(othermerges) { - if (merge->type != MRGridge) - continue; + if (merge->type != MRGridge) + continue; facet1= merge->facet1; facet2= merge->facet2; - while (facet1->visible) /* must exist, no qh_merge_degenredunant */ + while (facet1->visible) /* must exist, no qh_merge_degenredunant */ facet1= facet1->f.replace; /* previously merged facet */ while (facet2->visible) facet2= facet2->f.replace; /* previously merged facet */ @@ -1073,7 +1073,7 @@ void qh_forcedmerges(boolT *wasmerge) { continue; if (!qh_setin(facet2->neighbors, facet1)) { qh_fprintf(qh ferr, 6096, "qhull internal error (qh_forcedmerges): f%d and f%d had a duplicate ridge but as f%d and f%d they are no longer neighbors\n", - merge->facet1->id, merge->facet2->id, facet1->id, facet2->id); + merge->facet1->id, merge->facet2->id, facet1->id, facet2->id); qh_errexit2 (qh_ERRqhull, facet1, facet2); } if (qh TRACEmerge-1 == zzval_(Ztotmerge)) @@ -1081,8 +1081,8 @@ void qh_forcedmerges(boolT *wasmerge) { dist1= qh_getdistance(facet1, facet2, &mindist1, &maxdist1); dist2= qh_getdistance(facet2, facet1, &mindist2, &maxdist2); trace0((qh ferr, 16, "qh_forcedmerges: duplicate ridge between f%d and f%d, dist %2.2g and reverse dist %2.2g during p%d\n", - facet1->id, facet2->id, dist1, dist2, qh furthest_id)); - if (dist1 < dist2) + facet1->id, facet2->id, dist1, dist2, qh furthest_id)); + if (dist1 < dist2) qh_mergefacet(facet1, facet2, &mindist1, &maxdist1, !qh_MERGEapex); else { qh_mergefacet(facet2, facet1, &mindist2, &maxdist2, !qh_MERGEapex); @@ -1109,14 +1109,14 @@ void qh_forcedmerges(boolT *wasmerge) { qh_settempfree(&othermerges); if (nummerge) *wasmerge= True; - trace1((qh ferr, 1011, "qh_forcedmerges: merged %d facets and %d flipped facets across duplicated ridges\n", + trace1((qh ferr, 1011, "qh_forcedmerges: merged %d facets and %d flipped facets across duplicated ridges\n", nummerge, numflip)); } /* forcedmerges */ /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="getmergeset">-</a> - + qh_getmergeset( facetlist ) determines nonconvex facets on facetlist tests !tested ridges and nonconvex ridges of !tested facets @@ -1124,13 +1124,13 @@ void qh_forcedmerges(boolT *wasmerge) { returns: returns sorted qh.facet_mergeset of facet-neighbor pairs to be merged all ridges tested - + notes: assumes no nonconvex ridges with both facets tested uses facet->tested/ridge->tested to prevent duplicate tests can not limit tests to modified ridges since the centrum changed uses qh.visit_id - + see: qh_getmergeset_initial() @@ -1141,13 +1141,13 @@ void qh_forcedmerges(boolT *wasmerge) { test ridge for convexity if non-convex append ridge to qh.facet_mergeset - sort qh.facet_mergeset by angle + sort qh.facet_mergeset by angle */ void qh_getmergeset(facetT *facetlist) { facetT *facet, *neighbor, **neighborp; ridgeT *ridge, **ridgep; int nummerges; - + nummerges= qh_setsize(qh facet_mergeset); trace4((qh ferr, 4026, "qh_getmergeset: started.\n")); qh visit_id++; @@ -1160,18 +1160,18 @@ void qh_getmergeset(facetT *facetlist) { neighbor->seen= False; FOREACHridge_(facet->ridges) { if (ridge->tested && !ridge->nonconvex) - continue; + continue; /* if tested & nonconvex, need to append merge */ neighbor= otherfacet_(ridge, facet); if (neighbor->seen) { - ridge->tested= True; - ridge->nonconvex= False; + ridge->tested= True; + ridge->nonconvex= False; }else if (neighbor->visitid != qh visit_id) { ridge->tested= True; ridge->nonconvex= False; - neighbor->seen= True; /* only one ridge is marked nonconvex */ - if (qh_test_appendmerge(facet, neighbor)) - ridge->nonconvex= True; + neighbor->seen= True; /* only one ridge is marked nonconvex */ + if (qh_test_appendmerge(facet, neighbor)) + ridge->nonconvex= True; } } } @@ -1192,7 +1192,7 @@ void qh_getmergeset(facetT *facetlist) { /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="getmergeset_initial">-</a> - + qh_getmergeset_initial( facetlist ) determine initial qh.facet_mergeset for facets tests all facet/neighbor pairs on facetlist @@ -1231,7 +1231,7 @@ void qh_getmergeset_initial(facetT *facetlist) { FOREACHridge_(neighbor->ridges) { if (facet == otherfacet_(ridge, neighbor)) { ridge->nonconvex= True; - break; /* only one ridge is marked nonconvex */ + break; /* only one ridge is marked nonconvex */ } } } @@ -1257,7 +1257,7 @@ void qh_getmergeset_initial(facetT *facetlist) { /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="hashridge">-</a> - + qh_hashridge( hashtable, hashsize, ridge, oldvertex ) add ridge to hashtable without oldvertex @@ -1287,21 +1287,21 @@ void qh_hashridge(setT *hashtable, int hashsize, ridgeT *ridge, vertexT *oldvert /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="hashridge_find">-</a> - + qh_hashridge_find( hashtable, hashsize, ridge, vertex, oldvertex, hashslot ) - returns matching ridge without oldvertex in hashtable + returns matching ridge without oldvertex in hashtable for ridge without vertex - if oldvertex is NULL + if oldvertex is NULL matches with any one skip returns: matching ridge or NULL if no match, if ridge already in table - hashslot= -1 - else + hashslot= -1 + else hashslot= next NULL index - + notes: assumes hashtable is large enough can't match ridge to itself @@ -1311,7 +1311,7 @@ void qh_hashridge(setT *hashtable, int hashsize, ridgeT *ridge, vertexT *oldvert for each hashslot return match if ridge matches ridgeA without oldvertex */ -ridgeT *qh_hashridge_find(setT *hashtable, int hashsize, ridgeT *ridge, +ridgeT *qh_hashridge_find(setT *hashtable, int hashsize, ridgeT *ridge, vertexT *vertex, vertexT *oldvertex, int *hashslot) { int hash; ridgeT *ridgeA; @@ -1321,7 +1321,7 @@ ridgeT *qh_hashridge_find(setT *hashtable, int hashsize, ridgeT *ridge, hash= qh_gethash(hashsize, ridge->vertices, qh hull_dim-1, 0, vertex); while ((ridgeA= SETelemt_(hashtable, hash, ridgeT))) { if (ridgeA == ridge) - *hashslot= -1; + *hashslot= -1; else { zinc_(Zhashridgetest); if (qh_setequal_except(ridge->vertices, vertex, ridgeA->vertices, oldvertex)) @@ -1338,14 +1338,14 @@ ridgeT *qh_hashridge_find(setT *hashtable, int hashsize, ridgeT *ridge, /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="makeridges">-</a> - + qh_makeridges( facet ) creates explicit ridges between simplicial facets returns: facet with ridges and without qh_MERGEridge ->simplicial is False - + notes: allows qh_MERGEridge flag uses existing ridges @@ -1357,7 +1357,7 @@ ridgeT *qh_hashridge_find(setT *hashtable, int hashsize, ridgeT *ridge, design: look for qh_MERGEridge neighbors mark neighbors that already have ridges - for each unprocessed neighbor of facet + for each unprocessed neighbor of facet create a ridge for neighbor and facet if any qh_MERGEridge neighbors delete qh_MERGEridge flags (already handled by qh_mark_dupridges) @@ -1367,7 +1367,7 @@ void qh_makeridges(facetT *facet) { ridgeT *ridge, **ridgep; int neighbor_i, neighbor_n; boolT toporient, mergeridge= False; - + if (!facet->simplicial) return; trace4((qh ferr, 4027, "qh_makeridges: make ridges for f%d\n", facet->id)); @@ -1386,7 +1386,7 @@ void qh_makeridges(facetT *facet) { else if (!neighbor->seen) { /* no current ridges */ ridge= qh_newridge(); ridge->vertices= qh_setnew_delnthsorted(facet->vertices, qh hull_dim, - neighbor_i, 0); + neighbor_i, 0); toporient= facet->toporient ^ (neighbor_i & 0x1); if (toporient) { ridge->top= facet; @@ -1418,7 +1418,7 @@ void qh_makeridges(facetT *facet) { /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="mark_dupridges">-</a> - + qh_mark_dupridges( facetlist ) add duplicated ridges to qh.facet_mergeset facet->dupridge is true @@ -1428,7 +1428,7 @@ void qh_makeridges(facetT *facet) { ->mergeridge/->mergeridge2 set duplicate ridges marked by qh_MERGEridge and both sides facet->dupridge no MERGEridges in neighbor sets - + notes: duplicate ridges occur when the horizon is pinched, i.e. a subridge occurs in more than two horizon ridges. @@ -1440,9 +1440,9 @@ void qh_makeridges(facetT *facet) { if facet contains a duplicate ridge for each neighbor of facet if neighbor marked qh_MERGEridge (one side of the merge) - set facet->mergeridge + set facet->mergeridge else - if neighbor contains a duplicate ridge + if neighbor contains a duplicate ridge and the back link is qh_MERGEridge append duplicate ridge to qh.facet_mergeset for each duplicate ridge @@ -1456,30 +1456,30 @@ void qh_mark_dupridges(facetT *facetlist) { facetT *facet, *neighbor, **neighborp; int nummerge=0; mergeT *merge, **mergep; - - trace4((qh ferr, 4028, "qh_mark_dupridges: identify duplicate ridges\n")); + + trace4((qh ferr, 4028, "qh_mark_dupridges: identify duplicate ridges\n")); FORALLfacet_(facetlist) { if (facet->dupridge) { FOREACHneighbor_(facet) { if (neighbor == qh_MERGEridge) { - facet->mergeridge= True; - continue; - } + facet->mergeridge= True; + continue; + } if (neighbor->dupridge - && !qh_setin(neighbor->neighbors, facet)) { /* qh_MERGEridge */ - qh_appendmergeset(facet, neighbor, MRGridge, NULL); - facet->mergeridge2= True; - facet->mergeridge= True; - nummerge++; - } + && !qh_setin(neighbor->neighbors, facet)) { /* qh_MERGEridge */ + qh_appendmergeset(facet, neighbor, MRGridge, NULL); + facet->mergeridge2= True; + facet->mergeridge= True; + nummerge++; + } } } } if (!nummerge) return; FORALLfacet_(facetlist) { /* gets rid of qh_MERGEridge */ - if (facet->mergeridge && !facet->mergeridge2) + if (facet->mergeridge && !facet->mergeridge2) qh_makeridges(facet); } FOREACHmerge_(qh facet_mergeset) { /* restore the missing neighbors */ @@ -1488,20 +1488,20 @@ void qh_mark_dupridges(facetT *facetlist) { qh_makeridges(merge->facet1); /* and the missing ridges */ } } - trace1((qh ferr, 1012, "qh_mark_dupridges: found %d duplicated ridges\n", + trace1((qh ferr, 1012, "qh_mark_dupridges: found %d duplicated ridges\n", nummerge)); } /* mark_dupridges */ /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="maydropneighbor">-</a> - + qh_maydropneighbor( facet ) drop neighbor relationship if no ridge between facet and neighbor returns: neighbor sets updated appends degenerate facets to qh.facet_mergeset - + notes: won't cause redundant facets since vertex inclusion is the same may drop vertex and neighbor if no ridge @@ -1523,7 +1523,7 @@ void qh_maydropneighbor(facetT *facet) { qh visit_id++; trace4((qh ferr, 4029, "qh_maydropneighbor: test f%d for no ridges to a neighbor\n", - facet->id)); + facet->id)); FOREACHridge_(facet->ridges) { ridge->top->visitid= qh visit_id; ridge->bottom->visitid= qh visit_id; @@ -1531,7 +1531,7 @@ void qh_maydropneighbor(facetT *facet) { FOREACHneighbor_(facet) { if (neighbor->visitid != qh visit_id) { trace0((qh ferr, 17, "qh_maydropneighbor: facets f%d and f%d are no longer neighbors during p%d\n", - facet->id, neighbor->id, qh furthest_id)); + facet->id, neighbor->id, qh furthest_id)); zinc_(Zdropneighbor); qh_setdel(facet->neighbors, neighbor); neighborp--; /* repeat, deleted a neighbor */ @@ -1553,7 +1553,7 @@ void qh_maydropneighbor(facetT *facet) { /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="merge_degenredundant">-</a> - + qh_merge_degenredundant() merge all degenerate and redundant facets qh.degen_mergeset contains merges from qh_degen_redundant_neighbors() @@ -1592,8 +1592,8 @@ int qh_merge_degenredundant(void) { qh_memfree(merge, (int)sizeof(mergeT)); if (facet1->visible) continue; - facet1->degenerate= False; - facet1->redundant= False; + facet1->degenerate= False; + facet1->redundant= False; if (qh TRACEmerge-1 == zzval_(Ztotmerge)) qhmem.IStracing= qh IStracing= qh TRACElevel; if (mergetype == MRGredundant) { @@ -1601,17 +1601,17 @@ int qh_merge_degenredundant(void) { while (facet2->visible) { if (!facet2->f.replace) { qh_fprintf(qh ferr, 6097, "qhull internal error (qh_merge_degenredunant): f%d redundant but f%d has no replacement\n", - facet1->id, facet2->id); + facet1->id, facet2->id); qh_errexit2 (qh_ERRqhull, facet1, facet2); } facet2= facet2->f.replace; } if (facet1 == facet2) { - qh_degen_redundant_facet(facet1); /* in case of others */ - continue; + qh_degen_redundant_facet(facet1); /* in case of others */ + continue; } trace2((qh ferr, 2025, "qh_merge_degenredundant: facet f%d is contained in f%d, will merge\n", - facet1->id, facet2->id)); + facet1->id, facet2->id)); qh_mergefacet(facet1, facet2, NULL, NULL, !qh_MERGEapex); /* merge distance is already accounted for */ nummerges++; @@ -1621,28 +1621,28 @@ int qh_merge_degenredundant(void) { trace2((qh ferr, 2026, "qh_merge_degenredundant: facet f%d has no neighbors. Deleted\n", facet1->id)); qh_willdelete(facet1, NULL); FOREACHvertex_(facet1->vertices) { - qh_setdel(vertex->neighbors, facet1); - if (!SETfirst_(vertex->neighbors)) { - zinc_(Zdegenvertex); - trace2((qh ferr, 2027, "qh_merge_degenredundant: deleted v%d because f%d has no neighbors\n", - vertex->id, facet1->id)); - vertex->deleted= True; - qh_setappend(&qh del_vertices, vertex); - } + qh_setdel(vertex->neighbors, facet1); + if (!SETfirst_(vertex->neighbors)) { + zinc_(Zdegenvertex); + trace2((qh ferr, 2027, "qh_merge_degenredundant: deleted v%d because f%d has no neighbors\n", + vertex->id, facet1->id)); + vertex->deleted= True; + qh_setappend(&qh del_vertices, vertex); + } } nummerges++; }else if (size < qh hull_dim) { bestneighbor= qh_findbestneighbor(facet1, &dist, &mindist, &maxdist); trace2((qh ferr, 2028, "qh_merge_degenredundant: facet f%d has %d neighbors, merge into f%d dist %2.2g\n", - facet1->id, size, bestneighbor->id, dist)); + facet1->id, size, bestneighbor->id, dist)); qh_mergefacet(facet1, bestneighbor, &mindist, &maxdist, !qh_MERGEapex); nummerges++; if (qh PRINTstatistics) { - zinc_(Zdegen); - wadd_(Wdegentot, dist); - wmax_(Wdegenmax, dist); + zinc_(Zdegen); + wadd_(Wdegentot, dist); + wmax_(Wdegenmax, dist); } - } /* else, another merge fixed the degeneracy and redundancy tested */ + } /* else, another merge fixed the degeneracy and redundancy tested */ } } return nummerges; @@ -1650,14 +1650,14 @@ int qh_merge_degenredundant(void) { /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="merge_nonconvex">-</a> - + qh_merge_nonconvex( facet1, facet2, mergetype ) - remove non-convex ridge between facet1 into facet2 + remove non-convex ridge between facet1 into facet2 mergetype gives why the facet's are non-convex returns: merges one of the facets into the best neighbor - + design: if one of the facets is a new facet prefer merging new facet into old facet @@ -1716,9 +1716,9 @@ void qh_merge_nonconvex(facetT *facet1, facetT *facet2, mergeType mergetype) { /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="mergecycle">-</a> - + qh_mergecycle( samecycle, newfacet ) - merge a cycle of facets starting at samecycle into a newfacet + merge a cycle of facets starting at samecycle into a newfacet newfacet is a horizon facet with ->normal samecycle facets are simplicial from an apex @@ -1768,13 +1768,13 @@ void qh_mergecycle(facetT *samecycle, facetT *newfacet) { #ifndef qh_NOtrace if (qh TRACEmerge == zzval_(Ztotmerge)) qhmem.IStracing= qh IStracing= qh TRACElevel; - trace2((qh ferr, 2030, "qh_mergecycle: merge #%d for facets from cycle f%d into coplanar horizon f%d\n", + trace2((qh ferr, 2030, "qh_mergecycle: merge #%d for facets from cycle f%d into coplanar horizon f%d\n", zzval_(Ztotmerge), samecycle->id, newfacet->id)); if (newfacet == qh tracefacet) { tracerestore= qh IStracing; qh IStracing= 4; qh_fprintf(qh ferr, 8068, "qh_mergecycle: ========= trace merge %d of samecycle %d into trace f%d, furthest is p%d\n", - zzval_(Ztotmerge), samecycle->id, newfacet->id, qh furthest_id); + zzval_(Ztotmerge), samecycle->id, newfacet->id, qh furthest_id); traceonce= True; } if (qh IStracing >=4) { @@ -1791,7 +1791,7 @@ void qh_mergecycle(facetT *samecycle, facetT *newfacet) { qh_mergecycle_neighbors(samecycle, newfacet); qh_mergecycle_ridges(samecycle, newfacet); qh_mergecycle_vneighbors(samecycle, newfacet); - if (SETfirstt_(newfacet->vertices, vertexT) != apex) + if (SETfirstt_(newfacet->vertices, vertexT) != apex) qh_setaddnth(&newfacet->vertices, 0, apex); /* apex has last id */ if (!newfacet->newfacet) qh_newvertices(newfacet->vertices); @@ -1806,7 +1806,7 @@ void qh_mergecycle(facetT *samecycle, facetT *newfacet) { /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="mergecycle_all">-</a> - + qh_mergecycle_all( facetlist, wasmerge ) merge all samecycles of coplanar facets into horizon don't merge facets with ->mergeridge (these already have ->normal) @@ -1826,7 +1826,7 @@ void qh_mergecycle(facetT *samecycle, facetT *newfacet) { skip facets with duplicate ridges and normals check that facet is in a samecycle (->mergehorizon) if facet only member of samecycle - sets vertex->delridge for all vertices except apex + sets vertex->delridge for all vertices except apex merge facet into horizon else mark all facets in samecycle @@ -1849,11 +1849,11 @@ void qh_mergecycle_all(facetT *facetlist, boolT *wasmerge) { } horizon= SETfirstt_(facet->neighbors, facetT); if (facet->f.samecycle == facet) { - zinc_(Zonehorizon); + zinc_(Zonehorizon); /* merge distance done in qh_findhorizon */ apex= SETfirstt_(facet->vertices, vertexT); FOREACHvertex_(facet->vertices) { - if (vertex != apex) + if (vertex != apex) vertex->delridge= True; } horizon->f.newcycle= NULL; @@ -1863,26 +1863,26 @@ void qh_mergecycle_all(facetT *facetlist, boolT *wasmerge) { facets= 0; prev= facet; for (same= facet->f.samecycle; same; /* FORALLsame_cycle_(facet) */ - same= (same == facet ? NULL :nextsame)) { /* ends at facet */ - nextsame= same->f.samecycle; + same= (same == facet ? NULL :nextsame)) { /* ends at facet */ + nextsame= same->f.samecycle; if (same->cycledone || same->visible) qh_infiniteloop(same); same->cycledone= True; - if (same->normal) { + if (same->normal) { prev->f.samecycle= same->f.samecycle; /* unlink ->mergeridge */ - same->f.samecycle= NULL; + same->f.samecycle= NULL; }else { prev= same; - facets++; - } + facets++; + } } while (nextfacet && nextfacet->cycledone) /* will delete samecycle */ - nextfacet= nextfacet->next; + nextfacet= nextfacet->next; horizon->f.newcycle= NULL; qh_mergecycle(samecycle, horizon); nummerge= horizon->nummerge + facets; - if (nummerge > qh_MAXnummerge) - horizon->nummerge= qh_MAXnummerge; + if (nummerge > qh_MAXnummerge) + horizon->nummerge= qh_MAXnummerge; else horizon->nummerge= (short unsigned int)nummerge; zzinc_(Zcyclehorizon); @@ -1899,20 +1899,20 @@ void qh_mergecycle_all(facetT *facetlist, boolT *wasmerge) { /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="mergecycle_facets">-</a> - + qh_mergecycle_facets( samecycle, newfacet ) finish merge of samecycle into newfacet returns: samecycle prepended to visible_list for later deletion and partitioning each facet->f.replace == newfacet - + newfacet moved to end of qh.facet_list makes newfacet a newfacet (get's facet1->id if it was old) sets newfacet->newmerge clears newfacet->center (unless merging into a large facet) clears newfacet->tested and ridge->tested for facet1 - + adds neighboring facets to facet_mergeset if redundant or degenerate design: @@ -1923,30 +1923,30 @@ void qh_mergecycle_all(facetT *facetlist, boolT *wasmerge) { */ void qh_mergecycle_facets(facetT *samecycle, facetT *newfacet) { facetT *same, *next; - - trace4((qh ferr, 4030, "qh_mergecycle_facets: make newfacet new and samecycle deleted\n")); + + trace4((qh ferr, 4030, "qh_mergecycle_facets: make newfacet new and samecycle deleted\n")); qh_removefacet(newfacet); /* append as a newfacet to end of qh facet_list */ qh_appendfacet(newfacet); newfacet->newfacet= True; newfacet->simplicial= False; newfacet->newmerge= True; - + for (same= samecycle->f.samecycle; same; same= (same == samecycle ? NULL : next)) { next= same->f.samecycle; /* reused by willdelete */ qh_willdelete(same, newfacet); } - if (newfacet->center + if (newfacet->center && qh_setsize(newfacet->vertices) <= qh hull_dim + qh_MAXnewcentrum) { qh_memfree(newfacet->center, qh normal_size); newfacet->center= NULL; } - trace3((qh ferr, 3004, "qh_mergecycle_facets: merged facets from cycle f%d into f%d\n", + trace3((qh ferr, 3004, "qh_mergecycle_facets: merged facets from cycle f%d into f%d\n", samecycle->id, newfacet->id)); } /* mergecycle_facets */ /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="mergecycle_neighbors">-</a> - + qh_mergecycle_neighbors( samecycle, newfacet ) add neighbors for samecycle facets to newfacet @@ -1959,9 +1959,9 @@ void qh_mergecycle_facets(facetT *samecycle, facetT *newfacet) { notes: assumes newfacet not in samecycle - usually, samecycle facets are new, simplicial facets without internal ridges + usually, samecycle facets are new, simplicial facets without internal ridges not so if horizon facet is coplanar to two different samecycles - + see: qh_mergeneighbors() @@ -1992,7 +1992,7 @@ void qh_mergecycle_neighbors(facetT *samecycle, facetT *newfacet) { same->visitid= samevisitid; } newfacet->visitid= ++qh visit_id; - trace4((qh ferr, 4031, "qh_mergecycle_neighbors: delete shared neighbors from newfacet\n")); + trace4((qh ferr, 4031, "qh_mergecycle_neighbors: delete shared neighbors from newfacet\n")); FOREACHneighbor_(newfacet) { if (neighbor->visitid == samevisitid) { SETref_(neighbor)= NULL; /* samecycle neighbors deleted */ @@ -2002,31 +2002,31 @@ void qh_mergecycle_neighbors(facetT *samecycle, facetT *newfacet) { } qh_setcompact(newfacet->neighbors); - trace4((qh ferr, 4032, "qh_mergecycle_neighbors: update neighbors\n")); + trace4((qh ferr, 4032, "qh_mergecycle_neighbors: update neighbors\n")); FORALLsame_cycle_(samecycle) { FOREACHneighbor_(same) { if (neighbor->visitid == samevisitid) - continue; + continue; if (neighbor->simplicial) { - if (neighbor->visitid != qh visit_id) { - qh_setappend(&newfacet->neighbors, neighbor); - qh_setreplace(neighbor->neighbors, same, newfacet); - newneighbors++; - neighbor->visitid= qh visit_id; - FOREACHridge_(neighbor->ridges) { /* update ridge in case of qh_makeridges */ - if (ridge->top == same) { - ridge->top= newfacet; - break; - }else if (ridge->bottom == same) { - ridge->bottom= newfacet; - break; - } - } - }else { - qh_makeridges(neighbor); - qh_setdel(neighbor->neighbors, same); - /* same can't be horizon facet for neighbor */ - } + if (neighbor->visitid != qh visit_id) { + qh_setappend(&newfacet->neighbors, neighbor); + qh_setreplace(neighbor->neighbors, same, newfacet); + newneighbors++; + neighbor->visitid= qh visit_id; + FOREACHridge_(neighbor->ridges) { /* update ridge in case of qh_makeridges */ + if (ridge->top == same) { + ridge->top= newfacet; + break; + }else if (ridge->bottom == same) { + ridge->bottom= newfacet; + break; + } + } + }else { + qh_makeridges(neighbor); + qh_setdel(neighbor->neighbors, same); + /* same can't be horizon facet for neighbor */ + } }else { /* non-simplicial neighbor */ qh_setdel(neighbor->neighbors, same); if (neighbor->visitid != qh visit_id) { @@ -2034,17 +2034,17 @@ void qh_mergecycle_neighbors(facetT *samecycle, facetT *newfacet) { qh_setappend(&newfacet->neighbors, neighbor); neighbor->visitid= qh visit_id; newneighbors++; - } + } } } } - trace2((qh ferr, 2032, "qh_mergecycle_neighbors: deleted %d neighbors and added %d\n", + trace2((qh ferr, 2032, "qh_mergecycle_neighbors: deleted %d neighbors and added %d\n", delneighbors, newneighbors)); } /* mergecycle_neighbors */ /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="mergecycle_ridges">-</a> - + qh_mergecycle_ridges( samecycle, newfacet ) add ridges/neighbors for facets in samecycle to newfacet all new/old neighbors of newfacet marked with qh.visit_id @@ -2053,7 +2053,7 @@ void qh_mergecycle_neighbors(facetT *samecycle, facetT *newfacet) { returns: newfacet has merged ridges - + notes: ridge already updated for simplicial neighbors of samecycle with a ridge @@ -2085,41 +2085,41 @@ void qh_mergecycle_ridges(facetT *samecycle, facetT *newfacet) { boolT toporient; void **freelistp; /* used !qh_NOmem */ - trace4((qh ferr, 4033, "qh_mergecycle_ridges: delete shared ridges from newfacet\n")); + trace4((qh ferr, 4033, "qh_mergecycle_ridges: delete shared ridges from newfacet\n")); samevisitid= qh visit_id -1; FOREACHridge_(newfacet->ridges) { neighbor= otherfacet_(ridge, newfacet); if (neighbor->visitid == samevisitid) - SETref_(ridge)= NULL; /* ridge free'd below */ + SETref_(ridge)= NULL; /* ridge free'd below */ } qh_setcompact(newfacet->ridges); - - trace4((qh ferr, 4034, "qh_mergecycle_ridges: add ridges to newfacet\n")); + + trace4((qh ferr, 4034, "qh_mergecycle_ridges: add ridges to newfacet\n")); FORALLsame_cycle_(samecycle) { FOREACHridge_(same->ridges) { if (ridge->top == same) { ridge->top= newfacet; - neighbor= ridge->bottom; + neighbor= ridge->bottom; }else if (ridge->bottom == same) { - ridge->bottom= newfacet; - neighbor= ridge->top; + ridge->bottom= newfacet; + neighbor= ridge->top; }else if (ridge->top == newfacet || ridge->bottom == newfacet) { qh_setappend(&newfacet->ridges, ridge); numold++; /* already set by qh_mergecycle_neighbors */ - continue; + continue; }else { - qh_fprintf(qh ferr, 6098, "qhull internal error (qh_mergecycle_ridges): bad ridge r%d\n", ridge->id); - qh_errexit(qh_ERRqhull, NULL, ridge); + qh_fprintf(qh ferr, 6098, "qhull internal error (qh_mergecycle_ridges): bad ridge r%d\n", ridge->id); + qh_errexit(qh_ERRqhull, NULL, ridge); } if (neighbor == newfacet) { - qh_setfree(&(ridge->vertices)); + qh_setfree(&(ridge->vertices)); qh_memfree_(ridge, (int)sizeof(ridgeT), freelistp); numold++; }else if (neighbor->visitid == samevisitid) { - qh_setdel(neighbor->ridges, ridge); - qh_setfree(&(ridge->vertices)); - qh_memfree_(ridge, (int)sizeof(ridgeT), freelistp); - numold++; + qh_setdel(neighbor->ridges, ridge); + qh_setfree(&(ridge->vertices)); + qh_memfree_(ridge, (int)sizeof(ridgeT), freelistp); + numold++; }else { qh_setappend(&newfacet->ridges, ridge); numold++; @@ -2133,7 +2133,7 @@ void qh_mergecycle_ridges(facetT *samecycle, facetT *newfacet) { if (neighbor->visitid != samevisitid && neighbor->simplicial) { ridge= qh_newridge(); ridge->vertices= qh_setnew_delnthsorted(same->vertices, qh hull_dim, - neighbor_i, 0); + neighbor_i, 0); toporient= same->toporient ^ (neighbor_i & 0x1); if (toporient) { ridge->top= newfacet; @@ -2149,13 +2149,13 @@ void qh_mergecycle_ridges(facetT *samecycle, facetT *newfacet) { } } - trace2((qh ferr, 2033, "qh_mergecycle_ridges: found %d old ridges and %d new ones\n", + trace2((qh ferr, 2033, "qh_mergecycle_ridges: found %d old ridges and %d new ones\n", numold, numnew)); } /* mergecycle_ridges */ /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="mergecycle_vneighbors">-</a> - + qh_mergecycle_vneighbors( samecycle, newfacet ) create vertex neighbors for newfacet from vertices of facets in samecycle samecycle marked with visitid == qh.visit_id - 1 @@ -2183,8 +2183,8 @@ void qh_mergecycle_vneighbors(facetT *samecycle, facetT *newfacet) { unsigned int mergeid; vertexT *vertex, **vertexp, *apex; setT *vertices; - - trace4((qh ferr, 4035, "qh_mergecycle_vneighbors: update vertex neighbors for newfacet\n")); + + trace4((qh ferr, 4035, "qh_mergecycle_vneighbors: update vertex neighbors for newfacet\n")); mergeid= qh visit_id - 1; newfacet->visitid= mergeid; vertices= qh_basevertices(samecycle); /* temp */ @@ -2208,17 +2208,17 @@ void qh_mergecycle_vneighbors(facetT *samecycle, facetT *newfacet) { } } qh_settempfree(&vertices); - trace3((qh ferr, 3005, "qh_mergecycle_vneighbors: merged vertices from cycle f%d into f%d\n", + trace3((qh ferr, 3005, "qh_mergecycle_vneighbors: merged vertices from cycle f%d into f%d\n", samecycle->id, newfacet->id)); } /* mergecycle_vneighbors */ /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="mergefacet">-</a> - + qh_mergefacet( facet1, facet2, mindist, maxdist, mergeapex ) merges facet1 into facet2 mergeapex==qh_MERGEapex if merging new facet into coplanar horizon - + returns: qh.max_outside and qh.min_vertex updated initializes vertex neighbors on first merge @@ -2236,11 +2236,11 @@ void qh_mergecycle_vneighbors(facetT *samecycle, facetT *newfacet) { adds neighboring facets to facet_mergeset if redundant or degenerate - notes: + notes: mindist/maxdist may be NULL (only if both NULL) traces merge if fmax_(maxdist,-mindist) > TRACEdist - see: + see: qh_mergecycle() design: @@ -2290,30 +2290,30 @@ void qh_mergefacet(facetT *facet1, facetT *facet2, realT *mindist, realT *maxdis qh IStracing= qh TRACElevel; traceonce= True; qh_fprintf(qh ferr, 8075, "qh_mergefacet: ========= trace wide merge #%d(%2.2g) for f%d into f%d, last point was p%d\n", zzval_(Ztotmerge), - fmax_(-*mindist, *maxdist), facet1->id, facet2->id, qh furthest_id); + fmax_(-*mindist, *maxdist), facet1->id, facet2->id, qh furthest_id); }else if (facet1 == qh tracefacet || facet2 == qh tracefacet) { tracerestore= qh IStracing; qh IStracing= 4; traceonce= True; qh_fprintf(qh ferr, 8076, "qh_mergefacet: ========= trace merge #%d involving f%d, furthest is p%d\n", - zzval_(Ztotmerge), qh tracefacet_id, qh furthest_id); + zzval_(Ztotmerge), qh tracefacet_id, qh furthest_id); } } if (qh IStracing >= 2) { realT mergemin= -2; realT mergemax= -2; - + if (mindist) { mergemin= *mindist; mergemax= *maxdist; } - qh_fprintf(qh ferr, 8077, "qh_mergefacet: #%d merge f%d into f%d, mindist= %2.2g, maxdist= %2.2g\n", + qh_fprintf(qh ferr, 8077, "qh_mergefacet: #%d merge f%d into f%d, mindist= %2.2g, maxdist= %2.2g\n", zzval_(Ztotmerge), facet1->id, facet2->id, mergemin, mergemax); } #endif /* !qh_NOtrace */ if (facet1 == facet2 || facet1->visible || facet2->visible) { qh_fprintf(qh ferr, 6099, "qhull internal error (qh_mergefacet): either f%d and f%d are the same or one is a visible facet\n", - facet1->id, facet2->id); + facet1->id, facet2->id); qh_errexit2 (qh_ERRqhull, facet1, facet2); } if (qh num_facets - qh num_visible <= qh hull_dim + 1) { @@ -2338,14 +2338,14 @@ too strong.\n", qh hull_dim+1); maximize_(facet2->maxoutside, *maxdist); #endif minimize_(qh min_vertex, *mindist); - if (!facet2->keepcentrum + if (!facet2->keepcentrum && (*maxdist > qh WIDEfacet || *mindist < -qh WIDEfacet)) { facet2->keepcentrum= True; zinc_(Zwidefacet); } } nummerge= facet1->nummerge + facet2->nummerge + 1; - if (nummerge >= qh_MAXnummerge) + if (nummerge >= qh_MAXnummerge) facet2->nummerge= qh_MAXnummerge; else facet2->nummerge= (short unsigned int)nummerge; @@ -2358,7 +2358,7 @@ too strong.\n", qh hull_dim+1); qh vertex_visit++; FOREACHvertex_(facet2->vertices) vertex->visitid= qh vertex_visit; - if (qh hull_dim == 2) + if (qh hull_dim == 2) qh_mergefacet2d(facet1, facet2); else { qh_mergeneighbors(facet1, facet2); @@ -2393,10 +2393,10 @@ too strong.\n", qh hull_dim+1); /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="mergefacet2d">-</a> - + qh_mergefacet2d( facet1, facet2 ) in 2d, merges neighbors and vertices of facet1 into facet2 - + returns: build ridges for neighbors if necessary facet2 looks like a simplicial facet except for centrum, ridges @@ -2407,7 +2407,7 @@ too strong.\n", qh hull_dim+1); qh_mergefacet() retains non-simplicial structures they are not needed in 2d, but later routines may use them preserves qh.vertex_visit for qh_mergevertex_neighbors() - + design: get vertices and neighbors determine new vertices and neighbors @@ -2472,11 +2472,11 @@ void qh_mergefacet2d(facetT *facet1, facetT *facet2) { /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="mergeneighbors">-</a> - + qh_mergeneighbors( facet1, facet2 ) merges the neighbors of facet1 into facet2 - see: + see: qh_mergecycle_neighbors() design: @@ -2493,7 +2493,7 @@ void qh_mergeneighbors(facetT *facet1, facetT *facet2) { facetT *neighbor, **neighborp; trace4((qh ferr, 4037, "qh_mergeneighbors: merge neighbors of f%d and f%d\n", - facet1->id, facet2->id)); + facet1->id, facet2->id)); qh visit_id++; FOREACHneighbor_(facet2) { neighbor->visitid= qh visit_id; @@ -2501,9 +2501,9 @@ void qh_mergeneighbors(facetT *facet1, facetT *facet2) { FOREACHneighbor_(facet1) { if (neighbor->visitid == qh visit_id) { if (neighbor->simplicial) /* is degen, needs ridges */ - qh_makeridges(neighbor); + qh_makeridges(neighbor); if (SETfirstt_(neighbor->neighbors, facetT) != facet1) /*keep newfacet->horizon*/ - qh_setdel(neighbor->neighbors, facet1); + qh_setdel(neighbor->neighbors, facet1); else { qh_setdel(neighbor->neighbors, facet2); qh_setreplace(neighbor->neighbors, facet1, facet2); @@ -2520,7 +2520,7 @@ void qh_mergeneighbors(facetT *facet1, facetT *facet2) { /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="mergeridges">-</a> - + qh_mergeridges( facet1, facet2 ) merges the ridge set of facet1 into facet2 @@ -2533,16 +2533,16 @@ void qh_mergeneighbors(facetT *facet1, facetT *facet2) { design: delete ridges between facet1 and facet2 - mark (delridge) vertices on these ridges for later testing + mark (delridge) vertices on these ridges for later testing for each remaining ridge - rename facet1 to facet2 + rename facet1 to facet2 */ void qh_mergeridges(facetT *facet1, facetT *facet2) { ridgeT *ridge, **ridgep; vertexT *vertex, **vertexp; trace4((qh ferr, 4038, "qh_mergeridges: merge ridges of f%d and f%d\n", - facet1->id, facet2->id)); + facet1->id, facet2->id)); FOREACHridge_(facet2->ridges) { if ((ridge->top == facet1) || (ridge->bottom == facet1)) { FOREACHvertex_(ridge->vertices) @@ -2563,7 +2563,7 @@ void qh_mergeridges(facetT *facet1, facetT *facet2) { /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="mergesimplex">-</a> - + qh_mergesimplex( facet1, facet2, mergeapex ) merge simplicial facet1 into facet2 mergeapex==qh_MERGEapex if merging samecycle into horizon facet @@ -2576,7 +2576,7 @@ void qh_mergeridges(facetT *facet1, facetT *facet2) { updated neighbors for facet1's vertices facet1 not deleted sets vertex->delridge on deleted ridges - + notes: special case code since this is the most common merge called from qh_mergefacet() @@ -2615,7 +2615,7 @@ void qh_mergesimplex(facetT *facet1, facetT *facet2, boolT mergeapex) { if (!facet2->newfacet) qh_newvertices(facet2->vertices); /* apex is new */ apex= SETfirstt_(facet1->vertices, vertexT); - if (SETfirstt_(facet2->vertices, vertexT) != apex) + if (SETfirstt_(facet2->vertices, vertexT) != apex) qh_setaddnth(&facet2->vertices, 0, apex); /* apex has last id */ else issubset= True; @@ -2625,26 +2625,26 @@ void qh_mergesimplex(facetT *facet1, facetT *facet2, boolT mergeapex) { vertex->seen= False; FOREACHridge_(facet1->ridges) { if (otherfacet_(ridge, facet1) == facet2) { - FOREACHvertex_(ridge->vertices) { - vertex->seen= True; - vertex->delridge= True; - } - break; + FOREACHvertex_(ridge->vertices) { + vertex->seen= True; + vertex->delridge= True; + } + break; } } FOREACHvertex_(facet1->vertices) { if (!vertex->seen) - break; /* must occur */ + break; /* must occur */ } apex= vertex; trace4((qh ferr, 4039, "qh_mergesimplex: merge apex v%d of f%d into facet f%d\n", - apex->id, facet1->id, facet2->id)); + apex->id, facet1->id, facet2->id)); FOREACHvertex_i_(facet2->vertices) { if (vertex->id < apex->id) { - break; + break; }else if (vertex->id == apex->id) { - issubset= True; - break; + issubset= True; + break; } } if (!issubset) @@ -2657,18 +2657,18 @@ void qh_mergesimplex(facetT *facet1, facetT *facet2, boolT mergeapex) { } } trace4((qh ferr, 4040, "qh_mergesimplex: update vertex neighbors of f%d\n", - facet1->id)); + facet1->id)); FOREACHvertex_(facet1->vertices) { if (vertex == apex && !issubset) qh_setreplace(vertex->neighbors, facet1, facet2); else { qh_setdel(vertex->neighbors, facet1); if (!SETsecond_(vertex->neighbors)) - qh_mergevertex_del(vertex, facet1, facet2); + qh_mergevertex_del(vertex, facet1, facet2); } } trace4((qh ferr, 4041, "qh_mergesimplex: merge ridges and neighbors of f%d into f%d\n", - facet1->id, facet2->id)); + facet1->id, facet2->id)); qh visit_id++; FOREACHneighbor_(facet2) neighbor->visitid= qh visit_id; @@ -2676,45 +2676,45 @@ void qh_mergesimplex(facetT *facet1, facetT *facet2, boolT mergeapex) { otherfacet= otherfacet_(ridge, facet1); if (otherfacet == facet2) { qh_setdel(facet2->ridges, ridge); - qh_setfree(&(ridge->vertices)); + qh_setfree(&(ridge->vertices)); qh_memfree(ridge, (int)sizeof(ridgeT)); qh_setdel(facet2->neighbors, facet1); }else { qh_setappend(&facet2->ridges, ridge); if (otherfacet->visitid != qh visit_id) { - qh_setappend(&facet2->neighbors, otherfacet); - qh_setreplace(otherfacet->neighbors, facet1, facet2); - otherfacet->visitid= qh visit_id; + qh_setappend(&facet2->neighbors, otherfacet); + qh_setreplace(otherfacet->neighbors, facet1, facet2); + otherfacet->visitid= qh visit_id; }else { - if (otherfacet->simplicial) /* is degen, needs ridges */ - qh_makeridges(otherfacet); - if (SETfirstt_(otherfacet->neighbors, facetT) != facet1) - qh_setdel(otherfacet->neighbors, facet1); - else { /*keep newfacet->neighbors->horizon*/ - qh_setdel(otherfacet->neighbors, facet2); - qh_setreplace(otherfacet->neighbors, facet1, facet2); - } + if (otherfacet->simplicial) /* is degen, needs ridges */ + qh_makeridges(otherfacet); + if (SETfirstt_(otherfacet->neighbors, facetT) != facet1) + qh_setdel(otherfacet->neighbors, facet1); + else { /*keep newfacet->neighbors->horizon*/ + qh_setdel(otherfacet->neighbors, facet2); + qh_setreplace(otherfacet->neighbors, facet1, facet2); + } } if (ridge->top == facet1) /* wait until after qh_makeridges */ - ridge->top= facet2; - else - ridge->bottom= facet2; + ridge->top= facet2; + else + ridge->bottom= facet2; } } SETfirst_(facet1->ridges)= NULL; /* it will be deleted */ trace3((qh ferr, 3006, "qh_mergesimplex: merged simplex f%d apex v%d into facet f%d\n", - facet1->id, getid_(apex), facet2->id)); + facet1->id, getid_(apex), facet2->id)); } /* mergesimplex */ /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="mergevertex_del">-</a> - + qh_mergevertex_del( vertex, facet1, facet2 ) delete a vertex because of merging facet1 into facet2 returns: deletes vertex from facet2 - adds vertex to qh.del_vertices for later deletion + adds vertex to qh.del_vertices for later deletion */ void qh_mergevertex_del(vertexT *vertex, facetT *facet1, facetT *facet2) { @@ -2728,7 +2728,7 @@ void qh_mergevertex_del(vertexT *vertex, facetT *facet1, facetT *facet2) { /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="mergevertex_neighbors">-</a> - + qh_mergevertex_neighbors( facet1, facet2 ) merge the vertex neighbors of facet1 to facet2 @@ -2736,9 +2736,9 @@ void qh_mergevertex_del(vertexT *vertex, facetT *facet1, facetT *facet2) { if vertex is current qh.vertex_visit deletes facet1 from vertex->neighbors else - renames facet1 to facet2 in vertex->neighbors + renames facet1 to facet2 in vertex->neighbors deletes vertices if only one neighbor - + notes: assumes vertex neighbor sets are good */ @@ -2746,29 +2746,29 @@ void qh_mergevertex_neighbors(facetT *facet1, facetT *facet2) { vertexT *vertex, **vertexp; trace4((qh ferr, 4042, "qh_mergevertex_neighbors: merge vertex neighbors of f%d and f%d\n", - facet1->id, facet2->id)); + facet1->id, facet2->id)); if (qh tracevertex) { qh_fprintf(qh ferr, 8081, "qh_mergevertex_neighbors: of f%d and f%d at furthest p%d f0= %p\n", - facet1->id, facet2->id, qh furthest_id, qh tracevertex->neighbors->e[0].p); + facet1->id, facet2->id, qh furthest_id, qh tracevertex->neighbors->e[0].p); qh_errprint("TRACE", NULL, NULL, NULL, qh tracevertex); } FOREACHvertex_(facet1->vertices) { - if (vertex->visitid != qh vertex_visit) + if (vertex->visitid != qh vertex_visit) qh_setreplace(vertex->neighbors, facet1, facet2); else { qh_setdel(vertex->neighbors, facet1); if (!SETsecond_(vertex->neighbors)) - qh_mergevertex_del(vertex, facet1, facet2); + qh_mergevertex_del(vertex, facet1, facet2); } } - if (qh tracevertex) + if (qh tracevertex) qh_errprint("TRACE", NULL, NULL, NULL, qh tracevertex); } /* mergevertex_neighbors */ /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="mergevertices">-</a> - + qh_mergevertices( vertices1, vertices2 ) merges the vertex set of facet1 into facet2 @@ -2791,11 +2791,11 @@ void qh_mergevertices(setT *vertices1, setT **vertices2) { qh_setappend(&mergedvertices, vertex); else { while (*vertex2 && (*vertex2)->id > vertex->id) - qh_setappend(&mergedvertices, *vertex2++); + qh_setappend(&mergedvertices, *vertex2++); if (!*vertex2 || (*vertex2)->id < vertex->id) - qh_setappend(&mergedvertices, vertex); + qh_setappend(&mergedvertices, vertex); else - qh_setappend(&mergedvertices, *vertex2++); + qh_setappend(&mergedvertices, *vertex2++); } } while (*vertex2) @@ -2812,7 +2812,7 @@ void qh_mergevertices(setT *vertices1, setT **vertices2) { /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="neighbor_intersections">-</a> - + qh_neighbor_intersections( vertex ) return intersection of all vertices in vertex->neighbors except for vertex @@ -2821,7 +2821,7 @@ void qh_mergevertices(setT *vertices1, setT **vertices2) { does not include vertex NULL if a neighbor is simplicial NULL if empty set - + notes: used for renaming vertices @@ -2831,7 +2831,7 @@ void qh_mergevertices(setT *vertices1, setT **vertices2) { for each remaining neighbor intersect its vertex set with the intersection set return NULL if empty - return the intersection set + return the intersection set */ setT *qh_neighbor_intersections(vertexT *vertex) { facetT *neighbor, **neighborp, *neighborA, *neighborB; @@ -2864,14 +2864,14 @@ setT *qh_neighbor_intersections(vertexT *vertex) { } } } - trace3((qh ferr, 3007, "qh_neighbor_intersections: %d vertices in neighbor intersection of v%d\n", + trace3((qh ferr, 3007, "qh_neighbor_intersections: %d vertices in neighbor intersection of v%d\n", qh_setsize(intersect), vertex->id)); return intersect; } /* neighbor_intersections */ /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="newvertices">-</a> - + qh_newvertices( vertices ) add vertices to end of qh.vertex_list (marks as new vertices) @@ -2892,7 +2892,7 @@ void qh_newvertices(setT *vertices) { /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="reducevertices">-</a> - + qh_reducevertices() reduce extra vertices, shared vertices, and redundant vertices facet->newmerge is set if merged since last call @@ -2923,13 +2923,13 @@ boolT qh_reducevertices(void) { facetT *newfacet; vertexT *vertex, **vertexp; - if (qh hull_dim == 2) + if (qh hull_dim == 2) return False; if (qh_merge_degenredundant()) degenredun= True; LABELrestart: FORALLnew_facets { - if (newfacet->newmerge) { + if (newfacet->newmerge) { if (!qh MERGEvertices) newfacet->newmerge= False; qh_remove_extravertices(newfacet); @@ -2941,11 +2941,11 @@ boolT qh_reducevertices(void) { if (newfacet->newmerge) { newfacet->newmerge= False; FOREACHvertex_(newfacet->vertices) { - if (vertex->delridge) { - if (qh_rename_sharedvertex(vertex, newfacet)) { - numshare++; - vertexp--; /* repeat since deleted vertex */ - } + if (vertex->delridge) { + if (qh_rename_sharedvertex(vertex, newfacet)) { + numshare++; + vertexp--; /* repeat since deleted vertex */ + } } } } @@ -2954,30 +2954,30 @@ boolT qh_reducevertices(void) { if (vertex->delridge && !vertex->deleted) { vertex->delridge= False; if (qh hull_dim >= 4 && qh_redundant_vertex(vertex)) { - numrename++; - if (qh_merge_degenredundant()) { - degenredun= True; - goto LABELrestart; - } + numrename++; + if (qh_merge_degenredundant()) { + degenredun= True; + goto LABELrestart; + } } } } trace1((qh ferr, 1014, "qh_reducevertices: renamed %d shared vertices and %d redundant vertices. Degen? %d\n", - numshare, numrename, degenredun)); + numshare, numrename, degenredun)); return degenredun; } /* reducevertices */ - + /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="redundant_vertex">-</a> - + qh_redundant_vertex( vertex ) detect and rename a redundant vertex - vertices have full vertex->neighbors + vertices have full vertex->neighbors returns: returns true if find a redundant vertex deletes vertex(vertex->deleted) - + notes: only needed if vertex->delridge and hull_dim >= 4 may add degenerate facets to qh.facet_mergeset @@ -2993,7 +2993,7 @@ vertexT *qh_redundant_vertex(vertexT *vertex) { vertexT *newvertex= NULL; setT *vertices, *ridges; - trace3((qh ferr, 3008, "qh_redundant_vertex: check if v%d can be renamed\n", vertex->id)); + trace3((qh ferr, 3008, "qh_redundant_vertex: check if v%d can be renamed\n", vertex->id)); if ((vertices= qh_neighbor_intersections(vertex))) { ridges= qh_vertexridges(vertex); if ((newvertex= qh_find_newvertex(vertex, vertices, ridges))) @@ -3006,7 +3006,7 @@ vertexT *qh_redundant_vertex(vertexT *vertex) { /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="remove_extravertices">-</a> - + qh_remove_extravertices( facet ) remove extra vertices from non-simplicial facets @@ -3027,10 +3027,10 @@ boolT qh_remove_extravertices(facetT *facet) { boolT foundrem= False; trace4((qh ferr, 4043, "qh_remove_extravertices: test f%d for extra vertices\n", - facet->id)); + facet->id)); FOREACHvertex_(facet->vertices) vertex->seen= False; - FOREACHridge_(facet->ridges) { + FOREACHridge_(facet->ridges) { FOREACHvertex_(ridge->vertices) vertex->seen= True; } @@ -3041,12 +3041,12 @@ boolT qh_remove_extravertices(facetT *facet) { qh_setdelsorted(facet->vertices, vertex); qh_setdel(vertex->neighbors, facet); if (!qh_setsize(vertex->neighbors)) { - vertex->deleted= True; - qh_setappend(&qh del_vertices, vertex); - zinc_(Zremvertexdel); - trace2((qh ferr, 2036, "qh_remove_extravertices: v%d deleted because it's lost all ridges\n", vertex->id)); + vertex->deleted= True; + qh_setappend(&qh del_vertices, vertex); + zinc_(Zremvertexdel); + trace2((qh ferr, 2036, "qh_remove_extravertices: v%d deleted because it's lost all ridges\n", vertex->id)); }else - trace3((qh ferr, 3009, "qh_remove_extravertices: v%d removed from f%d because it's lost all ridges\n", vertex->id, facet->id)); + trace3((qh ferr, 3009, "qh_remove_extravertices: v%d removed from f%d because it's lost all ridges\n", vertex->id, facet->id)); vertexp--; /*repeat*/ } } @@ -3055,7 +3055,7 @@ boolT qh_remove_extravertices(facetT *facet) { /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="rename_sharedvertex">-</a> - + qh_rename_sharedvertex( vertex, facet ) detect and rename if shared vertex in facet vertices have full ->neighbors @@ -3065,11 +3065,11 @@ boolT qh_remove_extravertices(facetT *facet) { the vertex may still exist in other facets (i.e., a neighbor was pinched) does not change facet->neighbors updates vertex->neighbors - + notes: a shared vertex for a facet is only in ridges to one neighbor this may undo a pinched facet - + it does not catch pinches involving multiple facets. These appear to be difficult to detect, since an exhaustive search is too expensive. @@ -3119,7 +3119,7 @@ vertexT *qh_rename_sharedvertex(vertexT *vertex, facetT *facet) { vertices= qh_vertexintersect_new(facet->vertices, neighborA->vertices); qh_setdel(vertices, vertex); qh_settemppush(vertices); - if ((newvertex= qh_find_newvertex(vertex, vertices, ridges))) + if ((newvertex= qh_find_newvertex(vertex, vertices, ridges))) qh_renamevertex(vertex, newvertex, ridges, facet, neighborA); qh_settempfree(&vertices); qh_settempfree(&ridges); @@ -3128,12 +3128,12 @@ vertexT *qh_rename_sharedvertex(vertexT *vertex, facetT *facet) { /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="renameridgevertex">-</a> - + qh_renameridgevertex( ridge, oldvertex, newvertex ) renames oldvertex as newvertex in ridge returns: - + design: delete oldvertex from ridge if newvertex already in ridge @@ -3154,7 +3154,7 @@ void qh_renameridgevertex(ridgeT *ridge, vertexT *oldvertex, vertexT *newvertex) if (vertex == newvertex) { zinc_(Zdelridge); if (ridge->nonconvex) /* only one ridge has nonconvex set */ - qh_copynonconvex(ridge); + qh_copynonconvex(ridge); qh_delridge(ridge); trace2((qh ferr, 2038, "qh_renameridgevertex: ridge r%d deleted. It contained both v%d and v%d\n", ridge->id, oldvertex->id, newvertex->id)); @@ -3166,8 +3166,8 @@ void qh_renameridgevertex(ridgeT *ridge, vertexT *oldvertex, vertexT *newvertex) } qh_setaddnth(&ridge->vertices, nth, newvertex); if (abs(oldnth - nth)%2) { - trace3((qh ferr, 3010, "qh_renameridgevertex: swapped the top and bottom of ridge r%d\n", - ridge->id)); + trace3((qh ferr, 3010, "qh_renameridgevertex: swapped the top and bottom of ridge r%d\n", + ridge->id)); temp= ridge->top; ridge->top= ridge->bottom; ridge->bottom= temp; @@ -3177,14 +3177,14 @@ void qh_renameridgevertex(ridgeT *ridge, vertexT *oldvertex, vertexT *newvertex) /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="renamevertex">-</a> - + qh_renamevertex( oldvertex, newvertex, ridges, oldfacet, neighborA ) - renames oldvertex as newvertex in ridges + renames oldvertex as newvertex in ridges gives oldfacet/neighborA if oldvertex is shared between two facets returns: oldvertex may still exist afterwards - + notes: can not change neighbors of newvertex (since it's a subset) @@ -3211,9 +3211,9 @@ void qh_renamevertex(vertexT *oldvertex, vertexT *newvertex, setT *ridges, facet boolT istrace= False; if (qh IStracing >= 2 || oldvertex->id == qh tracevertex_id || - newvertex->id == qh tracevertex_id) + newvertex->id == qh tracevertex_id) istrace= True; - FOREACHridge_(ridges) + FOREACHridge_(ridges) qh_renameridgevertex(ridge, oldvertex, newvertex); if (!oldfacet) { zinc_(Zrenameall); @@ -3233,7 +3233,7 @@ void qh_renamevertex(vertexT *oldvertex, vertexT *newvertex, setT *ridges, facet }else if (qh_setsize(oldvertex->neighbors) == 2) { zinc_(Zrenameshare); if (istrace) - qh_fprintf(qh ferr, 8083, "qh_renamevertex: renamed v%d to v%d in oldfacet f%d\n", + qh_fprintf(qh ferr, 8083, "qh_renamevertex: renamed v%d to v%d in oldfacet f%d\n", oldvertex->id, newvertex->id, oldfacet->id); FOREACHneighbor_(oldvertex) qh_setdelsorted(neighbor->vertices, oldvertex); @@ -3242,7 +3242,7 @@ void qh_renamevertex(vertexT *oldvertex, vertexT *newvertex, setT *ridges, facet }else { zinc_(Zrenamepinch); if (istrace || qh IStracing) - qh_fprintf(qh ferr, 8084, "qh_renamevertex: renamed pinched v%d to v%d between f%d and f%d\n", + qh_fprintf(qh ferr, 8084, "qh_renamevertex: renamed pinched v%d to v%d between f%d and f%d\n", oldvertex->id, newvertex->id, oldfacet->id, neighborA->id); qh_setdelsorted(oldfacet->vertices, oldvertex); qh_setdel(oldvertex->neighbors, oldfacet); @@ -3253,11 +3253,11 @@ void qh_renamevertex(vertexT *oldvertex, vertexT *newvertex, setT *ridges, facet /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="test_appendmerge">-</a> - + qh_test_appendmerge( facet, neighbor ) tests facet/neighbor for convexity appends to mergeset if non-convex - if pre-merging, + if pre-merging, nop if qh.SKIPconvex, or qh.MERGEexact and coplanar returns: @@ -3333,19 +3333,19 @@ boolT qh_test_appendmerge(facetT *facet, facetT *neighbor) { angle += qh_ANGLEconcave + 0.5; qh_appendmergeset(facet, neighbor, MRGconcave, &angle); trace0((qh ferr, 18, "qh_test_appendmerge: concave f%d to f%d dist %4.4g and reverse dist %4.4g angle %4.4g during p%d\n", - facet->id, neighbor->id, dist, dist2, angle, qh furthest_id)); + facet->id, neighbor->id, dist, dist2, angle, qh furthest_id)); }else /* iscoplanar */ { zinc_(Zcoplanarcentrum); qh_appendmergeset(facet, neighbor, MRGcoplanar, &angle); trace2((qh ferr, 2040, "qh_test_appendmerge: coplanar f%d to f%d dist %4.4g, reverse dist %4.4g angle %4.4g\n", - facet->id, neighbor->id, dist, dist2, angle)); + facet->id, neighbor->id, dist, dist2, angle)); } return True; } /* test_appendmerge */ /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="test_vneighbors">-</a> - + qh_test_vneighbors() test vertex neighbors for convexity tests all facets on qh.newfacet_list @@ -3376,7 +3376,7 @@ boolT qh_test_vneighbors(void /* qh newfacet_list */) { trace1((qh ferr, 1015, "qh_test_vneighbors: testing vertex neighbors for convexity\n")); if (!qh VERTEXneighbors) qh_vertexneighbors(); - FORALLnew_facets + FORALLnew_facets newfacet->seen= False; FORALLnew_facets { newfacet->seen= True; @@ -3385,9 +3385,9 @@ boolT qh_test_vneighbors(void /* qh newfacet_list */) { newfacet->visitid= qh visit_id; FOREACHvertex_(newfacet->vertices) { FOREACHneighbor_(vertex) { - if (neighbor->seen || neighbor->visitid == qh visit_id) - continue; - if (qh_test_appendmerge(newfacet, neighbor)) + if (neighbor->seen || neighbor->visitid == qh visit_id) + continue; + if (qh_test_appendmerge(newfacet, neighbor)) nummerges++; } } @@ -3395,12 +3395,12 @@ boolT qh_test_vneighbors(void /* qh newfacet_list */) { zadd_(Ztestvneighbor, nummerges); trace1((qh ferr, 1016, "qh_test_vneighbors: found %d non-convex, vertex neighbors\n", nummerges)); - return (nummerges > 0); + return (nummerges > 0); } /* test_vneighbors */ /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="tracemerge">-</a> - + qh_tracemerge( facet1, facet2 ) print trace message after merge */ @@ -3408,20 +3408,20 @@ void qh_tracemerge(facetT *facet1, facetT *facet2) { boolT waserror= False; #ifndef qh_NOtrace - if (qh IStracing >= 4) + if (qh IStracing >= 4) qh_errprint("MERGED", facet2, NULL, NULL, NULL); if (facet2 == qh tracefacet || (qh tracevertex && qh tracevertex->newlist)) { qh_fprintf(qh ferr, 8085, "qh_tracemerge: trace facet and vertex after merge of f%d and f%d, furthest p%d\n", facet1->id, facet2->id, qh furthest_id); if (facet2 != qh tracefacet) - qh_errprint("TRACE", qh tracefacet, - (qh tracevertex && qh tracevertex->neighbors) ? + qh_errprint("TRACE", qh tracefacet, + (qh tracevertex && qh tracevertex->neighbors) ? SETfirstt_(qh tracevertex->neighbors, facetT) : NULL, - NULL, qh tracevertex); + NULL, qh tracevertex); } if (qh tracevertex) { if (qh tracevertex->deleted) qh_fprintf(qh ferr, 8086, "qh_tracemerge: trace vertex deleted at furthest p%d\n", - qh furthest_id); + qh furthest_id); else qh_checkvertex(qh tracevertex); } @@ -3440,16 +3440,16 @@ void qh_tracemerge(facetT *facet1, facetT *facet2) { /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="tracemerging">-</a> - + qh_tracemerging() print trace message during POSTmerging returns: updates qh.mergereport - + notes: called from qh_mergecycle() and qh_mergefacet() - + see: qh_buildtracing() */ @@ -3475,7 +3475,7 @@ At %d:%d:%d & %2.5g CPU secs, qhull has merged %d facets. The hull\n\ /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="updatetested">-</a> - + qh_updatetested( facet1, facet2 ) clear facet2->tested and facet1->ridge->tested for merge @@ -3488,7 +3488,7 @@ At %d:%d:%d & %2.5g CPU secs, qhull has merged %d facets. The hull\n\ clear ridge->tested for facet1's ridges if facet2 has a centrum if facet2 is large - set facet2->keepcentrum + set facet2->keepcentrum else if facet2 has 3 vertices due to many merges, or not large and post merging clear facet2->keepcentrum unless facet2->keepcentrum @@ -3498,7 +3498,7 @@ At %d:%d:%d & %2.5g CPU secs, qhull has merged %d facets. The hull\n\ void qh_updatetested(facetT *facet1, facetT *facet2) { ridgeT *ridge, **ridgep; int size; - + facet2->tested= False; FOREACHridge_(facet1->ridges) ridge->tested= False; @@ -3525,7 +3525,7 @@ void qh_updatetested(facetT *facet1, facetT *facet2) { /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="vertexridges">-</a> - + qh_vertexridges( vertex ) return temporary set of ridges adjacent to a vertex vertex->neighbors defined @@ -3536,7 +3536,7 @@ void qh_updatetested(facetT *facet1, facetT *facet2) { design: for each neighbor of vertex - add ridges that include the vertex to ridges + add ridges that include the vertex to ridges */ setT *qh_vertexridges(vertexT *vertex) { facetT *neighbor, **neighborp; @@ -3563,7 +3563,7 @@ setT *qh_vertexridges(vertexT *vertex) { /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="vertexridges_facet">-</a> - + qh_vertexridges_facet( vertex, facet, ridges ) add adjacent ridges for vertex in facet neighbor->visitid==qh.visit_id if it hasn't been visited @@ -3585,7 +3585,7 @@ void qh_vertexridges_facet(vertexT *vertex, facetT *facet, setT **ridges) { FOREACHridge_(facet->ridges) { neighbor= otherfacet_(ridge, facet); - if (neighbor->visitid == qh visit_id + if (neighbor->visitid == qh visit_id && qh_setin(ridge->vertices, vertex)) qh_setappend(ridges, ridge); } @@ -3594,7 +3594,7 @@ void qh_vertexridges_facet(vertexT *vertex, facetT *facet, setT **ridges) { /*-<a href="qh-merge.htm#TOC" >-------------------------------</a><a name="willdelete">-</a> - + qh_willdelete( facet, replace ) moves facet to visible list sets facet->f.replace to replace (may be NULL) @@ -3614,7 +3614,7 @@ void qh_willdelete(facetT *facet, facetT *replace) { #else /* qh_NOmerge */ void qh_premerge(vertexT *apex, realT maxcentrum, realT maxangle) { } -void qh_postmerge(const char *reason, realT maxcentrum, realT maxangle, +void qh_postmerge(const char *reason, realT maxcentrum, realT maxangle, boolT vneighbors) { } boolT qh_checkzero(boolT testall) { diff --git a/src/merge.h b/src/merge.h index 5403209..7ca9a4f 100644 --- a/src/merge.h +++ b/src/merge.h @@ -1,14 +1,14 @@ /*<html><pre> -<a href="qh-merge.htm" >-------------------------------</a><a name="TOP">-</a> - merge.h + merge.h header file for merge.c see qh-merge.htm and merge.c copyright (c) 1993-2010 C.B. Barber. - $Id: //product/qhull/main/rel/src/merge.h#20 $$Change: 1139 $ - $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/merge.h#21 $$Change: 1164 $ + $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ */ #ifndef qhDEFmerge @@ -29,7 +29,7 @@ /*-<a href="qh-merge.htm#TOC" >--------------------------------</a><a name="qh_ANGLEdegen">-</a> - + qh_ANGLEdegen indicates degenerate facet in mergeT->angle */ @@ -37,10 +37,10 @@ /*-<a href="qh-merge.htm#TOC" >--------------------------------</a><a name="qh_ANGLEconcave">-</a> - + qh_ANGLEconcave offset to indicate concave facets in mergeT->angle - + notes: concave facets are assigned the range of [2,4] in mergeT->angle roundoff error may make the angle less than 2 @@ -49,31 +49,31 @@ /*-<a href="qh-merge.htm#TOC" >--------------------------------</a><a name="MRG">-</a> - + MRG... (mergeType) indicates the type of a merge (mergeT->type) */ -typedef enum { /* in sort order for facet_mergeset */ +typedef enum { /* in sort order for facet_mergeset */ MRGnone= 0, - MRGcoplanar, /* centrum coplanar */ - MRGanglecoplanar, /* angle coplanar */ - /* could detect half concave ridges */ - MRGconcave, /* concave ridge */ - MRGflip, /* flipped facet. facet1 == facet2 */ - MRGridge, /* duplicate ridge (qh_MERGEridge) */ + MRGcoplanar, /* centrum coplanar */ + MRGanglecoplanar, /* angle coplanar */ + /* could detect half concave ridges */ + MRGconcave, /* concave ridge */ + MRGflip, /* flipped facet. facet1 == facet2 */ + MRGridge, /* duplicate ridge (qh_MERGEridge) */ /* degen and redundant go onto degen_mergeset */ - MRGdegen, /* degenerate facet (!enough neighbors) facet1 == facet2 */ - MRGredundant, /* redundant facet (vertex subset) */ - /* merge_degenredundant assumes degen < redundant */ - MRGmirror, /* mirror facet from qh_triangulate */ + MRGdegen, /* degenerate facet (!enough neighbors) facet1 == facet2 */ + MRGredundant, /* redundant facet (vertex subset) */ + /* merge_degenredundant assumes degen < redundant */ + MRGmirror, /* mirror facet from qh_triangulate */ ENDmrg } mergeType; /*-<a href="qh-merge.htm#TOC" >--------------------------------</a><a name="qh_MERGEapex">-</a> - + qh_MERGEapex - flag for qh_mergefacet() to indicate an apex merge + flag for qh_mergefacet() to indicate an apex merge */ #define qh_MERGEapex True @@ -81,15 +81,15 @@ typedef enum { /* in sort order for facet_mergeset */ /*-<a href="qh-merge.htm#TOC" >--------------------------------</a><a name="mergeT">-</a> - + mergeT structure used to merge facets */ typedef struct mergeT mergeT; -struct mergeT { /* initialize in qh_appendmergeset */ +struct mergeT { /* initialize in qh_appendmergeset */ realT angle; /* angle between normals of facet1 and facet2 */ - facetT *facet1; /* will merge facet1 into facet2 */ + facetT *facet1; /* will merge facet1 into facet2 */ facetT *facet2; mergeType type; }; @@ -99,10 +99,10 @@ struct mergeT { /* initialize in qh_appendmergeset */ /*-<a href="qh-merge.htm#TOC" >--------------------------------</a><a name="FOREACHmerge_">-</a> - + FOREACHmerge_( merges ) {...} assign 'merge' to each merge in merges - + notes: uses 'mergeT *merge, **mergep;' if qh_mergefacet(), @@ -114,7 +114,7 @@ struct mergeT { /* initialize in qh_appendmergeset */ /*============ prototypes in alphabetical order after pre/postmerge =======*/ void qh_premerge(vertexT *apex, realT maxcentrum, realT maxangle); -void qh_postmerge(const char *reason, realT maxcentrum, realT maxangle, +void qh_postmerge(const char *reason, realT maxcentrum, realT maxangle, boolT vneighbors); void qh_all_merges(boolT othermerge, boolT vneighbors); void qh_appendmergeset(facetT *facet, facetT *neighbor, mergeType mergetype, realT *angle); @@ -126,19 +126,19 @@ int qh_comparemerge(const void *p1, const void *p2); int qh_comparevisit(const void *p1, const void *p2); void qh_copynonconvex(ridgeT *atridge); void qh_degen_redundant_facet(facetT *facet); -void qh_degen_redundant_neighbors(facetT *facet, facetT *delfacet); +void qh_degen_redundant_neighbors(facetT *facet, facetT *delfacet); vertexT *qh_find_newvertex(vertexT *oldvertex, setT *vertices, setT *ridges); void qh_findbest_test(boolT testcentrum, facetT *facet, facetT *neighbor, facetT **bestfacet, realT *distp, realT *mindistp, realT *maxdistp); facetT *qh_findbestneighbor(facetT *facet, realT *distp, realT *mindistp, realT *maxdistp); -void qh_flippedmerges(facetT *facetlist, boolT *wasmerge); -void qh_forcedmerges( boolT *wasmerge); -void qh_getmergeset(facetT *facetlist); -void qh_getmergeset_initial(facetT *facetlist); +void qh_flippedmerges(facetT *facetlist, boolT *wasmerge); +void qh_forcedmerges( boolT *wasmerge); +void qh_getmergeset(facetT *facetlist); +void qh_getmergeset_initial(facetT *facetlist); void qh_hashridge(setT *hashtable, int hashsize, ridgeT *ridge, vertexT *oldvertex); -ridgeT *qh_hashridge_find(setT *hashtable, int hashsize, ridgeT *ridge, +ridgeT *qh_hashridge_find(setT *hashtable, int hashsize, ridgeT *ridge, vertexT *vertex, vertexT *oldvertex, int *hashslot); -void qh_makeridges(facetT *facet); +void qh_makeridges(facetT *facet); void qh_mark_dupridges(facetT *facetlist); void qh_maydropneighbor(facetT *facet); int qh_merge_degenredundant(void); @@ -149,24 +149,24 @@ void qh_mergecycle_facets( facetT *samecycle, facetT *newfacet); void qh_mergecycle_neighbors(facetT *samecycle, facetT *newfacet); void qh_mergecycle_ridges(facetT *samecycle, facetT *newfacet); void qh_mergecycle_vneighbors( facetT *samecycle, facetT *newfacet); -void qh_mergefacet(facetT *facet1, facetT *facet2, realT *mindist, realT *maxdist, boolT mergeapex); +void qh_mergefacet(facetT *facet1, facetT *facet2, realT *mindist, realT *maxdist, boolT mergeapex); void qh_mergefacet2d(facetT *facet1, facetT *facet2); -void qh_mergeneighbors(facetT *facet1, facetT *facet2); -void qh_mergeridges(facetT *facet1, facetT *facet2); +void qh_mergeneighbors(facetT *facet1, facetT *facet2); +void qh_mergeridges(facetT *facet1, facetT *facet2); void qh_mergesimplex(facetT *facet1, facetT *facet2, boolT mergeapex); void qh_mergevertex_del(vertexT *vertex, facetT *facet1, facetT *facet2); void qh_mergevertex_neighbors(facetT *facet1, facetT *facet2); -void qh_mergevertices(setT *vertices1, setT **vertices); +void qh_mergevertices(setT *vertices1, setT **vertices); setT *qh_neighbor_intersections(vertexT *vertex); void qh_newvertices(setT *vertices); boolT qh_reducevertices(void); vertexT *qh_redundant_vertex(vertexT *vertex); boolT qh_remove_extravertices(facetT *facet); vertexT *qh_rename_sharedvertex(vertexT *vertex, facetT *facet); -void qh_renameridgevertex(ridgeT *ridge, vertexT *oldvertex, vertexT *newvertex); +void qh_renameridgevertex(ridgeT *ridge, vertexT *oldvertex, vertexT *newvertex); void qh_renamevertex(vertexT *oldvertex, vertexT *newvertex, setT *ridges, - facetT *oldfacet, facetT *neighborA); -boolT qh_test_appendmerge(facetT *facet, facetT *neighbor); + facetT *oldfacet, facetT *neighborA); +boolT qh_test_appendmerge(facetT *facet, facetT *neighbor); boolT qh_test_vneighbors(void /* qh newfacet_list */); void qh_tracemerge(facetT *facet1, facetT *facet2); void qh_tracemerging(void); diff --git a/src/poly.c b/src/poly.c index 41e2466..9bdb419 100644 --- a/src/poly.c +++ b/src/poly.c @@ -1,17 +1,17 @@ /*<html><pre> -<a href="qh-poly.htm" >-------------------------------</a><a name="TOP">-</a> - poly.c + poly.c implements polygons and simplices see qh-poly.htm, poly.h and libqhull.h - infrequent code is in poly2.c + infrequent code is in poly2.c (all but top 50 and their callers 12/3/95) copyright (c) 1993-2010 The Geometry Center. - $Id: //product/qhull/main/rel/src/poly.c#24 $$Change: 1144 $ - $DateTime: 2010/01/04 18:23:37 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/poly.c#25 $$Change: 1164 $ + $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ */ #include "qhull_a.h" @@ -20,14 +20,14 @@ /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="appendfacet">-</a> - + qh_appendfacet( facet ) appends facet to end of qh.facet_list, returns: updates qh.newfacet_list, facet_next, facet_list increments qh.numfacets - + notes: assumes qh.facet_list/facet_tail is defined (createsimplex) @@ -56,7 +56,7 @@ void qh_appendfacet(facetT *facet) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="appendvertex">-</a> - + qh_appendvertex( vertex ) appends vertex to end of qh.vertex_list, @@ -89,7 +89,7 @@ void qh_appendvertex(vertexT *vertex) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="attachnewfacets">-</a> - + qh_attachnewfacets( ) attach horizon facets to new facets in qh.newfacet_list newfacets have neighbor and ridge links to horizon but not vice versa @@ -97,7 +97,7 @@ void qh_appendvertex(vertexT *vertex) { returns: set qh.NEWfacets - horizon facets linked to new facets + horizon facets linked to new facets ridges changed from visible facets to new facets simplicial ridges deleted qh.visible_list, no ridges valid @@ -137,14 +137,14 @@ void qh_attachnewfacets(void ) { visible->visitid= qh visit_id; if (visible->ridges) { FOREACHridge_(visible->ridges) { - neighbor= otherfacet_(ridge, visible); - if (neighbor->visitid == qh visit_id - || (!neighbor->visible && neighbor->simplicial)) { - if (!neighbor->visible) /* delete ridge for simplicial horizon */ - qh_setdel(neighbor->ridges, ridge); - qh_setfree(&(ridge->vertices)); /* delete on 2nd visit */ - qh_memfree(ridge, (int)sizeof(ridgeT)); - } + neighbor= otherfacet_(ridge, visible); + if (neighbor->visitid == qh visit_id + || (!neighbor->visible && neighbor->simplicial)) { + if (!neighbor->visible) /* delete ridge for simplicial horizon */ + qh_setdel(neighbor->ridges, ridge); + qh_setfree(&(ridge->vertices)); /* delete on 2nd visit */ + qh_memfree(ridge, (int)sizeof(ridgeT)); + } } SETfirst_(visible->ridges)= NULL; } @@ -156,53 +156,53 @@ void qh_attachnewfacets(void ) { if (horizon->simplicial) { visible= NULL; FOREACHneighbor_(horizon) { /* may have more than one horizon ridge */ - if (neighbor->visible) { - if (visible) { - if (qh_setequal_skip(newfacet->vertices, 0, horizon->vertices, - SETindex_(horizon->neighbors, neighbor))) { - visible= neighbor; - break; - } - }else - visible= neighbor; - } + if (neighbor->visible) { + if (visible) { + if (qh_setequal_skip(newfacet->vertices, 0, horizon->vertices, + SETindex_(horizon->neighbors, neighbor))) { + visible= neighbor; + break; + } + }else + visible= neighbor; + } } if (visible) { - visible->f.replace= newfacet; - qh_setreplace(horizon->neighbors, visible, newfacet); + visible->f.replace= newfacet; + qh_setreplace(horizon->neighbors, visible, newfacet); }else { - qh_fprintf(qh ferr, 6102, "qhull internal error (qh_attachnewfacets): couldn't find visible facet for horizon f%d of newfacet f%d\n", - horizon->id, newfacet->id); - qh_errexit2 (qh_ERRqhull, horizon, newfacet); + qh_fprintf(qh ferr, 6102, "qhull internal error (qh_attachnewfacets): couldn't find visible facet for horizon f%d of newfacet f%d\n", + horizon->id, newfacet->id); + qh_errexit2 (qh_ERRqhull, horizon, newfacet); } }else { /* non-simplicial, with a ridge for newfacet */ FOREACHneighbor_(horizon) { /* may hold for many new facets */ - if (neighbor->visible) { - neighbor->f.replace= newfacet; - qh_setdelnth(horizon->neighbors, - SETindex_(horizon->neighbors, neighbor)); - neighborp--; /* repeat */ - } + if (neighbor->visible) { + neighbor->f.replace= newfacet; + qh_setdelnth(horizon->neighbors, + SETindex_(horizon->neighbors, neighbor)); + neighborp--; /* repeat */ + } } qh_setappend(&horizon->neighbors, newfacet); ridge= SETfirstt_(newfacet->ridges, ridgeT); if (ridge->top == horizon) - ridge->bottom= newfacet; + ridge->bottom= newfacet; else - ridge->top= newfacet; + ridge->top= newfacet; } } /* newfacets */ if (qh PRINTstatistics) { FORALLvisible_facets { - if (!visible->f.replace) - zinc_(Zinsidevisible); + if (!visible->f.replace) + zinc_(Zinsidevisible); } } } /* attachnewfacets */ /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="checkflipped">-</a> - + qh_checkflipped( facet, dist, allerror ) checks facet orientation to interior point @@ -237,7 +237,7 @@ boolT qh_checkflipped(facetT *facet, realT *distp, boolT allerror) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="delfacet">-</a> - + qh_delfacet( facet ) removes facet from facet_list and frees up its memory @@ -275,7 +275,7 @@ void qh_delfacet(facetT *facet) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="deletevisible">-</a> - + qh_deletevisible() delete visible facets and vertices @@ -296,9 +296,9 @@ void qh_deletevisible(void /*qh visible_list*/) { trace1((qh ferr, 1018, "qh_deletevisible: delete %d visible facets and %d vertices\n", qh num_visible, numdel)); - for (visible= qh visible_list; visible && visible->visible; + for (visible= qh visible_list; visible && visible->visible; visible= nextfacet) { /* deleting current */ - nextfacet= visible->next; + nextfacet= visible->next; numvisible++; qh_delfacet(visible); } @@ -312,25 +312,25 @@ void qh_deletevisible(void /*qh visible_list*/) { zmax_(Zvisfacetmax, numvisible); zzadd_(Zdelvertextot, numdel); zmax_(Zdelvertexmax, numdel); - FOREACHvertex_(qh del_vertices) + FOREACHvertex_(qh del_vertices) qh_delvertex(vertex); qh_settruncate(qh del_vertices, 0); } /* deletevisible */ /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="facetintersect">-</a> - + qh_facetintersect( facetA, facetB, skipa, skipB, prepend ) return vertices for intersection of two simplicial facets may include 1 prepended entry (if more, need to settemppush) - + returns: returns set of qh.hull_dim-1 + prepend vertices returns skipped index for each test and checks for exactly one notes: does not need settemp since set in quick memory - + see also: qh_vertexintersect and qh_vertexintersect_new use qh_setnew_delnthsorted to get nth ridge (no skip information) @@ -341,7 +341,7 @@ void qh_deletevisible(void /*qh visible_list*/) { intersect the vertex sets */ setT *qh_facetintersect(facetT *facetA, facetT *facetB, - int *skipA,int *skipB, int prepend) { + int *skipA,int *skipB, int prepend) { setT *intersect; int dim= qh hull_dim, i, j; facetT **neighborsA, **neighborsB; @@ -384,13 +384,13 @@ setT *qh_facetintersect(facetT *facetA, facetT *facetB, } intersect= qh_setnew_delnthsorted(facetA->vertices, qh hull_dim, *skipA, prepend); trace4((qh ferr, 4047, "qh_facetintersect: f%d skip %d matches f%d skip %d\n", - facetA->id, *skipA, facetB->id, *skipB)); + facetA->id, *skipA, facetB->id, *skipB)); return(intersect); } /* facetintersect */ /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="gethash">-</a> - + qh_gethash( hashsize, set, size, firstindex, skipelem ) return hashvalue for a set with firstindex and skipelem @@ -398,7 +398,7 @@ setT *qh_facetintersect(facetT *facetA, facetT *facetB, returned hash is in [0,hashsize) assumes at least firstindex+1 elements assumes skipelem is NULL, in set, or part of hash - + hashes memory addresses which may change over different runs of the same data using sum for hash does badly in high d */ @@ -407,8 +407,8 @@ int qh_gethash(int hashsize, setT *set, int size, int firstindex, void *skipelem ptr_intT hash = 0, elem; unsigned result; int i; -#ifdef _MSC_VER /* Microsoft Visual C++ -- warn about 64-bit issues */ -#pragma warning( push) /* WARN64 -- ptr_intT holds a 64-bit pointer */ +#ifdef _MSC_VER /* Microsoft Visual C++ -- warn about 64-bit issues */ +#pragma warning( push) /* WARN64 -- ptr_intT holds a 64-bit pointer */ #pragma warning( disable : 4311) /* 'type cast': pointer truncation from 'void*' to 'ptr_intT' */ #endif @@ -442,9 +442,9 @@ int qh_gethash(int hashsize, setT *set, int size, int firstindex, void *skipelem do { /* this is about 10% in 10-d */ if ((elem= (ptr_intT)*elemp++) != (ptr_intT)skipelem) { hash ^= (elem << i) + (elem >> (32-i)); - i += 3; - if (i >= 32) - i -= 32; + i += 3; + if (i >= 32) + i -= 32; } }while (*elemp); break; @@ -464,7 +464,7 @@ int qh_gethash(int hashsize, setT *set, int size, int firstindex, void *skipelem /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="makenewfacet">-</a> - + qh_makenewfacet( vertices, toporient, horizon ) creates a toporient? facet from vertices @@ -498,7 +498,7 @@ facetT *qh_makenewfacet(setT *vertices, boolT toporient,facetT *horizon) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="makenewplanes">-</a> - + qh_makenewplanes() make new hyperplanes for facets on qh.newfacet_list @@ -515,18 +515,18 @@ void qh_makenewplanes(void /* newfacet_list */) { FORALLnew_facets { if (!newfacet->mergehorizon) - qh_setfacetplane(newfacet); + qh_setfacetplane(newfacet); } - if (qh JOGGLEmax < REALmax/2) + if (qh JOGGLEmax < REALmax/2) minimize_(qh min_vertex, -wwval_(Wnewvertexmax)); } /* makenewplanes */ /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="makenew_nonsimplicial">-</a> - + qh_makenew_nonsimplicial( visible, apex, numnew ) make new facets for ridges of a visible facet - + returns: first newfacet, bumps numnew as needed attaches new facets if !qh.ONLYgood @@ -535,13 +535,13 @@ void qh_makenewplanes(void /* newfacet_list */) { ridges on newfacet, horizon, and visible else ridge and neighbors between newfacet and horizon - visible facet's ridges are deleted + visible facet's ridges are deleted notes: qh.visit_id if visible has already been processed sets neighbor->seen for building f.samecycle assumes all 'seen' flags initially false - + design: for each ridge of visible facet get neighbor of visible facet @@ -551,13 +551,13 @@ void qh_makenewplanes(void /* newfacet_list */) { create a new facet if neighbor coplanar adds newfacet to f.samecycle for later merging - else + else updates neighbor's neighbor set (checks for non-simplicial facet with multiple ridges to visible facet) updates neighbor's ridge set (checks for simplicial neighbor to non-simplicial visible facet) - (deletes ridge if neighbor is simplicial) - + (deletes ridge if neighbor is simplicial) + */ #ifndef qh_NOmerge facetT *qh_makenew_nonsimplicial(facetT *visible, vertexT *apex, int *numnew) { @@ -575,8 +575,8 @@ facetT *qh_makenew_nonsimplicial(facetT *visible, vertexT *apex, int *numnew) { if (!qh ONLYgood) { if (neighbor->visitid == qh visit_id) { qh_setfree(&(ridge->vertices)); /* delete on 2nd visit */ - qh_memfree_(ridge, (int)sizeof(ridgeT), freelistp); - } + qh_memfree_(ridge, (int)sizeof(ridgeT), freelistp); + } } }else { /* neighbor is an horizon facet */ toporient= (ridge->top == visible); @@ -586,7 +586,7 @@ facetT *qh_makenew_nonsimplicial(facetT *visible, vertexT *apex, int *numnew) { newfacet= qh_makenewfacet(vertices, toporient, neighbor); (*numnew)++; if (neighbor->coplanar) { - newfacet->mergehorizon= True; + newfacet->mergehorizon= True; if (!neighbor->seen) { newfacet->f.samecycle= newfacet; neighbor->f.newcycle= newfacet; @@ -594,37 +594,37 @@ facetT *qh_makenew_nonsimplicial(facetT *visible, vertexT *apex, int *numnew) { samecycle= neighbor->f.newcycle; newfacet->f.samecycle= samecycle->f.samecycle; samecycle->f.samecycle= newfacet; - } + } } if (qh ONLYgood) { if (!neighbor->simplicial) - qh_setappend(&(newfacet->ridges), ridge); + qh_setappend(&(newfacet->ridges), ridge); }else { /* qh_attachnewfacets */ if (neighbor->seen) { - if (neighbor->simplicial) { - qh_fprintf(qh ferr, 6105, "qhull internal error (qh_makenew_nonsimplicial): simplicial f%d sharing two ridges with f%d\n", - neighbor->id, visible->id); - qh_errexit2 (qh_ERRqhull, neighbor, visible); - } - qh_setappend(&(neighbor->neighbors), newfacet); - }else + if (neighbor->simplicial) { + qh_fprintf(qh ferr, 6105, "qhull internal error (qh_makenew_nonsimplicial): simplicial f%d sharing two ridges with f%d\n", + neighbor->id, visible->id); + qh_errexit2 (qh_ERRqhull, neighbor, visible); + } + qh_setappend(&(neighbor->neighbors), newfacet); + }else qh_setreplace(neighbor->neighbors, visible, newfacet); if (neighbor->simplicial) { qh_setdel(neighbor->ridges, ridge); - qh_setfree(&(ridge->vertices)); - qh_memfree(ridge, (int)sizeof(ridgeT)); - }else { - qh_setappend(&(newfacet->ridges), ridge); - if (toporient) - ridge->top= newfacet; - else - ridge->bottom= newfacet; - } + qh_setfree(&(ridge->vertices)); + qh_memfree(ridge, (int)sizeof(ridgeT)); + }else { + qh_setappend(&(newfacet->ridges), ridge); + if (toporient) + ridge->top= newfacet; + else + ridge->bottom= newfacet; + } trace4((qh ferr, 4048, "qh_makenew_nonsimplicial: created facet f%d from v%d and r%d of horizon f%d\n", - newfacet->id, apex->id, ridgeid, neighbor->id)); + newfacet->id, apex->id, ridgeid, neighbor->id)); } } - neighbor->seen= True; + neighbor->seen= True; } /* for each ridge */ if (!qh ONLYgood) SETfirst_(visible->ridges)= NULL; @@ -638,7 +638,7 @@ facetT *qh_makenew_nonsimplicial(facetT *visible, vertexT *apex, int *numnew) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="makenew_simplicial">-</a> - + qh_makenew_simplicial( visible, apex, numnew ) make new facets for simplicial visible facet and apex @@ -655,7 +655,7 @@ facetT *qh_makenew_nonsimplicial(facetT *visible, vertexT *apex, int *numnew) { create new facet if coplanar, add new facet to f.samecycle - update horizon facet's neighbor list + update horizon facet's neighbor list */ facetT *qh_makenew_simplicial(facetT *visible, vertexT *apex, int *numnew) { facetT *neighbor, **neighborp, *newfacet= NULL; @@ -668,23 +668,23 @@ facetT *qh_makenew_simplicial(facetT *visible, vertexT *apex, int *numnew) { vertices= qh_facetintersect(neighbor,visible, &horizonskip, &visibleskip, 1); SETfirst_(vertices)= apex; flip= ((horizonskip & 0x1) ^ (visibleskip & 0x1)); - if (neighbor->toporient) - toporient= horizonskip & 0x1; + if (neighbor->toporient) + toporient= horizonskip & 0x1; else - toporient= (horizonskip & 0x1) ^ 0x1; + toporient= (horizonskip & 0x1) ^ 0x1; newfacet= qh_makenewfacet(vertices, toporient, neighbor); (*numnew)++; if (neighbor->coplanar && (qh PREmerge || qh MERGEexact)) { #ifndef qh_NOmerge - newfacet->f.samecycle= newfacet; - newfacet->mergehorizon= True; + newfacet->f.samecycle= newfacet; + newfacet->mergehorizon= True; #endif } if (!qh ONLYgood) SETelem_(neighbor->neighbors, horizonskip)= newfacet; trace4((qh ferr, 4049, "qh_makenew_simplicial: create facet f%d top %d from v%d and horizon f%d skip %d top %d and visible f%d skip %d, flip? %d\n", - newfacet->id, toporient, apex->id, neighbor->id, horizonskip, - neighbor->toporient, visible->id, visibleskip, flip)); + newfacet->id, toporient, apex->id, neighbor->id, horizonskip, + neighbor->toporient, visible->id, visibleskip, flip)); } } return newfacet; @@ -692,7 +692,7 @@ facetT *qh_makenew_simplicial(facetT *visible, vertexT *apex, int *numnew) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="matchneighbor">-</a> - + qh_matchneighbor( newfacet, newskip, hashsize, hashcount ) either match subridge of newfacet with neighbor or add to hash_table @@ -703,7 +703,7 @@ facetT *qh_makenew_simplicial(facetT *visible, vertexT *apex, int *numnew) { ridge is newfacet->vertices w/o newskip vertex do not allocate memory (need to free hash_table cleanly) uses linear hash chains - + see also: qh_matchduplicates @@ -728,12 +728,12 @@ void qh_matchneighbor(facetT *newfacet, int newskip, int hashsize, int *hashcoun facetT *facet, *matchfacet; int skip, matchskip; - hash= qh_gethash(hashsize, newfacet->vertices, qh hull_dim, 1, + hash= qh_gethash(hashsize, newfacet->vertices, qh hull_dim, 1, SETelem_(newfacet->vertices, newskip)); trace4((qh ferr, 4050, "qh_matchneighbor: newfacet f%d skip %d hash %d hashcount %d\n", - newfacet->id, newskip, hash, *hashcount)); + newfacet->id, newskip, hash, *hashcount)); zinc_(Zhashlookup); - for (scan= hash; (facet= SETelemt_(qh hash_table, scan, facetT)); + for (scan= hash; (facet= SETelemt_(qh hash_table, scan, facetT)); scan= (++scan >= hashsize ? 0 : scan)) { if (facet == newfacet) { newfound= True; @@ -741,7 +741,7 @@ void qh_matchneighbor(facetT *newfacet, int newskip, int hashsize, int *hashcoun } zinc_(Zhashtests); if (qh_matchvertices(1, newfacet->vertices, newskip, facet->vertices, &skip, &same)) { - if (SETelem_(newfacet->vertices, newskip) == + if (SETelem_(newfacet->vertices, newskip) == SETelem_(facet->vertices, skip)) { qh_precision("two facets with the same vertices"); qh_fprintf(qh ferr, 6106, "qhull precision error: Vertex sets are the same for f%d and f%d. Can not force output.\n", @@ -760,41 +760,41 @@ void qh_matchneighbor(facetT *newfacet, int newskip, int hashsize, int *hashcoun } if (!qh PREmerge && !qh MERGEexact) { qh_precision("a ridge with more than two neighbors"); - qh_fprintf(qh ferr, 6107, "qhull precision error: facets f%d, f%d and f%d meet at a ridge with more than 2 neighbors. Can not continue.\n", - facet->id, newfacet->id, getid_(matchfacet)); - qh_errexit2 (qh_ERRprec, facet, newfacet); + qh_fprintf(qh ferr, 6107, "qhull precision error: facets f%d, f%d and f%d meet at a ridge with more than 2 neighbors. Can not continue.\n", + facet->id, newfacet->id, getid_(matchfacet)); + qh_errexit2 (qh_ERRprec, facet, newfacet); } SETelem_(newfacet->neighbors, newskip)= qh_DUPLICATEridge; newfacet->dupridge= True; if (!newfacet->normal) - qh_setfacetplane(newfacet); + qh_setfacetplane(newfacet); qh_addhash(newfacet, qh hash_table, hashsize, hash); (*hashcount)++; if (!facet->normal) - qh_setfacetplane(facet); + qh_setfacetplane(facet); if (matchfacet != qh_DUPLICATEridge) { - SETelem_(facet->neighbors, skip)= qh_DUPLICATEridge; - facet->dupridge= True; - if (!facet->normal) - qh_setfacetplane(facet); - if (matchfacet) { - matchskip= qh_setindex(matchfacet->neighbors, facet); - SETelem_(matchfacet->neighbors, matchskip)= qh_DUPLICATEridge; - matchfacet->dupridge= True; - if (!matchfacet->normal) - qh_setfacetplane(matchfacet); - qh_addhash(matchfacet, qh hash_table, hashsize, hash); - *hashcount += 2; - } + SETelem_(facet->neighbors, skip)= qh_DUPLICATEridge; + facet->dupridge= True; + if (!facet->normal) + qh_setfacetplane(facet); + if (matchfacet) { + matchskip= qh_setindex(matchfacet->neighbors, facet); + SETelem_(matchfacet->neighbors, matchskip)= qh_DUPLICATEridge; + matchfacet->dupridge= True; + if (!matchfacet->normal) + qh_setfacetplane(matchfacet); + qh_addhash(matchfacet, qh hash_table, hashsize, hash); + *hashcount += 2; + } } trace4((qh ferr, 4052, "qh_matchneighbor: new f%d skip %d duplicates ridge for f%d skip %d matching f%d ismatch %d at hash %d\n", - newfacet->id, newskip, facet->id, skip, - (matchfacet == qh_DUPLICATEridge ? -2 : getid_(matchfacet)), - ismatch, hash)); + newfacet->id, newskip, facet->id, skip, + (matchfacet == qh_DUPLICATEridge ? -2 : getid_(matchfacet)), + ismatch, hash)); return; /* end of duplicate ridge */ } } - if (!newfound) + if (!newfound) SETelem_(qh hash_table, scan)= newfacet; /* same as qh_addhash */ (*hashcount)++; trace4((qh ferr, 4053, "qh_matchneighbor: no match for f%d skip %d at hash %d\n", @@ -804,14 +804,14 @@ void qh_matchneighbor(facetT *newfacet, int newskip, int hashsize, int *hashcoun /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="matchnewfacets">-</a> - + qh_matchnewfacets() match newfacets in qh.newfacet_list to their newfacet neighbors returns: qh.newfacet_list with full neighbor sets get vertices with nth neighbor by deleting nth vertex - if qh.PREmerge/MERGEexact or qh.FORCEoutput + if qh.PREmerge/MERGEexact or qh.FORCEoutput sets facet->flippped if flipped normal (also prevents point partitioning) if duplicate ridges and qh.PREmerge/MERGEexact sets facet->dupridge @@ -842,7 +842,7 @@ void qh_matchnewfacets(void /* qh newfacet_list */) { int facet_i, facet_n, numfree= 0; facetT *facet; #endif - + trace1((qh ferr, 1019, "qh_matchnewfacets: match neighbors for new facets.\n")); FORALLnew_facets { numnew++; @@ -850,7 +850,7 @@ void qh_matchnewfacets(void /* qh newfacet_list */) { neighbors= newfacet->neighbors; neighbors->e[neighbors->maxsize].i= dim+1; /*may be overwritten*/ memset((char *)SETelemaddr_(neighbors, 1, void), 0, dim * SETelemsize); - } + } } qh_newhashtable(numnew*(qh hull_dim-1)); /* twice what is normally needed, but every ridge could be DUPLICATEridge */ @@ -865,18 +865,18 @@ void qh_matchnewfacets(void /* qh newfacet_list */) { count= 0; FORALLfacet_(qh newfacet_list) { /* newfacet already in use */ - for (k=1; k < qh hull_dim; k++) { - neighbor= SETelemt_(facet->neighbors, k, facetT); - if (!neighbor || neighbor == qh_DUPLICATEridge) - count++; - } - if (facet == newfacet) - break; + for (k=1; k < qh hull_dim; k++) { + neighbor= SETelemt_(facet->neighbors, k, facetT); + if (!neighbor || neighbor == qh_DUPLICATEridge) + count++; + } + if (facet == newfacet) + break; } if (count != hashcount) { - qh_fprintf(qh ferr, 8088, "qh_matchnewfacets: after adding facet %d, hashcount %d != count %d\n", - newfacet->id, hashcount, count); - qh_errexit(qh_ERRqhull, newfacet, NULL); + qh_fprintf(qh ferr, 8088, "qh_matchnewfacets: after adding facet %d, hashcount %d != count %d\n", + newfacet->id, hashcount, count); + qh_errexit(qh_ERRqhull, newfacet, NULL); } } #endif /* end of trap code */ @@ -887,8 +887,8 @@ void qh_matchnewfacets(void /* qh newfacet_list */) { FOREACHneighbor_i_(newfacet) { if (neighbor == qh_DUPLICATEridge) { qh_matchduplicates(newfacet, neighbor_i, hashsize, &hashcount); - /* this may report MERGEfacet */ - } + /* this may report MERGEfacet */ + } } } } @@ -906,7 +906,7 @@ void qh_matchnewfacets(void /* qh newfacet_list */) { numfree++; } qh_fprintf(qh ferr, 8089, "qh_matchnewfacets: %d new facets, %d unused hash entries . hashsize %d\n", - numnew, numfree, qh_setsize(qh hash_table)); + numnew, numfree, qh_setsize(qh hash_table)); } #endif /* !qh_NOtrace */ qh_setfree(&qh hash_table); @@ -915,16 +915,16 @@ void qh_matchnewfacets(void /* qh newfacet_list */) { qh_printfacetlist(qh newfacet_list, NULL, qh_ALL); FORALLnew_facets { if (newfacet->normal) - qh_checkflipped(newfacet, NULL, qh_ALL); + qh_checkflipped(newfacet, NULL, qh_ALL); } }else if (qh FORCEoutput) qh_checkflipped_all(qh newfacet_list); /* prints warnings for flipped */ } /* matchnewfacets */ - + /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="matchvertices">-</a> - + qh_matchvertices( firstindex, verticesA, skipA, verticesB, skipB, same ) tests whether vertices match with a single skip starts match at firstindex since all new facets have a common vertex @@ -942,7 +942,7 @@ void qh_matchnewfacets(void /* qh newfacet_list */) { scan both sets checking for a match test orientation */ -boolT qh_matchvertices(int firstindex, setT *verticesA, int skipA, +boolT qh_matchvertices(int firstindex, setT *verticesA, int skipA, setT *verticesB, int *skipB, boolT *same) { vertexT **elemAp, **elemBp, **skipBp=NULL, **skipAp; @@ -962,15 +962,15 @@ boolT qh_matchvertices(int firstindex, setT *verticesA, int skipA, /* WARN64 -- This expression on pointers returns 0 or 1 */ *same= !(int)((((ptr_intT)skipA & 0x1) ^ ((ptr_intT)*skipB & 0x1))); trace4((qh ferr, 4054, "qh_matchvertices: matched by skip %d(v%d) and skip %d(v%d) same? %d\n", - skipA, (*skipAp)->id, *skipB, (*(skipBp-1))->id, *same)); + skipA, (*skipAp)->id, *skipB, (*(skipBp-1))->id, *same)); return(True); } /* matchvertices */ /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="newfacet">-</a> - + qh_newfacet() - return a new facet + return a new facet returns: all fields initialized or cleared (NULL) @@ -979,7 +979,7 @@ boolT qh_matchvertices(int firstindex, setT *verticesA, int skipA, facetT *qh_newfacet(void) { facetT *facet; void **freelistp; /* used !qh_NOmem */ - + qh_memalloc_((int)sizeof(facetT), freelistp, facet, facetT); memset((char *)facet, (size_t)0, sizeof(facetT)); if (qh facet_id == qh tracefacet_id) @@ -1005,7 +1005,7 @@ facetT *qh_newfacet(void) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="newridge">-</a> - + qh_newridge() return a new ridge */ @@ -1029,9 +1029,9 @@ may have the same identifier. Otherwise output ok.\n", 0xFFFFFF); /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="pointid">-</a> - + qh_pointid( ) - return id for a point, + return id for a point, returns -3 if null, -2 if interior, or -1 if not known alternative code: @@ -1048,9 +1048,9 @@ int qh_pointid(pointT *point) { ptr_intT offset, id; if (!point) - id= -3; + return -3; else if (point == qh interior_point) - id= -2; + return -2; else if (point >= qh first_point && point < qh first_point + qh num_points * qh hull_dim) { offset= (ptr_intT)(point - qh first_point); @@ -1058,13 +1058,13 @@ int qh_pointid(pointT *point) { }else if ((id= qh_setindex(qh other_points, point)) != -1) id += qh num_points; else - id= -1; - return(int) id; + return -1; + return (int)id; } /* pointid */ - + /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="removefacet">-</a> - + qh_removefacet( facet ) unlinks facet from qh.facet_list, @@ -1077,13 +1077,13 @@ int qh_pointid(pointT *point) { */ void qh_removefacet(facetT *facet) { facetT *next= facet->next, *previous= facet->previous; - + if (facet == qh newfacet_list) qh newfacet_list= next; if (facet == qh facet_next) qh facet_next= next; if (facet == qh visible_list) - qh visible_list= next; + qh visible_list= next; if (previous) { previous->next= next; next->previous= previous; @@ -1098,17 +1098,17 @@ void qh_removefacet(facetT *facet) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="removevertex">-</a> - + qh_removevertex( vertex ) unlinks vertex from qh.vertex_list, returns: - updates qh.vertex_list .newvertex_list + updates qh.vertex_list .newvertex_list decrements qh.num_vertices */ void qh_removevertex(vertexT *vertex) { vertexT *next= vertex->next, *previous= vertex->previous; - + if (vertex == qh newvertex_list) qh newvertex_list= next; if (previous) { @@ -1125,13 +1125,13 @@ void qh_removevertex(vertexT *vertex) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="updatevertices">-</a> - + qh_updatevertices() update vertex neighbors and delete interior vertices returns: if qh.VERTEXneighbors, updates neighbors for each vertex - if qh.newvertex_list, + if qh.newvertex_list, removes visible neighbors from vertex neighbors if qh.newfacet_list adds new facets to vertex neighbors @@ -1154,8 +1154,8 @@ void qh_updatevertices(void /*qh newvertex_list, newfacet_list, visible_list*/) if (qh VERTEXneighbors) { FORALLvertex_(qh newvertex_list) { FOREACHneighbor_(vertex) { - if (neighbor->visible) - SETref_(neighbor)= NULL; + if (neighbor->visible) + SETref_(neighbor)= NULL; } qh_setcompact(vertex->neighbors); } @@ -1166,18 +1166,18 @@ void qh_updatevertices(void /*qh newvertex_list, newfacet_list, visible_list*/) FORALLvisible_facets { FOREACHvertex_(visible->vertices) { if (!vertex->newlist && !vertex->deleted) { - FOREACHneighbor_(vertex) { /* this can happen under merging */ - if (!neighbor->visible) - break; - } - if (neighbor) - qh_setdel(vertex->neighbors, visible); - else { - vertex->deleted= True; - qh_setappend(&qh del_vertices, vertex); - trace2((qh ferr, 2041, "qh_updatevertices: delete vertex p%d(v%d) in f%d\n", - qh_pointid(vertex->point), vertex->id, visible->id)); - } + FOREACHneighbor_(vertex) { /* this can happen under merging */ + if (!neighbor->visible) + break; + } + if (neighbor) + qh_setdel(vertex->neighbors, visible); + else { + vertex->deleted= True; + qh_setappend(&qh del_vertices, vertex); + trace2((qh ferr, 2041, "qh_updatevertices: delete vertex p%d(v%d) in f%d\n", + qh_pointid(vertex->point), vertex->id, visible->id)); + } } } } @@ -1186,10 +1186,10 @@ void qh_updatevertices(void /*qh newvertex_list, newfacet_list, visible_list*/) FOREACHvertex_(visible->vertices) { if (!vertex->newlist && !vertex->deleted) { vertex->deleted= True; - qh_setappend(&qh del_vertices, vertex); - trace2((qh ferr, 2042, "qh_updatevertices: delete vertex p%d(v%d) in f%d\n", - qh_pointid(vertex->point), vertex->id, visible->id)); - } + qh_setappend(&qh del_vertices, vertex); + trace2((qh ferr, 2042, "qh_updatevertices: delete vertex p%d(v%d) in f%d\n", + qh_pointid(vertex->point), vertex->id, visible->id)); + } } } } diff --git a/src/poly.h b/src/poly.h index 06854e9..929de2c 100644 --- a/src/poly.h +++ b/src/poly.h @@ -1,14 +1,14 @@ /*<html><pre> -<a href="qh-poly.htm" >-------------------------------</a><a name="TOP">-</a> - poly.h + poly.h header file for poly.c and poly2.c see qh-poly.htm, libqhull.h and poly.c copyright (c) 1993-2010 The Geometry Center. - $Id: //product/qhull/main/rel/src/poly.h#21 $$Change: 1144 $ - $DateTime: 2010/01/04 18:23:37 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/poly.h#22 $$Change: 1164 $ + $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ */ #ifndef qhDEFpoly @@ -20,26 +20,26 @@ /*-<a href="qh-geom.htm#TOC" >--------------------------------</a><a name="ALGORITHMfault">-</a> - - ALGORITHMfault + + ALGORITHMfault use as argument to checkconvex() to report errors during buildhull */ #define qh_ALGORITHMfault 0 /*-<a href="qh-poly.htm#TOC" >--------------------------------</a><a name="DATAfault">-</a> - - DATAfault + + DATAfault use as argument to checkconvex() to report errors during initialhull */ #define qh_DATAfault 1 /*-<a href="qh-poly.htm#TOC" >--------------------------------</a><a name="DUPLICATEridge">-</a> - + DUPLICATEridge special value for facet->neighbor to indicate a duplicate ridge - + notes: set by matchneighbor, used by matchmatch and mark_dupridge */ @@ -47,10 +47,10 @@ /*-<a href="qh-poly.htm#TOC" >--------------------------------</a><a name="MERGEridge">-</a> - + MERGEridge flag in facet special value for facet->neighbor to indicate a merged ridge - + notes: set by matchneighbor, used by matchmatch and mark_dupridge */ @@ -63,14 +63,14 @@ /*-<a href="qh-poly.htm#TOC" >--------------------------------</a><a name="FORALLfacet_">-</a> - + FORALLfacet_( facetlist ) { ... } assign 'facet' to each facet in facetlist - + notes: uses 'facetT *facet;' assumes last facet is a sentinel - + see: FORALLfacets */ @@ -78,10 +78,10 @@ /*-<a href="qh-poly.htm#TOC" >--------------------------------</a><a name="FORALLnew_facets">-</a> - - FORALLnew_facets { ... } + + FORALLnew_facets { ... } assign 'newfacet' to each facet in qh.newfacet_list - + notes: uses 'facetT *newfacet;' at exit, newfacet==NULL @@ -90,10 +90,10 @@ /*-<a href="qh-poly.htm#TOC" >--------------------------------</a><a name="FORALLvertex_">-</a> - + FORALLvertex_( vertexlist ) { ... } assign 'vertex' to each vertex in vertexlist - + notes: uses 'vertexT *vertex;' at exit, vertex==NULL @@ -102,10 +102,10 @@ /*-<a href="qh-poly.htm#TOC" >--------------------------------</a><a name="FORALLvisible_facets">-</a> - + FORALLvisible_facets { ... } assign 'visible' to each visible facet in qh.visible_list - + notes: uses 'vacetT *visible;' at exit, visible==NULL @@ -114,10 +114,10 @@ /*-<a href="qh-poly.htm#TOC" >--------------------------------</a><a name="FORALLsame_">-</a> - - FORALLsame_( newfacet ) { ... } + + FORALLsame_( newfacet ) { ... } assign 'same' to each facet in newfacet->f.samecycle - + notes: uses 'facetT *same;' stops when it returns to newfacet @@ -126,10 +126,10 @@ /*-<a href="qh-poly.htm#TOC" >--------------------------------</a><a name="FORALLsame_cycle_">-</a> - - FORALLsame_cycle_( newfacet ) { ... } + + FORALLsame_cycle_( newfacet ) { ... } assign 'same' to each facet in newfacet->f.samecycle - + notes: uses 'facetT *same;' at exit, same == NULL @@ -140,13 +140,13 @@ /*-<a href="qh-poly.htm#TOC" >--------------------------------</a><a name="FOREACHneighborA_">-</a> - + FOREACHneighborA_( facet ) { ... } assign 'neighborA' to each neighbor in facet->neighbors - + FOREACHneighborA_( vertex ) { ... } assign 'neighborA' to each neighbor in vertex->neighbors - + declare: facetT *neighborA, **neighborAp; @@ -157,10 +157,10 @@ /*-<a href="qh-poly.htm#TOC" >--------------------------------</a><a name="FOREACHvisible_">-</a> - - FOREACHvisible_( facets ) { ... } + + FOREACHvisible_( facets ) { ... } assign 'visible' to each facet in facets - + notes: uses 'facetT *facet, *facetp;' see <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a> @@ -169,10 +169,10 @@ /*-<a href="qh-poly.htm#TOC" >--------------------------------</a><a name="FOREACHnewfacet_">-</a> - - FOREACHnewfacet_( facets ) { ... } + + FOREACHnewfacet_( facets ) { ... } assign 'newfacet' to each facet in facets - + notes: uses 'facetT *newfacet, *newfacetp;' see <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a> @@ -181,10 +181,10 @@ /*-<a href="qh-poly.htm#TOC" >--------------------------------</a><a name="FOREACHvertexA_">-</a> - - FOREACHvertexA_( vertices ) { ... } + + FOREACHvertexA_( vertices ) { ... } assign 'vertexA' to each vertex in vertices - + notes: uses 'vertexT *vertexA, *vertexAp;' see <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a> @@ -193,11 +193,11 @@ /*-<a href="qh-poly.htm#TOC" >--------------------------------</a><a name="FOREACHvertexreverse12_">-</a> - - FOREACHvertexreverse12_( vertices ) { ... } + + FOREACHvertexreverse12_( vertices ) { ... } assign 'vertex' to each vertex in vertices reverse order of first two vertices - + notes: uses 'vertexT *vertex, *vertexp;' see <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a> @@ -209,10 +209,10 @@ void qh_appendfacet(facetT *facet); void qh_appendvertex(vertexT *vertex); -void qh_attachnewfacets(void); +void qh_attachnewfacets(void); boolT qh_checkflipped(facetT *facet, realT *dist, boolT allerror); -void qh_delfacet(facetT *facet); -void qh_deletevisible(void /*qh visible_list, qh horizon_list*/); +void qh_delfacet(facetT *facet); +void qh_deletevisible(void /*qh visible_list, qh horizon_list*/); setT *qh_facetintersect(facetT *facetA, facetT *facetB, int *skipAp,int *skipBp, int extra); int qh_gethash(int hashsize, setT *set, int size, int firstindex, void *skipelem); facetT *qh_makenewfacet(setT *vertices, boolT toporient, facetT *facet); @@ -220,76 +220,76 @@ void qh_makenewplanes(void /* newfacet_list */); facetT *qh_makenew_nonsimplicial(facetT *visible, vertexT *apex, int *numnew); facetT *qh_makenew_simplicial(facetT *visible, vertexT *apex, int *numnew); void qh_matchneighbor(facetT *newfacet, int newskip, int hashsize, - int *hashcount); -void qh_matchnewfacets(void); -boolT qh_matchvertices(int firstindex, setT *verticesA, int skipA, - setT *verticesB, int *skipB, boolT *same); + int *hashcount); +void qh_matchnewfacets(void); +boolT qh_matchvertices(int firstindex, setT *verticesA, int skipA, + setT *verticesB, int *skipB, boolT *same); facetT *qh_newfacet(void); ridgeT *qh_newridge(void); int qh_pointid(pointT *point); -void qh_removefacet(facetT *facet); -void qh_removevertex(vertexT *vertex); +void qh_removefacet(facetT *facet); +void qh_removevertex(vertexT *vertex); void qh_updatevertices(void); /*========== -prototypes poly2.c in alphabetical order ===========*/ void qh_addhash(void* newelem, setT *hashtable, int hashsize, int hash); -void qh_check_bestdist(void); +void qh_check_bestdist(void); void qh_check_maxout(void); void qh_check_output(void); void qh_check_point(pointT *point, facetT *facet, realT *maxoutside, realT *maxdist, facetT **errfacet1, facetT **errfacet2); -void qh_check_points(void); -void qh_checkconvex(facetT *facetlist, int fault); +void qh_check_points(void); +void qh_checkconvex(facetT *facetlist, int fault); void qh_checkfacet(facetT *facet, boolT newmerge, boolT *waserrorp); -void qh_checkflipped_all(facetT *facetlist); -void qh_checkpolygon(facetT *facetlist); +void qh_checkflipped_all(facetT *facetlist); +void qh_checkpolygon(facetT *facetlist); void qh_checkvertex(vertexT *vertex); -void qh_clearcenters(qh_CENTER type); -void qh_createsimplex(setT *vertices); -void qh_delridge(ridgeT *ridge); +void qh_clearcenters(qh_CENTER type); +void qh_createsimplex(setT *vertices); +void qh_delridge(ridgeT *ridge); void qh_delvertex(vertexT *vertex); setT *qh_facet3vertex(facetT *facet); facetT *qh_findbestfacet(pointT *point, boolT bestoutside, realT *bestdist, boolT *isoutside); facetT *qh_findbestlower(facetT *upperfacet, pointT *point, realT *bestdistp, int *numpart); facetT *qh_findfacet_all(pointT *point, realT *bestdist, boolT *isoutside, - int *numpart); -int qh_findgood(facetT *facetlist, int goodhorizon); -void qh_findgood_all(facetT *facetlist); + int *numpart); +int qh_findgood(facetT *facetlist, int goodhorizon); +void qh_findgood_all(facetT *facetlist); void qh_furthestnext(void /* qh facet_list */); void qh_furthestout(facetT *facet); void qh_infiniteloop(facetT *facet); -void qh_initbuild(void); -void qh_initialhull(setT *vertices); +void qh_initbuild(void); +void qh_initialhull(setT *vertices); setT *qh_initialvertices(int dim, setT *maxpoints, pointT *points, int numpoints); vertexT *qh_isvertex(pointT *point, setT *vertices); vertexT *qh_makenewfacets(pointT *point /*horizon_list, visible_list*/); void qh_matchduplicates(facetT *atfacet, int atskip, int hashsize, int *hashcount); void qh_nearcoplanar(void /* qh.facet_list */); vertexT *qh_nearvertex(facetT *facet, pointT *point, realT *bestdistp); -int qh_newhashtable(int newsize); +int qh_newhashtable(int newsize); vertexT *qh_newvertex(pointT *point); ridgeT *qh_nextridge3d(ridgeT *atridge, facetT *facet, vertexT **vertexp); void qh_outcoplanar(void /* facet_list */); pointT *qh_point(int id); -void qh_point_add(setT *set, pointT *point, void *elem); +void qh_point_add(setT *set, pointT *point, void *elem); setT *qh_pointfacet(void /*qh facet_list*/); setT *qh_pointvertex(void /*qh facet_list*/); -void qh_prependfacet(facetT *facet, facetT **facetlist); -void qh_printhashtable(FILE *fp); +void qh_prependfacet(facetT *facet, facetT **facetlist); +void qh_printhashtable(FILE *fp); void qh_printlists(void); void qh_resetlists(boolT stats, boolT resetVisible /*qh newvertex_list newfacet_list visible_list*/); void qh_setvoronoi_all(void); -void qh_triangulate(void /*qh facet_list*/); +void qh_triangulate(void /*qh facet_list*/); void qh_triangulate_facet(facetT *facetA, vertexT **first_vertex); void qh_triangulate_link(facetT *oldfacetA, facetT *facetA, facetT *oldfacetB, facetT *facetB); -void qh_triangulate_mirror(facetT *facetA, facetT *facetB); +void qh_triangulate_mirror(facetT *facetA, facetT *facetB); void qh_triangulate_null(facetT *facetA); void qh_vertexintersect(setT **vertexsetA,setT *vertexsetB); setT *qh_vertexintersect_new(setT *vertexsetA,setT *vertexsetB); void qh_vertexneighbors(void /*qh facet_list*/); -boolT qh_vertexsubset(setT *vertexsetA, setT *vertexsetB); +boolT qh_vertexsubset(setT *vertexsetA, setT *vertexsetB); #endif /* qhDEFpoly */ diff --git a/src/poly2.c b/src/poly2.c index 58a2c9a..451d66f 100644 --- a/src/poly2.c +++ b/src/poly2.c @@ -1,7 +1,7 @@ /*<html><pre> -<a href="qh-poly.htm" >-------------------------------</a><a name="TOP">-</a> - poly2.c + poly2.c implements polygons and simplices see qh-poly.htm, poly.h and libqhull.h @@ -9,8 +9,8 @@ frequently used code is in poly.c copyright (c) 1993-2010 The Geometry Center. - $Id: //product/qhull/main/rel/src/poly2.c#39 $$Change: 1154 $ - $DateTime: 2010/01/06 20:41:28 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/poly2.c#40 $$Change: 1164 $ + $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ */ #include "qhull_a.h" @@ -19,7 +19,7 @@ /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="addhash">-</a> - + qh_addhash( newelem, hashtable, hashsize, hash ) add newelem to linear hash table at hash if not already there */ @@ -27,7 +27,7 @@ void qh_addhash(void* newelem, setT *hashtable, int hashsize, int hash) { int scan; void *elem; - for (scan= (int)hash; (elem= SETelem_(hashtable, scan)); + for (scan= (int)hash; (elem= SETelem_(hashtable, scan)); scan= (++scan >= hashsize ? 0 : scan)) { if (elem == newelem) break; @@ -39,13 +39,13 @@ void qh_addhash(void* newelem, setT *hashtable, int hashsize, int hash) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="check_bestdist">-</a> - + qh_check_bestdist() check that all points are within max_outside of the nearest facet if qh.ONLYgood, ignores !good facets - see: + see: qh_check_maxout(), qh_outerinner() notes: @@ -66,7 +66,7 @@ void qh_addhash(void* newelem, setT *hashtable, int hashsize, int hash) { void qh_check_bestdist(void) { boolT waserror= False, unassigned; facetT *facet, *bestfacet, *errfacet1= NULL, *errfacet2= NULL; - facetT *facetlist; + facetT *facetlist; realT dist, maxoutside, maxdist= -REALmax; pointT *point; int numpart= 0, facet_i, facet_n, notgood= 0, notverified= 0; @@ -83,7 +83,7 @@ void qh_check_bestdist(void) { qh_fprintf(qh ferr, 8091, "\n\ qhull output completed. Verifying that %d points are\n\ below %2.2g of the nearest %sfacet.\n", - qh_setsize(facets), maxoutside, (qh ONLYgood ? "good " : "")); + qh_setsize(facets), maxoutside, (qh ONLYgood ? "good " : "")); FOREACHfacet_i_(facets) { /* for each point with facet assignment */ if (facet) unassigned= False; @@ -100,27 +100,27 @@ below %2.2g of the nearest %sfacet.\n", /* occurs after statistics reported */ maximize_(maxdist, dist); if (dist > maxoutside) { - if (qh ONLYgood && !bestfacet->good - && !((bestfacet= qh_findgooddist(point, bestfacet, &dist, &facetlist)) - && dist > maxoutside)) - notgood++; + if (qh ONLYgood && !bestfacet->good + && !((bestfacet= qh_findgooddist(point, bestfacet, &dist, &facetlist)) + && dist > maxoutside)) + notgood++; else { - waserror= True; - qh_fprintf(qh ferr, 6109, "qhull precision error: point p%d is outside facet f%d, distance= %6.8g maxoutside= %6.8g\n", - facet_i, bestfacet->id, dist, maxoutside); - if (errfacet1 != bestfacet) { - errfacet2= errfacet1; - errfacet1= bestfacet; - } + waserror= True; + qh_fprintf(qh ferr, 6109, "qhull precision error: point p%d is outside facet f%d, distance= %6.8g maxoutside= %6.8g\n", + facet_i, bestfacet->id, dist, maxoutside); + if (errfacet1 != bestfacet) { + errfacet2= errfacet1; + errfacet1= bestfacet; + } } }else if (unassigned && dist < -qh MAXcoplanar) notverified++; } qh_settempfree(&facets); - if (notverified && !qh DELAUNAY && !qh_QUICKhelp && qh PRINTprecision) + if (notverified && !qh DELAUNAY && !qh_QUICKhelp && qh PRINTprecision) qh_fprintf(qh ferr, 8092, "\n%d points were well inside the hull. If the hull contains\n\ a lens-shaped component, these points were not verified. Use\n\ -options 'Qci Tv' to verify all points.\n", notverified); +options 'Qci Tv' to verify all points.\n", notverified); if (maxdist > qh outside_err) { qh_fprintf(qh ferr, 6110, "qhull precision error (qh_check_bestdist): a coplanar point is %6.2g from convex hull. The maximum value(qh.outside_err) is %6.2g\n", maxdist, qh outside_err); @@ -133,7 +133,7 @@ options 'Qci Tv' to verify all points.\n", notverified); /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="check_maxout">-</a> - + qh_check_maxout() updates qh.max_outside by checking all points against bestfacet if qh.ONLYgood, ignores !good facets @@ -141,13 +141,13 @@ options 'Qci Tv' to verify all points.\n", notverified); returns: updates facet->maxoutside via qh_findbesthorizon() sets qh.maxoutdone - if printing qh.min_vertex (qh_outerinner), + if printing qh.min_vertex (qh_outerinner), it is updated to the current vertices removes inside/coplanar points from coplanarset as needed notes: - defines coplanar as min_vertex instead of MAXcoplanar - may not need to check near-inside points because of qh.MAXcoplanar + defines coplanar as min_vertex instead of MAXcoplanar + may not need to check near-inside points because of qh.MAXcoplanar and qh.KEEPnearinside (before it was -DISTround) see also: @@ -174,57 +174,57 @@ void qh_check_maxout(void) { trace1((qh ferr, 1022, "qh_check_maxout: check and update maxoutside for each facet.\n")); maxoutside= minvertex= 0; - if (qh VERTEXneighbors - && (qh PRINTsummary || qh KEEPinside || qh KEEPcoplanar - || qh TRACElevel || qh PRINTstatistics - || qh PRINTout[0] == qh_PRINTsummary || qh PRINTout[0] == qh_PRINTnone)) { + if (qh VERTEXneighbors + && (qh PRINTsummary || qh KEEPinside || qh KEEPcoplanar + || qh TRACElevel || qh PRINTstatistics + || qh PRINTout[0] == qh_PRINTsummary || qh PRINTout[0] == qh_PRINTnone)) { trace1((qh ferr, 1023, "qh_check_maxout: determine actual maxoutside and minvertex\n")); vertices= qh_pointvertex(/*qh facet_list*/); FORALLvertices { FOREACHneighbor_(vertex) { zinc_(Zdistvertex); /* distance also computed by main loop below */ - qh_distplane(vertex->point, neighbor, &dist); - minimize_(minvertex, dist); - if (-dist > qh TRACEdist || dist > qh TRACEdist - || neighbor == qh tracefacet || vertex == qh tracevertex) - qh_fprintf(qh ferr, 8093, "qh_check_maxout: p%d(v%d) is %.2g from f%d\n", - qh_pointid(vertex->point), vertex->id, dist, neighbor->id); + qh_distplane(vertex->point, neighbor, &dist); + minimize_(minvertex, dist); + if (-dist > qh TRACEdist || dist > qh TRACEdist + || neighbor == qh tracefacet || vertex == qh tracevertex) + qh_fprintf(qh ferr, 8093, "qh_check_maxout: p%d(v%d) is %.2g from f%d\n", + qh_pointid(vertex->point), vertex->id, dist, neighbor->id); } } if (qh MERGING) { wmin_(Wminvertex, qh min_vertex); } qh min_vertex= minvertex; - qh_settempfree(&vertices); + qh_settempfree(&vertices); } facets= qh_pointfacet(/*qh facet_list*/); do { old_maxoutside= fmax_(qh max_outside, maxoutside); FOREACHfacet_i_(facets) { /* for each point with facet assignment */ - if (facet) { - point= qh_point(facet_i); - if (point == qh GOODpointp) - continue; - zzinc_(Ztotcheck); - qh_distplane(point, facet, &dist); - numpart++; - bestfacet= qh_findbesthorizon(qh_IScheckmax, point, facet, !qh_NOupper, &dist, &numpart); - if (bestfacet && dist > maxoutside) { - if (qh ONLYgood && !bestfacet->good - && !((bestfacet= qh_findgooddist(point, bestfacet, &dist, &facetlist)) - && dist > maxoutside)) - notgood++; - else - maxoutside= dist; - } - if (dist > qh TRACEdist || (bestfacet && bestfacet == qh tracefacet)) - qh_fprintf(qh ferr, 8094, "qh_check_maxout: p%d is %.2g above f%d\n", - qh_pointid(point), dist, bestfacet->id); + if (facet) { + point= qh_point(facet_i); + if (point == qh GOODpointp) + continue; + zzinc_(Ztotcheck); + qh_distplane(point, facet, &dist); + numpart++; + bestfacet= qh_findbesthorizon(qh_IScheckmax, point, facet, !qh_NOupper, &dist, &numpart); + if (bestfacet && dist > maxoutside) { + if (qh ONLYgood && !bestfacet->good + && !((bestfacet= qh_findgooddist(point, bestfacet, &dist, &facetlist)) + && dist > maxoutside)) + notgood++; + else + maxoutside= dist; + } + if (dist > qh TRACEdist || (bestfacet && bestfacet == qh tracefacet)) + qh_fprintf(qh ferr, 8094, "qh_check_maxout: p%d is %.2g above f%d\n", + qh_pointid(point), dist, bestfacet->id); } } - }while + }while (maxoutside > 2*old_maxoutside); - /* if qh.maxoutside increases substantially, qh_SEARCHdist is not valid + /* if qh.maxoutside increases substantially, qh_SEARCHdist is not valid e.g., RBOX 5000 s Z1 G1e-13 t1001200614 | qhull */ zzadd_(Zcheckpart, numpart); qh_settempfree(&facets); @@ -243,7 +243,7 @@ void qh_check_maxout(void) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="check_output">-</a> - + qh_check_output() performs the checks at the end of qhull algorithm Maybe called after voronoi output. Will recompute otherwise centrums are Voronoi centers instead @@ -267,7 +267,7 @@ void qh_check_output(void) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="check_point">-</a> - + qh_check_point( point, facet, maxoutside, maxdist, errfacet1, errfacet2 ) check that point is less than maxoutside from facet */ @@ -281,8 +281,8 @@ void qh_check_point(pointT *point, facetT *facet, realT *maxoutside, realT *maxd *errfacet2= *errfacet1; *errfacet1= facet; } - qh_fprintf(qh ferr, 6111, "qhull precision error: point p%d is outside facet f%d, distance= %6.8g maxoutside= %6.8g\n", - qh_pointid(point), facet->id, dist, *maxoutside); + qh_fprintf(qh ferr, 6111, "qhull precision error: point p%d is outside facet f%d, distance= %6.8g maxoutside= %6.8g\n", + qh_pointid(point), facet->id, dist, *maxoutside); } maximize_(*maxdist, dist); } /* qh_check_point */ @@ -290,12 +290,12 @@ void qh_check_point(pointT *point, facetT *facet, realT *maxoutside, realT *maxd /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="check_points">-</a> - + qh_check_points() checks that all points are inside all facets notes: - if many points and qh_check_maxout not called (i.e., !qh.MERGING), + if many points and qh_check_maxout not called (i.e., !qh.MERGING), calls qh_findbesthorizon (seldom done). ignores flipped facets maxoutside includes 2 qh.DISTrounds @@ -321,7 +321,7 @@ void qh_check_points(void) { maxoutside += qh DISTround; /* one more qh.DISTround for check computation */ trace1((qh ferr, 1025, "qh_check_points: check all points below %2.2g of all facet planes\n", - maxoutside)); + maxoutside)); if (qh num_good) /* miss counts other_points and !good facets */ total= (float)qh num_good * (float)qh num_points; else @@ -347,15 +347,15 @@ of a facet.\n"); } if (qh PRINTprecision) { if (testouter) - qh_fprintf(qh ferr, 8098, "\n\ + qh_fprintf(qh ferr, 8098, "\n\ Output completed. Verifying that all points are below outer planes of\n\ -all %sfacets. Will make %2.0f distance computations.\n", - (qh ONLYgood ? "good " : ""), total); +all %sfacets. Will make %2.0f distance computations.\n", + (qh ONLYgood ? "good " : ""), total); else - qh_fprintf(qh ferr, 8099, "\n\ + qh_fprintf(qh ferr, 8099, "\n\ Output completed. Verifying that all points are below %2.2g of\n\ -all %sfacets. Will make %2.0f distance computations.\n", - maxoutside, (qh ONLYgood ? "good " : ""), total); +all %sfacets. Will make %2.0f distance computations.\n", + maxoutside, (qh ONLYgood ? "good " : ""), total); } FORALLfacets { if (!facet->good && qh ONLYgood) @@ -363,22 +363,22 @@ all %sfacets. Will make %2.0f distance computations.\n", if (facet->flipped) continue; if (!facet->normal) { - qh_fprintf(qh ferr, 7061, "qhull warning (qh_check_points): missing normal for facet f%d\n", facet->id); + qh_fprintf(qh ferr, 7061, "qhull warning (qh_check_points): missing normal for facet f%d\n", facet->id); continue; } if (testouter) { #if qh_MAXoutside - maxoutside= facet->maxoutside + 2* qh DISTround; - /* one DISTround to actual point and another to computed point */ + maxoutside= facet->maxoutside + 2* qh DISTround; + /* one DISTround to actual point and another to computed point */ #endif } FORALLpoints { - if (point != qh GOODpointp) - qh_check_point(point, facet, &maxoutside, &maxdist, &errfacet1, &errfacet2); + if (point != qh GOODpointp) + qh_check_point(point, facet, &maxoutside, &maxdist, &errfacet1, &errfacet2); } FOREACHpoint_(qh other_points) { - if (point != qh GOODpointp) - qh_check_point(point, facet, &maxoutside, &maxdist, &errfacet1, &errfacet2); + if (point != qh GOODpointp) + qh_check_point(point, facet, &maxoutside, &maxdist, &errfacet1, &errfacet2); } } if (maxdist > qh outside_err) { @@ -395,7 +395,7 @@ all %sfacets. Will make %2.0f distance computations.\n", /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="checkconvex">-</a> - + qh_checkconvex( facetlist, fault ) check that each ridge in facetlist is convex fault = qh_DATAfault if reporting errors @@ -406,11 +406,11 @@ all %sfacets. Will make %2.0f distance computations.\n", errors if concaveridge or if merging an coplanar ridge note: - if not merging, + if not merging, tests vertices for neighboring simplicial facets - else if ZEROcentrum, + else if ZEROcentrum, tests vertices for neighboring simplicial facets - else + else tests centrums of neighboring facets design: @@ -419,7 +419,7 @@ all %sfacets. Will make %2.0f distance computations.\n", if ZEROcentrum and simplicial neighbors test vertices for neighboring simplicial facets else - test centrum against all neighbors + test centrum against all neighbors */ void qh_checkconvex(facetT *facetlist, int fault) { facetT *facet, *neighbor, **neighborp, *errfacet1=NULL, *errfacet2=NULL; @@ -438,7 +438,7 @@ void qh_checkconvex(facetT *facetlist, int fault) { if (facet->flipped) { qh_precision("flipped facet"); qh_fprintf(qh ferr, 6113, "qhull precision error: f%d is flipped(interior point is outside)\n", - facet->id); + facet->id); errfacet1= facet; waserror= True; continue; @@ -450,17 +450,17 @@ void qh_checkconvex(facetT *facetlist, int fault) { neighbor_i= 0; FOREACHneighbor_(facet) { vertex= SETelemt_(facet->vertices, neighbor_i++, vertexT); - if (!neighbor->simplicial || neighbor->tricoplanar) { - allsimplicial= False; - continue; - } + if (!neighbor->simplicial || neighbor->tricoplanar) { + allsimplicial= False; + continue; + } qh_distplane(vertex->point, neighbor, &dist); if (dist > -qh DISTround) { - if (fault == qh_DATAfault) { + if (fault == qh_DATAfault) { qh_precision("coplanar or concave ridge"); - qh_fprintf(qh ferr, 6114, "qhull precision error: initial simplex is not convex. Distance=%.2g\n", dist); - qh_errexit(qh_ERRsingular, NULL, NULL); - } + qh_fprintf(qh ferr, 6114, "qhull precision error: initial simplex is not convex. Distance=%.2g\n", dist); + qh_errexit(qh_ERRsingular, NULL, NULL); + } if (dist > qh DISTround) { zzinc_(Zconcaveridges); qh_precision("concave ridge"); @@ -471,15 +471,15 @@ void qh_checkconvex(facetT *facetlist, int fault) { waserror= True; }else if (qh ZEROcentrum) { if (dist > 0) { /* qh_checkzero checks that dist < - qh DISTround */ - zzinc_(Zcoplanarridges); + zzinc_(Zcoplanarridges); qh_precision("coplanar ridge"); qh_fprintf(qh ferr, 6116, "qhull precision error: f%d is clearly not convex to f%d, since p%d(v%d) is %6.4g above\n", facet->id, neighbor->id, qh_pointid(vertex->point), vertex->id, dist); errfacet1= facet; errfacet2= neighbor; waserror= True; - } - }else { + } + }else { zzinc_(Zcoplanarridges); qh_precision("coplanar ridge"); trace0((qh ferr, 22, "qhull precision error: f%d may be coplanar to f%d, since p%d(v%d) is within %6.4g during p%d\n", @@ -494,18 +494,18 @@ void qh_checkconvex(facetT *facetlist, int fault) { facet->center= qh_getcentrum(facet); centrum= facet->center; }else { - if (!centrum_warning && (!facet->simplicial || facet->tricoplanar)) { - centrum_warning= True; - qh_fprintf(qh ferr, 7062, "qhull warning: recomputing centrums for convexity test. This may lead to false, precision errors.\n"); - } + if (!centrum_warning && (!facet->simplicial || facet->tricoplanar)) { + centrum_warning= True; + qh_fprintf(qh ferr, 7062, "qhull warning: recomputing centrums for convexity test. This may lead to false, precision errors.\n"); + } centrum= qh_getcentrum(facet); tempcentrum= True; } FOREACHneighbor_(facet) { - if (qh ZEROcentrum && facet->simplicial && neighbor->simplicial) - continue; - if (facet->tricoplanar || neighbor->tricoplanar) - continue; + if (qh ZEROcentrum && facet->simplicial && neighbor->simplicial) + continue; + if (facet->tricoplanar || neighbor->tricoplanar) + continue; zzinc_(Zdistconvex); qh_distplane(centrum, neighbor, &dist); if (dist > qh DISTround) { @@ -516,15 +516,15 @@ void qh_checkconvex(facetT *facetlist, int fault) { errfacet1= facet; errfacet2= neighbor; waserror= True; - }else if (dist >= 0.0) { /* if arithmetic always rounds the same, - can test against centrum radius instead */ + }else if (dist >= 0.0) { /* if arithmetic always rounds the same, + can test against centrum radius instead */ zzinc_(Zcoplanarridges); qh_precision("coplanar ridge"); qh_fprintf(qh ferr, 6118, "qhull precision error: f%d is coplanar or concave to f%d. Centrum of f%d is %6.4g above f%d\n", facet->id, neighbor->id, facet->id, dist, neighbor->id); - errfacet1= facet; - errfacet2= neighbor; - waserror= True; + errfacet1= facet; + errfacet2= neighbor; + waserror= True; } } if (tempcentrum) @@ -538,7 +538,7 @@ void qh_checkconvex(facetT *facetlist, int fault) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="checkfacet">-</a> - + qh_checkfacet( facet, newmerge, waserror ) checks for consistency errors in facet newmerge set if from merge.c @@ -557,11 +557,11 @@ void qh_checkconvex(facetT *facetlist, int fault) { neighbors are reciprocated ridge neighbors are facet neighbors and a ridge for every neighbor simplicial neighbors match facetintersect - vertex intersection matches vertices of common ridges + vertex intersection matches vertices of common ridges vertex neighbors and facet vertices agree all ridges have distinct vertex sets - notes: + notes: uses neighbor->seen design: @@ -615,15 +615,15 @@ void qh_checkfacet(facetT *facet, boolT newmerge, boolT *waserrorp) { numvertices= qh_setsize(facet->vertices); numridges= qh_setsize(facet->ridges); if (facet->simplicial) { - if (numvertices+numneighbors != 2*qh hull_dim + if (numvertices+numneighbors != 2*qh hull_dim && !facet->degenerate && !facet->redundant) { - qh_fprintf(qh ferr, 6123, "qhull internal error (qh_checkfacet): for simplicial facet f%d, #vertices %d + #neighbors %d != 2*qh hull_dim\n", + qh_fprintf(qh ferr, 6123, "qhull internal error (qh_checkfacet): for simplicial facet f%d, #vertices %d + #neighbors %d != 2*qh hull_dim\n", facet->id, numvertices, numneighbors); qh_setprint(qh ferr, "", facet->neighbors); waserror= True; } }else { /* non-simplicial */ - if (!newmerge + if (!newmerge &&(numvertices < qh hull_dim || numneighbors < qh hull_dim) && !facet->degenerate && !facet->redundant) { qh_fprintf(qh ferr, 6124, "qhull internal error (qh_checkfacet): for facet f%d, #vertices %d or #neighbors %d < qh hull_dim\n", @@ -635,9 +635,9 @@ void qh_checkfacet(facetT *facet, boolT newmerge, boolT *waserrorp) { ||(qh hull_dim == 3 && numvertices > numridges && !qh NEWfacets) ||(qh hull_dim == 2 && numridges + numvertices + numneighbors != 6)) { if (!facet->degenerate && !facet->redundant) { - qh_fprintf(qh ferr, 6125, "qhull internal error (qh_checkfacet): for facet f%d, #ridges %d < #neighbors %d or(3-d) > #vertices %d or(2-d) not all 2\n", - facet->id, numridges, numneighbors, numvertices); - waserror= True; + qh_fprintf(qh ferr, 6125, "qhull internal error (qh_checkfacet): for facet f%d, #ridges %d < #neighbors %d or(3-d) > #vertices %d or(2-d) not all 2\n", + facet->id, numridges, numneighbors, numvertices); + waserror= True; } } } @@ -651,16 +651,16 @@ void qh_checkfacet(facetT *facet, boolT newmerge, boolT *waserrorp) { FOREACHneighbor_(facet) { if (!qh_setin(neighbor->neighbors, facet)) { qh_fprintf(qh ferr, 6127, "qhull internal error (qh_checkfacet): facet f%d has neighbor f%d, but f%d does not have neighbor f%d\n", - facet->id, neighbor->id, neighbor->id, facet->id); + facet->id, neighbor->id, neighbor->id, facet->id); errother= neighbor; waserror= True; } if (!neighbor->seen) { qh_fprintf(qh ferr, 6128, "qhull internal error (qh_checkfacet): facet f%d has a duplicate neighbor f%d\n", - facet->id, neighbor->id); + facet->id, neighbor->id); errother= neighbor; waserror= True; - } + } neighbor->seen= False; } FOREACHridge_(facet->ridges) { @@ -670,14 +670,14 @@ void qh_checkfacet(facetT *facet, boolT newmerge, boolT *waserrorp) { FOREACHridge_(facet->ridges) { if (ridge->seen) { qh_fprintf(qh ferr, 6129, "qhull internal error (qh_checkfacet): facet f%d has a duplicate ridge r%d\n", - facet->id, ridge->id); + facet->id, ridge->id); errridge= ridge; waserror= True; - } + } ridge->seen= True; numRvertices= qh_setsize(ridge->vertices); if (numRvertices != qh hull_dim - 1) { - qh_fprintf(qh ferr, 6130, "qhull internal error (qh_checkfacet): ridge between f%d and f%d has %d vertices\n", + qh_fprintf(qh ferr, 6130, "qhull internal error (qh_checkfacet): ridge between f%d and f%d has %d vertices\n", ridge->top->id, ridge->bottom->id, numRvertices); errridge= ridge; waserror= True; @@ -695,72 +695,72 @@ void qh_checkfacet(facetT *facet, boolT newmerge, boolT *waserrorp) { FOREACHneighbor_(facet) { if (!neighbor->seen) { qh_fprintf(qh ferr, 6132, "qhull internal error (qh_checkfacet): facet f%d does not have a ridge for neighbor f%d\n", - facet->id, neighbor->id); - errother= neighbor; + facet->id, neighbor->id); + errother= neighbor; waserror= True; } intersection= qh_vertexintersect_new(facet->vertices, neighbor->vertices); qh_settemppush(intersection); FOREACHvertex_(facet->vertices) { - vertex->seen= False; - vertex->seen2= False; + vertex->seen= False; + vertex->seen2= False; } FOREACHvertex_(intersection) - vertex->seen= True; + vertex->seen= True; FOREACHridge_(facet->ridges) { - if (neighbor != otherfacet_(ridge, facet)) - continue; - FOREACHvertex_(ridge->vertices) { - if (!vertex->seen) { - qh_fprintf(qh ferr, 6133, "qhull internal error (qh_checkfacet): vertex v%d in r%d not in f%d intersect f%d\n", - vertex->id, ridge->id, facet->id, neighbor->id); - qh_errexit(qh_ERRqhull, facet, ridge); - } - vertex->seen2= True; - } + if (neighbor != otherfacet_(ridge, facet)) + continue; + FOREACHvertex_(ridge->vertices) { + if (!vertex->seen) { + qh_fprintf(qh ferr, 6133, "qhull internal error (qh_checkfacet): vertex v%d in r%d not in f%d intersect f%d\n", + vertex->id, ridge->id, facet->id, neighbor->id); + qh_errexit(qh_ERRqhull, facet, ridge); + } + vertex->seen2= True; + } } if (!newmerge) { - FOREACHvertex_(intersection) { - if (!vertex->seen2) { - if (qh IStracing >=3 || !qh MERGING) { - qh_fprintf(qh ferr, 6134, "qhull precision error (qh_checkfacet): vertex v%d in f%d intersect f%d but\n\ + FOREACHvertex_(intersection) { + if (!vertex->seen2) { + if (qh IStracing >=3 || !qh MERGING) { + qh_fprintf(qh ferr, 6134, "qhull precision error (qh_checkfacet): vertex v%d in f%d intersect f%d but\n\ not in a ridge. This is ok under merging. Last point was p%d\n", - vertex->id, facet->id, neighbor->id, qh furthest_id); - if (!qh FORCEoutput && !qh MERGING) { - qh_errprint("ERRONEOUS", facet, neighbor, NULL, vertex); - if (!qh MERGING) - qh_errexit(qh_ERRqhull, NULL, NULL); - } - } - } - } - } + vertex->id, facet->id, neighbor->id, qh furthest_id); + if (!qh FORCEoutput && !qh MERGING) { + qh_errprint("ERRONEOUS", facet, neighbor, NULL, vertex); + if (!qh MERGING) + qh_errexit(qh_ERRqhull, NULL, NULL); + } + } + } + } + } qh_settempfree(&intersection); } }else { /* simplicial */ FOREACHneighbor_(facet) { - if (neighbor->simplicial) { - skipA= SETindex_(facet->neighbors, neighbor); - skipB= qh_setindex(neighbor->neighbors, facet); - if (!qh_setequal_skip(facet->vertices, skipA, neighbor->vertices, skipB)) { - qh_fprintf(qh ferr, 6135, "qhull internal error (qh_checkfacet): facet f%d skip %d and neighbor f%d skip %d do not match \n", - facet->id, skipA, neighbor->id, skipB); - errother= neighbor; - waserror= True; - } + if (neighbor->simplicial) { + skipA= SETindex_(facet->neighbors, neighbor); + skipB= qh_setindex(neighbor->neighbors, facet); + if (!qh_setequal_skip(facet->vertices, skipA, neighbor->vertices, skipB)) { + qh_fprintf(qh ferr, 6135, "qhull internal error (qh_checkfacet): facet f%d skip %d and neighbor f%d skip %d do not match \n", + facet->id, skipA, neighbor->id, skipB); + errother= neighbor; + waserror= True; + } } } } if (qh hull_dim < 5 && (qh IStracing > 2 || qh CHECKfrequently)) { FOREACHridge_i_(facet->ridges) { /* expensive */ for (i=ridge_i+1; i < ridge_n; i++) { - ridge2= SETelemt_(facet->ridges, i, ridgeT); - if (qh_setequal(ridge->vertices, ridge2->vertices)) { - qh_fprintf(qh ferr, 6227, "Qhull internal error (qh_checkfacet): ridges r%d and r%d have the same vertices\n", - ridge->id, ridge2->id); - errridge= ridge; - waserror= True; - } + ridge2= SETelemt_(facet->ridges, i, ridgeT); + if (qh_setequal(ridge->vertices, ridge2->vertices)) { + qh_fprintf(qh ferr, 6227, "Qhull internal error (qh_checkfacet): ridges r%d and r%d have the same vertices\n", + ridge->id, ridge2->id); + errridge= ridge; + waserror= True; + } } } } @@ -773,7 +773,7 @@ void qh_checkfacet(facetT *facet, boolT newmerge, boolT *waserrorp) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="checkflipped_all">-</a> - + qh_checkflipped_all( facetlist ) checks orientation of facets in list against interior point */ @@ -787,10 +787,10 @@ void qh_checkflipped_all(facetT *facetlist) { FORALLfacet_(facetlist) { if (facet->normal && !qh_checkflipped(facet, &dist, !qh_ALL)) { qh_fprintf(qh ferr, 6136, "qhull precision error: facet f%d is flipped, distance= %6.12g\n", - facet->id, dist); + facet->id, dist); if (!qh FORCEoutput) { - qh_errprint("ERRONEOUS", facet, NULL, NULL, NULL); - waserror= True; + qh_errprint("ERRONEOUS", facet, NULL, NULL, NULL); + waserror= True; } } } @@ -804,7 +804,7 @@ greater than %2.2g, the maximum roundoff error.\n", -qh DISTround); /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="checkpolygon">-</a> - + qh_checkpolygon( facetlist ) checks the correctness of the structure @@ -830,7 +830,7 @@ void qh_checkpolygon(facetT *facetlist) { int numfacets= 0, numvertices= 0, numridges= 0; int totvneighbors= 0, totvertices= 0; boolT waserror= False, nextseen= False, visibleseen= False; - + trace1((qh ferr, 1027, "qh_checkpolygon: check all facets from f%d\n", facetlist->id)); if (facetlist != qh facet_list || qh ONLYgood) nextseen= True; @@ -839,19 +839,19 @@ void qh_checkpolygon(facetT *facetlist) { visibleseen= True; if (!facet->visible) { if (!nextseen) { - if (facet == qh facet_next) - nextseen= True; - else if (qh_setsize(facet->outsideset)) { - if (!qh NARROWhull + if (facet == qh facet_next) + nextseen= True; + else if (qh_setsize(facet->outsideset)) { + if (!qh NARROWhull #if !qh_COMPUTEfurthest - || facet->furthestdist >= qh MINoutside + || facet->furthestdist >= qh MINoutside #endif - ) { - qh_fprintf(qh ferr, 6137, "qhull internal error (qh_checkpolygon): f%d has outside points before qh facet_next\n", - facet->id); - qh_errexit(qh_ERRqhull, facet, NULL); - } - } + ) { + qh_fprintf(qh ferr, 6137, "qhull internal error (qh_checkpolygon): f%d has outside points before qh facet_next\n", + facet->id); + qh_errexit(qh_ERRqhull, facet, NULL); + } + } } numfacets++; qh_checkfacet(facet, False, &waserror); @@ -871,7 +871,7 @@ void qh_checkpolygon(facetT *facetlist) { FORALLvertex_(vertexlist) { vertex->seen= False; vertex->visitid= 0; - } + } FORALLfacet_(facetlist) { if (facet->visible) continue; @@ -882,13 +882,13 @@ void qh_checkpolygon(facetT *facetlist) { FOREACHvertex_(facet->vertices) { vertex->visitid++; if (!vertex->seen) { - vertex->seen= True; - numvertices++; - if (qh_pointid(vertex->point) == -1) { - qh_fprintf(qh ferr, 6139, "qhull internal error (qh_checkpolygon): unknown point %p for vertex v%d first_point %p\n", - vertex->point, vertex->id, qh first_point); - waserror= True; - } + vertex->seen= True; + numvertices++; + if (qh_pointid(vertex->point) == -1) { + qh_fprintf(qh ferr, 6139, "qhull internal error (qh_checkpolygon): unknown point %p for vertex v%d first_point %p\n", + vertex->point, vertex->id, qh first_point); + waserror= True; + } } } } @@ -896,28 +896,28 @@ void qh_checkpolygon(facetT *facetlist) { if (facetlist == qh facet_list) { if (numfacets != qh num_facets - qh num_visible) { qh_fprintf(qh ferr, 6140, "qhull internal error (qh_checkpolygon): actual number of facets is %d, cumulative facet count is %d - %d visible facets\n", - numfacets, qh num_facets, qh num_visible); + numfacets, qh num_facets, qh num_visible); waserror= True; } qh vertex_visit++; if (qh VERTEXneighbors) { FORALLvertices { - qh_setcheck(vertex->neighbors, "neighbors for v", vertex->id); - if (vertex->deleted) - continue; - totvneighbors += qh_setsize(vertex->neighbors); + qh_setcheck(vertex->neighbors, "neighbors for v", vertex->id); + if (vertex->deleted) + continue; + totvneighbors += qh_setsize(vertex->neighbors); } FORALLfacet_(facetlist) - totvertices += qh_setsize(facet->vertices); + totvertices += qh_setsize(facet->vertices); if (totvneighbors != totvertices) { - qh_fprintf(qh ferr, 6141, "qhull internal error (qh_checkpolygon): vertex neighbors inconsistent. Totvneighbors %d, totvertices %d\n", - totvneighbors, totvertices); - waserror= True; + qh_fprintf(qh ferr, 6141, "qhull internal error (qh_checkpolygon): vertex neighbors inconsistent. Totvneighbors %d, totvertices %d\n", + totvneighbors, totvertices); + waserror= True; } } if (numvertices != qh num_vertices - qh_setsize(qh del_vertices)) { qh_fprintf(qh ferr, 6142, "qhull internal error (qh_checkpolygon): actual number of vertices is %d, cumulative vertex count is %d\n", - numvertices, qh num_vertices - qh_setsize(qh del_vertices)); + numvertices, qh num_vertices - qh_setsize(qh del_vertices)); waserror= True; } if (qh hull_dim == 2 && numvertices != numfacets) { @@ -927,19 +927,19 @@ void qh_checkpolygon(facetT *facetlist) { } if (qh hull_dim == 3 && numvertices + numfacets - numridges/2 != 2) { qh_fprintf(qh ferr, 7063, "qhull warning: #vertices %d + #facets %d - #edges %d != 2\n\ - A vertex appears twice in a edge list. May occur during merging.", + A vertex appears twice in a edge list. May occur during merging.", numvertices, numfacets, numridges/2); /* occurs if lots of merging and a vertex ends up twice in an edge list. e.g., RBOX 1000 s W1e-13 t995849315 D2 | QHULL d Tc Tv */ } } - if (waserror) + if (waserror) qh_errexit(qh_ERRqhull, NULL, NULL); } /* checkpolygon */ /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="checkvertex">-</a> - + qh_checkvertex( vertex ) check vertex for consistency checks vertex->neighbors @@ -964,9 +964,9 @@ void qh_checkvertex(vertexT *vertex) { FOREACHneighbor_(vertex) { if (!qh_setin(neighbor->vertices, vertex)) { qh_fprintf(qh ferr, 6146, "qhull internal error (qh_checkvertex): neighbor f%d does not contain v%d\n", neighbor->id, vertex->id); - errfacet= neighbor; - waserror= True; - } + errfacet= neighbor; + waserror= True; + } } } } @@ -975,10 +975,10 @@ void qh_checkvertex(vertexT *vertex) { qh_errexit(qh_ERRqhull, errfacet, NULL); } } /* checkvertex */ - + /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="clearcenters">-</a> - + qh_clearcenters( type ) clear old data from facet->center @@ -988,7 +988,7 @@ void qh_checkvertex(vertexT *vertex) { */ void qh_clearcenters(qh_CENTER type) { facetT *facet; - + if (qh CENTERtype != type) { FORALLfacets { if (facet->tricoplanar && !facet->keepcentrum) @@ -1001,7 +1001,7 @@ void qh_clearcenters(qh_CENTER type) { }else /* qh CENTERtype == qh_AScentrum */ { if (facet->center) { qh_memfree(facet->center, qh normal_size); - facet->center= NULL; + facet->center= NULL; } } } @@ -1012,7 +1012,7 @@ void qh_clearcenters(qh_CENTER type) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="createsimplex">-</a> - + qh_createsimplex( vertices ) creates a simplex from a set of vertices @@ -1034,14 +1034,14 @@ void qh_createsimplex(setT *vertices) { int vertex_i, vertex_n, nth; setT *newfacets= qh_settemp(qh hull_dim+1); vertexT *vertex; - + qh facet_list= qh newfacet_list= qh facet_tail= qh_newfacet(); qh num_facets= qh num_vertices= qh num_visible= 0; qh vertex_list= qh newvertex_list= qh vertex_tail= qh_newvertex(NULL); FOREACHvertex_i_(vertices) { newfacet= qh_newfacet(); newfacet->vertices= qh_setnew_delnthsorted(vertices, vertex_n, - vertex_i, 0); + vertex_i, 0); newfacet->toporient= (unsigned char)toporient; qh_appendfacet(newfacet); newfacet->newfacet= True; @@ -1052,7 +1052,7 @@ void qh_createsimplex(setT *vertices) { FORALLnew_facets { nth= 0; FORALLfacet_(qh newfacet_list) { - if (facet != newfacet) + if (facet != newfacet) SETelem_(newfacet->neighbors, nth++)= facet; } qh_settruncate(newfacet->neighbors, qh hull_dim); @@ -1063,7 +1063,7 @@ void qh_createsimplex(setT *vertices) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="delridge">-</a> - + qh_delridge( ridge ) deletes ridge from data structures it belongs to frees up its memory @@ -1074,7 +1074,7 @@ void qh_createsimplex(setT *vertices) { */ void qh_delridge(ridgeT *ridge) { void **freelistp; /* used !qh_NOmem */ - + qh_setdel(ridge->top->ridges, ridge); qh_setdel(ridge->bottom->ridges, ridge); qh_setfree(&(ridge->vertices)); @@ -1084,7 +1084,7 @@ void qh_delridge(ridgeT *ridge) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="delvertex">-</a> - + qh_delvertex( vertex ) deletes a vertex and frees its memory @@ -1104,7 +1104,7 @@ void qh_delvertex(vertexT *vertex) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="facet3vertex">-</a> - + qh_facet3vertex( ) return temporary set of 3-d vertices in qh_ORIENTclock order @@ -1125,7 +1125,7 @@ setT *qh_facet3vertex(facetT *facet) { vertices= qh_settemp(cntvertices); if (facet->simplicial) { if (cntvertices != 3) { - qh_fprintf(qh ferr, 6147, "qhull internal error (qh_facet3vertex): only %d vertices for simplicial facet f%d\n", + qh_fprintf(qh ferr, 6147, "qhull internal error (qh_facet3vertex): only %d vertices for simplicial facet f%d\n", cntvertices, facet->id); qh_errexit(qh_ERRqhull, facet, NULL); } @@ -1143,7 +1143,7 @@ setT *qh_facet3vertex(facetT *facet) { break; } if (!ridge || cntprojected != cntvertices) { - qh_fprintf(qh ferr, 6148, "qhull internal error (qh_facet3vertex): ridges for facet %d don't match up. got at least %d\n", + qh_fprintf(qh ferr, 6148, "qhull internal error (qh_facet3vertex): ridges for facet %d don't match up. got at least %d\n", facet->id, cntprojected); qh_errexit(qh_ERRqhull, facet, ridge); } @@ -1153,13 +1153,13 @@ setT *qh_facet3vertex(facetT *facet) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="findbestfacet">-</a> - + qh_findbestfacet( point, bestoutside, bestdist, isoutside ) - find facet that is furthest below a point + find facet that is furthest below a point - for Delaunay triangulations, + for Delaunay triangulations, Use qh_setdelaunay() to lift point to paraboloid and scale by 'Qbb' if needed - Do not use options 'Qbk', 'QBk', or 'QbB' since they scale the coordinates. + Do not use options 'Qbk', 'QBk', or 'QbB' since they scale the coordinates. returns: if bestoutside is set (e.g., qh_ALL) @@ -1170,18 +1170,18 @@ setT *qh_facet3vertex(facetT *facet) { if point is inside, returns nearest, !upperdelaunay facet distance to facet isoutside set if outside of facet - + notes: - For tricoplanar facets, this finds one of the tricoplanar facets closest - to the point. For Delaunay triangulations, the point may be inside a + For tricoplanar facets, this finds one of the tricoplanar facets closest + to the point. For Delaunay triangulations, the point may be inside a different tricoplanar facet. See <a href="../html/qh-code.htm#findfacet">locate a facet with qh_findbestfacet()</a> - + If inside, qh_findbestfacet performs an exhaustive search this may be too conservative. Sometimes it is clearly required. qh_findbestfacet is not used by qhull. uses qh.visit_id and qh.coplanarset - + see: <a href="geom.c#findbest">qh_findbest</a> */ @@ -1189,32 +1189,32 @@ facetT *qh_findbestfacet(pointT *point, boolT bestoutside, realT *bestdist, boolT *isoutside) { facetT *bestfacet= NULL; int numpart, totpart= 0; - - bestfacet= qh_findbest(point, qh facet_list, - bestoutside, !qh_ISnewfacets, bestoutside /* qh_NOupper */, - bestdist, isoutside, &totpart); + + bestfacet= qh_findbest(point, qh facet_list, + bestoutside, !qh_ISnewfacets, bestoutside /* qh_NOupper */, + bestdist, isoutside, &totpart); if (*bestdist < -qh DISTround) { bestfacet= qh_findfacet_all(point, bestdist, isoutside, &numpart); totpart += numpart; if ((isoutside && bestoutside) || (!isoutside && bestfacet->upperdelaunay)) { - bestfacet= qh_findbest(point, bestfacet, - bestoutside, False, bestoutside, - bestdist, isoutside, &totpart); + bestfacet= qh_findbest(point, bestfacet, + bestoutside, False, bestoutside, + bestdist, isoutside, &totpart); totpart += numpart; } } trace3((qh ferr, 3014, "qh_findbestfacet: f%d dist %2.2g isoutside %d totpart %d\n", - bestfacet->id, *bestdist, *isoutside, totpart)); + bestfacet->id, *bestdist, *isoutside, totpart)); return bestfacet; -} /* findbestfacet */ +} /* findbestfacet */ /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="findbestlower">-</a> - + qh_findbestlower( facet, point, bestdist, numpart ) returns best non-upper, non-flipped neighbor of facet for point - if needed, searches vertex neighbors + if needed, searches vertex neighbors returns: returns bestdist and updates numpart @@ -1248,12 +1248,12 @@ facetT *qh_findbestlower(facetT *upperfacet, pointT *point, realT *bestdistp, in qh_vertexneighbors(); FOREACHneighbor_(vertex) { if (neighbor->upperdelaunay || neighbor->flipped) - continue; + continue; (*numpart)++; qh_distplane(point, neighbor, &dist); if (dist > bestdist) { - bestfacet= neighbor; - bestdist= dist; + bestfacet= neighbor; + bestdist= dist; } } } @@ -1266,23 +1266,23 @@ Please report this error to qhull_bug@qhull.org with the input and all of the ou } *bestdistp= bestdist; trace3((qh ferr, 3015, "qh_findbestlower: f%d dist %2.2g for f%d p%d\n", - bestfacet->id, bestdist, upperfacet->id, qh_pointid(point))); + bestfacet->id, bestdist, upperfacet->id, qh_pointid(point))); return bestfacet; } /* findbestlower */ /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="findfacet_all">-</a> - + qh_findfacet_all( point, bestdist, isoutside, numpart ) - exhaustive search for facet below a point + exhaustive search for facet below a point - for Delaunay triangulations, + for Delaunay triangulations, Use qh_setdelaunay() to lift point to paraboloid and scale by 'Qbb' if needed - Do not use options 'Qbk', 'QBk', or 'QbB' since they scale the coordinates. + Do not use options 'Qbk', 'QBk', or 'QbB' since they scale the coordinates. returns: returns first facet below point - if point is inside, + if point is inside, returns nearest facet distance to facet isoutside if point is outside of the hull @@ -1292,11 +1292,11 @@ Please report this error to qhull_bug@qhull.org with the input and all of the ou for library users, not used by Qhull */ facetT *qh_findfacet_all(pointT *point, realT *bestdist, boolT *isoutside, - int *numpart) { + int *numpart) { facetT *bestfacet= NULL, *facet; realT dist; int totpart= 0; - + *bestdist= -REALmax; *isoutside= False; FORALLfacets { @@ -1315,13 +1315,13 @@ facetT *qh_findfacet_all(pointT *point, realT *bestdist, boolT *isoutside, } *numpart= totpart; trace3((qh ferr, 3016, "qh_findfacet_all: f%d dist %2.2g isoutside %d totpart %d\n", - getid_(bestfacet), *bestdist, *isoutside, totpart)); + getid_(bestfacet), *bestdist, *isoutside, totpart)); return bestfacet; -} /* findfacet_all */ - +} /* findfacet_all */ + /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="findgood">-</a> - + qh_findgood( facetlist, goodhorizon ) identify good facets for qh.PRINTgood if qh.GOODvertex>0 @@ -1329,27 +1329,27 @@ facetT *qh_findfacet_all(pointT *point, realT *bestdist, boolT *isoutside, if !match, returns goodhorizon inactive if qh.MERGING if qh.GOODpoint - facet is visible or coplanar (>0) or not visible (<0) + facet is visible or coplanar (>0) or not visible (<0) if qh.GOODthreshold facet->normal matches threshold - if !goodhorizon and !match, + if !goodhorizon and !match, selects facet with closest angle sets GOODclosest - + returns: number of new, good facets found determines facet->good may update qh.GOODclosest - + notes: qh_findgood_all further reduces the good region design: count good facets - mark good facets for qh.GOODpoint + mark good facets for qh.GOODpoint mark good facets for qh.GOODthreshold if necessary - update qh.GOODclosest + update qh.GOODclosest */ int qh_findgood(facetT *facetlist, int goodhorizon) { facetT *facet, *bestfacet= NULL; @@ -1395,23 +1395,23 @@ int qh_findgood(facetT *facetlist, int goodhorizon) { } if (!numgood && (!goodhorizon || qh GOODclosest)) { if (qh GOODclosest) { - if (qh GOODclosest->visible) - qh GOODclosest= NULL; - else { - qh_inthresholds(qh GOODclosest->normal, &angle); - if (angle < bestangle) - bestfacet= qh GOODclosest; - } + if (qh GOODclosest->visible) + qh GOODclosest= NULL; + else { + qh_inthresholds(qh GOODclosest->normal, &angle); + if (angle < bestangle) + bestfacet= qh GOODclosest; + } } if (bestfacet && bestfacet != qh GOODclosest) { - if (qh GOODclosest) - qh GOODclosest->good= False; - qh GOODclosest= bestfacet; - bestfacet->good= True; - numgood++; - trace2((qh ferr, 2044, "qh_findgood: f%d is closest(%2.2g) to thresholds\n", + if (qh GOODclosest) + qh GOODclosest->good= False; + qh GOODclosest= bestfacet; + bestfacet->good= True; + numgood++; + trace2((qh ferr, 2044, "qh_findgood: f%d is closest(%2.2g) to thresholds\n", bestfacet->id, bestangle)); - return numgood; + return numgood; } }else if (qh GOODclosest) { /* numgood > 0 */ qh GOODclosest->good= False; @@ -1421,17 +1421,17 @@ int qh_findgood(facetT *facetlist, int goodhorizon) { zadd_(Zgoodfacet, numgood); trace2((qh ferr, 2045, "qh_findgood: found %d good facets with %d good horizon\n", numgood, goodhorizon)); - if (!numgood && qh GOODvertex>0 && !qh MERGING) + if (!numgood && qh GOODvertex>0 && !qh MERGING) return goodhorizon; return numgood; } /* findgood */ /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="findgood_all">-</a> - + qh_findgood_all( facetlist ) apply other constraints for good facets (used by qh.PRINTgood) - if qh.GOODvertex + if qh.GOODvertex facet includes (>0) or doesn't include (<0) point as vertex if last good facet and ONLYgood, prints warning and continues if qh.SPLITthresholds @@ -1449,14 +1449,14 @@ int qh_findgood(facetT *facetlist, int goodhorizon) { design: uses qh_findgood to mark good facets marks facets for qh.GOODvertex - marks facets for qh.SPLITthreholds + marks facets for qh.SPLITthreholds */ void qh_findgood_all(facetT *facetlist) { facetT *facet, *bestfacet=NULL; realT angle, bestangle= REALmax; int numgood=0, startgood; - if (!qh GOODvertex && !qh GOODthreshold && !qh GOODpoint + if (!qh GOODvertex && !qh GOODthreshold && !qh GOODpoint && !qh SPLITthresholds) return; if (!qh ONLYgood) @@ -1469,16 +1469,16 @@ void qh_findgood_all(facetT *facetlist) { FORALLfacet_(facetlist) { if (facet->good && ((qh GOODvertex > 0) ^ !!qh_isvertex(qh GOODvertexp, facet->vertices))) { if (!--numgood) { - if (qh ONLYgood) { + if (qh ONLYgood) { qh_fprintf(qh ferr, 7064, "qhull warning: good vertex p%d does not match last good facet f%d. Ignored.\n", qh_pointid(qh GOODvertexp), facet->id); - return; - }else if (qh GOODvertex > 0) + return; + }else if (qh GOODvertex > 0) qh_fprintf(qh ferr, 7065, "qhull warning: point p%d is not a vertex('QV%d').\n", - qh GOODvertex-1, qh GOODvertex-1); - else + qh GOODvertex-1, qh GOODvertex-1); + else qh_fprintf(qh ferr, 7066, "qhull warning: point p%d is a vertex for every facet('QV-%d').\n", - -qh GOODvertex - 1, -qh GOODvertex - 1); + -qh GOODvertex - 1, -qh GOODvertex - 1); } facet->good= False; } @@ -1501,7 +1501,7 @@ void qh_findgood_all(facetT *facetlist) { if (!numgood && bestfacet) { bestfacet->good= True; numgood++; - trace0((qh ferr, 23, "qh_findgood_all: f%d is closest(%2.2g) to thresholds\n", + trace0((qh ferr, 23, "qh_findgood_all: f%d is closest(%2.2g) to thresholds\n", bestfacet->id, bestangle)); return; } @@ -1513,7 +1513,7 @@ void qh_findgood_all(facetT *facetlist) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="furthestnext">-</a> - + qh_furthestnext() set qh.facet_next to facet with furthest of all furthest points searches all facets on qh.facet_list @@ -1536,8 +1536,8 @@ void qh_furthestnext(void /* qh facet_list */) { dist= facet->furthestdist; #endif if (dist > bestdist) { - bestfacet= facet; - bestdist= dist; + bestfacet= facet; + bestdist= dist; } } } @@ -1545,13 +1545,13 @@ void qh_furthestnext(void /* qh facet_list */) { qh_removefacet(bestfacet); qh_prependfacet(bestfacet, &qh facet_next); trace1((qh ferr, 1029, "qh_furthestnext: made f%d next facet(dist %.2g)\n", - bestfacet->id, bestdist)); + bestfacet->id, bestdist)); } } /* furthestnext */ /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="furthestout">-</a> - + qh_furthestout( facet ) make furthest outside point the last point of outsideset @@ -1585,13 +1585,13 @@ void qh_furthestout(facetT *facet) { } facet->notfurthest= False; trace3((qh ferr, 3017, "qh_furthestout: p%d is furthest outside point of f%d\n", - qh_pointid(point), facet->id)); + qh_pointid(point), facet->id)); } /* furthestout */ /*-<a href="qh-qhull.htm#TOC" >-------------------------------</a><a name="infiniteloop">-</a> - + qh_infiniteloop( facet ) report infinite loop error due to facet */ @@ -1603,7 +1603,7 @@ void qh_infiniteloop(facetT *facet) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="initbuild">-</a> - + qh_initbuild() initialize hull and outside sets with point array qh.FIRSTpoint/qh.NUMpoints is point array @@ -1623,7 +1623,7 @@ void qh_infiniteloop(facetT *facet) { partition input points into facets of initial simplex set up lists if qh.ONLYgood - check consistency + check consistency add qh.GOODvertex if defined */ void qh_initbuild( void) { @@ -1639,22 +1639,22 @@ void qh_initbuild( void) { qh visit_id= qh vertex_visit= 0; qh maxoutdone= False; - if (qh GOODpoint > 0) + if (qh GOODpoint > 0) qh GOODpointp= qh_point(qh GOODpoint-1); - else if (qh GOODpoint < 0) + else if (qh GOODpoint < 0) qh GOODpointp= qh_point(-qh GOODpoint-1); if (qh GOODvertex > 0) qh GOODvertexp= qh_point(qh GOODvertex-1); - else if (qh GOODvertex < 0) + else if (qh GOODvertex < 0) qh GOODvertexp= qh_point(-qh GOODvertex-1); - if ((qh GOODpoint + if ((qh GOODpoint && (qh GOODpointp < qh first_point /* also catches !GOODpointp */ - || qh GOODpointp > qh_point(qh num_points-1))) + || qh GOODpointp > qh_point(qh num_points-1))) || (qh GOODvertex - && (qh GOODvertexp < qh first_point /* also catches !GOODvertexp */ - || qh GOODvertexp > qh_point(qh num_points-1)))) { + && (qh GOODvertexp < qh first_point /* also catches !GOODvertexp */ + || qh GOODvertexp > qh_point(qh num_points-1)))) { qh_fprintf(qh ferr, 6150, "qhull input error: either QGn or QVn point is > p%d\n", - qh num_points-1); + qh num_points-1); qh_errexit(qh_ERRinput, NULL, NULL); } maxpoints= qh_maxmin(qh first_point, qh num_points, qh hull_dim); @@ -1665,28 +1665,28 @@ void qh_initbuild( void) { if (qh DELAUNAY && qh upper_threshold[qh hull_dim-1] > REALmax/2 && qh lower_threshold[qh hull_dim-1] < -REALmax/2) { for (i=qh_PRINTEND; i--; ) { - if (qh PRINTout[i] == qh_PRINTgeom && qh DROPdim < 0 - && !qh GOODthreshold && !qh SPLITthresholds) - break; /* in this case, don't set upper_threshold */ + if (qh PRINTout[i] == qh_PRINTgeom && qh DROPdim < 0 + && !qh GOODthreshold && !qh SPLITthresholds) + break; /* in this case, don't set upper_threshold */ } if (i < 0) { if (qh UPPERdelaunay) { /* matches qh.upperdelaunay in qh_setfacetplane */ - qh lower_threshold[qh hull_dim-1]= qh ANGLEround * qh_ZEROdelaunay; - qh GOODthreshold= True; - }else { - qh upper_threshold[qh hull_dim-1]= -qh ANGLEround * qh_ZEROdelaunay; - if (!qh GOODthreshold) - qh SPLITthresholds= True; /* build upper-convex hull even if Qg */ + qh lower_threshold[qh hull_dim-1]= qh ANGLEround * qh_ZEROdelaunay; + qh GOODthreshold= True; + }else { + qh upper_threshold[qh hull_dim-1]= -qh ANGLEround * qh_ZEROdelaunay; + if (!qh GOODthreshold) + qh SPLITthresholds= True; /* build upper-convex hull even if Qg */ /* qh_initqhull_globals errors if Qg without Pdk/etc. */ } } } - vertices= qh_initialvertices(qh hull_dim, maxpoints, qh first_point, qh num_points); + vertices= qh_initialvertices(qh hull_dim, maxpoints, qh first_point, qh num_points); qh_initialhull(vertices); /* initial qh facet_list */ qh_partitionall(vertices, qh first_point, qh num_points); if (qh PRINToptions1st || qh TRACElevel || qh IStracing) { if (qh TRACElevel || qh IStracing) - qh_fprintf(qh ferr, 8103, "\nTrace level %d for %s | %s\n", + qh_fprintf(qh ferr, 8103, "\nTrace level %d for %s | %s\n", qh IStracing ? qh IStracing : qh TRACElevel, qh rbox_command, qh qhull_command); qh_fprintf(qh ferr, 8104, "Options selected for Qhull %s:\n%s\n", qh_version, qh qhull_options); } @@ -1709,19 +1709,19 @@ good point(QGn or QG-n), or a good vertex with 'QJ' or 'Q0' (QVn).\n"); qh_errexit(qh_ERRinput, NULL, NULL); } if (qh GOODvertex > 0 && !qh MERGING /* matches qh_partitionall */ - && !qh_isvertex(qh GOODvertexp, vertices)) { - facet= qh_findbestnew(qh GOODvertexp, qh facet_list, - &dist, !qh_ALL, &isoutside, &numpart); + && !qh_isvertex(qh GOODvertexp, vertices)) { + facet= qh_findbestnew(qh GOODvertexp, qh facet_list, + &dist, !qh_ALL, &isoutside, &numpart); zadd_(Zdistgood, numpart); if (!isoutside) { qh_fprintf(qh ferr, 6153, "qhull input error: point for QV%d is inside initial simplex. It can not be made a vertex.\n", - qh_pointid(qh GOODvertexp)); + qh_pointid(qh GOODvertexp)); qh_errexit(qh_ERRinput, NULL, NULL); } if (!qh_addpoint(qh GOODvertexp, facet, False)) { - qh_settempfree(&vertices); - qh_settempfree(&maxpoints); - return; + qh_settempfree(&vertices); + qh_settempfree(&maxpoints); + return; } } qh_findgood(qh facet_list, 0); @@ -1733,7 +1733,7 @@ good point(QGn or QG-n), or a good vertex with 'QJ' or 'Q0' (QVn).\n"); /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="initialhull">-</a> - + qh_initialhull( vertices ) constructs the initial hull as a DIM3 simplex of vertices @@ -1743,7 +1743,7 @@ good point(QGn or QG-n), or a good vertex with 'QJ' or 'Q0' (QVn).\n"); sets hyperplanes for facets doubles checks orientation (in case of axis-parallel facets with Gaussian elimination) checks for flipped facets and qh.NARROWhull - checks the result + checks the result */ void qh_initialhull(setT *vertices) { facetT *facet, *firstfacet, *neighbor, **neighborp; @@ -1760,7 +1760,7 @@ void qh_initialhull(setT *vertices) { qh_setfacetplane(firstfacet); zinc_(Znumvisibility); /* needs to be in printsummary */ qh_distplane(qh interior_point, firstfacet, &dist); - if (dist > 0) { + if (dist > 0) { FORALLfacets facet->toporient ^= (unsigned char)True; } @@ -1772,7 +1772,7 @@ void qh_initialhull(setT *vertices) { facet->flipped= False; FORALLfacets { facet->toporient ^= (unsigned char)True; - qh_orientoutside(facet); + qh_orientoutside(facet); } break; } @@ -1789,13 +1789,13 @@ void qh_initialhull(setT *vertices) { minimize_( minangle, angle); } } - if (minangle < qh_MAXnarrow && !qh NOnarrow) { + if (minangle < qh_MAXnarrow && !qh NOnarrow) { realT diff= 1.0 + minangle; qh NARROWhull= True; qh_option("_narrow-hull", NULL, &diff); if (minangle < qh_WARNnarrow && !qh RERUN && qh PRINTprecision) - qh_printhelp_narrowhull(qh ferr, minangle); + qh_printhelp_narrowhull(qh ferr, minangle); } zzval_(Zprocessed)= qh hull_dim+1; qh_checkpolygon(qh facet_list); @@ -1803,7 +1803,7 @@ void qh_initialhull(setT *vertices) { #ifndef qh_NOtrace if (qh IStracing >= 1) { qh_fprintf(qh ferr, 8105, "qh_initialhull: simplex constructed, interior point:"); - for (k=0; k < qh hull_dim; k++) + for (k=0; k < qh hull_dim; k++) qh_fprintf(qh ferr, 8106, " %6.4g", qh interior_point[k]); qh_fprintf(qh ferr, 8107, "\n"); } @@ -1812,7 +1812,7 @@ void qh_initialhull(setT *vertices) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="initialvertices">-</a> - + qh_initialvertices( dim, maxpoints, points, numpoints ) determines a non-singular set of initial vertices maxpoints may include duplicate points @@ -1821,11 +1821,11 @@ void qh_initialhull(setT *vertices) { temporary set of dim+1 vertices in descending order by vertex id if qh.RANDOMoutside && !qh.ALLpoints picks random points - if dim >= qh_INITIALmax, + if dim >= qh_INITIALmax, uses min/max x and max points with non-zero determinants notes: - unless qh.ALLpoints, + unless qh.ALLpoints, uses maxpoints as long as determinate is non-zero */ setT *qh_initialvertices(int dim, setT *maxpoints, pointT *points, int numpoints) { @@ -1834,10 +1834,10 @@ setT *qh_initialvertices(int dim, setT *maxpoints, pointT *points, int numpoints realT randr; int idx, point_i, point_n, k; boolT nearzero= False; - + vertices= qh_settemp(dim + 1); simplex= qh_settemp(dim+1); - if (qh ALLpoints) + if (qh ALLpoints) qh_maxsimplex(dim, NULL, points, numpoints, &simplex); else if (qh RANDOMoutside) { while (qh_setsize(simplex) != dim+1) { @@ -1845,7 +1845,7 @@ setT *qh_initialvertices(int dim, setT *maxpoints, pointT *points, int numpoints randr= randr/(qh_RANDOMmax+1); idx= (int)floor(qh num_points * randr); while (qh_setin(simplex, qh_point(idx))) { - idx++; /* in case qh_RANDOMint always returns the same value */ + idx++; /* in case qh_RANDOMint always returns the same value */ idx= idx < qh num_points ? idx : 0; } qh_setappend(&simplex, qh_point(idx)); @@ -1856,18 +1856,18 @@ setT *qh_initialvertices(int dim, setT *maxpoints, pointT *points, int numpoints qh_setappend(&simplex, SETsecond_(maxpoints)); qh_maxsimplex(fmin_(qh_INITIALsearch, dim), maxpoints, points, numpoints, &simplex); k= qh_setsize(simplex); - FOREACHpoint_i_(maxpoints) { + FOREACHpoint_i_(maxpoints) { if (point_i & 0x1) { /* first pick up max. coord. points */ - if (!qh_setin(simplex, point) && !qh_setin(tested, point)){ - qh_detsimplex(point, simplex, k, &nearzero); + if (!qh_setin(simplex, point) && !qh_setin(tested, point)){ + qh_detsimplex(point, simplex, k, &nearzero); if (nearzero) qh_setappend(&tested, point); else { qh_setappend(&simplex, point); if (++k == dim) /* use search for last point */ - break; - } - } + break; + } + } } } while (k != dim && (point= (pointT*)qh_setdellast(maxpoints))) { @@ -1878,7 +1878,7 @@ setT *qh_initialvertices(int dim, setT *maxpoints, pointT *points, int numpoints else { qh_setappend(&simplex, point); k++; - } + } } } idx= 0; @@ -1888,14 +1888,14 @@ setT *qh_initialvertices(int dim, setT *maxpoints, pointT *points, int numpoints if (!nearzero){ qh_setappend(&simplex, point); k++; - } + } } } qh_settempfree(&tested); qh_maxsimplex(dim, maxpoints, points, numpoints, &simplex); }else qh_maxsimplex(dim, maxpoints, points, numpoints, &simplex); - FOREACHpoint_(simplex) + FOREACHpoint_(simplex) qh_setaddnth(&vertices, 0, qh_newvertex(point)); /* descending order */ qh_settempfree(&simplex); return vertices; @@ -1904,7 +1904,7 @@ setT *qh_initialvertices(int dim, setT *maxpoints, pointT *points, int numpoints /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="isvertex">-</a> - + qh_isvertex( ) returns vertex if point is in vertex set, else returns NULL @@ -1923,14 +1923,14 @@ vertexT *qh_isvertex(pointT *point, setT *vertices) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="makenewfacets">-</a> - + qh_makenewfacets( point ) make new facets from point and qh.visible_list returns: qh.newfacet_list= list of new facets with hyperplanes and ->newfacet qh.newvertex_list= list of vertices in new facets with ->newlist set - + if (qh.ONLYgood) newfacets reference horizon facets, but not vice versa ridges reference non-simplicial horizon ridges, but not vice versa @@ -1938,10 +1938,10 @@ vertexT *qh_isvertex(pointT *point, setT *vertices) { else sets qh.NEWfacets new facets attached to horizon facets and ridges - for visible facets, + for visible facets, visible->r.replace is corresponding new facet - see also: + see also: qh_makenewplanes() -- make hyperplanes for facets qh_attachnewfacets() -- attachnewfacets if not done here(qh ONLYgood) qh_matchnewfacets() -- match up neighbors @@ -1953,7 +1953,7 @@ vertexT *qh_isvertex(pointT *point, setT *vertices) { design: for each visible facet make new facets to its horizon facets - update its f.replace + update its f.replace clear its neighbor set */ vertexT *qh_makenewfacets(pointT *point /*visible_list*/) { @@ -1964,12 +1964,12 @@ vertexT *qh_makenewfacets(pointT *point /*visible_list*/) { qh newfacet_list= qh facet_tail; qh newvertex_list= qh vertex_tail; apex= qh_newvertex(point); - qh_appendvertex(apex); + qh_appendvertex(apex); qh visit_id++; if (!qh ONLYgood) qh NEWfacets= True; FORALLvisible_facets { - FOREACHneighbor_(visible) + FOREACHneighbor_(visible) neighbor->seen= False; if (visible->ridges) { visible->visitid= qh visit_id; @@ -1981,14 +1981,14 @@ vertexT *qh_makenewfacets(pointT *point /*visible_list*/) { if (newfacet2) /* newfacet is null if all ridges defined */ newfacet= newfacet2; if (newfacet) - visible->f.replace= newfacet; + visible->f.replace= newfacet; else zinc_(Zinsidevisible); SETfirst_(visible->neighbors)= NULL; } } trace1((qh ferr, 1032, "qh_makenewfacets: created %d new facets from point p%d to horizon\n", - numnew, qh_pointid(point))); + numnew, qh_pointid(point))); if (qh IStracing >= 4) qh_printfacetlist(qh newfacet_list, NULL, qh_ALL); return apex; @@ -1996,7 +1996,7 @@ vertexT *qh_makenewfacets(pointT *point /*visible_list*/) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="matchduplicates">-</a> - + qh_matchduplicates( atfacet, atskip, hashsize, hashcount ) match duplicate ridges in qh.hash_table for atfacet/atskip duplicates marked with ->dupridge and qh_DUPLICATEridge @@ -2004,7 +2004,7 @@ vertexT *qh_makenewfacets(pointT *point /*visible_list*/) { returns: picks match with worst merge (min distance apart) updates hashcount - + see also: qh_matchneighbor @@ -2015,8 +2015,8 @@ vertexT *qh_makenewfacets(pointT *point /*visible_list*/) { repeat twice -- once to make best matches, once to match the rest for each possible facet in qh.hash_table if it is a matching facet and pass 2 - make match - unless tricoplanar, mark match for merging (qh_MERGEridge) + make match + unless tricoplanar, mark match for merging (qh_MERGEridge) [e.g., tricoplanar RBOX s 1000 t993602376 | QHULL C-1e-3 d Qbb FA Qt] if it is a matching facet and pass 1 test if this is a better match @@ -2031,89 +2031,89 @@ void qh_matchduplicates(facetT *atfacet, int atskip, int hashsize, int *hashcoun int skip, newskip, nextskip= 0, maxskip= 0, maxskip2= 0, makematch; realT maxdist= -REALmax, mindist, dist2, low, high; - hash= qh_gethash(hashsize, atfacet->vertices, qh hull_dim, 1, + hash= qh_gethash(hashsize, atfacet->vertices, qh hull_dim, 1, SETelem_(atfacet->vertices, atskip)); trace2((qh ferr, 2046, "qh_matchduplicates: find duplicate matches for f%d skip %d hash %d hashcount %d\n", - atfacet->id, atskip, hash, *hashcount)); + atfacet->id, atskip, hash, *hashcount)); for (makematch= 0; makematch < 2; makematch++) { qh visit_id++; for (newfacet= atfacet, newskip= atskip; newfacet; newfacet= nextfacet, newskip= nextskip) { zinc_(Zhashlookup); nextfacet= NULL; newfacet->visitid= qh visit_id; - for (scan= hash; (facet= SETelemt_(qh hash_table, scan, facetT)); - scan= (++scan >= hashsize ? 0 : scan)) { - if (!facet->dupridge || facet->visitid == qh visit_id) - continue; - zinc_(Zhashtests); - if (qh_matchvertices(1, newfacet->vertices, newskip, facet->vertices, &skip, &same)) { - ismatch= (same == (boolT)(newfacet->toporient ^ facet->toporient)); - if (SETelemt_(facet->neighbors, skip, facetT) != qh_DUPLICATEridge) { - if (!makematch) { - qh_fprintf(qh ferr, 6155, "qhull internal error (qh_matchduplicates): missing dupridge at f%d skip %d for new f%d skip %d hash %d\n", - facet->id, skip, newfacet->id, newskip, hash); - qh_errexit2 (qh_ERRqhull, facet, newfacet); - } - }else if (ismatch && makematch) { - if (SETelemt_(newfacet->neighbors, newskip, facetT) == qh_DUPLICATEridge) { - SETelem_(facet->neighbors, skip)= newfacet; - if (newfacet->tricoplanar) - SETelem_(newfacet->neighbors, newskip)= facet; - else - SETelem_(newfacet->neighbors, newskip)= qh_MERGEridge; - *hashcount -= 2; /* removed two unmatched facets */ - trace4((qh ferr, 4059, "qh_matchduplicates: duplicate f%d skip %d matched with new f%d skip %d merge\n", - facet->id, skip, newfacet->id, newskip)); - } - }else if (ismatch) { - mindist= qh_getdistance(facet, newfacet, &low, &high); - dist2= qh_getdistance(newfacet, facet, &low, &high); - minimize_(mindist, dist2); - if (mindist > maxdist) { - maxdist= mindist; - maxmatch= facet; - maxskip= skip; - maxmatch2= newfacet; - maxskip2= newskip; - } - trace3((qh ferr, 3018, "qh_matchduplicates: duplicate f%d skip %d new f%d skip %d at dist %2.2g, max is now f%d f%d\n", - facet->id, skip, newfacet->id, newskip, mindist, - maxmatch->id, maxmatch2->id)); - }else { /* !ismatch */ - nextfacet= facet; - nextskip= skip; - } - } - if (makematch && !facet + for (scan= hash; (facet= SETelemt_(qh hash_table, scan, facetT)); + scan= (++scan >= hashsize ? 0 : scan)) { + if (!facet->dupridge || facet->visitid == qh visit_id) + continue; + zinc_(Zhashtests); + if (qh_matchvertices(1, newfacet->vertices, newskip, facet->vertices, &skip, &same)) { + ismatch= (same == (boolT)(newfacet->toporient ^ facet->toporient)); + if (SETelemt_(facet->neighbors, skip, facetT) != qh_DUPLICATEridge) { + if (!makematch) { + qh_fprintf(qh ferr, 6155, "qhull internal error (qh_matchduplicates): missing dupridge at f%d skip %d for new f%d skip %d hash %d\n", + facet->id, skip, newfacet->id, newskip, hash); + qh_errexit2 (qh_ERRqhull, facet, newfacet); + } + }else if (ismatch && makematch) { + if (SETelemt_(newfacet->neighbors, newskip, facetT) == qh_DUPLICATEridge) { + SETelem_(facet->neighbors, skip)= newfacet; + if (newfacet->tricoplanar) + SETelem_(newfacet->neighbors, newskip)= facet; + else + SETelem_(newfacet->neighbors, newskip)= qh_MERGEridge; + *hashcount -= 2; /* removed two unmatched facets */ + trace4((qh ferr, 4059, "qh_matchduplicates: duplicate f%d skip %d matched with new f%d skip %d merge\n", + facet->id, skip, newfacet->id, newskip)); + } + }else if (ismatch) { + mindist= qh_getdistance(facet, newfacet, &low, &high); + dist2= qh_getdistance(newfacet, facet, &low, &high); + minimize_(mindist, dist2); + if (mindist > maxdist) { + maxdist= mindist; + maxmatch= facet; + maxskip= skip; + maxmatch2= newfacet; + maxskip2= newskip; + } + trace3((qh ferr, 3018, "qh_matchduplicates: duplicate f%d skip %d new f%d skip %d at dist %2.2g, max is now f%d f%d\n", + facet->id, skip, newfacet->id, newskip, mindist, + maxmatch->id, maxmatch2->id)); + }else { /* !ismatch */ + nextfacet= facet; + nextskip= skip; + } + } + if (makematch && !facet && SETelemt_(facet->neighbors, skip, facetT) == qh_DUPLICATEridge) { - qh_fprintf(qh ferr, 6156, "qhull internal error (qh_matchduplicates): no MERGEridge match for duplicate f%d skip %d at hash %d\n", - newfacet->id, newskip, hash); - qh_errexit(qh_ERRqhull, newfacet, NULL); - } + qh_fprintf(qh ferr, 6156, "qhull internal error (qh_matchduplicates): no MERGEridge match for duplicate f%d skip %d at hash %d\n", + newfacet->id, newskip, hash); + qh_errexit(qh_ERRqhull, newfacet, NULL); + } } } /* end of for each new facet at hash */ if (!makematch) { if (!maxmatch) { - qh_fprintf(qh ferr, 6157, "qhull internal error (qh_matchduplicates): no maximum match at duplicate f%d skip %d at hash %d\n", - atfacet->id, atskip, hash); - qh_errexit(qh_ERRqhull, atfacet, NULL); + qh_fprintf(qh ferr, 6157, "qhull internal error (qh_matchduplicates): no maximum match at duplicate f%d skip %d at hash %d\n", + atfacet->id, atskip, hash); + qh_errexit(qh_ERRqhull, atfacet, NULL); } SETelem_(maxmatch->neighbors, maxskip)= maxmatch2; SETelem_(maxmatch2->neighbors, maxskip2)= maxmatch; *hashcount -= 2; /* removed two unmatched facets */ zzinc_(Zmultiridge); trace0((qh ferr, 25, "qh_matchduplicates: duplicate f%d skip %d matched with new f%d skip %d keep\n", - maxmatch->id, maxskip, maxmatch2->id, maxskip2)); + maxmatch->id, maxskip, maxmatch2->id, maxskip2)); qh_precision("ridge with multiple neighbors"); if (qh IStracing >= 4) - qh_errprint("DUPLICATED/MATCH", maxmatch, maxmatch2, NULL, NULL); + qh_errprint("DUPLICATED/MATCH", maxmatch, maxmatch2, NULL, NULL); } } } /* matchduplicates */ /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="nearcoplanar">-</a> - + qh_nearcoplanar() for all facets, remove near-inside points from facet->coplanarset</li> coplanar points defined by innerplane from qh_outerinner() @@ -2124,7 +2124,7 @@ void qh_matchduplicates(facetT *atfacet, int atskip, int hashsize, int *hashcoun if qh.JOGGLEmax drops inner plane by another qh.JOGGLEmax diagonal since a vertex could shift out while a coplanar point shifts in - + notes: used for qh.PREmerge and qh.JOGGLEmax must agree with computation of qh.NEARcoplanar in qh_detroundoff() @@ -2142,7 +2142,7 @@ void qh_nearcoplanar(void /* qh.facet_list */) { if (!qh KEEPcoplanar && !qh KEEPinside) { FORALLfacets { - if (facet->coplanarset) + if (facet->coplanarset) qh_setfree( &facet->coplanarset); } }else if (!qh KEEPcoplanar || !qh KEEPinside) { @@ -2150,18 +2150,18 @@ void qh_nearcoplanar(void /* qh.facet_list */) { if (qh JOGGLEmax < REALmax/2) innerplane -= qh JOGGLEmax * sqrt((realT)qh hull_dim); numpart= 0; - FORALLfacets { + FORALLfacets { if (facet->coplanarset) { FOREACHpoint_(facet->coplanarset) { numpart++; - qh_distplane(point, facet, &dist); - if (dist < innerplane) { - if (!qh KEEPinside) + qh_distplane(point, facet, &dist); + if (dist < innerplane) { + if (!qh KEEPinside) SETref_(point)= NULL; }else if (!qh KEEPcoplanar) SETref_(point)= NULL; } - qh_setcompact(facet->coplanarset); + qh_setcompact(facet->coplanarset); } } zzadd_(Zcheckpart, numpart); @@ -2170,13 +2170,13 @@ void qh_nearcoplanar(void /* qh.facet_list */) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="nearvertex">-</a> - + qh_nearvertex( facet, point, bestdist ) return nearest vertex in facet to point returns: vertex and its distance - + notes: if qh.DELAUNAY distance is measured in the input set @@ -2204,11 +2204,11 @@ vertexT *qh_nearvertex(facetT *facet, pointT *point, realT *bestdistp) { center= facet->center; FOREACHneighbor_(apex) { if (neighbor->center == center) { - FOREACHvertex_(neighbor->vertices) - qh_setappend(&vertices, vertex); + FOREACHvertex_(neighbor->vertices) + qh_setappend(&vertices, vertex); } } - }else + }else vertices= facet->vertices; FOREACHvertex_(vertices) { dist= qh_pointdist(vertex->point, point, -dim); @@ -2220,14 +2220,14 @@ vertexT *qh_nearvertex(facetT *facet, pointT *point, realT *bestdistp) { if (facet->tricoplanar) qh_settempfree(&vertices); *bestdistp= sqrt(bestdist); - trace3((qh ferr, 3019, "qh_nearvertex: v%d dist %2.2g for f%d p%d\n", + trace3((qh ferr, 3019, "qh_nearvertex: v%d dist %2.2g for f%d p%d\n", bestvertex->id, *bestdistp, facet->id, qh_pointid(point))); return bestvertex; } /* nearvertex */ /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="newhashtable">-</a> - + qh_newhashtable( newsize ) returns size of qh.hash_table of at least newsize slots @@ -2240,7 +2240,7 @@ int qh_newhashtable(int newsize) { int size; size= ((newsize+1)*qh_HASHfactor) | 0x1; /* odd number */ - while (True) { + while (True) { if ((size%3) && (size%5)) break; size += 2; @@ -2253,7 +2253,7 @@ int qh_newhashtable(int newsize) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="newvertex">-</a> - + qh_newvertex( point ) returns a new vertex for point */ @@ -2274,13 +2274,13 @@ may have the same identifier. Vertices not sorted correctly.\n", 0xFFFFFF); vertex->point= point; vertex->dim= (unsigned char)(qh hull_dim <= MAX_vdim ? qh hull_dim : 0); trace4((qh ferr, 4060, "qh_newvertex: vertex p%d(v%d) created\n", qh_pointid(vertex->point), - vertex->id)); + vertex->id)); return(vertex); } /* newvertex */ /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="nextridge3d">-</a> - + qh_nextridge3d( atridge, facet, vertex ) return next ridge and vertex for a 3d facet returns NULL on error @@ -2292,7 +2292,7 @@ may have the same identifier. Vertices not sorted correctly.\n", 0xFFFFFF); be sure to stop on any 2nd visit same as QhullRidge::nextRidge3d does not use qh_qh or qh_errexit [QhullFacet.cpp] - + design: for each ridge exit if it is the ridge after atridge @@ -2331,10 +2331,10 @@ ridgeT *qh_nextridge3d(ridgeT *atridge, facetT *facet, vertexT **vertexp) { return NULL; } #endif /* qh_NOmerge */ - + /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="outcoplanar">-</a> - + qh_outcoplanar() move points from all facets' outsidesets to their coplanarsets @@ -2356,9 +2356,9 @@ void qh_outcoplanar(void /* facet_list */) { FOREACHpoint_(facet->outsideset) { qh num_outside--; if (qh KEEPcoplanar || qh KEEPnearinside) { - qh_distplane(point, facet, &dist); + qh_distplane(point, facet, &dist); zinc_(Zpartition); - qh_partitioncoplanar(point, facet, &dist); + qh_partitioncoplanar(point, facet, &dist); } } qh_setfree(&facet->outsideset); @@ -2367,7 +2367,7 @@ void qh_outcoplanar(void /* facet_list */) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="point">-</a> - + qh_point( id ) return point for a point id, or NULL if unknown @@ -2386,13 +2386,13 @@ pointT *qh_point(int id) { return SETelemt_(qh other_points, id, pointT); return NULL; } /* point */ - + /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="point_add">-</a> - + qh_point_add( set, point, elem ) stores elem at set[point.id] - + returns: access function for qh_pointfacet and qh_pointvertex @@ -2404,11 +2404,11 @@ void qh_point_add(setT *set, pointT *point, void *elem) { SETreturnsize_(set, size); if ((id= qh_pointid(point)) < 0) - qh_fprintf(qh ferr, 7067, "qhull internal warning (point_add): unknown point %p id %d\n", + qh_fprintf(qh ferr, 7067, "qhull internal warning (point_add): unknown point %p id %d\n", point, id); else if (id >= size) { qh_fprintf(qh ferr, 6160, "qhull internal errror(point_add): point p%d is out of bounds(%d)\n", - id, size); + id, size); qh_errexit(qh_ERRqhull, NULL, NULL); }else SETelem_(set, id)= elem; @@ -2417,7 +2417,7 @@ void qh_point_add(setT *set, pointT *point, void *elem) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="pointfacet">-</a> - + qh_pointfacet() return temporary set of facet for each point the set is indexed by point id @@ -2432,7 +2432,7 @@ void qh_point_add(setT *set, pointT *point, void *elem) { access: FOREACHfacet_i_(facets) { ... } SETelem_(facets, i) - + design: for each facet add each vertex @@ -2445,7 +2445,7 @@ setT *qh_pointfacet(void /*qh facet_list*/) { facetT *facet; vertexT *vertex, **vertexp; pointT *point, **pointp; - + facets= qh_settemp(numpoints); qh_setzero(facets, 0, numpoints); qh vertex_visit++; @@ -2456,9 +2456,9 @@ setT *qh_pointfacet(void /*qh facet_list*/) { qh_point_add(facets, vertex->point, facet); } } - FOREACHpoint_(facet->coplanarset) + FOREACHpoint_(facet->coplanarset) qh_point_add(facets, point, facet); - FOREACHpoint_(facet->outsideset) + FOREACHpoint_(facet->outsideset) qh_point_add(facets, point, facet); } return facets; @@ -2466,7 +2466,7 @@ setT *qh_pointfacet(void /*qh facet_list*/) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="pointvertex">-</a> - + qh_pointvertex( ) return temporary set of vertices indexed by point id entry is NULL if no vertex for a point @@ -2480,10 +2480,10 @@ setT *qh_pointvertex(void /*qh facet_list*/) { int numpoints= qh num_points + qh_setsize(qh other_points); setT *vertices; vertexT *vertex; - + vertices= qh_settemp(numpoints); qh_setzero(vertices, 0, numpoints); - FORALLvertices + FORALLvertices qh_point_add(vertices, vertex->point, vertex); return vertices; } /* pointvertex */ @@ -2491,24 +2491,24 @@ setT *qh_pointvertex(void /*qh facet_list*/) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="prependfacet">-</a> - + qh_prependfacet( facet, facetlist ) prepend facet to the start of a facetlist returns: increments qh.numfacets updates facetlist, qh.facet_list, facet_next - + notes: be careful of prepending since it can lose a pointer. e.g., can lose _next by deleting and then prepending before _next */ void qh_prependfacet(facetT *facet, facetT **facetlist) { facetT *prevfacet, *list; - + trace4((qh ferr, 4061, "qh_prependfacet: prepend f%d before f%d\n", - facet->id, getid_(*facetlist))); + facet->id, getid_(*facetlist))); if (!*facetlist) (*facetlist)= qh facet_tail; list= *facetlist; @@ -2529,13 +2529,13 @@ void qh_prependfacet(facetT *facet, facetT **facetlist) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="printhashtable">-</a> - + qh_printhashtable( fp ) print hash table to fp notes: not in I/O to avoid bringing io.c in - + design: for each hash entry if defined @@ -2550,7 +2550,7 @@ void qh_printhashtable(FILE *fp) { FOREACHfacet_i_(qh hash_table) { if (facet) { FOREACHneighbor_i_(facet) { - if (!neighbor || neighbor == qh_MERGEridge || neighbor == qh_DUPLICATEridge) + if (!neighbor || neighbor == qh_MERGEridge || neighbor == qh_DUPLICATEridge) break; } if (neighbor_i == neighbor_n) @@ -2560,23 +2560,23 @@ void qh_printhashtable(FILE *fp) { qh_fprintf(fp, 9284, "v%d ", vertex->id); qh_fprintf(fp, 9285, "\n neighbors:"); FOREACHneighbor_i_(facet) { - if (neighbor == qh_MERGEridge) - id= -3; - else if (neighbor == qh_DUPLICATEridge) - id= -2; - else - id= getid_(neighbor); + if (neighbor == qh_MERGEridge) + id= -3; + else if (neighbor == qh_DUPLICATEridge) + id= -2; + else + id= getid_(neighbor); qh_fprintf(fp, 9286, " %d", id); } qh_fprintf(fp, 9287, "\n"); } } } /* printhashtable */ - + /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="printlists">-</a> - + qh_printlists( fp ) print out facet and vertex list for debugging (without 'f/v' tags) */ @@ -2584,7 +2584,7 @@ void qh_printlists(void) { facetT *facet; vertexT *vertex; int count= 0; - + qh_fprintf(qh ferr, 8108, "qh_printlists: facets:"); FORALLfacets { if (++count % 100 == 0) @@ -2602,13 +2602,13 @@ void qh_printlists(void) { } qh_fprintf(qh ferr, 8114, "\n"); } /* printlists */ - + /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="resetlists">-</a> - + qh_resetlists( stats, qh_RESETvisible ) reset newvertex_list, newfacet_list, visible_list - if stats, + if stats, maintains statistics returns: @@ -2618,11 +2618,11 @@ void qh_resetlists(boolT stats, boolT resetVisible /*qh newvertex_list newfacet_ vertexT *vertex; facetT *newfacet, *visible; int totnew=0, totver=0; - + if (stats) { FORALLvertex_(qh newvertex_list) totver++; - FORALLnew_facets + FORALLnew_facets totnew++; zadd_(Zvisvertextot, totver); zmax_(Zvisvertexmax, totver); @@ -2648,20 +2648,20 @@ void qh_resetlists(boolT stats, boolT resetVisible /*qh newvertex_list newfacet_ /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="setvoronoi_all">-</a> - + qh_setvoronoi_all() compute Voronoi centers for all facets includes upperDelaunay facets if qh.UPPERdelaunay ('Qu') returns: facet->center is the Voronoi center - + notes: this is unused/untested code please email bradb@shore.net if this works ok for you - + use: - FORALLvertices {...} to locate the vertex for a point. + FORALLvertices {...} to locate the vertex for a point. FOREACHneighbor_(vertex) {...} to visit the Voronoi centers for a Voronoi cell. */ void qh_setvoronoi_all(void) { @@ -2669,7 +2669,7 @@ void qh_setvoronoi_all(void) { qh_clearcenters(qh_ASvoronoi); qh_vertexneighbors(); - + FORALLfacets { if (!facet->normal || !facet->upperdelaunay || qh UPPERdelaunay) { if (!facet->center) @@ -2682,9 +2682,9 @@ void qh_setvoronoi_all(void) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="triangulate">-</a> - + qh_triangulate() - triangulate non-simplicial facets on qh.facet_list, + triangulate non-simplicial facets on qh.facet_list, if qh VORONOI, sets Voronoi centers of non-simplicial facets nop if hasTriangulation @@ -2702,7 +2702,7 @@ void qh_triangulate(void /*qh facet_list*/) { facetT *neighbor, *visible= NULL, *facet1, *facet2, *new_facet_list= NULL; facetT *orig_neighbor= NULL, *otherfacet; vertexT *new_vertex_list= NULL; - mergeT *merge; + mergeT *merge; mergeType mergetype; int neighbor_i, neighbor_n; @@ -2732,12 +2732,12 @@ void qh_triangulate(void /*qh facet_list*/) { trace2((qh ferr, 2047, "qh_triangulate: delete null facets from f%d -- apex same as second vertex\n", getid_(new_facet_list))); for (facet= new_facet_list; facet && facet->next; facet= nextfacet) { /* null facets moved to end */ nextfacet= facet->next; - if (facet->visible) + if (facet->visible) continue; if (facet->ridges) { if (qh_setsize(facet->ridges) > 0) { - qh_fprintf(qh ferr, 6161, "qhull error (qh_triangulate): ridges still defined for f%d\n", facet->id); - qh_errexit(qh_ERRqhull, facet, NULL); + qh_fprintf(qh ferr, 6161, "qhull error (qh_triangulate): ridges still defined for f%d\n", facet->id); + qh_errexit(qh_ERRqhull, facet, NULL); } qh_setfree(&facet->ridges); } @@ -2770,22 +2770,22 @@ void qh_triangulate(void /*qh facet_list*/) { FORALLfacet_(new_facet_list) { if (facet->tricoplanar && !facet->visible) { FOREACHneighbor_i_(facet) { - if (neighbor_i == 0) { /* first iteration */ - if (neighbor->tricoplanar) + if (neighbor_i == 0) { /* first iteration */ + if (neighbor->tricoplanar) orig_neighbor= neighbor->f.triowner; - else - orig_neighbor= neighbor; - }else { - if (neighbor->tricoplanar) - otherfacet= neighbor->f.triowner; - else - otherfacet= neighbor; - if (orig_neighbor == otherfacet) { - zinc_(Ztridegen); - facet->degenerate= True; - break; - } - } + else + orig_neighbor= neighbor; + }else { + if (neighbor->tricoplanar) + otherfacet= neighbor->f.triowner; + else + otherfacet= neighbor; + if (orig_neighbor == otherfacet) { + zinc_(Ztridegen); + facet->degenerate= True; + break; + } + } } } } @@ -2797,52 +2797,52 @@ void qh_triangulate(void /*qh facet_list*/) { nextfacet= facet->next; if (facet->visible) { if (facet->tricoplanar) { /* a null or mirrored facet */ - qh_delfacet(facet); - qh num_visible--; + qh_delfacet(facet); + qh num_visible--; }else { /* a non-simplicial facet followed by its tricoplanars */ - if (visible && !owner) { - /* RBOX 200 s D5 t1001471447 | QHULL Qt C-0.01 Qx Qc Tv Qt -- f4483 had 6 vertices/neighbors and 8 ridges */ - trace2((qh ferr, 2053, "qh_triangulate: all tricoplanar facets degenerate for non-simplicial facet f%d\n", - visible->id)); - qh_delfacet(visible); - qh num_visible--; - } - visible= facet; - owner= NULL; + if (visible && !owner) { + /* RBOX 200 s D5 t1001471447 | QHULL Qt C-0.01 Qx Qc Tv Qt -- f4483 had 6 vertices/neighbors and 8 ridges */ + trace2((qh ferr, 2053, "qh_triangulate: all tricoplanar facets degenerate for non-simplicial facet f%d\n", + visible->id)); + qh_delfacet(visible); + qh num_visible--; + } + visible= facet; + owner= NULL; } }else if (facet->tricoplanar) { - if (facet->f.triowner != visible) { - qh_fprintf(qh ferr, 6162, "qhull error (qh_triangulate): tricoplanar facet f%d not owned by its visible, non-simplicial facet f%d\n", facet->id, getid_(visible)); - qh_errexit2 (qh_ERRqhull, facet, visible); + if (facet->f.triowner != visible) { + qh_fprintf(qh ferr, 6162, "qhull error (qh_triangulate): tricoplanar facet f%d not owned by its visible, non-simplicial facet f%d\n", facet->id, getid_(visible)); + qh_errexit2 (qh_ERRqhull, facet, visible); } - if (owner) - facet->f.triowner= owner; + if (owner) + facet->f.triowner= owner; else if (!facet->degenerate) { - owner= facet; - nextfacet= visible->next; /* rescan tricoplanar facets with owner */ - facet->keepcentrum= True; /* one facet owns ->normal, etc. */ - facet->coplanarset= visible->coplanarset; - facet->outsideset= visible->outsideset; - visible->coplanarset= NULL; - visible->outsideset= NULL; + owner= facet; + nextfacet= visible->next; /* rescan tricoplanar facets with owner */ + facet->keepcentrum= True; /* one facet owns ->normal, etc. */ + facet->coplanarset= visible->coplanarset; + facet->outsideset= visible->outsideset; + visible->coplanarset= NULL; + visible->outsideset= NULL; if (!qh TRInormals) { /* center and normal copied to tricoplanar facets */ - visible->center= NULL; - visible->normal= NULL; - } - qh_delfacet(visible); - qh num_visible--; + visible->center= NULL; + visible->normal= NULL; + } + qh_delfacet(visible); + qh num_visible--; } } } if (visible && !owner) { trace2((qh ferr, 2054, "qh_triangulate: all tricoplanar facets degenerate for last non-simplicial facet f%d\n", - visible->id)); + visible->id)); qh_delfacet(visible); qh num_visible--; } qh NEWfacets= False; qh ONLYgood= onlygood; /* restore value */ - if (qh CHECKfrequently) + if (qh CHECKfrequently) qh_checkpolygon(qh facet_list); qh hasTriangulation= True; } /* triangulate */ @@ -2850,7 +2850,7 @@ void qh_triangulate(void /*qh facet_list*/) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="triangulate_facet">-</a> - + qh_triangulate_facet(facetA) triangulate a non-simplicial facet if qh.CENTERtype=qh_ASvoronoi, sets its Voronoi center @@ -2860,7 +2860,7 @@ void qh_triangulate(void /*qh facet_list*/) { facet->degenerate set if duplicated apex facet->f.trivisible set to facetA facet->center copied from facetA (created if qh_ASvoronoi) - qh_eachvoronoi, qh_detvridge, qh_detvridge3 assume centers copied + qh_eachvoronoi, qh_detvridge, qh_detvridge3 assume centers copied facet->normal,offset,maxoutside copied from facetA notes: @@ -2871,8 +2871,8 @@ void qh_triangulate(void /*qh facet_list*/) { qh_makenewfacets() -- construct a cone of facets for a new vertex design: - if qh_ASvoronoi, - compute Voronoi center (facet->center) + if qh_ASvoronoi, + compute Voronoi center (facet->center) select first vertex (highest ID to preserve ID ordering of ->vertices) triangulate from vertex to ridges copy facet->center, normal, offset @@ -2908,13 +2908,13 @@ void qh_triangulate_facet(facetT *facetA, vertexT **first_vertex) { newfacet->degenerate= False; newfacet->upperdelaunay= facetA->upperdelaunay; newfacet->good= facetA->good; - if (qh TRInormals) { + if (qh TRInormals) { newfacet->keepcentrum= True; newfacet->normal= qh_copypoints(facetA->normal, 1, qh hull_dim); - if (qh CENTERtype == qh_AScentrum) - newfacet->center= qh_getcentrum(newfacet); + if (qh CENTERtype == qh_AScentrum) + newfacet->center= qh_getcentrum(newfacet); else - newfacet->center= qh_copypoints(facetA->center, 1, qh hull_dim); + newfacet->center= qh_copypoints(facetA->center, 1, qh hull_dim); }else { newfacet->keepcentrum= False; newfacet->normal= facetA->normal; @@ -2939,7 +2939,7 @@ void qh_triangulate_facet(facetT *facetA, vertexT **first_vertex) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="triangulate_link">-</a> - + qh_triangulate_link(oldfacetA, facetA, oldfacetB, facetB) relink facetA to facetB via oldfacets returns: @@ -2950,14 +2950,14 @@ void qh_triangulate_facet(facetT *facetA, vertexT **first_vertex) { void qh_triangulate_link(facetT *oldfacetA, facetT *facetA, facetT *oldfacetB, facetT *facetB) { int errmirror= False; - trace3((qh ferr, 3021, "qh_triangulate_link: relink old facets f%d and f%d between neighbors f%d and f%d\n", + trace3((qh ferr, 3021, "qh_triangulate_link: relink old facets f%d and f%d between neighbors f%d and f%d\n", oldfacetA->id, oldfacetB->id, facetA->id, facetB->id)); if (qh_setin(facetA->neighbors, facetB)) { - if (!qh_setin(facetB->neighbors, facetA)) + if (!qh_setin(facetB->neighbors, facetA)) errmirror= True; else qh_appendmergeset(facetA, facetB, MRGmirror, NULL); - }else if (qh_setin(facetB->neighbors, facetA)) + }else if (qh_setin(facetB->neighbors, facetA)) errmirror= True; if (errmirror) { qh_fprintf(qh ferr, 6163, "qhull error (qh_triangulate_link): mirror facets f%d and f%d do not match for old facets f%d and f%d\n", @@ -2970,7 +2970,7 @@ void qh_triangulate_link(facetT *oldfacetA, facetT *facetA, facetT *oldfacetB, f /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="triangulate_mirror">-</a> - + qh_triangulate_mirror(facetA, facetB) delete mirrored facets from qh_triangulate_null() and qh_triangulate_mirror a mirrored facet shares the same vertices of a logical ridge @@ -2982,7 +2982,7 @@ void qh_triangulate_mirror(facetT *facetA, facetT *facetB) { facetT *neighbor, *neighborB; int neighbor_i, neighbor_n; - trace3((qh ferr, 3022, "qh_triangulate_mirror: delete mirrored facets f%d and f%d\n", + trace3((qh ferr, 3022, "qh_triangulate_mirror: delete mirrored facets f%d and f%d\n", facetA->id, facetB->id)); FOREACHneighbor_i_(facetA) { neighborB= SETelemt_(facetB->neighbors, neighbor_i, facetT); @@ -2996,7 +2996,7 @@ void qh_triangulate_mirror(facetT *facetA, facetT *facetB) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="triangulate_null">-</a> - + qh_triangulate_null(facetA) remove null facetA from qh_triangulate_facet() a null facet has vertex #1 (apex) == vertex #2 @@ -3024,14 +3024,14 @@ void qh_triangulate(void) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="vertexintersect">-</a> - + qh_vertexintersect( vertexsetA, vertexsetB ) intersects two vertex sets (inverse id ordered) vertexsetA is a temporary set at the top of qhmem.tempstack returns: replaces vertexsetA with the intersection - + notes: could overwrite vertexsetA if currently too slow */ @@ -3046,7 +3046,7 @@ void qh_vertexintersect(setT **vertexsetA,setT *vertexsetB) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="vertexintersect_new">-</a> - + qh_vertexintersect_new( ) intersects two vertex sets (inverse id ordered) @@ -3055,8 +3055,8 @@ void qh_vertexintersect(setT **vertexsetA,setT *vertexsetB) { */ setT *qh_vertexintersect_new(setT *vertexsetA,setT *vertexsetB) { setT *intersection= qh_setnew(qh hull_dim - 1); - vertexT **vertexA= SETaddr_(vertexsetA, vertexT); - vertexT **vertexB= SETaddr_(vertexsetB, vertexT); + vertexT **vertexA= SETaddr_(vertexsetA, vertexT); + vertexT **vertexB= SETaddr_(vertexsetB, vertexT); while (*vertexA && *vertexB) { if (*vertexA == *vertexB) { @@ -3074,10 +3074,10 @@ setT *qh_vertexintersect_new(setT *vertexsetA,setT *vertexsetB) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="vertexneighbors">-</a> - + qh_vertexneighbors() - for each vertex in qh.facet_list, - determine its neighboring facets + for each vertex in qh.facet_list, + determine its neighboring facets returns: sets qh.VERTEXneighbors @@ -3116,12 +3116,12 @@ void qh_vertexneighbors(void /*qh facet_list*/) { /*-<a href="qh-poly.htm#TOC" >-------------------------------</a><a name="vertexsubset">-</a> - + qh_vertexsubset( vertexsetA, vertexsetB ) returns True if vertexsetA is a subset of vertexsetB assumes vertexsets are sorted - note: + note: empty set is a subset of any other set */ boolT qh_vertexsubset(setT *vertexsetA, setT *vertexsetB) { @@ -3137,7 +3137,7 @@ boolT qh_vertexsubset(setT *vertexsetA, setT *vertexsetB) { return False; if (*vertexA == *vertexB) vertexA++; - vertexB++; + vertexB++; } return False; /* avoid warnings */ } /* vertexsubset */ diff --git a/src/qconvex.c b/src/qconvex.c index 326b0bb..235e159 100644 --- a/src/qconvex.c +++ b/src/qconvex.c @@ -35,7 +35,7 @@ extern "C" { #else int isatty(int); /* returns 1 if stdin is a tty - if "Undefined symbol" this can be deleted along with call in main() */ + if "Undefined symbol" this can be deleted along with call in main() */ #endif /*-<a href="qh-qhull.htm#TOC" @@ -43,17 +43,17 @@ int isatty(int); /* returns 1 if stdin is a tty qh_prompt long prompt for qconvex - + notes: restricted version of libqhull.c see: concise prompt below -*/ +*/ /* duplicated in qconvex.htm */ char hidden_options[]=" d v H Qbb Qf Qg Qm Qr Qu Qv Qx Qz TR E V Fp Gt Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 "; - + char qh_prompta[]= "\n\ qconvex- compute the convex hull\n\ http://www.qhull.org %s\n\ @@ -182,8 +182,8 @@ Print options:\n\ >-------------------------------</a><a name="prompt2">-</a> qh_prompt2 - synopsis for qhull -*/ + synopsis for qhull +*/ char qh_prompt2[]= "\n\ qconvex- compute the convex hull. Qhull %s\n\ input (stdin): dimension, number of points, point coordinates\n\ @@ -223,8 +223,8 @@ examples:\n\ >-------------------------------</a><a name="prompt3">-</a> qh_prompt3 - concise prompt for qhull -*/ + concise prompt for qhull +*/ char qh_prompt3[]= "\n\ Qhull %s.\n\ Except for 'F.' and 'PG', upper-case options take an argument.\n\ @@ -257,10 +257,10 @@ Except for 'F.' and 'PG', upper-case options take an argument.\n\ /*-<a href="qh-qhull.htm" >-------------------------------</a><a name="main">-</a> - + main( argc, argv ) processes the command line, calls qhull() to do the work, and exits - + design: initializes data structures reads points @@ -283,18 +283,18 @@ int main(int argc, char *argv[]) { SIOUXSettings.rows= 40; if (setvbuf(stdin, inBuf, _IOFBF, sizeof(inBuf)) < 0 /* w/o, SIOUX I/O is slow*/ || setvbuf(stdout, outBuf, _IOFBF, sizeof(outBuf)) < 0 - || (stdout != stderr && setvbuf(stderr, errBuf, _IOFBF, sizeof(errBuf)) < 0)) + || (stdout != stderr && setvbuf(stderr, errBuf, _IOFBF, sizeof(errBuf)) < 0)) fprintf(stderr, "qhull internal warning (main): could not change stdio to fully buffered.\n"); argc= ccommand(&argv); #endif - if ((argc == 1) && isatty( 0 /*stdin*/)) { + if ((argc == 1) && isatty( 0 /*stdin*/)) { fprintf(stdout, qh_prompt2, qh_version); exit(qh_ERRnone); } if (argc > 1 && *argv[1] == '-' && !*(argv[1]+1)) { - fprintf(stdout, qh_prompta, qh_version, qh_DEFAULTbox, - qh_promptb, qh_promptc, qh_promptd, qh_prompte); + fprintf(stdout, qh_prompta, qh_version, qh_DEFAULTbox, + qh_promptb, qh_promptc, qh_promptd, qh_prompte); exit(qh_ERRnone); } if (argc >1 && *argv[1] == '.' && !*(argv[1]+1)) { @@ -325,7 +325,7 @@ int main(int argc, char *argv[]) { #else qh_freeqhull( False); qh_memfreeshort(&curlong, &totlong); - if (curlong || totlong) + if (curlong || totlong) fprintf(stderr, "qhull internal warning (main): did not free %d bytes of long memory(%d pieces)\n", totlong, curlong); #endif diff --git a/src/qdelaun.c b/src/qdelaun.c index 61c361e..06eda63 100644 --- a/src/qdelaun.c +++ b/src/qdelaun.c @@ -36,21 +36,21 @@ extern "C" { #else int isatty(int); /* returns 1 if stdin is a tty - if "Undefined symbol" this can be deleted along with call in main() */ + if "Undefined symbol" this can be deleted along with call in main() */ #endif /*-<a href="qh-qhull.htm#TOC" >-------------------------------</a><a name="prompt">-</a> - qh_prompt + qh_prompt long prompt for qhull - + notes: restricted version of libqhull.c - + see: concise prompt below -*/ +*/ /* duplicated in qdelau_f.htm and qdelaun.htm */ char hidden_options[]=" d n v H U Qb QB Qc Qf Qg Qi Qm Qr QR Qv Qx TR E V FC Fi Fo Ft Fp FV Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 "; @@ -146,7 +146,7 @@ Geomview options (2-d and 3-d)\n\ Gi - inner planes only\n\ Gn - no planes\n\ Go - outer planes only\n\ - Gc - centrums\n\ + Gc - centrums\n\ Gh - hyperplane intersections\n\ Gr - ridges\n\ GDn - drop dimension n in 3-d and 4-d output\n\ @@ -172,8 +172,8 @@ Print options:\n\ >-------------------------------</a><a name="prompt2">-</a> qh_prompt2 - synopsis for qhull -*/ + synopsis for qhull +*/ char qh_prompt2[]= "\n\ qdelaunay- compute the Delaunay triangulation. Qhull %s\n\ input (stdin): dimension, number of points, point coordinates\n\ @@ -210,8 +210,8 @@ examples:\n\ >-------------------------------</a><a name="prompt3">-</a> qh_prompt3 - concise prompt for qhull -*/ + concise prompt for qhull +*/ char qh_prompt3[]= "\n\ Qhull %s.\n\ Except for 'F.' and 'PG', upper-case options take an argument.\n\ @@ -243,10 +243,10 @@ Except for 'F.' and 'PG', upper-case options take an argument.\n\ /*-<a href="qh-qhull.htm#TOC" >-------------------------------</a><a name="main">-</a> - + main( argc, argv ) processes the command line, calls qhull() to do the work, and exits - + design: initializes data structures reads points @@ -269,18 +269,18 @@ int main(int argc, char *argv[]) { SIOUXSettings.rows= 40; if (setvbuf(stdin, inBuf, _IOFBF, sizeof(inBuf)) < 0 /* w/o, SIOUX I/O is slow*/ || setvbuf(stdout, outBuf, _IOFBF, sizeof(outBuf)) < 0 - || (stdout != stderr && setvbuf(stderr, errBuf, _IOFBF, sizeof(errBuf)) < 0)) + || (stdout != stderr && setvbuf(stderr, errBuf, _IOFBF, sizeof(errBuf)) < 0)) fprintf(stderr, "qhull internal warning (main): could not change stdio to fully buffered.\n"); argc= ccommand(&argv); #endif - if ((argc == 1) && isatty( 0 /*stdin*/)) { + if ((argc == 1) && isatty( 0 /*stdin*/)) { fprintf(stdout, qh_prompt2, qh_version); exit(qh_ERRnone); } if (argc > 1 && *argv[1] == '-' && !*(argv[1]+1)) { fprintf(stdout, qh_prompta, qh_version, - qh_promptb, qh_promptc, qh_promptd, qh_prompte); + qh_promptb, qh_promptc, qh_promptd, qh_prompte); exit(qh_ERRnone); } if (argc >1 && *argv[1] == '.' && !*(argv[1]+1)) { @@ -315,7 +315,7 @@ int main(int argc, char *argv[]) { #else qh_freeqhull( False); qh_memfreeshort(&curlong, &totlong); - if (curlong || totlong) + if (curlong || totlong) fprintf(stderr, "qhull internal warning (main): did not free %d bytes of long memory(%d pieces)\n", totlong, curlong); #endif diff --git a/src/qh-geom.htm b/src/qh-geom.htm index 1f527ee..f1c9f3e 100644 --- a/src/qh-geom.htm +++ b/src/qh-geom.htm @@ -12,13 +12,13 @@ content="text/html; charset=iso-8859-1"> href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="../html/index.htm#TOC">Qhull manual</a>: Table of Contents <br> <b>Up:</b> <a href="../html/qh-quick.htm#programs">Programs</a> -• <a href="../html/qh-quick.htm#options">Options</a> -• <a href="../html/qh-opto.htm#output">Output</a> -• <a href="../html/qh-optf.htm#format">Formats</a> -• <a href="../html/qh-optg.htm#geomview">Geomview</a> +• <a href="../html/qh-quick.htm#options">Options</a> +• <a href="../html/qh-opto.htm#output">Output</a> +• <a href="../html/qh-optf.htm#format">Formats</a> +• <a href="../html/qh-optg.htm#geomview">Geomview</a> • <a href="../html/qh-optp.htm#print">Print</a> -• <a href="../html/qh-optq.htm#qhull">Qhull</a> -• <a href="../html/qh-optc.htm#prec">Precision</a> +• <a href="../html/qh-optq.htm#qhull">Qhull</a> +• <a href="../html/qh-optc.htm#prec">Precision</a> • <a href="../html/qh-optt.htm#trace">Trace</a><br> <b>Up:</b> <a href="../html/qh-code.htm#TOC">Qhull code: Table of Contents</a><br> <b>To:</b> <a href="../src/index.htm">Qhull functions</a>, macros, and data structures<br> @@ -48,7 +48,7 @@ vertices, halfspace equations, centrums, and an interior point.</p> precision floating point arithmetic (see <a href="user.h#realT">realT</a> ). </p> -<p>Each floating point operation may incur round-off error (see +<p>Each floating point operation may incur round-off error (see <a href="qh-merge.htm#TOC">Merge</a>). The maximum error for distance computations is determined at initialization. The roundoff error in halfspace computation is accounted for by computing the @@ -56,14 +56,14 @@ distance from vertices to the halfspace. </p> </blockquote> <p><b>Copyright © 1995-2010 C.B. Barber</b></p> <hr> -<p><a href="#TOP">»</a> <b>Geom</b> -<a name="TOC">•</a> <a href="qh-globa.htm#TOC">Global</a> • -<a href="qh-io.htm#TOC">Io</a> • <a href="qh-mem.htm#TOC">Mem</a> • -<a href="qh-merge.htm#TOC">Merge</a> • <a href="qh-poly.htm#TOC">Poly</a> • -<a href="qh-qhull.htm#TOC">Qhull</a> • <a href="qh-set.htm#TOC">Set</a> • +<p><a href="#TOP">»</a> <b>Geom</b> +<a name="TOC">•</a> <a href="qh-globa.htm#TOC">Global</a> • +<a href="qh-io.htm#TOC">Io</a> • <a href="qh-mem.htm#TOC">Mem</a> • +<a href="qh-merge.htm#TOC">Merge</a> • <a href="qh-poly.htm#TOC">Poly</a> • +<a href="qh-qhull.htm#TOC">Qhull</a> • <a href="qh-set.htm#TOC">Set</a> • <a href="qh-stat.htm#TOC">Stat</a> • <a href="qh-user.htm#TOC">User</a> </p> -<h3>Index to <a href="geom.c">geom.c</a>, +<h3>Index to <a href="geom.c">geom.c</a>, <a href="geom2.c">geom2.c</a>, <a href="geom.h">geom.h</a>, <a href="random.c">random.c</a>, <a href="random.h">random.h</a> </h3> @@ -183,7 +183,7 @@ input points by qh.JOGGLEmax </li> points for each dimension</li> <li><a href="geom2.c#maxsimplex">qh_maxsimplex</a> determines maximum simplex for a set of points </li> -<li><a href="geom2.c#printpoints">qh_printpoints</a> print ids for a +<li><a href="geom2.c#printpoints">qh_printpoints</a> print ids for a set of points </li> <li><a href="geom2.c#projectinput">qh_projectinput</a> project input using qh DELAUNAY and qh low_bound/high_bound </li> @@ -214,7 +214,7 @@ of a facet </li> Voronoi center for a facet's vertices </li> <li><a href="geom.c#findbest">qh_findbest</a> find visible facet or best facet for a point </li> -<li><a href="geom.c#findbesthorizon">qh_findbesthorizon</a> +<li><a href="geom.c#findbesthorizon">qh_findbesthorizon</a> update best new facet with horizon facets</li> <li><a href="geom.c#findbestnew">qh_findbestnew</a> find best new facet for point </li> @@ -258,22 +258,22 @@ outer and inner planes <p><!-- Navigation links --> </p> <hr> -<p><b>Up:</b> +<p><b>Up:</b> <a href="http://www.qhull.org">Home page for Qhull</a> <br> <b>Up:</b> <a href="index.htm#TOC">Qhull manual: Table of Contents</a> <br> <b>Up:</b> <a href="../html/qh-quick.htm#programs">Programs</a> -• <a href="../html/qh-quick.htm#options">Options</a> -• <a href="../html/qh-opto.htm#output">Output</a> -• <a href="../html/qh-optf.htm#format">Formats</a> -• <a href="../html/qh-optg.htm#geomview">Geomview</a> +• <a href="../html/qh-quick.htm#options">Options</a> +• <a href="../html/qh-opto.htm#output">Output</a> +• <a href="../html/qh-optf.htm#format">Formats</a> +• <a href="../html/qh-optg.htm#geomview">Geomview</a> • <a href="../html/qh-optp.htm#print">Print</a> -• <a href="../html/qh-optq.htm#qhull">Qhull</a> -• <a href="../html/qh-optc.htm#prec">Precision</a> +• <a href="../html/qh-optq.htm#qhull">Qhull</a> +• <a href="../html/qh-optc.htm#prec">Precision</a> • <a href="../html/qh-optt.htm#trace">Trace</a><br> <b>Up:</b> <a href="../html/qh-code.htm#TOC">Qhull code: Table of Contents</a> <br> <b>To:</b> <a href="index.htm">Qhull functions</a>, macros, and data structures<br> -<b>To:</b> <a href="qh-geom.htm">Geom</a> • +<b>To:</b> <a href="qh-geom.htm">Geom</a> • <a href="qh-globa.htm">Global</a> • <a href="qh-io.htm">Io</a> • <a href="qh-mem.htm">Mem</a> • <a href="qh-merge.htm">Merge</a> • <a href="qh-poly.htm">Poly</a> • <a href="qh-qhull.htm#TOC">Qhull</a> diff --git a/src/qh-globa.htm b/src/qh-globa.htm index 5d33209..9ebf7c8 100644 --- a/src/qh-globa.htm +++ b/src/qh-globa.htm @@ -12,13 +12,13 @@ content="text/html; charset=iso-8859-1"> href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="../html/index.htm#TOC">Qhull manual</a>: Table of Contents <br> <b>Up:</b> <a href="../html/qh-quick.htm#programs">Programs</a> -• <a href="../html/qh-quick.htm#options">Options</a> -• <a href="../html/qh-opto.htm#output">Output</a> -• <a href="../html/qh-optf.htm#format">Formats</a> -• <a href="../html/qh-optg.htm#geomview">Geomview</a> +• <a href="../html/qh-quick.htm#options">Options</a> +• <a href="../html/qh-opto.htm#output">Output</a> +• <a href="../html/qh-optf.htm#format">Formats</a> +• <a href="../html/qh-optg.htm#geomview">Geomview</a> • <a href="../html/qh-optp.htm#print">Print</a> -• <a href="../html/qh-optq.htm#qhull">Qhull</a> -• <a href="../html/qh-optc.htm#prec">Precision</a> +• <a href="../html/qh-optq.htm#qhull">Qhull</a> +• <a href="../html/qh-optc.htm#prec">Precision</a> • <a href="../html/qh-optt.htm#trace">Trace</a><br> <b>Up:</b> <a href="../html/qh-code.htm#TOC">Qhull code: Table of Contents</a><br> <b>To:</b> <a href="index.htm">Qhull functions</a>, macros, and data structures<br> @@ -44,14 +44,14 @@ dynamically allocated with malloc(). See </blockquote> <p><b>Copyright © 1995-2010 C.B. Barber</b></p> <hr> -<p><a href="#TOP">»</a> <a href="qh-geom.htm#TOC">Geom</a> -<a name="TOC">•</a> <b>Global</b> • -<a href="qh-io.htm#TOC">Io</a> • <a href="qh-mem.htm#TOC">Mem</a> • -<a href="qh-merge.htm#TOC">Merge</a> • <a href="qh-poly.htm#TOC">Poly</a> • -<a href="qh-qhull.htm#TOC">Qhull</a> • <a href="qh-set.htm#TOC">Set</a> • +<p><a href="#TOP">»</a> <a href="qh-geom.htm#TOC">Geom</a> +<a name="TOC">•</a> <b>Global</b> • +<a href="qh-io.htm#TOC">Io</a> • <a href="qh-mem.htm#TOC">Mem</a> • +<a href="qh-merge.htm#TOC">Merge</a> • <a href="qh-poly.htm#TOC">Poly</a> • +<a href="qh-qhull.htm#TOC">Qhull</a> • <a href="qh-set.htm#TOC">Set</a> • <a href="qh-stat.htm#TOC">Stat</a> • <a href="qh-user.htm#TOC">User</a> </p> -<h3>Index to <a href="global.c">global.c</a> and +<h3>Index to <a href="global.c">global.c</a> and <a href="libqhull.h">libqhull.h</a></h3> <ul> @@ -128,22 +128,22 @@ strtod() and strtol() </li> <p><!-- Navigation links --> </p> <hr> -<p><b>Up:</b> +<p><b>Up:</b> <a href="http://www.qhull.org">Home page for Qhull</a> <br> <b>Up:</b> <a href="../html/index.htm#TOC">Qhull manual: Table of Contents</a> <br> <b>Up:</b> <a href="../html/qh-quick.htm#programs">Programs</a> -• <a href="../html/qh-quick.htm#options">Options</a> -• <a href="../html/qh-opto.htm#output">Output</a> -• <a href="../html/qh-optf.htm#format">Formats</a> -• <a href="../html/qh-optg.htm#geomview">Geomview</a> +• <a href="../html/qh-quick.htm#options">Options</a> +• <a href="../html/qh-opto.htm#output">Output</a> +• <a href="../html/qh-optf.htm#format">Formats</a> +• <a href="../html/qh-optg.htm#geomview">Geomview</a> • <a href="../html/qh-optp.htm#print">Print</a> -• <a href="../html/qh-optq.htm#qhull">Qhull</a> -• <a href="../html/qh-optc.htm#prec">Precision</a> +• <a href="../html/qh-optq.htm#qhull">Qhull</a> +• <a href="../html/qh-optc.htm#prec">Precision</a> • <a href="../html/qh-optt.htm#trace">Trace</a><br> <b>Up:</b> <a href="../html/qh-code.htm#TOC">Qhull code: Table of Contents</a> <br> <b>To:</b> <a href="index.htm">Qhull functions</a>, macros, and data structures<br> -<b>To:</b> <a href="qh-geom.htm">Geom</a> • +<b>To:</b> <a href="qh-geom.htm">Geom</a> • <a href="qh-globa.htm">Global</a> • <a href="qh-io.htm">Io</a> • <a href="qh-mem.htm">Mem</a> • <a href="qh-merge.htm">Merge</a> • <a href="qh-poly.htm">Poly</a> • <a href="qh-qhull.htm#TOC">Qhull</a> diff --git a/src/qh-io.htm b/src/qh-io.htm index 918f099..2920fca 100644 --- a/src/qh-io.htm +++ b/src/qh-io.htm @@ -12,13 +12,13 @@ content="text/html; charset=iso-8859-1"> href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="../html/index.htm#TOC">Qhull manual</a>: Table of Contents <br> <b>Up:</b> <a href="../html/qh-quick.htm#programs">Programs</a> -• <a href="../html/qh-quick.htm#options">Options</a> -• <a href="../html/qh-opto.htm#output">Output</a> -• <a href="../html/qh-optf.htm#format">Formats</a> -• <a href="../html/qh-optg.htm#geomview">Geomview</a> +• <a href="../html/qh-quick.htm#options">Options</a> +• <a href="../html/qh-opto.htm#output">Output</a> +• <a href="../html/qh-optf.htm#format">Formats</a> +• <a href="../html/qh-optg.htm#geomview">Geomview</a> • <a href="../html/qh-optp.htm#print">Print</a> -• <a href="../html/qh-optq.htm#qhull">Qhull</a> -• <a href="../html/qh-optc.htm#prec">Precision</a> +• <a href="../html/qh-optq.htm#qhull">Qhull</a> +• <a href="../html/qh-optc.htm#prec">Precision</a> • <a href="../html/qh-optt.htm#trace">Trace</a><br> <b>Up:</b> <a href="../html/qh-code.htm#TOC">Qhull code: Table of Contents</a><br> <b>To:</b> <a href="index.htm">Qhull functions</a>, macros, and data structures<br> @@ -56,10 +56,10 @@ qh_skipfacet() is tested. </p> <p><b>Copyright © 1995-2010 C.B. Barber</b></p> <hr> <p><a href="#TOP">»</a> <a href="qh-geom.htm#TOC">Geom</a> <a name="TOC">•</a> -<a href="qh-globa.htm#TOC">Global</a> • <b>Io</b> • -<a href="qh-mem.htm#TOC">Mem</a> • <a href="qh-merge.htm#TOC">Merge</a> • -<a href="qh-poly.htm#TOC">Poly</a> • <a href="qh-qhull.htm#TOC">Qhull</a> • -<a href="qh-set.htm#TOC">Set</a> • <a href="qh-stat.htm#TOC">Stat</a> • +<a href="qh-globa.htm#TOC">Global</a> • <b>Io</b> • +<a href="qh-mem.htm#TOC">Mem</a> • <a href="qh-merge.htm#TOC">Merge</a> • +<a href="qh-poly.htm#TOC">Poly</a> • <a href="qh-qhull.htm#TOC">Qhull</a> • +<a href="qh-set.htm#TOC">Set</a> • <a href="qh-stat.htm#TOC">Stat</a> • <a href="qh-user.htm#TOC">User</a> </p> <h3>Index to <a href="io.c">io.c</a> and <a href="io.h">io.h</a></h3> @@ -217,9 +217,9 @@ coordinates of a point ('p', 'o', 'Fp', 'G', 'f')</li> 3-d, or 4-d point as 3-d coordinates ('G')</li> <li><a href="io.c#printvdiagram2">qh_printvdiagram2</a> print voronoi diagram for each ridge of each vertex from qh_markvoronoi</li> -<li><a href="io.c#printvnorm">qh_printvnorm</a> print +<li><a href="io.c#printvnorm">qh_printvnorm</a> print separating plane of the Voronoi diagram for a pair of input sites</li> -<li><a href="io.c#printvridge">qh_printvridge</a> print +<li><a href="io.c#printvridge">qh_printvridge</a> print ridge of the Voronoi diagram for a pair of input sites</li> <li><a href="io.c#projectdim3">qh_projectdim3</a> project 2-d 3-d or 4-d point to a 3-d point ('G')</li> @@ -269,22 +269,22 @@ vertices as OFF spheres </li> <p> <p><!-- Navigation links --> </p> <hr> -<p><b>Up:</b> +<p><b>Up:</b> <a href="http://www.qhull.org">Home page for Qhull</a> <br> <b>Up:</b> <a href="../html/index.htm#TOC">Qhull manual: Table of Contents</a> <br> <b>Up:</b> <a href="../html/qh-quick.htm#programs">Programs</a> -• <a href="../html/qh-quick.htm#options">Options</a> -• <a href="../html/qh-opto.htm#output">Output</a> -• <a href="../html/qh-optf.htm#format">Formats</a> -• <a href="../html/qh-optg.htm#geomview">Geomview</a> +• <a href="../html/qh-quick.htm#options">Options</a> +• <a href="../html/qh-opto.htm#output">Output</a> +• <a href="../html/qh-optf.htm#format">Formats</a> +• <a href="../html/qh-optg.htm#geomview">Geomview</a> • <a href="../html/qh-optp.htm#print">Print</a> -• <a href="../html/qh-optq.htm#qhull">Qhull</a> -• <a href="../html/qh-optc.htm#prec">Precision</a> +• <a href="../html/qh-optq.htm#qhull">Qhull</a> +• <a href="../html/qh-optc.htm#prec">Precision</a> • <a href="../html/qh-optt.htm#trace">Trace</a><br> <b>Up:</b> <a href="../html/qh-code.htm#TOC">Qhull code: Table of Contents</a> <br> <b>To:</b> <a href="index.htm">Qhull functions</a>, macros, and data structures<br> -<b>To:</b> <a href="qh-geom.htm">Geom</a> • +<b>To:</b> <a href="qh-geom.htm">Geom</a> • <a href="qh-globa.htm">Global</a> • <a href="qh-io.htm">Io</a> • <a href="qh-mem.htm">Mem</a> • <a href="qh-merge.htm">Merge</a> • <a href="qh-poly.htm">Poly</a> • <a href="qh-qhull.htm#TOC">Qhull</a> diff --git a/src/qh-mem.htm b/src/qh-mem.htm index 258ae01..12928df 100644 --- a/src/qh-mem.htm +++ b/src/qh-mem.htm @@ -12,13 +12,13 @@ content="text/html; charset=iso-8859-1"> href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="../html/index.htm#TOC">Qhull manual</a>: Table of Contents <br> <b>Up:</b> <a href="../html/qh-quick.htm#programs">Programs</a> -• <a href="../html/qh-quick.htm#options">Options</a> -• <a href="../html/qh-opto.htm#output">Output</a> -• <a href="../html/qh-optf.htm#format">Formats</a> -• <a href="../html/qh-optg.htm#geomview">Geomview</a> +• <a href="../html/qh-quick.htm#options">Options</a> +• <a href="../html/qh-opto.htm#output">Output</a> +• <a href="../html/qh-optf.htm#format">Formats</a> +• <a href="../html/qh-optg.htm#geomview">Geomview</a> • <a href="../html/qh-optp.htm#print">Print</a> -• <a href="../html/qh-optq.htm#qhull">Qhull</a> -• <a href="../html/qh-optc.htm#prec">Precision</a> +• <a href="../html/qh-optq.htm#qhull">Qhull</a> +• <a href="../html/qh-optc.htm#prec">Precision</a> • <a href="../html/qh-optt.htm#trace">Trace</a><br> <b>Up:</b> <a href="../html/qh-code.htm#TOC">Qhull code: Table of Contents</a><br> <b>To:</b> <a href="index.htm">Qhull functions</a>, macros, and data structures<br> @@ -42,14 +42,14 @@ from a reserved buffer. </p> </blockquote> <p><b>Copyright © 1995-2010 C.B. Barber</b></p> <hr> -<p><a href="#TOP">»</a> <a href="qh-geom.htm#TOC">Geom</a> +<p><a href="#TOP">»</a> <a href="qh-geom.htm#TOC">Geom</a> <a name="TOC">•</a> <a href="qh-globa.htm#TOC">Global</a> • <a href="qh-io.htm#TOC">Io</a> • <b>Mem</b> • <a href="qh-merge.htm#TOC">Merge</a> • <a href="qh-poly.htm#TOC">Poly</a> • <a href="qh-qhull.htm#TOC">Qhull</a> • <a href="qh-set.htm#TOC">Set</a> • <a href="qh-stat.htm#TOC">Stat</a> • <a href="qh-user.htm#TOC">User</a> </p> -<h3>Index to <a href="mem.c">mem.c</a> and +<h3>Index to <a href="mem.c">mem.c</a> and <a href="mem.h">mem.h</a></h3> <ul> <li><a href="#etype">mem.h data types</a> </li> @@ -107,22 +107,22 @@ print out memory statistics </li> <p><!-- Navigation links --> </p> <hr> -<p><b>Up:</b> +<p><b>Up:</b> <a href="http://www.qhull.org">Home page for Qhull</a> <br> <b>Up:</b> <a href="../html/index.htm#TOC">Qhull manual: Table of Contents</a> <br> <b>Up:</b> <a href="../html/qh-quick.htm#programs">Programs</a> -• <a href="../html/qh-quick.htm#options">Options</a> -• <a href="../html/qh-opto.htm#output">Output</a> -• <a href="../html/qh-optf.htm#format">Formats</a> -• <a href="../html/qh-optg.htm#geomview">Geomview</a> +• <a href="../html/qh-quick.htm#options">Options</a> +• <a href="../html/qh-opto.htm#output">Output</a> +• <a href="../html/qh-optf.htm#format">Formats</a> +• <a href="../html/qh-optg.htm#geomview">Geomview</a> • <a href="../html/qh-optp.htm#print">Print</a> -• <a href="../html/qh-optq.htm#qhull">Qhull</a> -• <a href="../html/qh-optc.htm#prec">Precision</a> +• <a href="../html/qh-optq.htm#qhull">Qhull</a> +• <a href="../html/qh-optc.htm#prec">Precision</a> • <a href="../html/qh-optt.htm#trace">Trace</a><br> <b>Up:</b> <a href="../html/qh-code.htm#TOC">Qhull code: Table of Contents</a> <br> <b>To:</b> <a href="index.htm">Qhull functions</a>, macros, and data structures<br> -<b>To:</b> <a href="qh-geom.htm">Geom</a> • +<b>To:</b> <a href="qh-geom.htm">Geom</a> • <a href="qh-globa.htm">Global</a> • <a href="qh-io.htm">Io</a> • <a href="qh-mem.htm">Mem</a> • <a href="qh-merge.htm">Merge</a> • <a href="qh-poly.htm">Poly</a> • <a href="qh-qhull.htm#TOC">Qhull</a> diff --git a/src/qh-merge.htm b/src/qh-merge.htm index 165b3a6..ff420c0 100644 --- a/src/qh-merge.htm +++ b/src/qh-merge.htm @@ -12,13 +12,13 @@ content="text/html; charset=iso-8859-1"> href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="../html/index.htm#TOC">Qhull manual</a>: Table of Contents <br> <b>Up:</b> <a href="../html/qh-quick.htm#programs">Programs</a> -• <a href="../html/qh-quick.htm#options">Options</a> -• <a href="../html/qh-opto.htm#output">Output</a> -• <a href="../html/qh-optf.htm#format">Formats</a> -• <a href="../html/qh-optg.htm#geomview">Geomview</a> +• <a href="../html/qh-quick.htm#options">Options</a> +• <a href="../html/qh-opto.htm#output">Output</a> +• <a href="../html/qh-optf.htm#format">Formats</a> +• <a href="../html/qh-optg.htm#geomview">Geomview</a> • <a href="../html/qh-optp.htm#print">Print</a> -• <a href="../html/qh-optq.htm#qhull">Qhull</a> -• <a href="../html/qh-optc.htm#prec">Precision</a> +• <a href="../html/qh-optq.htm#qhull">Qhull</a> +• <a href="../html/qh-optc.htm#prec">Precision</a> • <a href="../html/qh-optt.htm#trace">Trace</a><br> <b>Up:</b> <a href="../html/qh-code.htm#TOC">Qhull code: Table of Contents</a><br> <b>To:</b> <a href="index.htm">Qhull functions</a>, macros, and data structures<br> @@ -100,14 +100,14 @@ structure.This is called a <em>redundant vertex</em>. </blockquote> <p><b>Copyright © 1995-2010 C.B. Barber</b></p> <hr> -<p><a href="#TOP">»</a> <a href="qh-geom.htm#TOC">Geom</a> +<p><a href="#TOP">»</a> <a href="qh-geom.htm#TOC">Geom</a> <a name="TOC">•</a> <a href="qh-globa.htm#TOC">Global</a> • <a href="qh-io.htm#TOC">Io</a> • <a href="qh-mem.htm#TOC">Mem</a> • <b>Merge</b> • <a href="qh-poly.htm#TOC">Poly</a> • <a href="qh-qhull.htm#TOC">Qhull</a> • <a href="qh-set.htm#TOC">Set</a> • <a href="qh-stat.htm#TOC">Stat</a> • <a href="qh-user.htm#TOC">User</a> </p> -<h3>Index to <a href="merge.c">merge.c</a> and +<h3>Index to <a href="merge.c">merge.c</a> and <a href="merge.h">merge.h</a></h3> <ul> <li><a href="#mtype">merge.h data types, macros, and @@ -330,22 +330,22 @@ print trace message during post-merging </li> <p><!-- Navigation links --> </p> <hr> -<p><b>Up:</b> +<p><b>Up:</b> <a href="http://www.qhull.org">Home page for Qhull</a> <br> <b>Up:</b> <a href="../html/index.htm#TOC">Qhull manual: Table of Contents</a> <br> <b>Up:</b> <a href="../html/qh-quick.htm#programs">Programs</a> -• <a href="../html/qh-quick.htm#options">Options</a> -• <a href="../html/qh-opto.htm#output">Output</a> -• <a href="../html/qh-optf.htm#format">Formats</a> -• <a href="../html/qh-optg.htm#geomview">Geomview</a> +• <a href="../html/qh-quick.htm#options">Options</a> +• <a href="../html/qh-opto.htm#output">Output</a> +• <a href="../html/qh-optf.htm#format">Formats</a> +• <a href="../html/qh-optg.htm#geomview">Geomview</a> • <a href="../html/qh-optp.htm#print">Print</a> -• <a href="../html/qh-optq.htm#qhull">Qhull</a> -• <a href="../html/qh-optc.htm#prec">Precision</a> +• <a href="../html/qh-optq.htm#qhull">Qhull</a> +• <a href="../html/qh-optc.htm#prec">Precision</a> • <a href="../html/qh-optt.htm#trace">Trace</a><br> <b>Up:</b> <a href="../html/qh-code.htm#TOC">Qhull code: Table of Contents</a> <br> <b>To:</b> <a href="index.htm">Qhull functions</a>, macros, and data structures<br> -<b>To:</b> <a href="qh-geom.htm">Geom</a> • +<b>To:</b> <a href="qh-geom.htm">Geom</a> • <a href="qh-globa.htm">Global</a> • <a href="qh-io.htm">Io</a> • <a href="qh-mem.htm">Mem</a> • <a href="qh-merge.htm">Merge</a> • <a href="qh-poly.htm">Poly</a> • <a href="qh-qhull.htm#TOC">Qhull</a> diff --git a/src/qh-poly.htm b/src/qh-poly.htm index 69c199e..1dfe7af 100644 --- a/src/qh-poly.htm +++ b/src/qh-poly.htm @@ -12,13 +12,13 @@ content="text/html; charset=iso-8859-1"> href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="../html/index.htm#TOC">Qhull manual</a>: Table of Contents <br> <b>Up:</b> <a href="../html/qh-quick.htm#programs">Programs</a> -• <a href="../html/qh-quick.htm#options">Options</a> -• <a href="../html/qh-opto.htm#output">Output</a> -• <a href="../html/qh-optf.htm#format">Formats</a> -• <a href="../html/qh-optg.htm#geomview">Geomview</a> +• <a href="../html/qh-quick.htm#options">Options</a> +• <a href="../html/qh-opto.htm#output">Output</a> +• <a href="../html/qh-optf.htm#format">Formats</a> +• <a href="../html/qh-optg.htm#geomview">Geomview</a> • <a href="../html/qh-optp.htm#print">Print</a> -• <a href="../html/qh-optq.htm#qhull">Qhull</a> -• <a href="../html/qh-optc.htm#prec">Precision</a> +• <a href="../html/qh-optq.htm#qhull">Qhull</a> +• <a href="../html/qh-optc.htm#prec">Precision</a> • <a href="../html/qh-optt.htm#trace">Trace</a><br> <b>Up:</b> <a href="../html/qh-code.htm#TOC">Qhull code: Table of Contents</a><br> <b>To:</b> <a href="index.htm">Qhull functions</a>, macros, and data structures<br> @@ -40,7 +40,7 @@ top and bottom-level faces. A (<em>d-1</em>)-face is a <em>facet</em>, a (<em>d-2</em>)-face is a <em>ridge</em>, and a <em>0</em>-face is a <em>vertex</em>. For example in 3-d, a facet is a polygon and a ridge is an edge. A facet is built from a ridge (the <em>base</em>) -and a vertex (the <em>apex</em>). See +and a vertex (the <em>apex</em>). See <a href="../html/index.htm#structure">Qhull's data structures</a>.</p> <p>Qhull's primary data structure is a polyhedron. A @@ -80,7 +80,7 @@ three vertices and more than three neighbors. A nonsimplicial facet has a set of ridges and a centrum. </p> <p> A simplicial facet has an orientation. An <i>orientation</i> -is either <i>top</i> or <i>bottom</i>. +is either <i>top</i> or <i>bottom</i>. The flag, <tt>facet->toporient,</tt> defines the orientation of the facet's vertices. For example in 3-d, 'top' is left-handed orientation (i.e., the vertex order follows the direction @@ -110,25 +110,25 @@ plane is defined by <tt>facet->maxoutside</tt> while the inner plane is computed from the facet's vertices.</p> <p>Qhull 3.1 includes triangulation of non-simplicial facets -('<A href="../html/qh-optq.htm#Qt">Qt</A>'). +('<A href="../html/qh-optq.htm#Qt">Qt</A>'). These facets, called <i>tricoplanar</i>, share the same normal. centrum, and Voronoi center. One facet (keepcentrum) owns these data structures. -While tricoplanar facets are more accurate than the simplicial facets from +While tricoplanar facets are more accurate than the simplicial facets from joggled input, they may have zero area or flipped orientation. </blockquote> <p><b>Copyright © 1995-2010 C.B. Barber</b></p> <hr> -<p><a href="#TOP">»</a> <a href="qh-geom.htm#TOC">Geom</a> +<p><a href="#TOP">»</a> <a href="qh-geom.htm#TOC">Geom</a> <a name="TOC">•</a> <a href="qh-globa.htm#TOC">Global</a> • <a href="qh-io.htm#TOC">Io</a> • <a href="qh-mem.htm#TOC">Mem</a> • <a href="qh-merge.htm#TOC">Merge</a> • <b>Poly</b> • <a href="qh-qhull.htm#TOC">Qhull</a> • <a href="qh-set.htm#TOC">Set</a> • <a href="qh-stat.htm#TOC">Stat</a> • <a href="qh-user.htm#TOC">User</a> </p> -<h3>Index to <a href="poly.c">poly.c</a>, +<h3>Index to <a href="poly.c">poly.c</a>, <a href="poly2.c">poly2.c</a>, <a href="poly.h">poly.h</a>, and <a href="libqhull.h">libqhull.h</a></h3> <ul> @@ -272,7 +272,7 @@ facet_next </li> <li><a href="poly2.c#initialhull">qh_initialhull</a> construct the initial hull as a simplex of vertices </li> -<li><a href="poly2.c#nearcoplanar">qh_nearcoplanar</a> +<li><a href="poly2.c#nearcoplanar">qh_nearcoplanar</a> remove near-inside points from coplanar sets</li> <li><a href="poly2.c#prependfacet">qh_prependfacet</a> prepends facet to start of facetlist </li> @@ -447,22 +447,22 @@ print out facet list for debugging </li> <p><!-- Navigation links --> </p> <hr> -<p><b>Up:</b> +<p><b>Up:</b> <a href="http://www.qhull.org">Home page for Qhull</a> <br> <b>Up:</b> <a href="../html/index.htm#TOC">Qhull manual: Table of Contents</a> <br> <b>Up:</b> <a href="../html/qh-quick.htm#programs">Programs</a> -• <a href="../html/qh-quick.htm#options">Options</a> -• <a href="../html/qh-opto.htm#output">Output</a> -• <a href="../html/qh-optf.htm#format">Formats</a> -• <a href="../html/qh-optg.htm#geomview">Geomview</a> +• <a href="../html/qh-quick.htm#options">Options</a> +• <a href="../html/qh-opto.htm#output">Output</a> +• <a href="../html/qh-optf.htm#format">Formats</a> +• <a href="../html/qh-optg.htm#geomview">Geomview</a> • <a href="../html/qh-optp.htm#print">Print</a> -• <a href="../html/qh-optq.htm#qhull">Qhull</a> -• <a href="../html/qh-optc.htm#prec">Precision</a> +• <a href="../html/qh-optq.htm#qhull">Qhull</a> +• <a href="../html/qh-optc.htm#prec">Precision</a> • <a href="../html/qh-optt.htm#trace">Trace</a><br> <b>Up:</b> <a href="../html/qh-code.htm#TOC">Qhull code: Table of Contents</a> <br> <b>To:</b> <a href="index.htm">Qhull functions</a>, macros, and data structures<br> -<b>To:</b> <a href="qh-geom.htm">Geom</a> • +<b>To:</b> <a href="qh-geom.htm">Geom</a> • <a href="qh-globa.htm">Global</a> • <a href="qh-io.htm">Io</a> • <a href="qh-mem.htm">Mem</a> • <a href="qh-merge.htm">Merge</a> • <a href="qh-poly.htm">Poly</a> • <a href="qh-qhull.htm#TOC">Qhull</a> diff --git a/src/qh-qhull.htm b/src/qh-qhull.htm index 995a268..391234e 100644 --- a/src/qh-qhull.htm +++ b/src/qh-qhull.htm @@ -12,13 +12,13 @@ content="text/html; charset=iso-8859-1"> href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="../html/index.htm#TOC">Qhull manual</a>: Table of Contents <br> <b>Up:</b> <a href="../html/qh-quick.htm#programs">Programs</a> -• <a href="../html/qh-quick.htm#options">Options</a> -• <a href="../html/qh-opto.htm#output">Output</a> -• <a href="../html/qh-optf.htm#format">Formats</a> -• <a href="../html/qh-optg.htm#geomview">Geomview</a> +• <a href="../html/qh-quick.htm#options">Options</a> +• <a href="../html/qh-opto.htm#output">Output</a> +• <a href="../html/qh-optf.htm#format">Formats</a> +• <a href="../html/qh-optg.htm#geomview">Geomview</a> • <a href="../html/qh-optp.htm#print">Print</a> -• <a href="../html/qh-optq.htm#qhull">Qhull</a> -• <a href="../html/qh-optc.htm#prec">Precision</a> +• <a href="../html/qh-optq.htm#qhull">Qhull</a> +• <a href="../html/qh-optc.htm#prec">Precision</a> • <a href="../html/qh-optt.htm#trace">Trace</a><br> <b>Up:</b> <a href="../html/qh-code.htm#TOC">Qhull code: Table of Contents</a><br> <b>To:</b> <a href="index.htm">Qhull functions</a>, macros, and data structures<br> @@ -35,7 +35,7 @@ href="http://www.qhull.org">Home page</a> for Qhull<br> <p>Qhull implements the Quickhull algorithm for computing the convex hull. The Quickhull algorithm combines two well-known algorithms: the 2-d quickhull algorithm and -the n-d beneath-beyond algorithm. See +the n-d beneath-beyond algorithm. See <a href="../html/index.htm#description">Description of Qhull</a>. </p> <p>This section provides an index to the top-level functions and base data types. The top-level header file, <tt>libqhull.h</tt>, @@ -43,7 +43,7 @@ contains prototypes for these functions.</p> </blockquote> <p><b>Copyright © 1995-2010 C.B. Barber</b></p> <hr> -<p><a href="#TOP">»</a> <a href="qh-geom.htm#TOC">Geom</a> +<p><a href="#TOP">»</a> <a href="qh-geom.htm#TOC">Geom</a> <a name="TOC">•</a> <a href="qh-globa.htm#TOC">Global</a> • <a href="qh-io.htm#TOC">Io</a> • <a href="qh-mem.htm#TOC">Mem</a> • <a href="qh-merge.htm#TOC">Merge</a> • <a href="qh-poly.htm#TOC">Poly</a> @@ -51,7 +51,7 @@ contains prototypes for these functions.</p> • <a href="qh-stat.htm#TOC">Stat</a> • <a href="qh-user.htm#TOC">User</a> </p> <h3>Index to <a href="libqhull.c">libqhull.c</a>, -<a href="libqhull.h">libqhull.h</a>, and +<a href="libqhull.h">libqhull.h</a>, and <a href="unix.c">unix.c</a></h3> <ul> <li><a href="#qtype">libqhull.h and unix.c data types and @@ -80,7 +80,7 @@ formats for printing (qh.PRINTout) </li> for selecting everything </li> <li><a href="libqhull.h#qh_ERR">qh_ERR</a> Qhull exit codes for indicating errors </li> -<li><a href="libqhull.h#qh_FILEstderr">qh_FILEstderr</a> Fake stderr +<li><a href="libqhull.h#qh_FILEstderr">qh_FILEstderr</a> Fake stderr to distinguish error output from normal output [C++ only]</li> <li><a href="unix.c#prompt">qh_prompt</a> version and long prompt for Qhull</li> <li><a href="unix.c#prompt2">qh_prompt2</a> synopsis for Qhull</li> @@ -243,22 +243,22 @@ print all fields for a list of facets </li> <p><!-- Navigation links --> </p> <hr> -<p><b>Up:</b> +<p><b>Up:</b> <a href="http://www.qhull.org">Home page for Qhull</a> <br> <b>Up:</b> <a href="../html/index.htm#TOC">Qhull manual: Table of Contents</a> <br> <b>Up:</b> <a href="../html/qh-quick.htm#programs">Programs</a> -• <a href="../html/qh-quick.htm#options">Options</a> -• <a href="../html/qh-opto.htm#output">Output</a> -• <a href="../html/qh-optf.htm#format">Formats</a> -• <a href="../html/qh-optg.htm#geomview">Geomview</a> +• <a href="../html/qh-quick.htm#options">Options</a> +• <a href="../html/qh-opto.htm#output">Output</a> +• <a href="../html/qh-optf.htm#format">Formats</a> +• <a href="../html/qh-optg.htm#geomview">Geomview</a> • <a href="../html/qh-optp.htm#print">Print</a> -• <a href="../html/qh-optq.htm#qhull">Qhull</a> -• <a href="../html/qh-optc.htm#prec">Precision</a> +• <a href="../html/qh-optq.htm#qhull">Qhull</a> +• <a href="../html/qh-optc.htm#prec">Precision</a> • <a href="../html/qh-optt.htm#trace">Trace</a><br> <b>Up:</b> <a href="../html/qh-code.htm#TOC">Qhull code: Table of Contents</a> <br> <b>To:</b> <a href="index.htm">Qhull functions</a>, macros, and data structures<br> -<b>To:</b> <a href="qh-geom.htm">Geom</a> • +<b>To:</b> <a href="qh-geom.htm">Geom</a> • <a href="qh-globa.htm">Global</a> • <a href="qh-io.htm">Io</a> • <a href="qh-mem.htm">Mem</a> • <a href="qh-merge.htm">Merge</a> • <a href="qh-poly.htm">Poly</a> • <a href="qh-qhull.htm#TOC">Qhull</a> diff --git a/src/qh-set.htm b/src/qh-set.htm index d6c2451..bdc2f43 100644 --- a/src/qh-set.htm +++ b/src/qh-set.htm @@ -12,13 +12,13 @@ content="text/html; charset=iso-8859-1"> href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="../html/index.htm#TOC">Qhull manual</a>: Table of Contents <br> <b>Up:</b> <a href="../html/qh-quick.htm#programs">Programs</a> -• <a href="../html/qh-quick.htm#options">Options</a> -• <a href="../html/qh-opto.htm#output">Output</a> -• <a href="../html/qh-optf.htm#format">Formats</a> -• <a href="../html/qh-optg.htm#geomview">Geomview</a> +• <a href="../html/qh-quick.htm#options">Options</a> +• <a href="../html/qh-opto.htm#output">Output</a> +• <a href="../html/qh-optf.htm#format">Formats</a> +• <a href="../html/qh-optg.htm#geomview">Geomview</a> • <a href="../html/qh-optp.htm#print">Print</a> -• <a href="../html/qh-optq.htm#qhull">Qhull</a> -• <a href="../html/qh-optc.htm#prec">Precision</a> +• <a href="../html/qh-optq.htm#qhull">Qhull</a> +• <a href="../html/qh-optc.htm#prec">Precision</a> • <a href="../html/qh-optt.htm#trace">Trace</a><br> <b>Up:</b> <a href="../html/qh-code.htm#TOC">Qhull code: Table of Contents</a><br> <b>To:</b> <a href="index.htm">Qhull functions</a>, macros, and data structures<br> @@ -39,7 +39,7 @@ functions in Qhull. For this reason, efficiency is the primary concern. </p> <p>In Qhull, a <i>set</i> is represented by an unordered array of pointers with a maximum size and a NULL -terminator (<a href="qset.h#setT">setT</a>). +terminator (<a href="qset.h#setT">setT</a>). Most sets correspond to mathematical sets (i.e., the pointers are unique). Some sets are sorted to enforce uniqueness. Some sets are ordered. For example, @@ -62,14 +62,14 @@ a larger array. </p> </blockquote> <p><b>Copyright © 1995-2010 C.B. Barber</b></p> <hr> -<p><a href="#TOP">»</a> <a href="qh-geom.htm#TOC">Geom</a> +<p><a href="#TOP">»</a> <a href="qh-geom.htm#TOC">Geom</a> <a name="TOC">•</a> <a href="qh-globa.htm#TOC">Global</a> • <a href="qh-io.htm#TOC">Io</a> • <a href="qh-mem.htm#TOC">Mem</a> • <a href="qh-merge.htm#TOC">Merge</a> • <a href="qh-poly.htm#TOC">Poly</a> • <a href="qh-qhull.htm#TOC">Qhull</a> • <b>Set</b> • <a href="qh-stat.htm#TOC">Stat</a> • <a href="qh-user.htm#TOC">User</a> </p> -<h3>Index to <a href="qset.c">qset.c</a> and +<h3>Index to <a href="qset.c">qset.c</a> and <a href="qset.h">qset.h</a></h3> <ul> <li><a href="#stype">Data types and constants</a> </li> @@ -270,22 +270,22 @@ temporary) </li> <p><!-- Navigation links --> </p> <hr> -<p><b>Up:</b> +<p><b>Up:</b> <a href="http://www.qhull.org">Home page for Qhull</a> <br> <b>Up:</b> <a href="../html/index.htm#TOC">Qhull manual: Table of Contents</a> <br> <b>Up:</b> <a href="../html/qh-quick.htm#programs">Programs</a> -• <a href="../html/qh-quick.htm#options">Options</a> -• <a href="../html/qh-opto.htm#output">Output</a> -• <a href="../html/qh-optf.htm#format">Formats</a> -• <a href="../html/qh-optg.htm#geomview">Geomview</a> +• <a href="../html/qh-quick.htm#options">Options</a> +• <a href="../html/qh-opto.htm#output">Output</a> +• <a href="../html/qh-optf.htm#format">Formats</a> +• <a href="../html/qh-optg.htm#geomview">Geomview</a> • <a href="../html/qh-optp.htm#print">Print</a> -• <a href="../html/qh-optq.htm#qhull">Qhull</a> -• <a href="../html/qh-optc.htm#prec">Precision</a> +• <a href="../html/qh-optq.htm#qhull">Qhull</a> +• <a href="../html/qh-optc.htm#prec">Precision</a> • <a href="../html/qh-optt.htm#trace">Trace</a><br> <b>Up:</b> <a href="../html/qh-code.htm#TOC">Qhull code: Table of Contents</a> <br> <b>To:</b> <a href="index.htm">Qhull functions</a>, macros, and data structures<br> -<b>To:</b> <a href="qh-geom.htm">Geom</a> • +<b>To:</b> <a href="qh-geom.htm">Geom</a> • <a href="qh-globa.htm">Global</a> • <a href="qh-io.htm">Io</a> • <a href="qh-mem.htm">Mem</a> • <a href="qh-merge.htm">Merge</a> • <a href="qh-poly.htm">Poly</a> • <a href="qh-qhull.htm#TOC">Qhull</a> diff --git a/src/qh-stat.htm b/src/qh-stat.htm index e75e8f0..7fcf7ba 100644 --- a/src/qh-stat.htm +++ b/src/qh-stat.htm @@ -12,13 +12,13 @@ content="text/html; charset=iso-8859-1"> href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="../html/index.htm#TOC">Qhull manual</a>: Table of Contents <br> <b>Up:</b> <a href="../html/qh-quick.htm#programs">Programs</a> -• <a href="../html/qh-quick.htm#options">Options</a> -• <a href="../html/qh-opto.htm#output">Output</a> -• <a href="../html/qh-optf.htm#format">Formats</a> -• <a href="../html/qh-optg.htm#geomview">Geomview</a> +• <a href="../html/qh-quick.htm#options">Options</a> +• <a href="../html/qh-opto.htm#output">Output</a> +• <a href="../html/qh-optf.htm#format">Formats</a> +• <a href="../html/qh-optg.htm#geomview">Geomview</a> • <a href="../html/qh-optp.htm#print">Print</a> -• <a href="../html/qh-optq.htm#qhull">Qhull</a> -• <a href="../html/qh-optc.htm#prec">Precision</a> +• <a href="../html/qh-optq.htm#qhull">Qhull</a> +• <a href="../html/qh-optc.htm#prec">Precision</a> • <a href="../html/qh-optt.htm#trace">Trace</a><br> <b>Up:</b> <a href="../html/qh-code.htm#TOC">Qhull code: Table of Contents</a><br> <b>To:</b> <a href="index.htm">Qhull functions</a>, macros, and data structures<br> @@ -33,7 +33,7 @@ href="http://www.qhull.org">Home page</a> for Qhull<br> <h2>stat.c -- statistical operations</h2> <blockquote> <p>Qhull records many statistics. These functions and -macros make it inexpensive to add a statistic. +macros make it inexpensive to add a statistic. <p>As with Qhull's global variables, the statistics data structure is accessed by a macro, 'qhstat'. If qh_QHpointer is defined, the macro is 'qh_qhstat->', otherwise the macro is 'qh_qhstat.'. @@ -43,14 +43,14 @@ statistics are ignored.</p> </blockquote> <p><b>Copyright © 1995-2010 C.B. Barber</b></p> <hr> -<p><a href="#TOP">»</a> <a href="qh-geom.htm#TOC">Geom</a> +<p><a href="#TOP">»</a> <a href="qh-geom.htm#TOC">Geom</a> <a name="TOC">•</a> <a href="qh-globa.htm#TOC">Global</a> • <a href="qh-io.htm#TOC">Io</a> • <a href="qh-mem.htm#TOC">Mem</a> • <a href="qh-merge.htm#TOC">Merge</a> • <a href="qh-poly.htm#TOC">Poly</a> • <a href="qh-qhull.htm#TOC">Qhull</a> • <a href="qh-set.htm#TOC">Set</a> • <b>Stat</b> • <a href="qh-user.htm#TOC">User</a> </p> -<h3>Index to <a href="stat.c">stat.c</a> and +<h3>Index to <a href="stat.c">stat.c</a> and <a href="stat.h">stat.h</a></h3> <ul> <li><a href="#ttype">stat.h types</a> </li> @@ -127,22 +127,22 @@ standard deviation and average from statistics </li> <p><!-- Navigation links --> </p> <hr> -<p><b>Up:</b> +<p><b>Up:</b> <a href="http://www.qhull.org">Home page for Qhull</a> <br> <b>Up:</b> <a href="../html/index.htm#TOC">Qhull manual: Table of Contents</a> <br> <b>Up:</b> <a href="../html/qh-quick.htm#programs">Programs</a> -• <a href="../html/qh-quick.htm#options">Options</a> -• <a href="../html/qh-opto.htm#output">Output</a> -• <a href="../html/qh-optf.htm#format">Formats</a> -• <a href="../html/qh-optg.htm#geomview">Geomview</a> +• <a href="../html/qh-quick.htm#options">Options</a> +• <a href="../html/qh-opto.htm#output">Output</a> +• <a href="../html/qh-optf.htm#format">Formats</a> +• <a href="../html/qh-optg.htm#geomview">Geomview</a> • <a href="../html/qh-optp.htm#print">Print</a> -• <a href="../html/qh-optq.htm#qhull">Qhull</a> -• <a href="../html/qh-optc.htm#prec">Precision</a> +• <a href="../html/qh-optq.htm#qhull">Qhull</a> +• <a href="../html/qh-optc.htm#prec">Precision</a> • <a href="../html/qh-optt.htm#trace">Trace</a><br> <b>Up:</b> <a href="../html/qh-code.htm#TOC">Qhull code: Table of Contents</a> <br> <b>To:</b> <a href="index.htm">Qhull functions</a>, macros, and data structures<br> -<b>To:</b> <a href="qh-geom.htm">Geom</a> • +<b>To:</b> <a href="qh-geom.htm">Geom</a> • <a href="qh-globa.htm">Global</a> • <a href="qh-io.htm">Io</a> • <a href="qh-mem.htm">Mem</a> • <a href="qh-merge.htm">Merge</a> • <a href="qh-poly.htm">Poly</a> • <a href="qh-qhull.htm#TOC">Qhull</a> diff --git a/src/qh-user.htm b/src/qh-user.htm index 7de8426..3e881a7 100644 --- a/src/qh-user.htm +++ b/src/qh-user.htm @@ -12,13 +12,13 @@ content="text/html; charset=iso-8859-1"> href="http://www.qhull.org">Home page</a> for Qhull<br> <b>Up:</b> <a href="../html/index.htm#TOC">Qhull manual</a>: Table of Contents <br> <b>Up:</b> <a href="../html/qh-quick.htm#programs">Programs</a> -• <a href="../html/qh-quick.htm#options">Options</a> -• <a href="../html/qh-opto.htm#output">Output</a> -• <a href="../html/qh-optf.htm#format">Formats</a> -• <a href="../html/qh-optg.htm#geomview">Geomview</a> +• <a href="../html/qh-quick.htm#options">Options</a> +• <a href="../html/qh-opto.htm#output">Output</a> +• <a href="../html/qh-optf.htm#format">Formats</a> +• <a href="../html/qh-optg.htm#geomview">Geomview</a> • <a href="../html/qh-optp.htm#print">Print</a> -• <a href="../html/qh-optq.htm#qhull">Qhull</a> -• <a href="../html/qh-optc.htm#prec">Precision</a> +• <a href="../html/qh-optq.htm#qhull">Qhull</a> +• <a href="../html/qh-optc.htm#prec">Precision</a> • <a href="../html/qh-optt.htm#trace">Trace</a><br> <b>Up:</b> <a href="../html/qh-code.htm#TOC">Qhull code: Table of Contents</a><br> <b>To:</b> <a href="index.htm">Qhull functions</a>, macros, and data structures<br> @@ -37,14 +37,14 @@ user may want to change. </p> </blockquote> <p><b>Copyright © 1995-2010 C.B. Barber</b></p> <hr> -<p><a href="#TOP">»</a> <a href="qh-geom.htm#TOC">Geom</a> +<p><a href="#TOP">»</a> <a href="qh-geom.htm#TOC">Geom</a> <a name="TOC">•</a> <a href="qh-globa.htm#TOC">Global</a> • <a href="qh-io.htm#TOC">Io</a> • <a href="qh-mem.htm#TOC">Mem</a> • <a href="qh-merge.htm#TOC">Merge</a> • <a href="qh-poly.htm#TOC">Poly</a> • <a href="qh-qhull.htm#TOC">Qhull</a> • <a href="qh-set.htm#TOC">Set</a> • <a href="qh-stat.htm#TOC">Stat</a> • <b>User</b> </p> -<h3>Index to <a href="user.c">user.c</a>, <a href="user2.c">user2.c</a> and +<h3>Index to <a href="user.c">user.c</a>, <a href="user2.c">user2.c</a> and <a href="user.h">user.h</a></h3> <ul> <li><a href="#qulllib">qhull library constants</a></li> @@ -140,7 +140,7 @@ size of initial memory buffer </li> <h3><a href="qh-user.htm#TOC">»</a><a name="ucond">conditional compilation</a></h3> <ul> -<li><a href="user.h#compiler">compiler</a> defined symbols, +<li><a href="user.h#compiler">compiler</a> defined symbols, e.g., _STDC_ and _cplusplus <li><a href="user.h#COMPUTEfurthest">qh_COMPUTEfurthest</a> @@ -223,22 +223,22 @@ information from Rbox, sames as fprintf(). </li> <p><!-- Navigation links --> </p> <hr> -<p><b>Up:</b> +<p><b>Up:</b> <a href="http://www.qhull.org">Home page for Qhull</a> <br> <b>Up:</b> <a href="../html/index.htm#TOC">Qhull manual: Table of Contents</a> <br> <b>Up:</b> <a href="../html/qh-quick.htm#programs">Programs</a> -• <a href="../html/qh-quick.htm#options">Options</a> -• <a href="../html/qh-opto.htm#output">Output</a> -• <a href="../html/qh-optf.htm#format">Formats</a> -• <a href="../html/qh-optg.htm#geomview">Geomview</a> +• <a href="../html/qh-quick.htm#options">Options</a> +• <a href="../html/qh-opto.htm#output">Output</a> +• <a href="../html/qh-optf.htm#format">Formats</a> +• <a href="../html/qh-optg.htm#geomview">Geomview</a> • <a href="../html/qh-optp.htm#print">Print</a> -• <a href="../html/qh-optq.htm#qhull">Qhull</a> -• <a href="../html/qh-optc.htm#prec">Precision</a> +• <a href="../html/qh-optq.htm#qhull">Qhull</a> +• <a href="../html/qh-optc.htm#prec">Precision</a> • <a href="../html/qh-optt.htm#trace">Trace</a><br> <b>Up:</b> <a href="../html/qh-code.htm#TOC">Qhull code: Table of Contents</a> <br> <b>To:</b> <a href="index.htm">Qhull functions</a>, macros, and data structures<br> -<b>To:</b> <a href="qh-geom.htm">Geom</a> • +<b>To:</b> <a href="qh-geom.htm">Geom</a> • <a href="qh-globa.htm">Global</a> • <a href="qh-io.htm">Io</a> • <a href="qh-mem.htm">Mem</a> • <a href="qh-merge.htm">Merge</a> • <a href="qh-poly.htm">Poly</a> • <a href="qh-qhull.htm#TOC">Qhull</a> diff --git a/src/qhalf.c b/src/qhalf.c index fa5f7a7..9c04d63 100644 --- a/src/qhalf.c +++ b/src/qhalf.c @@ -35,21 +35,21 @@ extern "C" { #else int isatty(int); /* returns 1 if stdin is a tty - if "Undefined symbol" this can be deleted along with call in main() */ + if "Undefined symbol" this can be deleted along with call in main() */ #endif /*-<a href="qh-qhull.htm#TOC" >-------------------------------</a><a name="prompt">-</a> - qh_prompt + qh_prompt long prompt for qhull - + notes: restricted version of libqhull.c - + see: concise prompt below -*/ +*/ /* duplicated in qhalf.htm */ char hidden_options[]=" d n v Qbb QbB Qf Qg Qm Qr QR Qv Qx Qz TR E V Fa FA FC FD FS Ft FV Gt Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 "; @@ -146,7 +146,7 @@ Geomview output (2-d, 3-d and 4-d; dual convex hull)\n\ Gi - inner planes (i.e., halfspace intersections) only\n\ Gn - no planes\n\ Go - outer planes only\n\ - Gc - centrums\n\ + Gc - centrums\n\ Gh - hyperplane intersections\n\ Gr - ridges\n\ GDn - drop dimension n in 3-d and 4-d output\n\ @@ -171,8 +171,8 @@ Print options:\n\ >-------------------------------</a><a name="prompt2">-</a> qh_prompt2 - synopsis for qhull -*/ + synopsis for qhull +*/ char qh_prompt2[]= "\n\ qhalf- halfspace intersection about a point. Qhull %s\n\ input (stdin): [dim, 1, interior point], dim+1, n, coefficients+offset\n\ @@ -209,8 +209,8 @@ examples:\n\ >-------------------------------</a><a name="prompt3">-</a> qh_prompt3 - concise prompt for qhull -*/ + concise prompt for qhull +*/ char qh_prompt3[]= "\n\ Qhull %s.\n\ Except for 'F.' and 'PG', upper_case options take an argument.\n\ @@ -240,10 +240,10 @@ Except for 'F.' and 'PG', upper_case options take an argument.\n\ /*-<a href="qh-qhull.htm#TOC" >-------------------------------</a><a name="main">-</a> - + main( argc, argv ) processes the command line, calls qhull() to do the work, and exits - + design: initializes data structures reads points @@ -266,17 +266,17 @@ int main(int argc, char *argv[]) { SIOUXSettings.rows= 40; if (setvbuf(stdin, inBuf, _IOFBF, sizeof(inBuf)) < 0 /* w/o, SIOUX I/O is slow*/ || setvbuf(stdout, outBuf, _IOFBF, sizeof(outBuf)) < 0 - || (stdout != stderr && setvbuf(stderr, errBuf, _IOFBF, sizeof(errBuf)) < 0)) + || (stdout != stderr && setvbuf(stderr, errBuf, _IOFBF, sizeof(errBuf)) < 0)) fprintf(stderr, "qhull internal warning (main): could not change stdio to fully buffered.\n"); argc= ccommand(&argv); #endif - if ((argc == 1) && isatty( 0 /*stdin*/)) { + if ((argc == 1) && isatty( 0 /*stdin*/)) { fprintf(stdout, qh_prompt2, qh_version); exit(qh_ERRnone); } if (argc > 1 && *argv[1] == '-' && !*(argv[1]+1)) { - fprintf(stdout, qh_prompta, qh_version, + fprintf(stdout, qh_prompta, qh_version, qh_promptb, qh_promptc, qh_promptd, qh_prompte); exit(qh_ERRnone); } @@ -316,7 +316,7 @@ qhull error: options 'Qbk:n' and 'QBk:n' are not used with qhalf.\n\ #else qh_freeqhull( False); qh_memfreeshort(&curlong, &totlong); - if (curlong || totlong) + if (curlong || totlong) fprintf(stderr, "qhull internal warning (main): did not free %d bytes of long memory(%d pieces)\n", totlong, curlong); #endif diff --git a/src/qhull_a.h b/src/qhull_a.h index d5c6089..8bd2924 100644 --- a/src/qhull_a.h +++ b/src/qhull_a.h @@ -13,12 +13,12 @@ defines internal functions for libqhull.c global.c copyright (c) 1993-2010 The Geometry Center. - $Id: //product/qhull/main/rel/src/qhull_a.h#26 $$Change: 1151 $ - $DateTime: 2010/01/05 19:34:31 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/qhull_a.h#27 $$Change: 1164 $ + $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ Notes: grep for ((" and (" to catch fprintf("lkasdjf"); full parens around (x?y:z) - use '#include qhull/qhull_a.h' to avoid name clashes + use '#include qhull/qhull_a.h' to avoid name clashes */ #ifndef qhDEFqhulla @@ -112,40 +112,40 @@ inline void qhullUnused(T &x) { (void)x; } /***** -libqhull.c prototypes (alphabetical after qhull) ********************/ -void qh_qhull(void); +void qh_qhull(void); boolT qh_addpoint(pointT *furthest, facetT *facet, boolT checkdist); -void qh_buildhull(void); +void qh_buildhull(void); void qh_buildtracing(pointT *furthest, facetT *facet); void qh_build_withrestart(void); -void qh_errexit2(int exitcode, facetT *facet, facetT *otherfacet); +void qh_errexit2(int exitcode, facetT *facet, facetT *otherfacet); void qh_findhorizon(pointT *point, facetT *facet, int *goodvisible,int *goodhorizon); pointT *qh_nextfurthest(facetT **visible); -void qh_partitionall(setT *vertices, pointT *points,int npoints); +void qh_partitionall(setT *vertices, pointT *points,int npoints); void qh_partitioncoplanar(pointT *point, facetT *facet, realT *dist); void qh_partitionpoint(pointT *point, facetT *facet); -void qh_partitionvisible(boolT allpoints, int *numpoints); +void qh_partitionvisible(boolT allpoints, int *numpoints); void qh_precision(const char *reason); -void qh_printsummary(FILE *fp); +void qh_printsummary(FILE *fp); /***** -global.c internal prototypes (alphabetical) ***********************/ void qh_appendprint(qh_PRINT format); -void qh_freebuild(boolT allmem); -void qh_freebuffers(void); +void qh_freebuild(boolT allmem); +void qh_freebuffers(void); void qh_initbuffers(coordT *points, int numpoints, int dim, boolT ismalloc); /***** -stat.c internal prototypes (alphabetical) ***********************/ -void qh_allstatA(void); -void qh_allstatB(void); -void qh_allstatC(void); -void qh_allstatD(void); -void qh_allstatE(void); -void qh_allstatE2 (void); -void qh_allstatF(void); -void qh_allstatG(void); -void qh_allstatH(void); -void qh_freebuffers(void); +void qh_allstatA(void); +void qh_allstatB(void); +void qh_allstatC(void); +void qh_allstatD(void); +void qh_allstatE(void); +void qh_allstatE2 (void); +void qh_allstatF(void); +void qh_allstatG(void); +void qh_allstatH(void); +void qh_freebuffers(void); void qh_initbuffers(coordT *points, int numpoints, int dim, boolT ismalloc); #endif /* qhDEFqhulla */ diff --git a/src/qset.c b/src/qset.c index 3984721..08082b4 100644 --- a/src/qset.c +++ b/src/qset.c @@ -1,4 +1,3 @@ - /*<html><pre> -<a href="qh-set.htm" >-------------------------------</a><a name="TOP">-</a> @@ -8,8 +7,8 @@ see qh-set.htm and qset.h copyright (c) 1993-2010 The Geometry Center. - $Id: //product/qhull/main/rel/src/qset.c#28 $$Change: 1150 $ - $DateTime: 2010/01/04 22:43:14 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/qset.c#29 $$Change: 1164 $ + $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ */ #include "qset.h" @@ -25,7 +24,7 @@ typedef struct ridgeT ridgeT; typedef struct facetT facetT; void qh_errexit(int exitcode, facetT *, ridgeT *); -void qh_fprintf(FILE *fp, int msgcode, const char *fmt, ... ); +void qh_fprintf(FILE *fp, int msgcode, const char *fmt, ... ); # ifdef _MSC_VER /* Microsoft Visual C++ -- warning level 4 */ # pragma warning( disable : 4127) /* conditional expression is constant */ # pragma warning( disable : 4706) /* assignment within conditional function */ @@ -35,13 +34,13 @@ void qh_fprintf(FILE *fp, int msgcode, const char *fmt, ... ); /*=============== internal macros ===========================*/ /*============ functions in alphabetical order ===================*/ - + /*-<a href="qh-set.htm#TOC" >--------------------------------<a name="setaddnth">-</a> - + qh_setaddnth( setp, nth, newelem) adds newelem as n'th element of sorted or unsorted *setp - + notes: *setp and newelem must be defined *setp may be a temp set @@ -78,15 +77,15 @@ void qh_setaddnth(setT **setp, int nth, void *newelem) { /*-<a href="qh-set.htm#TOC" >--------------------------------<a name="setaddsorted">-</a> - + setaddsorted( setp, newelem ) adds an newelem into sorted *setp - + notes: *setp and newelem must be defined *setp may be a temp set nop if newelem already in set - + design: find newelem's position in *setp insert newelem @@ -109,7 +108,7 @@ void qh_setaddsorted(setT **setp, void *newelem) { /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="setappend">-</a> - + qh_setappend( setp, newelem) append newelem to *setp @@ -120,7 +119,7 @@ void qh_setaddsorted(setT **setp, void *newelem) { design: expand *setp if empty or full append newelem to *setp - + */ void qh_setappend(setT **setp, void *newelem) { int *sizep, end_idx; @@ -138,8 +137,8 @@ void qh_setappend(setT **setp, void *newelem) { /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="setappend_set">-</a> - - qh_setappend_set( setp, setA) + + qh_setappend_set( setp, setA) appends setA to *setp notes: @@ -149,7 +148,7 @@ void qh_setappend(setT **setp, void *newelem) { design: setup for copy expand *setp if it is too small - append all elements of setA to *setp + append all elements of setA to *setp */ void qh_setappend_set(setT **setp, setT *setA) { int *sizep, sizeA, size; @@ -172,14 +171,14 @@ void qh_setappend_set(setT **setp, setT *setA) { sizep= SETsizeaddr_(*setp); } *sizep= size+sizeA+1; /* memcpy may overwrite */ - if (sizeA > 0) + if (sizeA > 0) memcpy((char *)&((*setp)->e[size].p), (char *)&(setA->e[0].p), (size_t)(sizeA+1) * SETelemsize); } /* setappend_set */ /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="setappend2ndlast">-</a> - + qh_setappend2ndlast( setp, newelem ) makes newelem the next to the last element in *setp @@ -196,7 +195,7 @@ void qh_setappend_set(setT **setp, setT *setA) { void qh_setappend2ndlast(setT **setp, void *newelem) { int *sizep; void **endp, **lastp; - + if (!*setp || !*(sizep= SETsizeaddr_(*setp))) { qh_setlarger(setp); sizep= SETsizeaddr_(*setp); @@ -211,8 +210,8 @@ void qh_setappend2ndlast(setT **setp, void *newelem) { /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="setcheck">-</a> - - qh_setcheck( set, typename, id ) + + qh_setcheck( set, typename, id ) check set for validity report errors with typename and id @@ -229,11 +228,11 @@ void qh_setcheck(setT *set, const char *tname, unsigned id) { maxsize= set->maxsize; if (size > maxsize || !maxsize) { qh_fprintf(qhmem.ferr, 6172, "qhull internal error (qh_setcheck): actual size %d of %s%d is greater than max size %d\n", - size, tname, id, maxsize); + size, tname, id, maxsize); waserr= 1; }else if (set->e[size].p) { qh_fprintf(qhmem.ferr, 6173, "qhull internal error (qh_setcheck): %s%d(size %d max %d) is not null terminated.\n", - tname, id, maxsize, size-1); + tname, id, maxsize, size-1); waserr= 1; } if (waserr) { @@ -245,7 +244,7 @@ void qh_setcheck(setT *set, const char *tname, unsigned id) { /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="setcompact">-</a> - + qh_setcompact( set ) remove internal NULLs from an unsorted set @@ -258,7 +257,7 @@ void qh_setcheck(setT *set, const char *tname, unsigned id) { design: setup pointers into set - skip NULLs while copying elements to start of set + skip NULLs while copying elements to start of set update the actual size */ void qh_setcompact(setT *set) { @@ -274,7 +273,7 @@ void qh_setcompact(setT *set) { if (!(*destp++ = *elemp++)) { destp--; if (elemp > endp) - break; + break; } } qh_settruncate(set, (int)(destp-firstp)); /* WARN64 */ @@ -283,7 +282,7 @@ void qh_setcompact(setT *set) { /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="setcopy">-</a> - + qh_setcopy( set, extra ) make a copy of a sorted or unsorted set with extra slots @@ -293,7 +292,7 @@ void qh_setcompact(setT *set) { design: create a newset with extra slots copy the elements to the newset - + */ setT *qh_setcopy(setT *set, int extra) { setT *newset; @@ -311,19 +310,19 @@ setT *qh_setcopy(setT *set, int extra) { /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="setdel">-</a> - + qh_setdel( set, oldelem ) delete oldelem from an unsorted set returns: returns oldelem if found returns NULL otherwise - + notes: set may be NULL oldelem must not be NULL; only deletes one copy of oldelem in set - + design: locate oldelem update actual size if it was full @@ -353,8 +352,8 @@ void *qh_setdel(setT *set, void *oldelem) { /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="setdellast">-</a> - - qh_setdellast( set) + + qh_setdellast( set) return last element of set or NULL notes: @@ -366,14 +365,14 @@ void *qh_setdel(setT *set, void *oldelem) { if full set delete last element and set actual size else - delete last element and update actual size + delete last element and update actual size */ void *qh_setdellast(setT *set) { int setsize; /* actually, actual_size + 1 */ int maxsize; int *sizep; void *returnvalue; - + if (!set || !(set->e[0].p)) return NULL; sizep= SETsizeaddr_(set); @@ -393,9 +392,9 @@ void *qh_setdellast(setT *set) { /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="setdelnth">-</a> - + qh_setdelnth( set, nth ) - deletes nth element from unsorted set + deletes nth element from unsorted set 0 is first element returns: @@ -431,23 +430,23 @@ void *qh_setdelnth(setT *set, int nth) { /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="setdelnthsorted">-</a> - + qh_setdelnthsorted( set, nth ) deletes nth element from sorted set returns: returns the element (use type conversion) - + notes: errors if nth invalid - - see also: + + see also: setnew_delnthsorted design: setup points and check nth copy remaining elements down one - update actual size + update actual size */ void *qh_setdelnthsorted(setT *set, int nth) { void **newp, **oldp, *elem; @@ -472,20 +471,20 @@ void *qh_setdelnthsorted(setT *set, int nth) { /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="setdelsorted">-</a> - + qh_setdelsorted( set, oldelem ) deletes oldelem from sorted set returns: returns oldelem if it was deleted - + notes: set may be NULL design: locate oldelem in set copy remaining elements down one - update actual size + update actual size */ void *qh_setdelsorted(setT *set, void *oldelem) { void **newp, **oldp; @@ -511,7 +510,7 @@ void *qh_setdelsorted(setT *set, void *oldelem) { /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="setduplicate">-</a> - + qh_setduplicate( set, elemsize ) duplicate a set of elemsize elements @@ -525,10 +524,10 @@ void *qh_setdelsorted(setT *set, void *oldelem) { append newelem to newset */ setT *qh_setduplicate(setT *set, int elemsize) { - void *elem, **elemp, *newElem; - setT *newSet; - int size; - + void *elem, **elemp, *newElem; + setT *newSet; + int size; + if (!(size= qh_setsize(set))) return NULL; newSet= qh_setnew(size); @@ -543,7 +542,7 @@ setT *qh_setduplicate(setT *set, int elemsize) { /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="setequal">-</a> - + qh_setequal( ) returns 1 if two sorted sets are equal, otherwise returns 0 @@ -558,7 +557,7 @@ setT *qh_setduplicate(setT *set, int elemsize) { int qh_setequal(setT *setA, setT *setB) { void **elemAp, **elemBp; int sizeA, sizeB; - + SETreturnsize_(setA, sizeA); SETreturnsize_(setB, sizeB); if (sizeA != sizeB) @@ -575,17 +574,17 @@ int qh_setequal(setT *setA, setT *setB) { /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="setequal_except">-</a> - + qh_setequal_except( setA, skipelemA, setB, skipelemB ) returns 1 if sorted setA and setB are equal except for skipelemA & B returns: false if either skipelemA or skipelemB are missing - + notes: neither set may be NULL - if skipelemB is NULL, + if skipelemB is NULL, can skip any one element of setB design: @@ -616,18 +615,18 @@ int qh_setequal_except(setT *setA, void *skipelemA, setT *setB, void *skipelemB) } if (!*elemA) break; - if (*elemA++ != *elemB++) + if (*elemA++ != *elemB++) return 0; } if (skip != 2 || *elemB) return 0; return 1; } /* setequal_except */ - + /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="setequal_skip">-</a> - + qh_setequal_skip( setA, skipA, setB, skipB ) returns 1 if sorted setA and setB are equal except for elements skipA & B @@ -655,24 +654,24 @@ int qh_setequal_skip(setT *setA, int skipA, setT *setB, int skipB) { elemB++; if (!*elemA) break; - if (*elemA++ != *elemB++) + if (*elemA++ != *elemB++) return 0; } if (*elemB) return 0; return 1; } /* setequal_skip */ - + /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="setfree">-</a> - + qh_setfree( setp ) frees the space occupied by a sorted or unsorted set returns: sets setp to NULL - + notes: set may be NULL @@ -683,9 +682,9 @@ int qh_setequal_skip(setT *setA, int skipA, setT *setB, int skipB) { void qh_setfree(setT **setp) { int size; void **freelistp; /* used !qh_NOmem */ - + if (*setp) { - size= sizeof(setT) + ((*setp)->maxsize)*SETelemsize; + size= sizeof(setT) + ((*setp)->maxsize)*SETelemsize; if (size <= qhmem.LASTsize) { qh_memfree_(*setp, size, freelistp); }else @@ -697,7 +696,7 @@ void qh_setfree(setT **setp) { /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="setfree2">-</a> - + qh_setfree2( setp, elemsize ) frees the space occupied by a set and its elements @@ -706,39 +705,39 @@ void qh_setfree(setT **setp) { design: free each element - free set + free set */ void qh_setfree2 (setT **setp, int elemsize) { - void *elem, **elemp; - + void *elem, **elemp; + FOREACHelem_(*setp) qh_memfree(elem, elemsize); qh_setfree(setp); } /* setfree2 */ - + /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="setfreelong">-</a> - + qh_setfreelong( setp ) frees a set only if it's in long memory returns: sets setp to NULL if it is freed - + notes: set may be NULL design: if set is large - free it + free it */ void qh_setfreelong(setT **setp) { int size; - + if (*setp) { - size= sizeof(setT) + ((*setp)->maxsize)*SETelemsize; + size= sizeof(setT) + ((*setp)->maxsize)*SETelemsize; if (size > qhmem.LASTsize) { qh_memfree(*setp, size); *setp= NULL; @@ -749,7 +748,7 @@ void qh_setfreelong(setT **setp) { /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="setin">-</a> - + qh_setin( set, setelem ) returns 1 if setelem is in a set, 0 otherwise @@ -772,9 +771,9 @@ int qh_setin(setT *set, void *setelem) { /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="setindex">-</a> - + qh_setindex( set, atelem ) - returns the index of atelem in set. + returns the index of atelem in set. returns -1, if not in set or maxsize wrong notes: @@ -803,7 +802,7 @@ int qh_setindex(setT *set, void *atelem) { /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="setlarger">-</a> - + qh_setlarger( oldsetp ) returns a larger set that contains all elements of *oldsetp @@ -833,12 +832,12 @@ void qh_setlarger(setT **oldsetp) { memcpy((char *)newp, (char *)oldp, (size_t)(size+1) * SETelemsize); sizep= SETsizeaddr_(newset); *sizep= size+1; - FOREACHset_((setT *)qhmem.tempstack) { + FOREACHset_(qhmem.tempstack) { if (set == oldset) - *(setp-1)= newset; + *(setp-1)= newset; } qh_setfree(oldsetp); - }else + }else newset= qh_setnew(3); *oldsetp= newset; } /* setlarger */ @@ -846,7 +845,7 @@ void qh_setlarger(setT **oldsetp) { /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="setlast">-</a> - + qh_setlast( ) return last element of set or NULL (use type conversion) @@ -854,14 +853,14 @@ void qh_setlarger(setT **oldsetp) { set may be NULL design: - return last element + return last element */ void *qh_setlast(setT *set) { int size; if (set) { size= *SETsizeaddr_(set); - if (!size) + if (!size) return SETelem_(set, set->maxsize - 1); else if (size > 1) return SETelem_(set, size - 2); @@ -872,7 +871,7 @@ void *qh_setlast(setT *set) { /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="setnew">-</a> - + qh_setnew( setsize ) creates and allocates space for a set @@ -898,7 +897,7 @@ setT *qh_setnew(int setsize) { qh_memalloc_(size, freelistp, set, setT); #ifndef qh_NOmem sizereceived= qhmem.sizetable[ qhmem.indextable[size]]; - if (sizereceived > size) + if (sizereceived > size) setsize += (sizereceived - size)/SETelemsize; #endif }else @@ -912,7 +911,7 @@ setT *qh_setnew(int setsize) { /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="setnew_delnthsorted">-</a> - + qh_setnew_delnthsorted( set, size, nth, prepend ) creates a sorted set not containing nth element if prepend, the first prepend elements are undefined @@ -1003,7 +1002,7 @@ setT *qh_setnew_delnthsorted(setT *set, int size, int nth, int prepend) { /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="setprint">-</a> - + qh_setprint( fp, string, set ) print set elements to fp with identifying string @@ -1018,7 +1017,7 @@ void qh_setprint(FILE *fp, const char* string, setT *set) { else { SETreturnsize_(set, size); qh_fprintf(fp, 9347, "%s set=%p maxsize=%d size=%d elems=", - string, set, set->maxsize, size); + string, set, set->maxsize, size); if (size > set->maxsize) size= set->maxsize+1; for (k=0; k < size; k++) @@ -1029,7 +1028,7 @@ void qh_setprint(FILE *fp, const char* string, setT *set) { /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="setreplace">-</a> - + qh_setreplace( set, oldelem, newelem ) replaces oldelem in set with newelem @@ -1043,7 +1042,7 @@ void qh_setprint(FILE *fp, const char* string, setT *set) { */ void qh_setreplace(setT *set, void *oldelem, void *newelem) { void **elemp; - + elemp= SETaddr_(set, void); while (*elemp != oldelem && *elemp) elemp++; @@ -1060,7 +1059,7 @@ void qh_setreplace(setT *set, void *oldelem, void *newelem) { /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="setsize">-</a> - + qh_setsize( set ) returns the size of a set @@ -1074,7 +1073,7 @@ void qh_setreplace(setT *set, void *oldelem, void *newelem) { */ int qh_setsize(setT *set) { int size, *sizep; - + if (!set) return(0); sizep= SETsizeaddr_(set); @@ -1082,7 +1081,7 @@ int qh_setsize(setT *set) { size--; if (size > set->maxsize) { qh_fprintf(qhmem.ferr, 6178, "qhull internal error (qh_setsize): current set size %d is greater than maximum size %d\n", - size, set->maxsize); + size, set->maxsize); qh_setprint(qhmem.ferr, "set: ", set); qh_errexit(qhmem_ERRqhull, NULL, NULL); } @@ -1104,29 +1103,29 @@ int qh_setsize(setT *set) { design: allocate set append to qhmem.tempstack - + */ setT *qh_settemp(int setsize) { setT *newset; - + newset= qh_setnew(setsize); - qh_setappend((setT **)&qhmem.tempstack, newset); + qh_setappend(&qhmem.tempstack, newset); if (qhmem.IStracing >= 5) qh_fprintf(qhmem.ferr, 8123, "qh_settemp: temp set %p of %d elements, depth %d\n", - newset, newset->maxsize, qh_setsize((setT*)qhmem.tempstack)); + newset, newset->maxsize, qh_setsize(qhmem.tempstack)); return newset; } /* settemp */ /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="settempfree">-</a> - + qh_settempfree( set ) free temporary set at top of qhmem.tempstack notes: nop if set is NULL errors if set not from previous qh_settemp - + to locate errors: use 'T2' to find source and then find mis-matching qh_settemp @@ -1143,8 +1142,8 @@ void qh_settempfree(setT **set) { if (stackedset != *set) { qh_settemppush(stackedset); qh_fprintf(qhmem.ferr, 6179, "qhull internal error (qh_settempfree): set %p(size %d) was not last temporary allocated(depth %d, set %p, size %d)\n", - *set, qh_setsize(*set), qh_setsize((setT*)qhmem.tempstack)+1, - stackedset, qh_setsize(stackedset)); + *set, qh_setsize(*set), qh_setsize(qhmem.tempstack)+1, + stackedset, qh_setsize(stackedset)); qh_errexit(qhmem_ERRqhull, NULL, NULL); } qh_setfree(set); @@ -1152,7 +1151,7 @@ void qh_settempfree(setT **set) { /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="settempfree_all">-</a> - + qh_settempfree_all( ) free all temporary sets in qhmem.tempstack @@ -1164,40 +1163,40 @@ void qh_settempfree(setT **set) { void qh_settempfree_all(void) { setT *set, **setp; - FOREACHset_((setT *)qhmem.tempstack) + FOREACHset_(qhmem.tempstack) qh_setfree(&set); - qh_setfree((setT **)&qhmem.tempstack); + qh_setfree(&qhmem.tempstack); } /* settempfree_all */ /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="settemppop">-</a> - + qh_settemppop( ) - pop and return temporary set from qhmem.tempstack + pop and return temporary set from qhmem.tempstack notes: the returned set is permanent - + design: pop and check top of qhmem.tempstack */ setT *qh_settemppop(void) { setT *stackedset; - - stackedset= (setT*)qh_setdellast((setT *)qhmem.tempstack); + + stackedset= (setT*)qh_setdellast(qhmem.tempstack); if (!stackedset) { qh_fprintf(qhmem.ferr, 6180, "qhull internal error (qh_settemppop): pop from empty temporary stack\n"); qh_errexit(qhmem_ERRqhull, NULL, NULL); } if (qhmem.IStracing >= 5) qh_fprintf(qhmem.ferr, 8124, "qh_settemppop: depth %d temp set %p of %d elements\n", - qh_setsize((setT*)qhmem.tempstack)+1, stackedset, qh_setsize(stackedset)); + qh_setsize(qhmem.tempstack)+1, stackedset, qh_setsize(stackedset)); return stackedset; } /* settemppop */ /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="settemppush">-</a> - + qh_settemppush( set ) push temporary set unto qhmem.tempstack (makes it temporary) @@ -1205,26 +1204,26 @@ setT *qh_settemppop(void) { duplicates settemp() for tracing design: - append set to tempstack + append set to tempstack */ void qh_settemppush(setT *set) { - - qh_setappend((setT**)&qhmem.tempstack, set); + + qh_setappend(&qhmem.tempstack, set); if (qhmem.IStracing >= 5) qh_fprintf(qhmem.ferr, 8125, "qh_settemppush: depth %d temp set %p of %d elements\n", - qh_setsize((setT*)qhmem.tempstack), set, qh_setsize(set)); + qh_setsize(qhmem.tempstack), set, qh_setsize(set)); } /* settemppush */ - + /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="settruncate">-</a> - + qh_settruncate( set, size ) truncate set to size elements notes: set must be defined - + see: SETtruncate_ @@ -1242,10 +1241,10 @@ void qh_settruncate(setT *set, int size) { set->e[set->maxsize].i= size+1; /* maybe overwritten */ set->e[size].p= NULL; } /* settruncate */ - + /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="setunique">-</a> - + qh_setunique( set, elem ) add elem to unsorted set unless it is already in set @@ -1264,10 +1263,10 @@ int qh_setunique(setT **set, void *elem) { } return 0; } /* setunique */ - + /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="setzero">-</a> - + qh_setzero( set, index, size ) zero elements from index on set actual size of set to size @@ -1275,14 +1274,14 @@ int qh_setunique(setT **set, void *elem) { notes: set must be defined the set becomes an indexed set (can not use FOREACH...) - + see also: qh_settruncate - + design: check index and size update actual size - zero elements starting at e[index] + zero elements starting at e[index] */ void qh_setzero(setT *set, int idx, int size) { int count; diff --git a/src/qset.h b/src/qset.h index 613caf8..611040b 100644 --- a/src/qset.h +++ b/src/qset.h @@ -5,20 +5,20 @@ header file for qset.c that implements set see qh-set.htm and qset.c - + only uses mem.c, malloc/free for error handling, writes message and calls qh_errexit(qhmem_ERRqhull, NULL, NULL); - + set operations satisfy the following properties: - sets have a max size, the actual size (if different) is stored at the end - every set is NULL terminated - sets may be sorted or unsorted, the caller must distinguish this - + copyright (c) 1993-2010 The Geometry Center. - $Id: //product/qhull/main/rel/src/qset.h#19 $$Change: 1150 $ - $DateTime: 2010/01/04 22:43:14 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/qset.h#20 $$Change: 1164 $ + $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ */ #ifndef qhDEFset @@ -35,38 +35,38 @@ typedef struct setT setT; /* a set is a sorted or unsorted array of pointers * /*-<a href="qh-set.htm#TOC" >----------------------------------------</a><a name="setT">-</a> - + setT a set or list of pointers with maximum size and actual size. variations: unsorted, unique -- a list of unique pointers with NULL terminator - user guarantees uniqueness - sorted -- a sorted list of unique pointers with NULL terminator - qset.c guarantees uniqueness + user guarantees uniqueness + sorted -- a sorted list of unique pointers with NULL terminator + qset.c guarantees uniqueness unsorted -- a list of pointers terminated with NULL - indexed -- an array of pointers with NULL elements + indexed -- an array of pointers with NULL elements structure for set of n elements: - -------------- - | maxsize - -------------- - | e[0] - a pointer, may be NULL for indexed sets - -------------- - | e[1] - - -------------- - | ... - -------------- - | e[n-1] - -------------- - | e[n] = NULL - -------------- - | ... - -------------- - | e[maxsize] - n+1 or NULL (determines actual size of set) - -------------- + -------------- + | maxsize + -------------- + | e[0] - a pointer, may be NULL for indexed sets + -------------- + | e[1] + + -------------- + | ... + -------------- + | e[n-1] + -------------- + | e[n] = NULL + -------------- + | ... + -------------- + | e[maxsize] - n+1 or NULL (determines actual size of set) + -------------- */ @@ -81,38 +81,38 @@ union setelemT { struct setT { int maxsize; /* maximum number of elements (except NULL) */ setelemT e[1]; /* array of pointers, tail is NULL */ - /* last slot (unless NULL) is actual size+1 + /* last slot (unless NULL) is actual size+1 e[maxsize]==NULL or e[e[maxsize]-1]==NULL */ /* this may generate a warning since e[] contains - maxsize elements */ + maxsize elements */ }; /*=========== -constants- =========================*/ /*-<a href="qh-set.htm#TOC" >-----------------------------------</a><a name="SETelemsize">-</a> - + SETelemsize size of a set element in bytes */ -#define SETelemsize ((int)sizeof(setelemT)) +#define SETelemsize ((int)sizeof(setelemT)) /*=========== -macros- =========================*/ /*-<a href="qh-set.htm#TOC" >-----------------------------------</a><a name="FOREACHsetelement_">-</a> - + FOREACHsetelement_(type, set, variable) define FOREACH iterator - declare: + declare: assumes *variable and **variablep are declared no space in "variable)" [DEC Alpha cc compiler] each iteration: variable is set element - variablep is one beyond variable. + variablep is one beyond variable. to repeat an element: variablep--; / *repeat* / @@ -120,22 +120,22 @@ struct setT { at exit: variable is NULL at end of loop - example: + example: #define FOREACHfacet_( facets ) FOREACHsetelement_( facetT, facets, facet ) notes: use FOREACHsetelement_i_() if need index or include NULLs - WARNING: + WARNING: nested loops can't use the same variable (define another FOREACH) - + needs braces if nested inside another FOREACH this includes intervening blocks, e.g. FOREACH...{ if () FOREACH...} ) */ #define FOREACHsetelement_(type, set, variable) \ if (((variable= NULL), set)) for (\ variable##p= (type **)&((set)->e[0].p); \ - (variable= *variable##p++);) + (variable= *variable##p++);) /*-<a href="qh-set.htm#TOC" >----------------------------------------</a><a name="FOREACHsetelement_i_">-</a> @@ -143,7 +143,7 @@ struct setT { FOREACHsetelement_i_(type, set, variable) define indexed FOREACH iterator - declare: + declare: type *variable, variable_n, variable_i; each iteration: @@ -158,10 +158,10 @@ struct setT { example: #define FOREACHfacet_i_( facets ) FOREACHsetelement_i_( facetT, facets, facet ) - - WARNING: + + WARNING: nested loops can't use the same variable (define another FOREACH) - + needs braces if nested inside another FOREACH this includes intervening blocks, e.g. FOREACH...{ if () FOREACH...} ) */ @@ -175,10 +175,10 @@ struct setT { /*-<a href="qh-set.htm#TOC" >--------------------------------------</a><a name="FOREACHsetelementreverse_">-</a> - FOREACHsetelementreverse_(type, set, variable)- + FOREACHsetelementreverse_(type, set, variable)- define FOREACH iterator in reverse order - declare: + declare: assumes *variable and **variablep are declared also declare 'int variabletemp' @@ -193,36 +193,36 @@ struct setT { example: #define FOREACHvertexreverse_( vertices ) FOREACHsetelementreverse_( vertexT, vertices, vertex ) - + notes: use FOREACHsetelementreverse12_() to reverse first two elements WARNING: needs braces if nested inside another FOREACH */ #define FOREACHsetelementreverse_(type, set, variable) \ if (((variable= NULL), set)) for (\ - variable##temp= qh_setsize(set)-1, variable= qh_setlast(set);\ - variable; variable= \ - ((--variable##temp >= 0) ? SETelemt_(set, variable##temp, type) : NULL)) + variable##temp= qh_setsize(set)-1, variable= qh_setlast(set);\ + variable; variable= \ + ((--variable##temp >= 0) ? SETelemt_(set, variable##temp, type) : NULL)) /*-<a href="qh-set.htm#TOC" >-----------------------------------</a><a name="FOREACHsetelementreverse12_">-</a> - FOREACHsetelementreverse12_(type, set, variable)- + FOREACHsetelementreverse12_(type, set, variable)- define FOREACH iterator with e[1] and e[0] reversed - declare: + declare: assumes *variable and **variablep are declared each iteration: variable is set element - variablep is one after variable. + variablep is one after variable. to repeat an element: variablep--; / *repeat* / at exit: variable is NULL at end of loop - + example #define FOREACHvertexreverse12_( vertices ) FOREACHsetelementreverse12_( vertexT, vertices, vertex ) @@ -232,17 +232,17 @@ struct setT { #define FOREACHsetelementreverse12_(type, set, variable) \ if (((variable= NULL), set)) for (\ variable##p= (type **)&((set)->e[1].p); \ - (variable= *variable##p); \ + (variable= *variable##p); \ variable##p == ((type **)&((set)->e[0].p))?variable##p += 2: \ - (variable##p == ((type **)&((set)->e[1].p))?variable##p--:variable##p++)) + (variable##p == ((type **)&((set)->e[1].p))?variable##p--:variable##p++)) /*-<a href="qh-set.htm#TOC" >-----------------------------------</a><a name="FOREACHelem_">-</a> - FOREACHelem_( set )- + FOREACHelem_( set )- iterate elements in a set - declare: + declare: void *elem, *elemp; each iteration: @@ -254,10 +254,10 @@ struct setT { at exit: elem == NULL at end of loop - + example: FOREACHelem_(set) { - + notes: WARNING: needs braces if nested inside another FOREACH */ @@ -266,10 +266,10 @@ struct setT { /*-<a href="qh-set.htm#TOC" >-----------------------------------</a><a name="FOREACHset_">-</a> - FOREACHset_( set )- + FOREACHset_( set )- iterate a set of sets - declare: + declare: setT *set, **setp; each iteration: @@ -281,10 +281,10 @@ struct setT { at exit: set == NULL at end of loop - + example FOREACHset_(sets) { - + notes: WARNING: needs braces if nested inside another FOREACH */ @@ -296,7 +296,7 @@ struct setT { SETindex_( set, elem ) return index of elem in set - notes: + notes: for use with FOREACH iteration WARN64 -- Maximum set size is 2G @@ -321,7 +321,7 @@ struct setT { SETelem_(set, n) return the n'th element of set - + notes: assumes that n is valid [0..size] and that set is defined use SETelemt_() for type cast @@ -333,7 +333,7 @@ struct setT { SETelemt_(set, n, type) return the n'th element of set as a type - + notes: assumes that n is valid [0..size] and that set is defined */ @@ -344,9 +344,9 @@ struct setT { SETelemaddr_(set, n, type) return address of the n'th element of a set - + notes: - assumes that n is valid [0..size] and set is defined + assumes that n is valid [0..size] and set is defined */ #define SETelemaddr_(set, n, type) ((type **)(&((set)->e[n].p))) @@ -355,7 +355,7 @@ struct setT { SETfirst_(set) return first element of set - + */ #define SETfirst_(set) ((set)->e[0].p) @@ -364,7 +364,7 @@ struct setT { SETfirstt_(set, type) return first element of set as a type - + */ #define SETfirstt_(set, type) ((type*)((set)->e[0].p)) @@ -373,7 +373,7 @@ struct setT { SETsecond_(set) return second element of set - + */ #define SETsecond_(set) ((set)->e[1].p) @@ -391,14 +391,14 @@ struct setT { SETaddr_(set, type) return address of set's elements */ -#define SETaddr_(set,type) ((type **)(&((set)->e[0].p))) +#define SETaddr_(set,type) ((type **)(&((set)->e[0].p))) /*-<a href="qh-set.htm#TOC" >---------------------------------------</a><a name="SETreturnsize_">-</a> - SETreturnsize_(set, size) + SETreturnsize_(set, size) return size of a set - + notes: set must be defined use qh_setsize(set) unless speed is critical @@ -408,20 +408,20 @@ struct setT { /*-<a href="qh-set.htm#TOC" >---------------------------------------</a><a name="SETempty_">-</a> - SETempty_(set) + SETempty_(set) return true(1) if set is empty - + notes: set may be NULL */ -#define SETempty_(set) (!set || (SETfirst_(set) ? 0 : 1)) +#define SETempty_(set) (!set || (SETfirst_(set) ? 0 : 1)) /*-<a href="qh-set.htm#TOC" >-------------------------------<a name="SETsizeaddr_">-</a> - - SETsizeaddr_(set) + + SETsizeaddr_(set) return pointer to 'actual size+1' of set (set CANNOT be NULL!!) - + notes: *SETsizeaddr==NULL or e[*SETsizeaddr-1].p==NULL */ @@ -435,7 +435,7 @@ struct setT { see: qh_settruncate() - + */ #define SETtruncate_(set, size) {set->e[set->maxsize].i= size+1; /* maybe overwritten */ \ set->e[size].p= NULL;} diff --git a/src/qvoronoi.c b/src/qvoronoi.c index 3893ba3..9a09fdb 100644 --- a/src/qvoronoi.c +++ b/src/qvoronoi.c @@ -36,21 +36,21 @@ extern "C" { #else int isatty(int); /* returns 1 if stdin is a tty - if "Undefined symbol" this can be deleted along with call in main() */ + if "Undefined symbol" this can be deleted along with call in main() */ #endif /*-<a href="qh-qhull.htm#TOC" >-------------------------------</a><a name="prompt">-</a> - qh_prompt + qh_prompt long prompt for qhull - + notes: restricted version of libqhull.c - + see: concise prompt below -*/ +*/ /* duplicated in qvoron_f.htm and qvoronoi.htm */ char hidden_options[]=" d n m v H U Qb QB Qc Qf Qg Qi Qm Qr QR Qv Qx TR E V Fa FA FC Fp FS Ft FV Pv Gt Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 "; @@ -141,7 +141,7 @@ Geomview options (2-d only)\n\ Gi - inner planes only\n\ Gn - no planes\n\ Go - outer planes only\n\ - Gc - centrums\n\ + Gc - centrums\n\ Gh - hyperplane intersections\n\ Gr - ridges\n\ GDn - drop dimension n in 3-d and 4-d output\n\ @@ -166,8 +166,8 @@ Print options:\n\ >-------------------------------</a><a name="prompt2">-</a> qh_prompt2 - synopsis for qhull -*/ + synopsis for qhull +*/ char qh_prompt2[]= "\n\ qvoronoi- compute the Voronoi diagram. Qhull %s\n\ input (stdin): dimension, number of points, point coordinates\n\ @@ -206,8 +206,8 @@ rbox c P0 D2 | qvoronoi s Fv QV0\n\ >-------------------------------</a><a name="prompt3">-</a> qh_prompt3 - concise prompt for qhull -*/ + concise prompt for qhull +*/ char qh_prompt3[]= "\n\ Qhull %s.\n\ Except for 'F.' and 'PG', upper-case options take an argument.\n\ @@ -237,10 +237,10 @@ Except for 'F.' and 'PG', upper-case options take an argument.\n\ /*-<a href="qh-qhull.htm#TOC" >-------------------------------</a><a name="main">-</a> - + main( argc, argv ) processes the command line, calls qhull() to do the work, and exits - + design: initializes data structures reads points @@ -263,18 +263,18 @@ int main(int argc, char *argv[]) { SIOUXSettings.rows= 40; if (setvbuf(stdin, inBuf, _IOFBF, sizeof(inBuf)) < 0 /* w/o, SIOUX I/O is slow*/ || setvbuf(stdout, outBuf, _IOFBF, sizeof(outBuf)) < 0 - || (stdout != stderr && setvbuf(stderr, errBuf, _IOFBF, sizeof(errBuf)) < 0)) + || (stdout != stderr && setvbuf(stderr, errBuf, _IOFBF, sizeof(errBuf)) < 0)) fprintf(stderr, "qhull internal warning (main): could not change stdio to fully buffered.\n"); argc= ccommand(&argv); #endif - if ((argc == 1) && isatty( 0 /*stdin*/)) { + if ((argc == 1) && isatty( 0 /*stdin*/)) { fprintf(stdout, qh_prompt2, qh_version); exit(qh_ERRnone); } if (argc > 1 && *argv[1] == '-' && !*(argv[1]+1)) { fprintf(stdout, qh_prompta, qh_version, - qh_promptb, qh_promptc, qh_promptd, qh_prompte); + qh_promptb, qh_promptc, qh_promptd, qh_prompte); exit(qh_ERRnone); } if (argc >1 && *argv[1] == '.' && !*(argv[1]+1)) { @@ -286,7 +286,7 @@ int main(int argc, char *argv[]) { if (!exitcode) { qh_option("voronoi _bbound-last _coplanar-keep", NULL, NULL); qh DELAUNAY= True; /* 'v' */ - qh VORONOI= True; + qh VORONOI= True; qh SCALElast= True; /* 'Qbb' */ qh_checkflags(qh qhull_command, hidden_options); qh_initflags(qh qhull_command); @@ -309,7 +309,7 @@ int main(int argc, char *argv[]) { #else qh_freeqhull( False); qh_memfreeshort(&curlong, &totlong); - if (curlong || totlong) + if (curlong || totlong) fprintf(stderr, "qhull internal warning (main): did not free %d bytes of long memory(%d pieces)\n", totlong, curlong); #endif diff --git a/src/random.c b/src/random.c index 7772c8c..30a67e9 100644 --- a/src/random.c +++ b/src/random.c @@ -22,7 +22,7 @@ qh_argv_to_command( argc, argv, command, max_size ) build command from argc/argv - max_size is at least + max_size is at least returns: a space-delimited string of options (just as typed) @@ -43,16 +43,16 @@ int qh_argv_to_command(int argc, char *argv[], char* command, int max_size) { if (argc) { if ((s= strrchr( argv[0], '\\')) /* get filename w/o .exe extension */ || (s= strrchr( argv[0], '/'))) - s++; + s++; else - s= argv[0]; + s= argv[0]; if ((int)strlen(s) < max_size) /* WARN64 */ - strcpy(command, s); + strcpy(command, s); else - goto error_argv; + goto error_argv; if ((s= strstr(command, ".EXE")) || (s= strstr(command, ".exe"))) - *s= '\0'; + *s= '\0'; } for (i=1; i < argc; i++) { s= argv[i]; @@ -95,7 +95,7 @@ error_argv: qh_argv_to_command_size( argc, argv ) return size to allocate for qh_argv_to_command() - + notes: argc may be 0 actual size is usually shorter @@ -104,7 +104,7 @@ int qh_argv_to_command_size(int argc, char *argv[]) { unsigned int count= 1; /* null-terminator if argc==0 */ int i; char *s; - + for (i=0; i<argc; i++){ count += (int)strlen(argv[i]) + 1; /* WARN64 */ if (i>0 && strchr(argv[i], ' ')) { @@ -153,9 +153,9 @@ int qh_rand( void) { lo = seed % qh_rand_q; /* seed mod q */ test = qh_rand_a * lo - qh_rand_r * hi; if (test > 0) - seed= test; + seed= test; else - seed= test + qh_rand_m; + seed= test + qh_rand_m; qh_rand_seed= seed; /* seed = seed < qh_RANDOMmax/2 ? 0 : qh_RANDOMmax; for testing */ /* seed = qh_RANDOMmax; for testing */ @@ -164,11 +164,11 @@ int qh_rand( void) { void qh_srand( int seed) { if (seed < 1) - qh_rand_seed= 1; + qh_rand_seed= 1; else if (seed >= qh_rand_m) - qh_rand_seed= qh_rand_m - 1; + qh_rand_seed= qh_rand_m - 1; else - qh_rand_seed= seed; + qh_rand_seed= seed; } /* qh_srand */ /*-<a href="qh-geom.htm#TOC" @@ -206,11 +206,11 @@ void qh_randommatrix(realT *buffer, int dim, realT **rows) { coord= buffer; rowi= rows; for (i=0; i < dim; i++) { - *(rowi++)= coord; - for (k=0; k < dim; k++) { - realr= qh_RANDOMint; - *(coord++)= 2.0 * realr/(qh_RANDOMmax+1) - 1.0; - } + *(rowi++)= coord; + for (k=0; k < dim; k++) { + realr= qh_RANDOMint; + *(coord++)= 2.0 * realr/(qh_RANDOMmax+1) - 1.0; + } } *rowi= coord; } /* randommatrix */ diff --git a/src/random.h b/src/random.h index cb20ab6..5a0ecd5 100644 --- a/src/random.h +++ b/src/random.h @@ -1,14 +1,14 @@ /*<html><pre> -<a href="qh-geom.htm" >-------------------------------</a><a name="TOP">-</a> - random.h + random.h header file for random routines see qh-geom.htm and random.c copyright (c) 1993-2010 The Geometry Center. - $Id: //product/qhull/main/rel/src/random.h#10 $$Change: 1137 $ - $DateTime: 2010/01/02 21:58:11 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/random.h#11 $$Change: 1164 $ + $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ */ #ifndef qhDEFrandom @@ -19,7 +19,7 @@ /*============= prototypes in alphabetical order ======= */ -int qh_argv_to_command(int argc, char *argv[], char* command, int max_size); +int qh_argv_to_command(int argc, char *argv[], char* command, int max_size); int qh_argv_to_command_size(int argc, char *argv[]); int qh_rand( void); void qh_srand( int seed); diff --git a/src/rbox.c b/src/rbox.c index f1bb9d4..27ba50f 100644 --- a/src/rbox.c +++ b/src/rbox.c @@ -3,7 +3,7 @@ rbox.c rbox program for generating input points for qhull. - + notes: 50 points generated for 'rbox D4' @@ -73,7 +73,7 @@ int main(int argc, char **argv) { SIOUXSettings.rows= 40; if (setvbuf(stdin, inBuf, _IOFBF, sizeof(inBuf)) < 0 /* w/o, SIOUX I/O is slow*/ || setvbuf(stdout, outBuf, _IOFBF, sizeof(outBuf)) < 0 - || (stdout != stderr && setvbuf(stderr, errBuf, _IOFBF, sizeof(errBuf)) < 0)) + || (stdout != stderr && setvbuf(stderr, errBuf, _IOFBF, sizeof(errBuf)) < 0)) fprintf(stderr, "qhull internal warning (main): could not change stdio to fully buffered.\n"); argc= ccommand(&argv); #endif diff --git a/src/rboxlib.c b/src/rboxlib.c index 8442d7e..e9064be 100644 --- a/src/rboxlib.c +++ b/src/rboxlib.c @@ -3,12 +3,12 @@ rboxlib.c Generate input points - + notes: For documentation, see prompt[] of rbox.c 50 points generated for 'rbox D4' - WARNING: + WARNING: incorrect range if qh_RANDOMmax is defined wrong (user.h) */ @@ -39,7 +39,7 @@ void out1( double a); void out2n( double a, double b); void out3n( double a, double b, double c); -void qh_fprintf_rbox(FILE *fp, int msgcode, const char *fmt, ... ); +void qh_fprintf_rbox(FILE *fp, int msgcode, const char *fmt, ... ); void qh_free(void *mem); void *qh_malloc(size_t size); int qh_rand( void); @@ -74,7 +74,7 @@ rboxT rbox; 1 (qh_ERRinput) on input error 4 (qh_ERRmem) on memory error 5 (qh_ERRqhull) on internal error - + notes: To avoid stdio, redefine qh_malloc, qh_free, and qh_fprintf_rbox (user.c) @@ -102,7 +102,7 @@ int qh_rboxpoints(FILE* fout, FILE* ferr, char* rbox_command) { double anglediff, angle, x, y, cube= 0.0, diamond= 0.0; double box= qh_DEFAULTbox; /* scale all numbers before output */ double randmax= qh_RANDOMmax; - char command[200], seedbuf[200]; + char command[200], seedbuf[200]; char *s= command, *t, *first_point= NULL; time_t timedata; int exitcode; @@ -119,7 +119,7 @@ int qh_rboxpoints(FILE* fout, FILE* ferr, char* rbox_command) { if (exitcode) { /* same code for error exit and normal return */ if (simplex) - qh_free(simplex); + qh_free(simplex); rbox_inuse= False; return exitcode; } @@ -146,17 +146,17 @@ int qh_rboxpoints(FILE* fout, FILE* ferr, char* rbox_command) { addcube= 1; t= s; while (isspace(*t)) - t++; + t++; if (*t == 'G') - cube= qh_strtod(++t, &s); + cube= qh_strtod(++t, &s); break; case 'd': adddiamond= 1; t= s; while (isspace(*t)) - t++; + t++; if (*t == 'G') - diamond= qh_strtod(++t, &s); + diamond= qh_strtod(++t, &s); break; case 'h': iscdd= 1; @@ -178,7 +178,7 @@ int qh_rboxpoints(FILE* fout, FILE* ferr, char* rbox_command) { if (isdigit(*s)) { seed= qh_strtol(s, &s); israndom= 0; - }else + }else israndom= 1; break; case 'x': @@ -204,46 +204,46 @@ int qh_rboxpoints(FILE* fout, FILE* ferr, char* rbox_command) { break; case 'G': if (isdigit(*s)) - gap= qh_strtod(s, &s); + gap= qh_strtod(s, &s); else - gap= 0.5; + gap= 0.5; isgap= 1; break; case 'L': if (isdigit(*s)) - radius= qh_strtod(s, &s); + radius= qh_strtod(s, &s); else - radius= 10; + radius= 10; islens= 1; break; case 'M': ismesh= 1; if (*s) - meshn= qh_strtod(s, &s); + meshn= qh_strtod(s, &s); if (*s == ',') { ++s; meshm= qh_strtod(s, &s); }else - meshm= 0.0; + meshm= 0.0; if (*s == ',') { ++s; meshr= qh_strtod(s, &s); }else - meshr= sqrt(meshn*meshn + meshm*meshm); + meshr= sqrt(meshn*meshn + meshm*meshm); if (*s && !isspace(*s)) { - qh_fprintf_rbox(rbox.ferr, 7069, "rbox warning: assuming 'M3,4,5' since mesh args are not integers or reals\n"); - meshn= 3.0, meshm=4.0, meshr=5.0; + qh_fprintf_rbox(rbox.ferr, 7069, "rbox warning: assuming 'M3,4,5' since mesh args are not integers or reals\n"); + meshn= 3.0, meshm=4.0, meshr=5.0; } break; case 'O': rbox.out_offset= qh_strtod(s, &s); break; case 'P': - if (!first_point) + if (!first_point) first_point= s-1; addpoints++; while (*s && !isspace(*s)) /* read points later */ - s++; + s++; break; case 'W': width= qh_strtod(s, &s); @@ -251,9 +251,9 @@ int qh_rboxpoints(FILE* fout, FILE* ferr, char* rbox_command) { break; case 'Z': if (isdigit(*s)) - radius= qh_strtod(s, &s); + radius= qh_strtod(s, &s); else - radius= 1.0; + radius= 1.0; isaxis= 1; break; default: @@ -283,13 +283,13 @@ int qh_rboxpoints(FILE* fout, FILE* ferr, char* rbox_command) { diamondsize= 0; if (islens) { if (isaxis) { - qh_fprintf_rbox(rbox.ferr, 6190, "rbox error: can not combine 'Ln' with 'Zn'\n"); - qh_errexit_rbox(qh_ERRinput); + qh_fprintf_rbox(rbox.ferr, 6190, "rbox error: can not combine 'Ln' with 'Zn'\n"); + qh_errexit_rbox(qh_ERRinput); } if (radius <= 1.0) { - qh_fprintf_rbox(rbox.ferr, 6191, "rbox error: lens radius %.2g should be greater than 1.0\n", - radius); - qh_errexit_rbox(qh_ERRinput); + qh_fprintf_rbox(rbox.ferr, 6191, "rbox error: lens radius %.2g should be greater than 1.0\n", + radius); + qh_errexit_rbox(qh_ERRinput); } lensangle= asin(1.0/radius); lensbase= radius * cos(lensangle); @@ -297,18 +297,18 @@ int qh_rboxpoints(FILE* fout, FILE* ferr, char* rbox_command) { if (!numpoints) { if (issimplex2) - ; /* ok */ + ; /* ok */ else if (isregular + issimplex + islens + issphere + isaxis + isspiral + iswidth + ismesh) { - qh_fprintf_rbox(rbox.ferr, 6192, "rbox error: missing count\n"); - qh_errexit_rbox(qh_ERRinput); + qh_fprintf_rbox(rbox.ferr, 6192, "rbox error: missing count\n"); + qh_errexit_rbox(qh_ERRinput); }else if (adddiamond + addcube + addpoints) - ; /* ok */ - else { - numpoints= 50; /* ./rbox D4 is the test case */ - issphere= 1; + ; /* ok */ + else { + numpoints= 50; /* ./rbox D4 is the test case */ + issphere= 1; } } - if ((issimplex + islens + isspiral + ismesh > 1) + if ((issimplex + islens + isspiral + ismesh > 1) || (issimplex + issphere + isspiral + ismesh > 1)) { qh_fprintf_rbox(rbox.ferr, 6193, "rbox error: can only specify one of 'l', 's', 'x', 'Ln', or 'Mn,m,r' ('Ln s' is ok).\n"); qh_errexit_rbox(qh_ERRinput); @@ -322,11 +322,11 @@ int qh_rboxpoints(FILE* fout, FILE* ferr, char* rbox_command) { else if (isregular) { totpoints= numpoints; if (dim == 2) { - if (islens) - totpoints += numpoints - 2; + if (islens) + totpoints += numpoints - 2; }else if (dim == 3) { - if (islens) - totpoints += 2 * numpoints; + if (islens) + totpoints += 2 * numpoints; else if (isgap) totpoints += 1 + numpoints; else @@ -340,9 +340,9 @@ int qh_rboxpoints(FILE* fout, FILE* ferr, char* rbox_command) { if (istime == 0) { for (s=command; *s; s++) { if (issimplex2 && *s == 'y') /* make 'y' same seed as 'x' */ - i= 'x'; + i= 'x'; else - i= *s; + i= *s; seed= 11*seed + i; } }else if (israndom) { @@ -357,9 +357,9 @@ int qh_rboxpoints(FILE* fout, FILE* ferr, char* rbox_command) { /* ============= print header =============== */ - if (iscdd) - qh_fprintf_rbox(rbox.fout, 9391, "%s\nbegin\n %d %d %s\n", - NOcommand ? "" : command, + if (iscdd) + qh_fprintf_rbox(rbox.fout, 9391, "%s\nbegin\n %d %d %s\n", + NOcommand ? "" : command, totpoints, dim+1, rbox.isinteger ? "integer" : "real"); else if (NOcommand) @@ -372,29 +372,29 @@ int qh_rboxpoints(FILE* fout, FILE* ferr, char* rbox_command) { while (s && *s) { /* 'P' */ count= 0; if (iscdd) - out1( 1.0); + out1( 1.0); while (*++s) { - out1( qh_strtod(s, &s)); - count++; - if (isspace(*s) || !*s) - break; - if (*s != ',') { - qh_fprintf_rbox(rbox.ferr, 6194, "rbox error: missing comma after coordinate in %s\n\n", s); - qh_errexit_rbox(qh_ERRinput); - } + out1( qh_strtod(s, &s)); + count++; + if (isspace(*s) || !*s) + break; + if (*s != ',') { + qh_fprintf_rbox(rbox.ferr, 6194, "rbox error: missing comma after coordinate in %s\n\n", s); + qh_errexit_rbox(qh_ERRinput); + } } if (count < dim) { - for (k=dim-count; k--; ) - out1( 0.0); + for (k=dim-count; k--; ) + out1( 0.0); }else if (count > dim) { - qh_fprintf_rbox(rbox.ferr, 6195, "rbox error: %d coordinates instead of %d coordinates in %s\n\n", - count, dim, s); - qh_errexit_rbox(qh_ERRinput); + qh_fprintf_rbox(rbox.ferr, 6195, "rbox error: %d coordinates instead of %d coordinates in %s\n\n", + count, dim, s); + qh_errexit_rbox(qh_ERRinput); } qh_fprintf_rbox(rbox.fout, 9394, "\n"); while ((s= strchr(s, 'P'))) { - if (isspace(s[-1])) - break; + if (isspace(s[-1])) + break; } } } @@ -421,8 +421,8 @@ int qh_rboxpoints(FILE* fout, FILE* ferr, char* rbox_command) { } } } - if (issimplex2) { - simplexp= simplex; + if (issimplex2) { + simplexp= simplex; for (i=0; i<dim+1; i++) { if (iscdd) out1( 1.0); @@ -432,7 +432,7 @@ int qh_rboxpoints(FILE* fout, FILE* ferr, char* rbox_command) { } } for (j=0; j<numpoints; j++) { - if (iswidth) + if (iswidth) apex= qh_RANDOMint % (dim+1); else apex= -1; @@ -454,7 +454,7 @@ int qh_rboxpoints(FILE* fout, FILE* ferr, char* rbox_command) { coord[k] /= norm; if (iscdd) out1( 1.0); - for (k=0; k < dim; k++) + for (k=0; k < dim; k++) out1( coord[k] * box); qh_fprintf_rbox(rbox.fout, 9396, "\n"); } @@ -469,18 +469,18 @@ int qh_rboxpoints(FILE* fout, FILE* ferr, char* rbox_command) { mult[k]= 0; for (i=0; i < numpoints; i++) { for (k=0; k < dim; k++) { - if (k == 0) - out1( mult[0] * meshn + mult[1] * (-meshm)); - else if (k == 1) - out1( mult[0] * meshm + mult[1] * meshn); - else - out1( mult[k] * meshr ); + if (k == 0) + out1( mult[0] * meshn + mult[1] * (-meshm)); + else if (k == 1) + out1( mult[0] * meshm + mult[1] * meshn); + else + out1( mult[k] * meshr ); } qh_fprintf_rbox(rbox.fout, 9397, "\n"); for (k=0; k < dim; k++) { - if (++mult[k] < nthroot) - break; - mult[k]= 0; + if (++mult[k] < nthroot) + break; + mult[k]= 0; } } } @@ -511,29 +511,29 @@ int qh_rboxpoints(FILE* fout, FILE* ferr, char* rbox_command) { x= radius * cos(angle); y= radius * sin(angle); if (dim == 2) { - if (iscdd) - out1( 1.0); + if (iscdd) + out1( 1.0); out2n( x*box, y*box); }else { - norm= sqrt(1.0 + x*x + y*y); - if (iscdd) - out1( 1.0); - out3n( box*x/norm, box*y/norm, box/norm); - if (isgap) { - x *= 1-gap; - y *= 1-gap; - norm= sqrt(1.0 + x*x + y*y); - if (iscdd) + norm= sqrt(1.0 + x*x + y*y); + if (iscdd) + out1( 1.0); + out3n( box*x/norm, box*y/norm, box/norm); + if (isgap) { + x *= 1-gap; + y *= 1-gap; + norm= sqrt(1.0 + x*x + y*y); + if (iscdd) out1( 1.0); - out3n( box*x/norm, box*y/norm, box/norm); - } + out3n( box*x/norm, box*y/norm, box/norm); + } } } } /* ============= regular points for 'r Ln D2' =============== */ else if (isregular && islens && dim == 2) { double cos_0; - + angle= lensangle; anglediff= 2 * lensangle/(numpoints - 1); cos_0= cos(lensangle); @@ -584,12 +584,12 @@ int qh_rboxpoints(FILE* fout, FILE* ferr, char* rbox_command) { if (isaxis) { gendim= dim-1; if (iscdd) - out1( 1.0); + out1( 1.0); for (j=0; j < gendim; j++) - out1( 0.0); + out1( 0.0); out1( -box); qh_fprintf_rbox(rbox.fout, 9398, "\n"); - }else if (islens) + }else if (islens) gendim= dim-1; else gendim= dim; @@ -597,68 +597,68 @@ int qh_rboxpoints(FILE* fout, FILE* ferr, char* rbox_command) { for (i=0; i < numpoints; i++) { norm= 0.0; for (j=0; j < gendim; j++) { - randr= qh_RANDOMint; - coord[j]= 2.0 * randr/randmax - 1.0; - norm += coord[j] * coord[j]; + randr= qh_RANDOMint; + coord[j]= 2.0 * randr/randmax - 1.0; + norm += coord[j] * coord[j]; } norm= sqrt(norm); /* ============= dim-1 point of 'Zn' distribution ========== */ if (isaxis) { - if (!isgap) { - isgap= 1; - gap= 1.0; - } - randr= qh_RANDOMint; - rangap= 1.0 - gap * randr/randmax; - factor= radius * rangap / norm; - for (j=0; j<gendim; j++) - coord[j]= factor * coord[j]; + if (!isgap) { + isgap= 1; + gap= 1.0; + } + randr= qh_RANDOMint; + rangap= 1.0 - gap * randr/randmax; + factor= radius * rangap / norm; + for (j=0; j<gendim; j++) + coord[j]= factor * coord[j]; /* ============= dim-1 point of 'Ln s' distribution =========== */ }else if (islens && issphere) { - if (!isgap) { - isgap= 1; - gap= 1.0; - } - randr= qh_RANDOMint; - rangap= 1.0 - gap * randr/randmax; - factor= rangap / norm; - for (j=0; j<gendim; j++) - coord[j]= factor * coord[j]; + if (!isgap) { + isgap= 1; + gap= 1.0; + } + randr= qh_RANDOMint; + rangap= 1.0 - gap * randr/randmax; + factor= rangap / norm; + for (j=0; j<gendim; j++) + coord[j]= factor * coord[j]; /* ============= dim-1 point of 'Ln' distribution ========== */ }else if (islens && !issphere) { - if (!isgap) { - isgap= 1; - gap= 1.0; - } - j= qh_RANDOMint % gendim; - if (coord[j] < 0) - coord[j]= -1.0 - coord[j] * gap; - else - coord[j]= 1.0 - coord[j] * gap; + if (!isgap) { + isgap= 1; + gap= 1.0; + } + j= qh_RANDOMint % gendim; + if (coord[j] < 0) + coord[j]= -1.0 - coord[j] * gap; + else + coord[j]= 1.0 - coord[j] * gap; /* ============= point of 'l' distribution =============== */ }else if (isspiral) { - if (dim != 3) { - qh_fprintf_rbox(rbox.ferr, 6199, "rbox error: spiral distribution is available only in 3d\n\n"); - longjmp(rbox.errexit,qh_ERRinput); - } - coord[0]= cos(2*PI*i/(numpoints - 1)); - coord[1]= sin(2*PI*i/(numpoints - 1)); - coord[2]= 2.0*(double)i/(double)(numpoints-1) - 1.0; + if (dim != 3) { + qh_fprintf_rbox(rbox.ferr, 6199, "rbox error: spiral distribution is available only in 3d\n\n"); + longjmp(rbox.errexit,qh_ERRinput); + } + coord[0]= cos(2*PI*i/(numpoints - 1)); + coord[1]= sin(2*PI*i/(numpoints - 1)); + coord[2]= 2.0*(double)i/(double)(numpoints-1) - 1.0; /* ============= point of 's' distribution =============== */ }else if (issphere) { - factor= 1.0/norm; - if (iswidth) { - randr= qh_RANDOMint; - factor *= 1.0 - width * randr/randmax; - } - for (j=0; j<dim; j++) - coord[j]= factor * coord[j]; + factor= 1.0/norm; + if (iswidth) { + randr= qh_RANDOMint; + factor *= 1.0 - width * randr/randmax; + } + for (j=0; j<dim; j++) + coord[j]= factor * coord[j]; } /* ============= project 'Zn s' point in to sphere =============== */ if (isaxis && issphere) { - coord[dim-1]= 1.0; - norm= 1.0; - for (j=0; j<gendim; j++) + coord[dim-1]= 1.0; + norm= 1.0; + for (j=0; j<gendim; j++) norm += coord[j] * coord[j]; norm= sqrt(norm); for (j=0; j<dim; j++) @@ -673,7 +673,7 @@ int qh_rboxpoints(FILE* fout, FILE* ferr, char* rbox_command) { coord[dim-1]= 2.0 * randr/randmax - 1.0; /* ============= project 'Ln' point out to sphere =============== */ }else if (islens) { - coord[dim-1]= lensbase; + coord[dim-1]= lensbase; for (j=0, norm= 0; j<dim; j++) norm += coord[j] * coord[j]; norm= sqrt(norm); @@ -697,7 +697,7 @@ int qh_rboxpoints(FILE* fout, FILE* ferr, char* rbox_command) { /* ============= write point =============== */ if (iscdd) out1( 1.0); - for (k=0; k < dim; k++) + for (k=0; k < dim; k++) out1( coord[k] * box); qh_fprintf_rbox(rbox.fout, 9399, "\n"); } @@ -709,10 +709,10 @@ int qh_rboxpoints(FILE* fout, FILE* ferr, char* rbox_command) { if (iscdd) out1( 1.0); for (k=dim-1; k>=0; k--) { - if (j & ( 1 << k)) - out1( cube); - else - out1( -cube); + if (j & ( 1 << k)) + out1( cube); + else + out1( -cube); } qh_fprintf_rbox(rbox.fout, 9400, "\n"); } @@ -724,12 +724,12 @@ int qh_rboxpoints(FILE* fout, FILE* ferr, char* rbox_command) { if (iscdd) out1( 1.0); for (k=dim-1; k>=0; k--) { - if (j/2 != k) - out1( 0.0); - else if (j & 0x1) - out1( diamond); - else - out1( -diamond); + if (j/2 != k) + out1( 0.0); + else if (j & 0x1) + out1( diamond); + else + out1( -diamond); } qh_fprintf_rbox(rbox.fout, 9401, "\n"); } @@ -766,7 +766,7 @@ int roundi( double a) { void out1(double a) { - if (rbox.isinteger) + if (rbox.isinteger) qh_fprintf_rbox(rbox.fout, 9403, "%d ", roundi( a+rbox.out_offset)); else qh_fprintf_rbox(rbox.fout, 9404, qh_REAL_1, a+rbox.out_offset); @@ -780,7 +780,7 @@ void out2n( double a, double b) { qh_fprintf_rbox(rbox.fout, 9406, qh_REAL_2n, a+rbox.out_offset, b+rbox.out_offset); } /* out2n */ -void out3n( double a, double b, double c) { +void out3n( double a, double b, double c) { if (rbox.isinteger) qh_fprintf_rbox(rbox.fout, 9407, "%d %d %d\n", roundi(a+rbox.out_offset), roundi(b+rbox.out_offset), roundi(c+rbox.out_offset)); diff --git a/src/stat.c b/src/stat.c index 225f1af..ac158c8 100644 --- a/src/stat.c +++ b/src/stat.c @@ -1,14 +1,14 @@ /*<html><pre> -<a href="qh-stat.htm" >-------------------------------</a><a name="TOP">-</a> - stat.c + stat.c contains all statistics that are collected for qhull see qh-stat.htm and stat.h copyright (c) 1993-2010 The Geometry Center. - $Id: //product/qhull/main/rel/src/stat.c#27 $$Change: 1150 $ - $DateTime: 2010/01/04 22:43:14 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/stat.c#28 $$Change: 1164 $ + $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ */ #include "qhull_a.h" @@ -25,7 +25,7 @@ qhstatT qh_qhstat; /* add "={0}" if this causes a compiler error */ /*-<a href="qh-stat.htm#TOC" >-------------------------------</a><a name="allstatA">-</a> - + qh_allstatA() define statistics in groups of 20 @@ -34,7 +34,7 @@ qhstatT qh_qhstat; /* add "={0}" if this causes a compiler error */ uses qhstat.next */ void qh_allstatA(void) { - + /* zdef_(type,name,doc,average) */ zzdef_(zdoc, Zdoc2, "precision statistics", -1); zdef_(zinc, Znewvertex, NULL, -1); @@ -86,7 +86,7 @@ void qh_allstatB(void) { zdef_(wadd, Wareatot, "total area of facets", -1); zdef_(wmax, Wareamax, " maximum facet area", -1); zdef_(wmin, Wareamin, " minimum facet area", -1); -} +} void qh_allstatC(void) { zdef_(zdoc, Zdoc9, "build hull statistics", -1); zzdef_(zinc, Zprocessed, "points processed", -1); @@ -155,11 +155,11 @@ void qh_allstatE(void) { zzdef_(zinc, Zpartitionall, "distance tests for initial partition", -1); zdef_(zinc, Ztotpartition, "partitions of a point", -1); zzdef_(zinc, Zpartition, "distance tests for partitioning", -1); - zzdef_(zinc, Zdistcheck, "distance tests for checking flipped facets", -1); - zzdef_(zinc, Zdistconvex, "distance tests for checking convexity", -1); - zdef_(zinc, Zdistgood, "distance tests for checking good point", -1); - zdef_(zinc, Zdistio, "distance tests for output", -1); - zdef_(zinc, Zdiststat, "distance tests for statistics", -1); + zzdef_(zinc, Zdistcheck, "distance tests for checking flipped facets", -1); + zzdef_(zinc, Zdistconvex, "distance tests for checking convexity", -1); + zdef_(zinc, Zdistgood, "distance tests for checking good point", -1); + zdef_(zinc, Zdistio, "distance tests for output", -1); + zdef_(zinc, Zdiststat, "distance tests for statistics", -1); zdef_(zinc, Zdistplane, "total number of distance tests", -1); zdef_(zinc, Ztotpartcoplanar, "partitions of coplanar points or deleted vertices", -1); zzdef_(zinc, Zpartcoplanar, " distance tests for these partitions", -1); @@ -211,7 +211,7 @@ void qh_allstatF(void) { zdef_(zinc, Zdegenvertex, "vertices deleted by degenerate facet", -1); zdef_(zinc, Zmergeflipdup, "merges due to flipped facets in duplicated ridge", -1); zdef_(zinc, Zneighbor, "merges due to redundant neighbors", -1); - zdef_(zadd, Ztestvneighbor, "non-convex vertex neighbors", -1); + zdef_(zadd, Ztestvneighbor, "non-convex vertex neighbors", -1); } void qh_allstatG(void) { zdef_(zinc, Zacoplanar, "merges due to angle coplanar facets", -1); @@ -292,21 +292,21 @@ void qh_allstatI(void) { /*-<a href="qh-stat.htm#TOC" >-------------------------------</a><a name="allstatistics">-</a> - + qh_allstatistics() reset printed flag for all statistics */ void qh_allstatistics(void) { int i; - - for(i=ZEND; i--; ) + + for(i=ZEND; i--; ) qhstat printed[i]= False; } /* allstatistics */ #if qh_KEEPstatistics /*-<a href="qh-stat.htm#TOC" >-------------------------------</a><a name="collectstatistics">-</a> - + qh_collectstatistics() collect statistics for qh.facet_list @@ -316,10 +316,10 @@ void qh_collectstatistics(void) { vertexT *vertex, **vertexp; realT dotproduct, dist; int sizneighbors, sizridges, sizvertices, i; - + qh old_randomdist= qh RANDOMdist; qh RANDOMdist= False; - zval_(Zmempoints)= qh num_points * qh normal_size + + zval_(Zmempoints)= qh num_points * qh normal_size + sizeof(qhT) + sizeof(qhstatT); zval_(Zmemfacets)= 0; zval_(Zmemridges)= 0; @@ -359,10 +359,10 @@ void qh_collectstatistics(void) { zmax_(Zmaxneighbors, sizneighbors); zadd_(Znummergetot, facet->nummerge); i= facet->nummerge; /* avoid warnings */ - zmax_(Znummergemax, i); + zmax_(Znummergemax, i); if (!facet->simplicial) { if (sizvertices == qh hull_dim) { - zinc_(Znowsimplicial); + zinc_(Znowsimplicial); }else { zinc_(Znonsimplicial); } @@ -371,11 +371,11 @@ void qh_collectstatistics(void) { zadd_(Znumridges, sizridges); zmax_(Zmaxridges, sizridges); } - zadd_(Zmemfacets, sizeof(facetT) + qh normal_size + 2*sizeof(setT) + zadd_(Zmemfacets, sizeof(facetT) + qh normal_size + 2*sizeof(setT) + SETelemsize * (sizneighbors + sizvertices)); if (facet->ridges) { zadd_(Zmemridges, - sizeof(setT) + SETelemsize * sizridges + sizridges * + sizeof(setT) + SETelemsize * sizridges + sizridges * (sizeof(ridgeT) + sizeof(setT) + SETelemsize * (qh hull_dim-1))/2); } if (facet->outsideset) @@ -387,8 +387,8 @@ void qh_collectstatistics(void) { facet->seen= True; FOREACHneighbor_(facet) { if (neighbor == qh_DUPLICATEridge || neighbor == qh_MERGEridge - || neighbor->seen || !facet->normal || !neighbor->normal) - continue; + || neighbor->seen || !facet->normal || !neighbor->normal) + continue; dotproduct= qh_getangle(facet->normal, neighbor->normal); zinc_(Zangle); wadd_(Wangle, dotproduct); @@ -421,7 +421,7 @@ void qh_collectstatistics(void) { /*-<a href="qh-stat.htm#TOC" >-------------------------------</a><a name="freestatistics">-</a> - + qh_freestatistics( ) free memory used for statistics */ @@ -435,7 +435,7 @@ void qh_freestatistics(void) { /*-<a href="qh-stat.htm#TOC" >-------------------------------</a><a name="initstatistics">-</a> - + qh_initstatistics( ) allocate and initialize statistics @@ -458,7 +458,7 @@ void qh_initstatistics(void) { qh_exit(qh_ERRmem); /* can not use qh_errexit() */ } #endif - + qhstat next= 0; qh_allstatA(); qh_allstatB(); @@ -477,13 +477,13 @@ void qh_initstatistics(void) { for(i=0; i < ZEND; i++) { int j; for(j=i+1; j < ZEND; j++) { - if (qhstat id[i] == qhstat id[j]) { - qh_fprintf(qhmem.ferr, 6185, "qhull error (qh_initstatistics): duplicated statistic %d at indices %d and %d\n", - qhstat id[i], i, j); - } + if (qhstat id[i] == qhstat id[j]) { + qh_fprintf(qhmem.ferr, 6185, "qhull error (qh_initstatistics): duplicated statistic %d at indices %d and %d\n", + qhstat id[i], i, j); + } } } -#endif +#endif qh_exit(qh_ERRqhull); /* can not use qh_errexit() */ } qhstat init[zinc].i= 0; @@ -506,7 +506,7 @@ void qh_initstatistics(void) { /*-<a href="qh-stat.htm#TOC" >-------------------------------</a><a name="newstats">-</a> - + qh_newstats( ) returns True if statistics for zdoc @@ -517,13 +517,13 @@ boolT qh_newstats(int idx, int *nextindex) { boolT isnew= False; int start, i; - if (qhstat type[qhstat id[idx]] == zdoc) + if (qhstat type[qhstat id[idx]] == zdoc) start= idx+1; else start= idx; for(i= start; i < qhstat next && qhstat type[qhstat id[i]] != zdoc; i++) { if (!qh_nostatistic(qhstat id[i]) && !qhstat printed[qhstat id[i]]) - isnew= True; + isnew= True; } *nextindex= i; return isnew; @@ -531,16 +531,16 @@ boolT qh_newstats(int idx, int *nextindex) { /*-<a href="qh-stat.htm#TOC" >-------------------------------</a><a name="nostatistic">-</a> - + qh_nostatistic( index ) true if no statistic to print */ boolT qh_nostatistic(int i) { - + if ((qhstat type[i] > ZTYPEreal &&qhstat stats[i].r == qhstat init[(unsigned char)(qhstat type[i])].r) || (qhstat type[i] < ZTYPEreal - &&qhstat stats[i].i == qhstat init[(unsigned char)(qhstat type[i])].i)) + &&qhstat stats[i].i == qhstat init[(unsigned char)(qhstat type[i])].i)) return True; return False; } /* nostatistic */ @@ -548,7 +548,7 @@ boolT qh_nostatistic(int i) { #if qh_KEEPstatistics /*-<a href="qh-stat.htm#TOC" >-------------------------------</a><a name="printallstatistics">-</a> - + qh_printallstatistics( fp, string ) print all statistics with header 'string' */ @@ -563,29 +563,29 @@ void qh_printallstatistics(FILE *fp, const char *string) { /*-<a href="qh-stat.htm#TOC" >-------------------------------</a><a name="printstatistics">-</a> - + qh_printstatistics( fp, string ) print statistics to a file with header 'string' skips statistics with qhstat.printed[] (reset with qh_allstatistics) - see: + see: qh_printallstatistics() */ void qh_printstatistics(FILE *fp, const char *string) { int i, k; realT ave; - + if (qh num_points != qh num_vertices) { wval_(Wpbalance)= 0; wval_(Wpbalance2)= 0; }else - wval_(Wpbalance2)= qh_stddev(zval_(Zpbalance), wval_(Wpbalance), + wval_(Wpbalance2)= qh_stddev(zval_(Zpbalance), wval_(Wpbalance), wval_(Wpbalance2), &ave); - wval_(Wnewbalance2)= qh_stddev(zval_(Zprocessed), wval_(Wnewbalance), + wval_(Wnewbalance2)= qh_stddev(zval_(Zprocessed), wval_(Wnewbalance), wval_(Wnewbalance2), &ave); qh_fprintf(fp, 9350, "\n\ %s\n\ - qhull invoked by: %s | %s\n%s with options:\n%s\n", string, qh rbox_command, + qhull invoked by: %s | %s\n%s with options:\n%s\n", string, qh rbox_command, qh qhull_command, qh_version, qh qhull_options); qh_fprintf(fp, 9351, "\nprecision constants:\n\ %6.2g max. abs. coordinate in the (transformed) input('Qbd:n')\n\ @@ -595,8 +595,8 @@ void qh_printstatistics(FILE *fp, const char *string) { %6.2g min. distance for visible facets ('Vn')\n\ %6.2g max. distance for coplanar facets ('Un')\n\ %6.2g max. facet width for recomputing centrum and area\n\ -", - qh MAXabs_coord, qh DISTround, qh ANGLEround, qh MINoutside, +", + qh MAXabs_coord, qh DISTround, qh ANGLEround, qh MINoutside, qh MINvisible, qh MAXcoplanar, qh WIDEfacet); if (qh KEEPnearinside) qh_fprintf(fp, 9352, "\ @@ -617,14 +617,14 @@ void qh_printstatistics(FILE *fp, const char *string) { for(k=0; k < qh hull_dim; k++) qh_fprintf(fp, 9358, "%6.2e ", qh NEARzero[k]); qh_fprintf(fp, 9359, "\n\n"); - for(i=0 ; i < qhstat next; ) + for(i=0 ; i < qhstat next; ) qh_printstats(fp, i, &i); } /* printstatistics */ #endif /* qh_KEEPstatistics */ /*-<a href="qh-stat.htm#TOC" >-------------------------------</a><a name="printstatlevel">-</a> - + qh_printstatlevel( fp, id ) print level information for a statistic @@ -644,7 +644,7 @@ void qh_printstatlevel(FILE *fp, int id, int start) { if (qh_nostatistic(id) || !qhstat doc[id]) return; qhstat printed[id]= True; - if (qhstat count[id] != -1 + if (qhstat count[id] != -1 && qhstat stats[(unsigned char)(qhstat count[id])].i == 0) qh_fprintf(fp, 9361, " *0 cnt*"); else if (qhstat type[id] >= ZTYPEreal && qhstat count[id] == -1) @@ -661,7 +661,7 @@ void qh_printstatlevel(FILE *fp, int id, int start) { /*-<a href="qh-stat.htm#TOC" >-------------------------------</a><a name="printstats">-</a> - + qh_printstats( fp, index, nextindex ) print statistics for a zdoc group @@ -684,16 +684,16 @@ void qh_printstats(FILE *fp, int idx, int *nextindex) { /*-<a href="qh-stat.htm#TOC" >-------------------------------</a><a name="stddev">-</a> - + qh_stddev( num, tot, tot2, ave ) compute the standard deviation and average from statistics tot2 is the sum of the squares notes: - computes r.m.s.: - (x-ave)^2 + computes r.m.s.: + (x-ave)^2 == x^2 - 2x tot/num + (tot/num)^2 - == tot2 - 2 tot tot/num + tot tot/num + == tot2 - 2 tot tot/num + tot tot/num == tot2 - tot ave */ realT qh_stddev(int num, realT tot, realT tot2, realT *ave) { @@ -704,7 +704,7 @@ realT qh_stddev(int num, realT tot, realT tot2, realT *ave) { return stddev; } /* stddev */ -#endif /* qh_KEEPstatistics */ +#endif /* qh_KEEPstatistics */ #if !qh_KEEPstatistics void qh_collectstatistics(void) {} diff --git a/src/stat.h b/src/stat.h index 4c15ae1..da06165 100644 --- a/src/stat.h +++ b/src/stat.h @@ -1,18 +1,18 @@ /*<html><pre> -<a href="qh-stat.htm" >-------------------------------</a><a name="TOP">-</a> - stat.h + stat.h contains all statistics that are collected for qhull see qh-stat.htm and stat.c copyright (c) 1993-2010 The Geometry Center. - $Id: //product/qhull/main/rel/src/stat.h#27 $$Change: 1151 $ - $DateTime: 2010/01/05 19:34:31 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/stat.h#28 $$Change: 1164 $ + $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ recompile qhull if you change this file - Integer statistics are Z* while real statistics are W*. + Integer statistics are Z* while real statistics are W*. define maydebugx to call a routine at every statistic event @@ -93,7 +93,7 @@ enum statistics { /* alphabetical after Z/W */ Wdegenmax, Wdegentot, Zdegenvertex, - Zdelfacetdup, + Zdelfacetdup, Zdelridge, Zdelvertextot, Zdelvertexmax, @@ -126,9 +126,9 @@ enum statistics { /* alphabetical after Z/W */ Wduplicatetot, Zdupridge, Zdupsame, - Zflipped, - Wflippedmax, - Wflippedtot, + Zflipped, + Wflippedmax, + Wflippedtot, Zflippedfacets, Zfindbest, Zfindbestmax, @@ -212,13 +212,13 @@ enum statistics { /* alphabetical after Z/W */ Zpartflip, Zparthorizon, Zpartinside, - Zpartition, + Zpartition, Zpartitionall, Zpartnear, Zpbalance, Wpbalance, - Wpbalance2, - Zpostfacets, + Wpbalance2, + Zpostfacets, Zpremergetot, Zprocessed, Zremvertex, @@ -335,9 +335,9 @@ enum statistics { /* for zzdef etc. macros */ /*-<a href="qh-stat.htm#TOC" >-------------------------------</a><a name="ztype">-</a> - + ztype - the type of a statistic sets its initial value. + the type of a statistic sets its initial value. notes: The type should be the same as the macro for collecting the statistic @@ -348,7 +348,7 @@ enum ztypes {zdoc,zinc,zadd,zmax,zmin,ZTYPEreal,wadd,wmax,wmin,ZTYPEend}; /*-<a href="qh-stat.htm#TOC" >--------------------------------</a><a name="MAYdebugx">-</a> - + MAYdebugx define as maydebug() to be called frequently for error trapping */ @@ -356,7 +356,7 @@ enum ztypes {zdoc,zinc,zadd,zmax,zmin,ZTYPEreal,wadd,wmax,wmin,ZTYPEend}; /*-<a href="qh-stat.htm#TOC" >--------------------------------</a><a name="zdef_">-</a> - + zzdef_, zdef_( type, name, doc, -1) define a statistic (assumes 'qhstat.next= 0;') @@ -375,7 +375,7 @@ enum ztypes {zdoc,zinc,zadd,zmax,zmin,ZTYPEreal,wadd,wmax,wmin,ZTYPEend}; /*-<a href="qh-stat.htm#TOC" >--------------------------------</a><a name="zinc_">-</a> - + zzinc_( name ), zinc_( name) increment an integer statistic */ @@ -388,7 +388,7 @@ enum ztypes {zdoc,zinc,zadd,zmax,zmin,ZTYPEreal,wadd,wmax,wmin,ZTYPEend}; /*-<a href="qh-stat.htm#TOC" >--------------------------------</a><a name="zadd_">-</a> - + zzadd_( name, value ), zadd_( name, value ), wadd_( name, value ) add value to an integer or real statistic */ @@ -452,7 +452,7 @@ enum ztypes {zdoc,zinc,zadd,zmax,zmin,ZTYPEreal,wadd,wmax,wmin,ZTYPEend}; /*-<a href="qh-stat.htm#TOC" >--------------------------------</a><a name="intrealT">-</a> - + intrealT union of integer and real, used for statistics */ @@ -464,24 +464,24 @@ union intrealT { /*-<a href="qh-stat.htm#TOC" >--------------------------------</a><a name="qhstat">-</a> - + qhstat global data structure for statistics, similar to qh and qhrbox - + notes: access to qh_qhstat is via the "qhstat" macro. There are two choices qh_QHpointer = 1 access globals via a pointer enables qh_saveqhull() and qh_restoreqhull() - = 0 qh_qhstat is a static data structure - only one instance of qhull() can be active at a time - default value + = 0 qh_qhstat is a static data structure + only one instance of qhull() can be active at a time + default value qh_QHpointer is defined in libqhull.h allocated in stat.c using qh_malloc() */ #ifndef DEFqhstatT #define DEFqhstatT 1 -typedef struct qhstatT qhstatT; +typedef struct qhstatT qhstatT; #endif #if qh_QHpointer @@ -489,9 +489,9 @@ typedef struct qhstatT qhstatT; extern qhstatT *qh_qhstat; #else #define qhstat qh_qhstat. -extern qhstatT qh_qhstat; +extern qhstatT qh_qhstat; #endif -struct qhstatT { +struct qhstatT { intrealT stats[ZEND]; /* integer and real statistics */ unsigned char id[ZEND+10]; /* id's in print order */ const char *doc[ZEND]; /* array of documentation strings */ @@ -521,14 +521,14 @@ void qh_allstatH(void); void qh_allstatI(void); void qh_allstatistics(void); void qh_collectstatistics(void); -void qh_freestatistics(void); +void qh_freestatistics(void); void qh_initstatistics(void); -boolT qh_newstats(int idx, int *nextindex); -boolT qh_nostatistic(int i); +boolT qh_newstats(int idx, int *nextindex); +boolT qh_nostatistic(int i); void qh_printallstatistics(FILE *fp, const char *string); void qh_printstatistics(FILE *fp, const char *string); -void qh_printstatlevel(FILE *fp, int id, int start); -void qh_printstats(FILE *fp, int idx, int *nextindex); +void qh_printstatlevel(FILE *fp, int id, int start); +void qh_printstats(FILE *fp, int idx, int *nextindex); realT qh_stddev(int num, realT tot, realT tot2, realT *ave); #endif /* qhDEFstat */ diff --git a/src/unix.c b/src/unix.c index d74b403..d0643ad 100644 --- a/src/unix.c +++ b/src/unix.c @@ -3,13 +3,13 @@ unix.c command line interface to qhull - includes SIOUX interface for Macintoshes + includes SIOUX interface for Macintoshes see qh-qhull.htm copyright (c) 1993-2010 The Geometry Center. - $Id: //product/qhull/main/rel/src/unix.c#25 $$Change: 1137 $ - $DateTime: 2010/01/02 21:58:11 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/unix.c#26 $$Change: 1164 $ + $DateTime: 2010/01/07 21:52:00 $$Author: bbarber $ */ #include "mem.h" @@ -39,18 +39,18 @@ extern "C" { #else int isatty(int); /* returns 1 if stdin is a tty - if "Undefined symbol" this can be deleted along with call in main() */ + if "Undefined symbol" this can be deleted along with call in main() */ #endif /*-<a href="qh-qhull.htm#TOC" >-------------------------------</a><a name="prompt">-</a> - qh_prompt + qh_prompt long prompt for qhull - + see: concise prompt below -*/ +*/ char qh_prompta[]= "\n\ qhull- compute convex hulls and related structures.\n\ http://www.qhull.org %s\n\ @@ -96,7 +96,7 @@ char qh_promptb[]= "\ QGn - good facet if visible from point n, -n for not visible\n\ QVn - good facet if it includes point n, -n if not\n\ Q0 - turn off default premerge with 'C-0'/'Qx'\n\ - Q1 - sort merges by type instead of angle\n\ + Q1 - sort merges by type instead of angle\n\ Q2 - merge all non-convex at once instead of independent sets\n\ Q3 - do not merge redundant vertices\n\ Q4 - avoid old->new merges\n\ @@ -273,7 +273,7 @@ char qh_prompt3[]= "\n\ Qhull %s.\n\ Except for 'F.' and 'PG', upper-case options take an argument.\n\ \n\ - delaunay voronoi Geomview Halfspace facet_dump\n\ + delaunay voronoi Geomview Halfspace facet_dump\n\ incidences mathematica normals OFF_format points\n\ summary\n\ \n\ @@ -346,7 +346,7 @@ int main(int argc, char *argv[]) { } if (argc > 1 && *argv[1] == '-' && !*(argv[1]+1)) { fprintf(stdout, qh_prompta, qh_version, qh_DEFAULTbox, - qh_promptb, qh_promptc, qh_promptd, qh_prompte); + qh_promptb, qh_promptc, qh_promptd, qh_prompte); exit(qh_ERRnone); } if (argc >1 && *argv[1] == '.' && !*(argv[1]+1)) { diff --git a/src/user.c b/src/user.c index 6e6287e..4c2b17e 100644 --- a/src/user.c +++ b/src/user.c @@ -1,7 +1,7 @@ /*<html><pre> -<a href="qh-user.htm" >-------------------------------</a><a name="TOP">-</a> - user.c + user.c user redefinable functions see user2.c for qh_fprintf, qh_malloc, qh_free @@ -20,10 +20,10 @@ This is unsupported software. You're welcome to make changes, but you're on your own if something goes wrong. Use 'Tc' to - check frequently. Usually qhull will report an error if + check frequently. Usually qhull will report an error if a data structure becomes inconsistent. If so, it also reports the last point added to the hull, e.g., 102. You can then trace - the execution of qhull with "T4P102". + the execution of qhull with "T4P102". Please report any errors that you fix to qhull@qhull.org @@ -36,11 +36,11 @@ if the other functions here are redefined to not use qh_print..., then io.o will not be loaded from qhull.a. See user_eg.c for an - example. We recommend keeping io.o for the extra debugging + example. We recommend keeping io.o for the extra debugging information it supplies. */ -#include "qhull_a.h" +#include "qhull_a.h" #include <stdarg.h> @@ -51,34 +51,34 @@ template for calling qhull from inside your program remove #if 0, #endif to compile - returns: + returns: exit code(see qh_ERR... in libqhull.h) all memory freed notes: - This can be called any number of times. + This can be called any number of times. see: qh_call_qhull_once() - + */ #if 0 { - int dim; /* dimension of points */ + int dim; /* dimension of points */ int numpoints; /* number of points */ coordT *points; /* array of coordinates for each point */ boolT ismalloc; /* True if qhull should free points in qh_freeqhull() or reallocation */ char flags[]= "qhull Tv"; /* option flags for qhull, see qh_opt.htm */ FILE *outfile= stdout; /* output from qh_produce_output() - use NULL to skip qh_produce_output() */ + use NULL to skip qh_produce_output() */ FILE *errfile= stderr; /* error messages from qhull code */ int exitcode; /* 0 if no error from qhull */ - facetT *facet; /* set by FORALLfacets */ - int curlong, totlong; /* memory remaining after qh_memfreeshort */ + facetT *facet; /* set by FORALLfacets */ + int curlong, totlong; /* memory remaining after qh_memfreeshort */ /* initialize dim, numpoints, points[], ismalloc here */ exitcode= qh_new_qhull(dim, numpoints, points, ismalloc, - flags, outfile, errfile); + flags, outfile, errfile); if (!exitcode) { /* if no error */ /* 'qh facet_list' contains the convex hull */ FORALLfacets { @@ -87,7 +87,7 @@ } qh_freeqhull(!qh_ALL); qh_memfreeshort(&curlong, &totlong); - if (curlong || totlong) + if (curlong || totlong) qh_fprintf(errfile, 7068, "qhull internal warning (main): did not free %d bytes of long memory(%d pieces)\n", totlong, curlong); } #endif @@ -108,9 +108,9 @@ qhull_cmd must start with "qhull " projects points to a new point array for Delaunay triangulations ('d' and 'v') transforms points into a new point array for halfspace intersection ('H') - - To allow multiple, concurrent calls to qhull() + + To allow multiple, concurrent calls to qhull() - set qh_QHpointer in user.h - use qh_save_qhull and qh_restore_qhull to swap the global data structure between calls. - use qh_freeqhull(qh_ALL) to free intermediate convex hulls @@ -118,8 +118,8 @@ see: user_eg.c for an example */ -int qh_new_qhull(int dim, int numpoints, coordT *points, boolT ismalloc, - char *qhull_cmd, FILE *outfile, FILE *errfile) { +int qh_new_qhull(int dim, int numpoints, coordT *points, boolT ismalloc, + char *qhull_cmd, FILE *outfile, FILE *errfile) { int exitcode, hulldim; boolT new_ismalloc; static boolT firstcall = True; @@ -143,14 +143,14 @@ int qh_new_qhull(int dim, int numpoints, coordT *points, boolT ismalloc, if (qh DELAUNAY) qh PROJECTdelaunay= True; if (qh HALFspace) { - /* points is an array of halfspaces, + /* points is an array of halfspaces, the last coordinate of each halfspace is its offset */ hulldim= dim-1; - qh_setfeasible(hulldim); + qh_setfeasible(hulldim); new_points= qh_sethalfspace_all(dim, numpoints, points, qh feasible_point); new_ismalloc= True; if (ismalloc) - qh_free(points); + qh_free(points); }else { hulldim= dim; new_points= points; @@ -160,7 +160,7 @@ int qh_new_qhull(int dim, int numpoints, coordT *points, boolT ismalloc, qh_qhull(); qh_check_output(); if (outfile) - qh_produce_output(); + qh_produce_output(); if (qh VERIFYoutput && !qh STOPpoint && !qh STOPcone) qh_check_points(); } @@ -170,14 +170,14 @@ int qh_new_qhull(int dim, int numpoints, coordT *points, boolT ismalloc, /*-<a href="qh-user.htm#TOC" >-------------------------------</a><a name="errexit">-</a> - + qh_errexit( exitcode, facet, ridge ) report and exit from an error report facet and ridge if non-NULL reports useful information such as last point processed set qh.FORCEoutput to print neighborhood of facet - see: + see: qh_errexit2() in libqhull.c for printing 2 facets design: @@ -188,7 +188,7 @@ int qh_new_qhull(int dim, int numpoints, coordT *points, boolT ismalloc, print summary and statistics (including precision statistics) if qh_ERRsingular print help text for singular data set - exit program via long jump (if defined) or exit() + exit program via long jump (if defined) or exit() */ void qh_errexit(int exitcode, facetT *facet, ridgeT *ridge) { @@ -219,9 +219,9 @@ void qh_errexit(int exitcode, facetT *facet, ridgeT *ridge) { qh_fprintf(qh ferr, 8134, "\nAt error exit:\n"); qh_printsummary(qh ferr); if (qh PRINTstatistics) { - qh_collectstatistics(); - qh_printstatistics(qh ferr, "at error exit"); - qh_memstatistics(qh ferr); + qh_collectstatistics(); + qh_printstatistics(qh ferr, "at error exit"); + qh_memstatistics(qh ferr); } } if (qh PRINTprecision) @@ -245,11 +245,11 @@ void qh_errexit(int exitcode, facetT *facet, ridgeT *ridge) { /*-<a href="qh-user.htm#TOC" >-------------------------------</a><a name="errprint">-</a> - + qh_errprint( fp, string, atfacet, otherfacet, atridge, atvertex ) prints out the information of facets and ridges to fp also prints neighbors and geomview output - + notes: except for string, any parameter may be NULL */ @@ -270,7 +270,7 @@ void qh_errprint(const char *string, facetT *atfacet, facetT *otherfacet, ridgeT if (atridge->top && atridge->top != atfacet && atridge->top != otherfacet) qh_printfacet(qh ferr, atridge->top); if (atridge->bottom - && atridge->bottom != atfacet && atridge->bottom != otherfacet) + && atridge->bottom != atfacet && atridge->bottom != otherfacet) qh_printfacet(qh ferr, atridge->bottom); if (!atfacet) atfacet= atridge->top; @@ -285,17 +285,17 @@ void qh_errprint(const char *string, facetT *atfacet, facetT *otherfacet, ridgeT qh_fprintf(qh ferr, 8139, "ERRONEOUS and NEIGHBORING FACETS to output\n"); for (i=0; i < qh_PRINTEND; i++) /* use fout for geomview output */ qh_printneighborhood(qh fout, qh PRINTout[i], atfacet, otherfacet, - !qh_ALL); + !qh_ALL); } } /* errprint */ /*-<a href="qh-user.htm#TOC" >-------------------------------</a><a name="printfacetlist">-</a> - + qh_printfacetlist( fp, facetlist, facets, printall ) print all fields for a facet list and/or set of facets to fp - if !printall, + if !printall, only prints good facets notes: @@ -391,7 +391,7 @@ To guarantee simplicial output:\n\ /*-<a href="qh-globa.htm#TOC" >-------------------------------</a><a name="printhelp_narrowhull">-</a> - + qh_printhelp_narrowhull( minangle ) Warn about a narrow hull @@ -504,7 +504,7 @@ This is a Delaunay triangulation and the input is co-circular or co-spherical:\n /*-<a href="qh-globa.htm#TOC" >-------------------------------</a><a name="user_memsizes">-</a> - + qh_user_memsizes() allocate up to 10 additional, quick allocation sizes diff --git a/src/user.h b/src/user.h index 868faef..9adc6bb 100644 --- a/src/user.h +++ b/src/user.h @@ -6,7 +6,7 @@ see qh-user.htm. see COPYING for copyright information. - before reading any code, review libqhull.h for data structure definitions and + before reading any code, review libqhull.h for data structure definitions and the "qh" macro. Sections: @@ -18,7 +18,7 @@ Sections: ============= conditional compilation ====================== ============= -merge constants- ============================ -Code flags -- +Code flags -- NOerrors -- the code does not call qh_errexit() WARN64 -- the code maybe incompatible with 64-bit pointers @@ -70,7 +70,7 @@ Code flags -- qh_OPTIONline -- max length of an option line 'FO' */ -#define qh_OPTIONline 80 +#define qh_OPTIONline 80 /*============================================================*/ /*============= data types and configuration macros ==========*/ @@ -78,44 +78,44 @@ Code flags -- /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="realT">-</a> - + realT set the size of floating point numbers - - qh_REALdigits + + qh_REALdigits maximimum number of significant digits - + qh_REAL_1, qh_REAL_2n, qh_REAL_3n format strings for printf - + qh_REALmax, qh_REALmin - maximum and minimum (near zero) values - + maximum and minimum (near zero) values + qh_REALepsilon machine roundoff. Maximum roundoff error for addition and multiplication. - + notes: Select whether to store floating point numbers in single precision (float) or double precision (double). - + Use 'float' to save about 8% in time and 25% in space. This is particularly helpful if high-d where convex hulls are space limited. Using 'float' also - reduces the printed size of Qhull's output since numbers have 8 digits of + reduces the printed size of Qhull's output since numbers have 8 digits of precision. - + Use 'double' when greater arithmetic precision is needed. This is needed - for Delaunay triangulations and Voronoi diagrams when you are not merging + for Delaunay triangulations and Voronoi diagrams when you are not merging facets. If 'double' gives insufficient precision, your data probably includes degeneracies. If so you should use facet merging (done by default) - or exact arithmetic (see imprecision section of manual, qh-impre.htm). + or exact arithmetic (see imprecision section of manual, qh-impre.htm). You may also use option 'Po' to force output despite precision errors. You may use 'long double', but many format statements need to be changed and you may need a 'long double' square root routine. S. Grundmann - (sg@eeiwzb.et.tu-dresden.de) has done this. He reports that the code runs - much slower with little gain in precision. + (sg@eeiwzb.et.tu-dresden.de) has done this. He reports that the code runs + much slower with little gain in precision. WARNING: on some machines, int f(){realT a= REALmax;return (a == REALmax);} returns False. Use (a > REALmax/2) instead of (a == REALmax). @@ -151,13 +151,13 @@ Code flags -- /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="CPUclock">-</a> - + qh_CPUclock define the clock() function for reporting the total time spent by Qhull returns CPU ticks as a 'long int' qh_CPUclock is only used for reporting the total time spent by Qhull - qh_SECticks + qh_SECticks the number of clock ticks per second notes: @@ -170,11 +170,11 @@ Code flags -- <time.h> defines clock_t as 'long' Set qh_CLOCKtype to - - 1 for CLOCKS_PER_SEC, CLOCKS_PER_SECOND, or microsecond + + 1 for CLOCKS_PER_SEC, CLOCKS_PER_SECOND, or microsecond Note: may fail if more than 1 hour elapsed time - 2 use qh_clock() with POSIX times() (see global.c) + 2 use qh_clock() with POSIX times() (see global.c) */ #define qh_CLOCKtype 1 /* change to the desired number */ @@ -207,11 +207,11 @@ Code flags -- /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="RANDOM">-</a> - + qh_RANDOMtype, qh_RANDOMmax, qh_RANDOMseed define random number generator - qh_RANDOMint generates a random integer between 0 and qh_RANDOMmax. + qh_RANDOMint generates a random integer between 0 and qh_RANDOMmax. qh_RANDOMseed sets the random number seed for qh_RANDOMint Set qh_RANDOMtype (default 5) to: @@ -220,7 +220,7 @@ Code flags -- 3 for rand() with 31 bits (Sun) 4 for lrand48() with 31 bits (Solaris) 5 for qh_rand() with 31 bits (included with Qhull) - + notes: Random numbers are used by rbox to generate point sets. Random numbers are used by Qhull to rotate the input ('QRn' option), @@ -229,12 +229,12 @@ Code flags -- Random number generators differ between systems. Most systems provide rand() but the period varies. The period of rand() is not critical - since qhull does not normally use random numbers. + since qhull does not normally use random numbers. The default generator is Park & Miller's minimal standard random number generator [CACM 31:1195 '88]. It is included with Qhull. - If qh_RANDOMmax is wrong, qhull will report a warning and Geomview + If qh_RANDOMmax is wrong, qhull will report a warning and Geomview output will likely be invisible. */ #define qh_RANDOMtype 5 /* *** change to the desired number *** */ @@ -252,7 +252,7 @@ Code flags -- #endif #define qh_RANDOMint rand() #define qh_RANDOMseed_(seed) srand((unsigned)seed); - + #elif (qh_RANDOMtype == 3) #define qh_RANDOMmax ((realT)0x7fffffffUL) /* 31 bits, Sun */ #define qh_RANDOMint rand() @@ -275,11 +275,11 @@ Code flags -- /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="ORIENTclock">-</a> - + qh_ORIENTclock 0 for inward pointing normals by Geomview convention */ -#define qh_ORIENTclock 0 +#define qh_ORIENTclock 0 /*============================================================*/ @@ -364,10 +364,10 @@ stop after qh_JOGGLEmaxretry attempts /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="HASHfactor">-</a> - + qh_HASHfactor total hash slots / used hash slots. Must be at least 1.1. - + notes: =2 for at worst 50% occupancy for qh hash_table and normally 25% occupancy */ @@ -375,18 +375,18 @@ stop after qh_JOGGLEmaxretry attempts /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="VERIFYdirect">-</a> - + qh_VERIFYdirect with 'Tv' verify all points against all facets if op count is smaller notes: if greater, calls qh_check_bestdist() instead */ -#define qh_VERIFYdirect 1000000 +#define qh_VERIFYdirect 1000000 /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="INITIALsearch">-</a> - + qh_INITIALsearch if qh_INITIALmax, search points up to this dimension */ @@ -394,10 +394,10 @@ stop after qh_JOGGLEmaxretry attempts /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="INITIALmax">-</a> - + qh_INITIALmax if dim >= qh_INITIALmax, use min/max coordinate points for initial simplex - + notes: from points with non-zero determinants use option 'Qs' to override (much slower) @@ -410,19 +410,19 @@ stop after qh_JOGGLEmaxretry attempts /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="MEMalign">-</a> - + qh_MEMalign memory alignment for qh_meminitbuffers() in global.c - + notes: to avoid bus errors, memory allocation must consider alignment requirements. malloc() automatically takes care of alignment. Since mem.c manages its own memory, we need to explicitly specify alignment in qh_meminitbuffers(). - A safe choice is sizeof(double). sizeof(float) may be used if doubles + A safe choice is sizeof(double). sizeof(float) may be used if doubles do not occur in data structures and pointers are the same size. Be careful - of machines (e.g., DEC Alpha) with large pointers. + of machines (e.g., DEC Alpha) with large pointers. If using gcc, best alignment is #define qh_MEMalign fmax_(__alignof__(realT),__alignof__(void *)) @@ -431,10 +431,10 @@ stop after qh_JOGGLEmaxretry attempts /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="MEMbufsize">-</a> - + qh_MEMbufsize size of additional memory buffers - + notes: used for qh_meminitbuffers() in global.c */ @@ -442,10 +442,10 @@ stop after qh_JOGGLEmaxretry attempts /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="MEMinitbuf">-</a> - + qh_MEMinitbuf size of initial memory buffer - + notes: use for qh_meminitbuffers() in global.c */ @@ -453,7 +453,7 @@ stop after qh_JOGGLEmaxretry attempts /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="INFINITE">-</a> - + qh_INFINITE on output, indicates Voronoi center at infinity */ @@ -461,15 +461,15 @@ stop after qh_JOGGLEmaxretry attempts /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="DEFAULTbox">-</a> - + qh_DEFAULTbox default box size (Geomview expects 0.5) qh_DEFAULTbox default box size for integer coorindate (rbox only) */ -#define qh_DEFAULTbox 0.5 -#define qh_DEFAULTzbox 1e6 +#define qh_DEFAULTbox 0.5 +#define qh_DEFAULTzbox 1e6 /*============================================================*/ /*============= conditional compilation ======================*/ @@ -483,97 +483,97 @@ stop after qh_JOGGLEmaxretry attempts __MSC_VER defined by Microsoft Visual C++ - + __MWERKS__ && __POWERPC__ defined by Metrowerks when compiling for the Power Macintosh __STDC__ - defined for strict ANSI C + defined for strict ANSI C */ /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="COMPUTEfurthest">-</a> - - qh_COMPUTEfurthest + + qh_COMPUTEfurthest compute furthest distance to an outside point instead of storing it with the facet =1 to compute furthest - + notes: computing furthest saves memory but costs time about 40% more distance tests for partitioning - removes facet->furthestdist + removes facet->furthestdist */ #define qh_COMPUTEfurthest 0 - + /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="KEEPstatistics">-</a> - - qh_KEEPstatistics + + qh_KEEPstatistics =0 removes most of statistic gathering and reporting notes: if 0, code size is reduced by about 4%. */ #define qh_KEEPstatistics 1 - + /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="MAXoutside">-</a> - - qh_MAXoutside + + qh_MAXoutside record outer plane for each facet =1 to record facet->maxoutside - + notes: this takes a realT per facet and slightly slows down qhull - it produces better outer planes for geomview output + it produces better outer planes for geomview output */ #define qh_MAXoutside 1 /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="NOmerge">-</a> - + qh_NOmerge disables facet merging if defined - + notes: This saves about 10% space. - + Unless 'Q0' qh_NOmerge sets 'QJ' to avoid precision errors - #define qh_NOmerge + #define qh_NOmerge see: <a href="mem.h#NOmem">qh_NOmem</a> in mem.c - + see user.c/user_eg.c for removing io.o -*/ - +*/ + /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="NOtrace">-</a> - + qh_NOtrace - no tracing if defined - + no tracing if defined + notes: This saves about 5% space. #define qh_NOtrace -*/ +*/ /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="QHpointer">-</a> - + qh_QHpointer access global data with pointer or static structure qh_QHpointer = 1 access globals via a pointer to allocated memory enables qh_saveqhull() and qh_restoreqhull() - costs about 8% in time and 2% in space + costs about 8% in time and 2% in space - = 0 qh_qh and qh_qhstat are static data structures - only one instance of qhull() can be active at a time - default value + = 0 qh_qh and qh_qhstat are static data structures + only one instance of qhull() can be active at a time + default value notes: all global variables for qhull are in qh, qhmem, and qhstat @@ -592,11 +592,11 @@ stop after qh_JOGGLEmaxretry attempts qhT *oldqhA, *oldqhB; exitcode= qh_new_qhull(dim, numpoints, points, ismalloc, - flags, outfile, errfile); + flags, outfile, errfile); /* use results from first call to qh_new_qhull */ oldqhA= qh_save_qhull(); exitcode= qh_new_qhull(dimB, numpointsB, pointsB, ismalloc, - flags, outfile, errfile); + flags, outfile, errfile); /* use results from second call to qh_new_qhull */ oldqhB= qh_save_qhull(); qh_restore_qhull(&oldqhA); @@ -610,11 +610,11 @@ stop after qh_JOGGLEmaxretry attempts /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="QUICKhelp">-</a> - - qh_QUICKhelp + + qh_QUICKhelp =1 to use abbreviated help messages, e.g., for degenerate inputs */ -#define qh_QUICKhelp 0 +#define qh_QUICKhelp 0 /*============================================================*/ /*============= -merge constants- ============================*/ @@ -626,7 +626,7 @@ stop after qh_JOGGLEmaxretry attempts /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="DIMmergeVertex">-</a> - + qh_DIMmergeVertex max dimension for vertex merging (it is not effective in high-d) */ @@ -634,7 +634,7 @@ stop after qh_JOGGLEmaxretry attempts /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="DIMreduceBuild">-</a> - + qh_DIMreduceBuild max dimension for vertex reduction during build (slow in high-d) */ @@ -642,7 +642,7 @@ stop after qh_JOGGLEmaxretry attempts /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="BESTcentrum">-</a> - + qh_BESTcentrum if > 2*dim+n vertices, qh_findbestneighbor() tests centrums (faster) else, qh_findbestneighbor() tests all vertices (much better merges) @@ -655,21 +655,21 @@ stop after qh_JOGGLEmaxretry attempts /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="BESTnonconvex">-</a> - + qh_BESTnonconvex if > dim+n neighbors, qh_findbestneighbor() tests nonconvex ridges. - + notes: It is needed because qh_findbestneighbor is slow for large facets */ -#define qh_BESTnonconvex 15 +#define qh_BESTnonconvex 15 /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="MAXnewmerges">-</a> - + qh_MAXnewmerges if >n newmerges, qh_merge_nonconvex() calls qh_reducevertices_centrums. - + notes: It is needed because postmerge can merge many facets at once */ @@ -677,20 +677,20 @@ stop after qh_JOGGLEmaxretry attempts /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="MAXnewcentrum">-</a> - + qh_MAXnewcentrum if <= dim+n vertices (n approximates the number of merges), reset the centrum in qh_updatetested() and qh_mergecycle_facets() - + notes: - needed to reduce cost and because centrums may move too much if + needed to reduce cost and because centrums may move too much if many vertices in high-d */ #define qh_MAXnewcentrum 5 /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="COPLANARratio">-</a> - + qh_COPLANARratio for 3-d+ merging, qh.MINvisible is n*premerge_centrum @@ -701,15 +701,15 @@ stop after qh_JOGGLEmaxretry attempts /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="DISToutside">-</a> - + qh_DISToutside - When is a point clearly outside of a facet? + When is a point clearly outside of a facet? Stops search in qh_findbestnew or qh_partitionall qh_findbest uses qh.MINoutside since since it is only called if no merges. - + notes: 'Qf' always searches for best facet - if !qh.MERGING, same as qh.MINoutside. + if !qh.MERGING, same as qh.MINoutside. if qh_USEfindbestnew, increase value since neighboring facets may be ill-behaved [Note: Zdelvertextot occurs normally with interior points] RBOX 1000 s Z1 G1e-13 t1001188774 | QHULL Tv @@ -722,7 +722,7 @@ stop after qh_JOGGLEmaxretry attempts Needed in qh_findbestnew for many instances of RBOX 1000 s Z1 G1e-13 t | QHULL Tv - See: + See: qh_DISToutside -- when is a point clearly outside of a facet qh_SEARCHdist -- when is facet coplanar with the best facet? qh_USEfindbestnew -- when to use qh_findbestnew for qh_partitionpoint() @@ -732,11 +732,11 @@ stop after qh_JOGGLEmaxretry attempts /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="RATIOnearinside">-</a> - + qh_RATIOnearinside ratio of qh.NEARinside to qh.ONEmerge for retaining inside points for - qh_check_maxout(). - + qh_check_maxout(). + notes: This is overkill since do not know the correct value. It effects whether 'Qc' reports all coplanar points @@ -746,9 +746,9 @@ stop after qh_JOGGLEmaxretry attempts /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="SEARCHdist">-</a> - + qh_SEARCHdist - When is a facet coplanar with the best facet? + When is a facet coplanar with the best facet? qh_findbesthorizon: all coplanar facets of the best facet need to be searched. See: @@ -761,11 +761,11 @@ stop after qh_JOGGLEmaxretry attempts /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="USEfindbestnew">-</a> - + qh_USEfindbestnew Always use qh_findbestnew for qh_partitionpoint, otherwise use qh_findbestnew if merged new facet or sharpnewfacets. - + See: qh_DISToutside -- when is a point clearly outside of a facet qh_SEARCHdist -- when is facet coplanar with the best facet? @@ -775,14 +775,14 @@ stop after qh_JOGGLEmaxretry attempts /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="WIDEcoplanar">-</a> - + qh_WIDEcoplanar - n*MAXcoplanar or n*MINvisible for a WIDEfacet - + n*MAXcoplanar or n*MINvisible for a WIDEfacet + if vertex is further than qh.WIDEfacet from the hyperplane then its ridges are not counted in computing the area, and - the facet's centrum is frozen. - + the facet's centrum is frozen. + notes: qh.WIDEfacet= max(qh.MAXoutside,qh_WIDEcoplanar*qh.MAXcoplanar, qh_WIDEcoplanar * qh.MINvisible); @@ -791,13 +791,13 @@ stop after qh_JOGGLEmaxretry attempts /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="MAXnarrow">-</a> - + qh_MAXnarrow max. cosine in initial hull that sets qh.NARROWhull - + notes: - If qh.NARROWhull, the initial partition does not make - coplanar points. If narrow, a coplanar point can be + If qh.NARROWhull, the initial partition does not make + coplanar points. If narrow, a coplanar point can be coplanar to two facets of opposite orientations and distant from the exact convex hull. @@ -807,24 +807,24 @@ stop after qh_JOGGLEmaxretry attempts /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="WARNnarrow">-</a> - + qh_WARNnarrow max. cosine in initial hull to warn about qh.NARROWhull - + notes: - this is a conservative estimate. + this is a conservative estimate. Don't actually see problems until it is -1.0. See qh-impre.htm */ #define qh_WARNnarrow -0.999999999999999 /*-<a href="qh-user.htm#TOC" >--------------------------------</a><a name="ZEROdelaunay">-</a> - + qh_ZEROdelaunay a zero Delaunay facet occurs for input sites coplanar with their convex hull the last normal coefficient of a zero Delaunay facet is within qh_ZEROdelaunay * qh.ANGLEround of 0 - + notes: qh_ZEROdelaunay does not allow for joggled input ('QJ'). diff --git a/src/user_eg.c b/src/user_eg.c index fb5524d..56daf14 100644 --- a/src/user_eg.c +++ b/src/user_eg.c @@ -18,7 +18,7 @@ user_eg "QR0 p" "QR0 v p" "QR0 Fp" # rotate input and return points # 'v' returns Voronoi - # transform is rotated for halfspaces + # transform is rotated for halfspaces main() makes three runs of qhull. @@ -84,9 +84,9 @@ void makecube (coordT *points, int numpoints, int dim) { point= points + j*dim; for (k=dim; k--; ) { if (j & ( 1 << k)) - point[k]= 1.0; + point[k]= 1.0; else - point[k]= -1.0; + point[k]= -1.0; } } } /*.makecube.*/ @@ -160,9 +160,9 @@ void makehalf (coordT *points, int numpoints, int dim) { point[dim]= -1.0; /* offset */ for (k=dim; k--; ) { if (j & ( 1 << k)) - point[k]= 1.0; + point[k]= 1.0; else - point[k]= -1.0; + point[k]= -1.0; } } } /*.makehalf.*/ @@ -182,18 +182,18 @@ void makehalf (coordT *points, int numpoints, int dim) { */ int main (int argc, char *argv[]) { - int dim= DIM; /* dimension of points */ + int dim= DIM; /* dimension of points */ int numpoints; /* number of points */ coordT points[(DIM+1)*TOTpoints]; /* array of coordinates for each point */ coordT *rows[TOTpoints]; boolT ismalloc= False; /* True if qhull should free points in qh_freeqhull() or reallocation */ char flags[250]; /* option flags for qhull, see qh_opt.htm */ FILE *outfile= stdout; /* output from qh_produce_output() - use NULL to skip qh_produce_output() */ + use NULL to skip qh_produce_output() */ FILE *errfile= stderr; /* error messages from qhull code */ int exitcode; /* 0 if no error from qhull */ - facetT *facet; /* set by FORALLfacets */ - int curlong, totlong; /* memory remaining after qh_memfreeshort */ + facetT *facet; /* set by FORALLfacets */ + int curlong, totlong; /* memory remaining after qh_memfreeshort */ int i; printf ("This is the output from user_eg.c\n\n\ @@ -280,7 +280,7 @@ your project.\n\n"); print_summary(); printf( "\nfree first triangulation and restore second one.\n"); qh_freeqhull (qh_ALL); /* free short and long memory used by first call */ - /* do not use qh_memfreeshort */ + /* do not use qh_memfreeshort */ qh_restore_qhull (&oldqhB); print_summary(); } diff --git a/src/user_eg2.c b/src/user_eg2.c index afffbd7..b83fea2 100644 --- a/src/user_eg2.c +++ b/src/user_eg2.c @@ -23,7 +23,7 @@ user_eg2 "QR0 p" "QR0 v p" "QR0 Fp" # rotate input and return points # 'v' returns Voronoi - # transform is rotated for halfspaces + # transform is rotated for halfspaces main() makes three runs of qhull. @@ -93,9 +93,9 @@ void makecube (coordT *points, int numpoints, int dim) { point= points + j*dim; for (k=dim; k--; ) { if (j & ( 1 << k)) - point[k]= 1.0; + point[k]= 1.0; else - point[k]= -1.0; + point[k]= -1.0; } } } /*.makecube.*/ @@ -129,14 +129,14 @@ void adddiamond (coordT *points, int numpoints, int numnew, int dim) { */ for (k=dim; k--; ) { if (j/2 == k) - point[k]= (j & 1) ? 2.0 : -2.0; + point[k]= (j & 1) ? 2.0 : -2.0; else - point[k]= 0.0; + point[k]= 0.0; } facet= qh_findbestfacet (point, !qh_ALL, &bestdist, &isoutside); if (isoutside) { if (!qh_addpoint (point, facet, False)) - break; /* user requested an early exit with 'TVn' or 'TCn' */ + break; /* user requested an early exit with 'TVn' or 'TCn' */ } printf ("%d vertices and %d facets\n", qh num_vertices, qh num_facets); @@ -202,11 +202,11 @@ void addDelaunay (coordT *points, int numpoints, int numnew, int dim) { facet= qh_findbestfacet (point, !qh_ALL, &bestdist, &isoutside); if (isoutside) { if (!qh_addpoint (point, facet, False)) - break; /* user requested an early exit with 'TVn' or 'TCn' */ + break; /* user requested an early exit with 'TVn' or 'TCn' */ } qh_printpoint (stdout, "added point", point); printf ("%d points, %d extra points, %d vertices, and %d facets in total\n", - qh num_points, qh_setsize (qh other_points), + qh num_points, qh_setsize (qh other_points), qh num_vertices, qh num_facets); /* qh_produce_output(); */ @@ -265,9 +265,9 @@ void makehalf (coordT *points, int numpoints, int dim) { point[dim]= -1.0; /* offset */ for (k=dim; k--; ) { if (j & ( 1 << k)) - point[k]= 1.0; + point[k]= 1.0; else - point[k]= -1.0; + point[k]= -1.0; } } } /*.makehalf.*/ @@ -304,22 +304,22 @@ void addhalf (coordT *points, int numpoints, int numnew, int dim, coordT *feasib offset= -1.0; for (k=dim; k--; ) { if (j/2 == k) { - normal[k]= sqrt((coordT)dim); /* to normalize as in makehalf */ - if (j & 1) - normal[k]= -normal[k]; + normal[k]= sqrt((coordT)dim); /* to normalize as in makehalf */ + if (j & 1) + normal[k]= -normal[k]; }else - normal[k]= 0.0; + normal[k]= 0.0; } point= points + (numpoints+j)* (dim+1); /* does not use point[dim] */ qh_sethalfspace (dim, point, &next, normal, &offset, feasible); facet= qh_findbestfacet (point, !qh_ALL, &bestdist, &isoutside); if (isoutside) { if (!qh_addpoint (point, facet, False)) - break; /* user requested an early exit with 'TVn' or 'TCn' */ + break; /* user requested an early exit with 'TVn' or 'TCn' */ } qh_printpoint (stdout, "added offset -1 and normal", normal); printf ("%d points, %d extra points, %d vertices, and %d facets in total\n", - qh num_points, qh_setsize (qh other_points), + qh num_points, qh_setsize (qh other_points), qh num_vertices, qh num_facets); /* qh_produce_output(); */ } @@ -352,7 +352,7 @@ int main (int argc, char *argv[]) { It shows how qhull() may be called from an application. It is not part\n\ of qhull itself. If it appears accidently, please remove user_eg2.c from\n\ your project.\n\n"); - ismalloc= False; /* True if qh_freeqhull should 'free(array)' */ + ismalloc= False; /* True if qh_freeqhull should 'free(array)' */ /* Run 1: convex hull */ @@ -513,8 +513,8 @@ void qh_errexit(int exitcode, facetT *facet, ridgeT *ridge) { void qh_errprint(const char *string, facetT *atfacet, facetT *otherfacet, ridgeT *atridge, vertexT *atvertex) { fprintf (qh ferr, "%s facets f%d f%d ridge r%d vertex v%d\n", - string, getid_(atfacet), getid_(otherfacet), getid_(atridge), - getid_(atvertex)); + string, getid_(atfacet), getid_(otherfacet), getid_(atridge), + getid_(atvertex)); } /* errprint */ diff --git a/src/usermem.c b/src/usermem.c index 134a415..5a8ac48 100644 --- a/src/usermem.c +++ b/src/usermem.c @@ -1,7 +1,7 @@ /*<html><pre> -<a href="qh-user.htm" >-------------------------------</a><a name="TOP">-</a> - usermem.c + usermem.c qh_exit(), qh_free(), and qh_malloc() see README.txt see COPYING.txt for copyright information. @@ -18,7 +18,7 @@ Please report any errors that you fix to qhull@qhull.org */ -#include "libqhull.h" +#include "libqhull.h" #include <stdlib.h> diff --git a/src/userprintf.c b/src/userprintf.c index 4183061..9602453 100644 --- a/src/userprintf.c +++ b/src/userprintf.c @@ -1,7 +1,7 @@ /*<html><pre> -<a href="qh-user.htm" >-------------------------------</a><a name="TOP">-</a> - userprintf.c + userprintf.c qh_fprintf() and qh_fprintf_rbox() see README.txt see COPYING.txt for copyright information. @@ -19,7 +19,7 @@ Please report any errors that you fix to qhull@qhull.org */ -#include "libqhull.h" +#include "libqhull.h" #include <stdarg.h> #include <stdio.h> @@ -27,7 +27,7 @@ /*-<a href="qh-user.htm#TOC" >-------------------------------</a><a name="qh_fprintf">-</a> - + qh_fprintf(fp, msgcode, format, list of args ) print arguments to *fp according to format Use qh_fprintf_rbox() for rboxlib.c @@ -35,7 +35,7 @@ notes: same as fprintf() fgets() is not trapped like fprintf() - exit qh_fprintf via qh_errexit() + exit qh_fprintf via qh_errexit() exit qh_fprintf_rbox via qh_errexit_rbox() */ @@ -65,7 +65,7 @@ void qh_fprintf(FILE *fp, int msgcode, const char *fmt, ... ) { void qh_fprintf_rbox(FILE *fp, int msgcode, const char *fmt, ... ) { va_list args; - + if (!fp) { fprintf(stderr, "QH6231 Qhull internal error (userprintf.c): fp is 0. Wrong qh_fprintf_rbox called.\n"); qh_errexit_rbox(6231); -- GitLab