libmove3d
3.13.0
|
00001 /*<html><pre> -<a href="qh-user.htm" 00002 >-------------------------------</a><a name="TOP">-</a> 00003 00004 user.h 00005 user redefinable constants 00006 00007 see qh-user.htm. see COPYING for copyright information. 00008 00009 before reading any code, review libqhull.h for data structure definitions and 00010 the "qh" macro. 00011 00012 Sections: 00013 ============= qhull library constants ====================== 00014 ============= data types and configuration macros ========== 00015 ============= performance related constants ================ 00016 ============= memory constants ============================= 00017 ============= joggle constants ============================= 00018 ============= conditional compilation ====================== 00019 ============= -merge constants- ============================ 00020 00021 Code flags -- 00022 NOerrors -- the code does not call qh_errexit() 00023 WARN64 -- the code may be incompatible with 64-bit pointers 00024 00025 */ 00026 00027 #include <time.h> 00028 00029 #ifndef qhDEFuser 00030 #define qhDEFuser 1 00031 00032 /*============================================================*/ 00033 /*============= qhull library constants ======================*/ 00034 /*============================================================*/ 00035 00036 /*-<a href="qh-user.htm#TOC" 00037 >--------------------------------</a><a name="filenamelen">-</a> 00038 00039 FILENAMElen -- max length for TI and TO filenames 00040 00041 */ 00042 00043 #define qh_FILENAMElen 500 00044 00045 /*-<a href="qh-user.htm#TOC" 00046 >--------------------------------</a><a name="msgcode">-</a> 00047 00048 msgcode -- Unique message codes for qh_fprintf 00049 00050 If add new messages, assign these values and increment. 00051 00052 def counters = [27, 1047, 2059, 3025, 4068, 5003, 00053 6233, 7079, 8143, 9410, 10026] 00054 00055 See: qh_ERR* [libqhull.h] 00056 */ 00057 00058 #define MSG_TRACE0 0 00059 #define MSG_TRACE1 1000 00060 #define MSG_TRACE2 2000 00061 #define MSG_TRACE3 3000 00062 #define MSG_TRACE4 4000 00063 #define MSG_TRACE5 5000 00064 #define MSG_ERROR 6000 /* errors written to qh.ferr */ 00065 #define MSG_WARNING 7000 00066 #define MSG_STDERR 8000 /* log messages Written to qh.ferr */ 00067 #define MSG_OUTPUT 9000 00068 #define MSG_FIXUP 10000 00069 #define MSG_MAXLEN 3000 /* qh_printhelp_degenerate() in user.c */ 00070 00071 00072 /*-<a href="qh-user.htm#TOC" 00073 >--------------------------------</a><a name="qh_OPTIONline">-</a> 00074 00075 qh_OPTIONline -- max length of an option line 'FO' 00076 */ 00077 #define qh_OPTIONline 80 00078 00079 /*============================================================*/ 00080 /*============= data types and configuration macros ==========*/ 00081 /*============================================================*/ 00082 00083 /*-<a href="qh-user.htm#TOC" 00084 >--------------------------------</a><a name="realT">-</a> 00085 00086 realT 00087 set the size of floating point numbers 00088 00089 qh_REALdigits 00090 maximimum number of significant digits 00091 00092 qh_REAL_1, qh_REAL_2n, qh_REAL_3n 00093 format strings for printf 00094 00095 qh_REALmax, qh_REALmin 00096 maximum and minimum (near zero) values 00097 00098 qh_REALepsilon 00099 machine roundoff. Maximum roundoff error for addition and multiplication. 00100 00101 notes: 00102 Select whether to store floating point numbers in single precision (float) 00103 or double precision (double). 00104 00105 Use 'float' to save about 8% in time and 25% in space. This is particularly 00106 helpful if high-d where convex hulls are space limited. Using 'float' also 00107 reduces the printed size of Qhull's output since numbers have 8 digits of 00108 precision. 00109 00110 Use 'double' when greater arithmetic precision is needed. This is needed 00111 for Delaunay triangulations and Voronoi diagrams when you are not merging 00112 facets. 00113 00114 If 'double' gives insufficient precision, your data probably includes 00115 degeneracies. If so you should use facet merging (done by default) 00116 or exact arithmetic (see imprecision section of manual, qh-impre.htm). 00117 You may also use option 'Po' to force output despite precision errors. 00118 00119 You may use 'long double', but many format statements need to be changed 00120 and you may need a 'long double' square root routine. S. Grundmann 00121 (sg@eeiwzb.et.tu-dresden.de) has done this. He reports that the code runs 00122 much slower with little gain in precision. 00123 00124 WARNING: on some machines, int f(){realT a= REALmax;return (a == REALmax);} 00125 returns False. Use (a > REALmax/2) instead of (a == REALmax). 00126 00127 REALfloat = 1 all numbers are 'float' type 00128 = 0 all numbers are 'double' type 00129 */ 00130 #define REALfloat 0 00131 00132 #if (REALfloat == 1) 00133 #define realT float 00134 #define REALmax FLT_MAX 00135 #define REALmin FLT_MIN 00136 #define REALepsilon FLT_EPSILON 00137 #define qh_REALdigits 8 /* maximum number of significant digits */ 00138 #define qh_REAL_1 "%6.8g " 00139 #define qh_REAL_2n "%6.8g %6.8g\n" 00140 #define qh_REAL_3n "%6.8g %6.8g %6.8g\n" 00141 00142 #elif (REALfloat == 0) 00143 #define realT double 00144 #define REALmax DBL_MAX 00145 #define REALmin DBL_MIN 00146 #define REALepsilon DBL_EPSILON 00147 #define qh_REALdigits 16 /* maximum number of significant digits */ 00148 #define qh_REAL_1 "%6.16g " 00149 #define qh_REAL_2n "%6.16g %6.16g\n" 00150 #define qh_REAL_3n "%6.16g %6.16g %6.16g\n" 00151 00152 #else 00153 #error unknown float option 00154 #endif 00155 00156 /*-<a href="qh-user.htm#TOC" 00157 >--------------------------------</a><a name="CPUclock">-</a> 00158 00159 qh_CPUclock 00160 define the clock() function for reporting the total time spent by Qhull 00161 returns CPU ticks as a 'long int' 00162 qh_CPUclock is only used for reporting the total time spent by Qhull 00163 00164 qh_SECticks 00165 the number of clock ticks per second 00166 00167 notes: 00168 looks for CLOCKS_PER_SEC, CLOCKS_PER_SECOND, or assumes microseconds 00169 to define a custom clock, set qh_CLOCKtype to 0 00170 00171 if your system does not use clock() to return CPU ticks, replace 00172 qh_CPUclock with the corresponding function. It is converted 00173 to 'unsigned long' to prevent wrap-around during long runs. By default, 00174 <time.h> defines clock_t as 'long' 00175 00176 Set qh_CLOCKtype to 00177 00178 1 for CLOCKS_PER_SEC, CLOCKS_PER_SECOND, or microsecond 00179 Note: may fail if more than 1 hour elapsed time 00180 00181 2 use qh_clock() with POSIX times() (see global.c) 00182 */ 00183 #define qh_CLOCKtype 1 /* change to the desired number */ 00184 00185 #if (qh_CLOCKtype == 1) 00186 00187 #if defined(CLOCKS_PER_SECOND) 00188 #define qh_CPUclock ((unsigned long)clock()) /* return CPU clock */ 00189 #define qh_SECticks CLOCKS_PER_SECOND 00190 00191 #elif defined(CLOCKS_PER_SEC) 00192 #define qh_CPUclock ((unsigned long)clock()) /* return CPU clock */ 00193 #define qh_SECticks CLOCKS_PER_SEC 00194 00195 #elif defined(CLK_TCK) 00196 #define qh_CPUclock ((unsigned long)clock()) /* return CPU clock */ 00197 #define qh_SECticks CLK_TCK 00198 00199 #else 00200 #define qh_CPUclock ((unsigned long)clock()) /* return CPU clock */ 00201 #define qh_SECticks 1E6 00202 #endif 00203 00204 #elif (qh_CLOCKtype == 2) 00205 #define qh_CPUclock qh_clock() /* return CPU clock */ 00206 #define qh_SECticks 100 00207 00208 #else /* qh_CLOCKtype == ? */ 00209 #error unknown clock option 00210 #endif 00211 00212 /*-<a href="qh-user.htm#TOC" 00213 >--------------------------------</a><a name="RANDOM">-</a> 00214 00215 qh_RANDOMtype, qh_RANDOMmax, qh_RANDOMseed 00216 define random number generator 00217 00218 qh_RANDOMint generates a random integer between 0 and qh_RANDOMmax. 00219 qh_RANDOMseed sets the random number seed for qh_RANDOMint 00220 00221 Set qh_RANDOMtype (default 5) to: 00222 1 for random() with 31 bits (UCB) 00223 2 for rand() with RAND_MAX or 15 bits (system 5) 00224 3 for rand() with 31 bits (Sun) 00225 4 for lrand48() with 31 bits (Solaris) 00226 5 for qh_rand() with 31 bits (included with Qhull) 00227 00228 notes: 00229 Random numbers are used by rbox to generate point sets. Random 00230 numbers are used by Qhull to rotate the input ('QRn' option), 00231 simulate a randomized algorithm ('Qr' option), and to simulate 00232 roundoff errors ('Rn' option). 00233 00234 Random number generators differ between systems. Most systems provide 00235 rand() but the period varies. The period of rand() is not critical 00236 since qhull does not normally use random numbers. 00237 00238 The default generator is Park & Miller's minimal standard random 00239 number generator [CACM 31:1195 '88]. It is included with Qhull. 00240 00241 If qh_RANDOMmax is wrong, qhull will report a warning and Geomview 00242 output will likely be invisible. 00243 */ 00244 #define qh_RANDOMtype 5 /* *** change to the desired number *** */ 00245 00246 #if (qh_RANDOMtype == 1) 00247 #define qh_RANDOMmax ((realT)0x7fffffffUL) /* 31 bits, random()/MAX */ 00248 #define qh_RANDOMint random() 00249 #define qh_RANDOMseed_(seed) srandom(seed); 00250 00251 #elif (qh_RANDOMtype == 2) 00252 #ifdef RAND_MAX 00253 #define qh_RANDOMmax ((realT)RAND_MAX) 00254 #else 00255 #define qh_RANDOMmax ((realT)32767) /* 15 bits (System 5) */ 00256 #endif 00257 #define qh_RANDOMint rand() 00258 #define qh_RANDOMseed_(seed) srand((unsigned)seed); 00259 00260 #elif (qh_RANDOMtype == 3) 00261 #define qh_RANDOMmax ((realT)0x7fffffffUL) /* 31 bits, Sun */ 00262 #define qh_RANDOMint rand() 00263 #define qh_RANDOMseed_(seed) srand((unsigned)seed); 00264 00265 #elif (qh_RANDOMtype == 4) 00266 #define qh_RANDOMmax ((realT)0x7fffffffUL) /* 31 bits, lrand38()/MAX */ 00267 #define qh_RANDOMint lrand48() 00268 #define qh_RANDOMseed_(seed) srand48(seed); 00269 00270 #elif (qh_RANDOMtype == 5) 00271 #define qh_RANDOMmax ((realT)2147483646UL) /* 31 bits, qh_rand/MAX */ 00272 #define qh_RANDOMint qh_rand() 00273 #define qh_RANDOMseed_(seed) qh_srand(seed); 00274 /* unlike rand(), never returns 0 */ 00275 00276 #else 00277 #error: unknown random option 00278 #endif 00279 00280 /*-<a href="qh-user.htm#TOC" 00281 >--------------------------------</a><a name="ORIENTclock">-</a> 00282 00283 qh_ORIENTclock 00284 0 for inward pointing normals by Geomview convention 00285 */ 00286 #define qh_ORIENTclock 0 00287 00288 00289 /*============================================================*/ 00290 /*============= joggle constants =============================*/ 00291 /*============================================================*/ 00292 00293 /*-<a href="qh-user.htm#TOC" 00294 >--------------------------------</a><a name="JOGGLEdefault">-</a> 00295 00296 qh_JOGGLEdefault 00297 default qh.JOGGLEmax is qh.DISTround * qh_JOGGLEdefault 00298 00299 notes: 00300 rbox s r 100 | qhull QJ1e-15 QR0 generates 90% faults at distround 7e-16 00301 rbox s r 100 | qhull QJ1e-14 QR0 generates 70% faults 00302 rbox s r 100 | qhull QJ1e-13 QR0 generates 35% faults 00303 rbox s r 100 | qhull QJ1e-12 QR0 generates 8% faults 00304 rbox s r 100 | qhull QJ1e-11 QR0 generates 1% faults 00305 rbox s r 100 | qhull QJ1e-10 QR0 generates 0% faults 00306 rbox 1000 W0 | qhull QJ1e-12 QR0 generates 86% faults 00307 rbox 1000 W0 | qhull QJ1e-11 QR0 generates 20% faults 00308 rbox 1000 W0 | qhull QJ1e-10 QR0 generates 2% faults 00309 the later have about 20 points per facet, each of which may interfere 00310 00311 pick a value large enough to avoid retries on most inputs 00312 */ 00313 #define qh_JOGGLEdefault 30000.0 00314 00315 /*-<a href="qh-user.htm#TOC" 00316 >--------------------------------</a><a name="JOGGLEincrease">-</a> 00317 00318 qh_JOGGLEincrease 00319 factor to increase qh.JOGGLEmax on qh_JOGGLEretry or qh_JOGGLEagain 00320 */ 00321 #define qh_JOGGLEincrease 10.0 00322 00323 /*-<a href="qh-user.htm#TOC" 00324 >--------------------------------</a><a name="JOGGLEretry">-</a> 00325 00326 qh_JOGGLEretry 00327 if ZZretry = qh_JOGGLEretry, increase qh.JOGGLEmax 00328 00329 notes: 00330 try twice at the original value in case of bad luck the first time 00331 */ 00332 #define qh_JOGGLEretry 2 00333 00334 /*-<a href="qh-user.htm#TOC" 00335 >--------------------------------</a><a name="JOGGLEagain">-</a> 00336 00337 qh_JOGGLEagain 00338 every following qh_JOGGLEagain, increase qh.JOGGLEmax 00339 00340 notes: 00341 1 is OK since it's already failed qh_JOGGLEretry times 00342 */ 00343 #define qh_JOGGLEagain 1 00344 00345 /*-<a href="qh-user.htm#TOC" 00346 >--------------------------------</a><a name="JOGGLEmaxincrease">-</a> 00347 00348 qh_JOGGLEmaxincrease 00349 maximum qh.JOGGLEmax due to qh_JOGGLEincrease 00350 relative to qh.MAXwidth 00351 00352 notes: 00353 qh.joggleinput will retry at this value until qh_JOGGLEmaxretry 00354 */ 00355 #define qh_JOGGLEmaxincrease 1e-2 00356 00357 /*-<a href="qh-user.htm#TOC" 00358 >--------------------------------</a><a name="JOGGLEmaxretry">-</a> 00359 00360 qh_JOGGLEmaxretry 00361 stop after qh_JOGGLEmaxretry attempts 00362 */ 00363 #define qh_JOGGLEmaxretry 100 00364 00365 /*============================================================*/ 00366 /*============= performance related constants ================*/ 00367 /*============================================================*/ 00368 00369 /*-<a href="qh-user.htm#TOC" 00370 >--------------------------------</a><a name="HASHfactor">-</a> 00371 00372 qh_HASHfactor 00373 total hash slots / used hash slots. Must be at least 1.1. 00374 00375 notes: 00376 =2 for at worst 50% occupancy for qh hash_table and normally 25% occupancy 00377 */ 00378 #define qh_HASHfactor 2 00379 00380 /*-<a href="qh-user.htm#TOC" 00381 >--------------------------------</a><a name="VERIFYdirect">-</a> 00382 00383 qh_VERIFYdirect 00384 with 'Tv' verify all points against all facets if op count is smaller 00385 00386 notes: 00387 if greater, calls qh_check_bestdist() instead 00388 */ 00389 #define qh_VERIFYdirect 1000000 00390 00391 /*-<a href="qh-user.htm#TOC" 00392 >--------------------------------</a><a name="INITIALsearch">-</a> 00393 00394 qh_INITIALsearch 00395 if qh_INITIALmax, search points up to this dimension 00396 */ 00397 #define qh_INITIALsearch 6 00398 00399 /*-<a href="qh-user.htm#TOC" 00400 >--------------------------------</a><a name="INITIALmax">-</a> 00401 00402 qh_INITIALmax 00403 if dim >= qh_INITIALmax, use min/max coordinate points for initial simplex 00404 00405 notes: 00406 from points with non-zero determinants 00407 use option 'Qs' to override (much slower) 00408 */ 00409 #define qh_INITIALmax 8 00410 00411 /*============================================================*/ 00412 /*============= memory constants =============================*/ 00413 /*============================================================*/ 00414 00415 /*-<a href="qh-user.htm#TOC" 00416 >--------------------------------</a><a name="MEMalign">-</a> 00417 00418 qh_MEMalign 00419 memory alignment for qh_meminitbuffers() in global.c 00420 00421 notes: 00422 to avoid bus errors, memory allocation must consider alignment requirements. 00423 malloc() automatically takes care of alignment. Since mem.c manages 00424 its own memory, we need to explicitly specify alignment in 00425 qh_meminitbuffers(). 00426 00427 A safe choice is sizeof(double). sizeof(float) may be used if doubles 00428 do not occur in data structures and pointers are the same size. Be careful 00429 of machines (e.g., DEC Alpha) with large pointers. 00430 00431 If using gcc, best alignment is 00432 #define qh_MEMalign fmax_(__alignof__(realT),__alignof__(void *)) 00433 */ 00434 #define qh_MEMalign ((int)(fmax_(sizeof(realT), sizeof(void *)))) 00435 00436 /*-<a href="qh-user.htm#TOC" 00437 >--------------------------------</a><a name="MEMbufsize">-</a> 00438 00439 qh_MEMbufsize 00440 size of additional memory buffers 00441 00442 notes: 00443 used for qh_meminitbuffers() in global.c 00444 */ 00445 #define qh_MEMbufsize 0x10000 /* allocate 64K memory buffers */ 00446 00447 /*-<a href="qh-user.htm#TOC" 00448 >--------------------------------</a><a name="MEMinitbuf">-</a> 00449 00450 qh_MEMinitbuf 00451 size of initial memory buffer 00452 00453 notes: 00454 use for qh_meminitbuffers() in global.c 00455 */ 00456 #define qh_MEMinitbuf 0x20000 /* initially allocate 128K buffer */ 00457 00458 /*-<a href="qh-user.htm#TOC" 00459 >--------------------------------</a><a name="INFINITE">-</a> 00460 00461 qh_INFINITE 00462 on output, indicates Voronoi center at infinity 00463 */ 00464 #define qh_INFINITE -10.101 00465 00466 /*-<a href="qh-user.htm#TOC" 00467 >--------------------------------</a><a name="DEFAULTbox">-</a> 00468 00469 qh_DEFAULTbox 00470 default box size (Geomview expects 0.5) 00471 00472 qh_DEFAULTbox 00473 default box size for integer coorindate (rbox only) 00474 */ 00475 #define qh_DEFAULTbox 0.5 00476 #define qh_DEFAULTzbox 1e6 00477 00478 /*============================================================*/ 00479 /*============= conditional compilation ======================*/ 00480 /*============================================================*/ 00481 00482 /*-<a href="qh-user.htm#TOC" 00483 >--------------------------------</a><a name="compiler">-</a> 00484 00485 __cplusplus 00486 defined by C++ compilers 00487 00488 __MSC_VER 00489 defined by Microsoft Visual C++ 00490 00491 __MWERKS__ && __POWERPC__ 00492 defined by Metrowerks when compiling for the Power Macintosh 00493 00494 __STDC__ 00495 defined for strict ANSI C 00496 */ 00497 00498 /*-<a href="qh-user.htm#TOC" 00499 >--------------------------------</a><a name="COMPUTEfurthest">-</a> 00500 00501 qh_COMPUTEfurthest 00502 compute furthest distance to an outside point instead of storing it with the facet 00503 =1 to compute furthest 00504 00505 notes: 00506 computing furthest saves memory but costs time 00507 about 40% more distance tests for partitioning 00508 removes facet->furthestdist 00509 */ 00510 #define qh_COMPUTEfurthest 0 00511 00512 /*-<a href="qh-user.htm#TOC" 00513 >--------------------------------</a><a name="KEEPstatistics">-</a> 00514 00515 qh_KEEPstatistics 00516 =0 removes most of statistic gathering and reporting 00517 00518 notes: 00519 if 0, code size is reduced by about 4%. 00520 */ 00521 #define qh_KEEPstatistics 1 00522 00523 /*-<a href="qh-user.htm#TOC" 00524 >--------------------------------</a><a name="MAXoutside">-</a> 00525 00526 qh_MAXoutside 00527 record outer plane for each facet 00528 =1 to record facet->maxoutside 00529 00530 notes: 00531 this takes a realT per facet and slightly slows down qhull 00532 it produces better outer planes for geomview output 00533 */ 00534 #define qh_MAXoutside 1 00535 00536 /*-<a href="qh-user.htm#TOC" 00537 >--------------------------------</a><a name="NOmerge">-</a> 00538 00539 qh_NOmerge 00540 disables facet merging if defined 00541 00542 notes: 00543 This saves about 10% space. 00544 00545 Unless 'Q0' 00546 qh_NOmerge sets 'QJ' to avoid precision errors 00547 00548 #define qh_NOmerge 00549 00550 see: 00551 <a href="mem.h#NOmem">qh_NOmem</a> in mem.c 00552 00553 see user.c/user_eg.c for removing io.o 00554 */ 00555 00556 /*-<a href="qh-user.htm#TOC" 00557 >--------------------------------</a><a name="NOtrace">-</a> 00558 00559 qh_NOtrace 00560 no tracing if defined 00561 00562 notes: 00563 This saves about 5% space. 00564 00565 #define qh_NOtrace 00566 */ 00567 00568 /*-<a href="qh-user.htm#TOC" 00569 >--------------------------------</a><a name="QHpointer">-</a> 00570 00571 qh_QHpointer 00572 access global data with pointer or static structure 00573 00574 qh_QHpointer = 1 access globals via a pointer to allocated memory 00575 enables qh_saveqhull() and qh_restoreqhull() 00576 [2010, gcc] costs about 4% in time and 4% in space 00577 [2003, msvc] costs about 8% in time and 2% in space 00578 00579 = 0 qh_qh and qh_qhstat are static data structures 00580 only one instance of qhull() can be active at a time 00581 default value 00582 00583 notes: 00584 all global variables for qhull are in qh, qhmem, and qhstat 00585 qh is defined in libqhull.h 00586 qhmem is defined in mem.h 00587 qhstat is defined in stat.h 00588 C++ build defines qh_QHpointer [libqhullp.pro, libqhullcpp.pro] 00589 00590 see: 00591 user_eg.c for an example 00592 FIXUP need to override for C++ (-Dqh_QHpointer=1) 00593 */ 00594 #ifndef qh_QHpointer 00595 #define qh_QHpointer 0 00596 #endif 00597 #if 0 /* sample code */ 00598 qhT *oldqhA, *oldqhB; 00599 00600 exitcode= qh_new_qhull(dim, numpoints, points, ismalloc, 00601 flags, outfile, errfile); 00602 /* use results from first call to qh_new_qhull */ 00603 oldqhA= qh_save_qhull(); 00604 exitcode= qh_new_qhull(dimB, numpointsB, pointsB, ismalloc, 00605 flags, outfile, errfile); 00606 /* use results from second call to qh_new_qhull */ 00607 oldqhB= qh_save_qhull(); 00608 qh_restore_qhull(&oldqhA); 00609 /* use results from first call to qh_new_qhull */ 00610 qh_freeqhull(qh_ALL); /* frees all memory used by first call */ 00611 qh_restore_qhull(&oldqhB); 00612 /* use results from second call to qh_new_qhull */ 00613 qh_freeqhull(!qh_ALL); /* frees long memory used by second call */ 00614 qh_memfreeshort(&curlong, &totlong); /* frees short memory and memory allocator */ 00615 #endif 00616 00617 /*-<a href="qh-user.htm#TOC" 00618 >--------------------------------</a><a name="QUICKhelp">-</a> 00619 00620 qh_QUICKhelp 00621 =1 to use abbreviated help messages, e.g., for degenerate inputs 00622 */ 00623 #define qh_QUICKhelp 0 00624 00625 /*============================================================*/ 00626 /*============= -merge constants- ============================*/ 00627 /*============================================================*/ 00628 /* 00629 These constants effect facet merging. You probably will not need 00630 to modify them. They effect the performance of facet merging. 00631 */ 00632 00633 /*-<a href="qh-user.htm#TOC" 00634 >--------------------------------</a><a name="DIMmergeVertex">-</a> 00635 00636 qh_DIMmergeVertex 00637 max dimension for vertex merging (it is not effective in high-d) 00638 */ 00639 #define qh_DIMmergeVertex 6 00640 00641 /*-<a href="qh-user.htm#TOC" 00642 >--------------------------------</a><a name="DIMreduceBuild">-</a> 00643 00644 qh_DIMreduceBuild 00645 max dimension for vertex reduction during build (slow in high-d) 00646 */ 00647 #define qh_DIMreduceBuild 5 00648 00649 /*-<a href="qh-user.htm#TOC" 00650 >--------------------------------</a><a name="BESTcentrum">-</a> 00651 00652 qh_BESTcentrum 00653 if > 2*dim+n vertices, qh_findbestneighbor() tests centrums (faster) 00654 else, qh_findbestneighbor() tests all vertices (much better merges) 00655 00656 qh_BESTcentrum2 00657 if qh_BESTcentrum2 * DIM3 + BESTcentrum < #vertices tests centrums 00658 */ 00659 #define qh_BESTcentrum 20 00660 #define qh_BESTcentrum2 2 00661 00662 /*-<a href="qh-user.htm#TOC" 00663 >--------------------------------</a><a name="BESTnonconvex">-</a> 00664 00665 qh_BESTnonconvex 00666 if > dim+n neighbors, qh_findbestneighbor() tests nonconvex ridges. 00667 00668 notes: 00669 It is needed because qh_findbestneighbor is slow for large facets 00670 */ 00671 #define qh_BESTnonconvex 15 00672 00673 /*-<a href="qh-user.htm#TOC" 00674 >--------------------------------</a><a name="MAXnewmerges">-</a> 00675 00676 qh_MAXnewmerges 00677 if >n newmerges, qh_merge_nonconvex() calls qh_reducevertices_centrums. 00678 00679 notes: 00680 It is needed because postmerge can merge many facets at once 00681 */ 00682 #define qh_MAXnewmerges 2 00683 00684 /*-<a href="qh-user.htm#TOC" 00685 >--------------------------------</a><a name="MAXnewcentrum">-</a> 00686 00687 qh_MAXnewcentrum 00688 if <= dim+n vertices (n approximates the number of merges), 00689 reset the centrum in qh_updatetested() and qh_mergecycle_facets() 00690 00691 notes: 00692 needed to reduce cost and because centrums may move too much if 00693 many vertices in high-d 00694 */ 00695 #define qh_MAXnewcentrum 5 00696 00697 /*-<a href="qh-user.htm#TOC" 00698 >--------------------------------</a><a name="COPLANARratio">-</a> 00699 00700 qh_COPLANARratio 00701 for 3-d+ merging, qh.MINvisible is n*premerge_centrum 00702 00703 notes: 00704 for non-merging, it's DISTround 00705 */ 00706 #define qh_COPLANARratio 3 00707 00708 /*-<a href="qh-user.htm#TOC" 00709 >--------------------------------</a><a name="DISToutside">-</a> 00710 00711 qh_DISToutside 00712 When is a point clearly outside of a facet? 00713 Stops search in qh_findbestnew or qh_partitionall 00714 qh_findbest uses qh.MINoutside since since it is only called if no merges. 00715 00716 notes: 00717 'Qf' always searches for best facet 00718 if !qh.MERGING, same as qh.MINoutside. 00719 if qh_USEfindbestnew, increase value since neighboring facets may be ill-behaved 00720 [Note: Zdelvertextot occurs normally with interior points] 00721 RBOX 1000 s Z1 G1e-13 t1001188774 | QHULL Tv 00722 When there is a sharp edge, need to move points to a 00723 clearly good facet; otherwise may be lost in another partitioning. 00724 if too big then O(n^2) behavior for partitioning in cone 00725 if very small then important points not processed 00726 Needed in qh_partitionall for 00727 RBOX 1000 s Z1 G1e-13 t1001032651 | QHULL Tv 00728 Needed in qh_findbestnew for many instances of 00729 RBOX 1000 s Z1 G1e-13 t | QHULL Tv 00730 00731 See: 00732 qh_DISToutside -- when is a point clearly outside of a facet 00733 qh_SEARCHdist -- when is facet coplanar with the best facet? 00734 qh_USEfindbestnew -- when to use qh_findbestnew for qh_partitionpoint() 00735 */ 00736 #define qh_DISToutside ((qh_USEfindbestnew ? 2 : 1) * \ 00737 fmax_((qh MERGING ? 2 : 1)*qh MINoutside, qh max_outside)) 00738 00739 /*-<a href="qh-user.htm#TOC" 00740 >--------------------------------</a><a name="RATIOnearinside">-</a> 00741 00742 qh_RATIOnearinside 00743 ratio of qh.NEARinside to qh.ONEmerge for retaining inside points for 00744 qh_check_maxout(). 00745 00746 notes: 00747 This is overkill since do not know the correct value. 00748 It effects whether 'Qc' reports all coplanar points 00749 Not used for 'd' since non-extreme points are coplanar 00750 */ 00751 #define qh_RATIOnearinside 5 00752 00753 /*-<a href="qh-user.htm#TOC" 00754 >--------------------------------</a><a name="SEARCHdist">-</a> 00755 00756 qh_SEARCHdist 00757 When is a facet coplanar with the best facet? 00758 qh_findbesthorizon: all coplanar facets of the best facet need to be searched. 00759 00760 See: 00761 qh_DISToutside -- when is a point clearly outside of a facet 00762 qh_SEARCHdist -- when is facet coplanar with the best facet? 00763 qh_USEfindbestnew -- when to use qh_findbestnew for qh_partitionpoint() 00764 */ 00765 #define qh_SEARCHdist ((qh_USEfindbestnew ? 2 : 1) * \ 00766 (qh max_outside + 2 * qh DISTround + fmax_( qh MINvisible, qh MAXcoplanar))); 00767 00768 /*-<a href="qh-user.htm#TOC" 00769 >--------------------------------</a><a name="USEfindbestnew">-</a> 00770 00771 qh_USEfindbestnew 00772 Always use qh_findbestnew for qh_partitionpoint, otherwise use 00773 qh_findbestnew if merged new facet or sharpnewfacets. 00774 00775 See: 00776 qh_DISToutside -- when is a point clearly outside of a facet 00777 qh_SEARCHdist -- when is facet coplanar with the best facet? 00778 qh_USEfindbestnew -- when to use qh_findbestnew for qh_partitionpoint() 00779 */ 00780 #define qh_USEfindbestnew (zzval_(Ztotmerge) > 50) 00781 00782 /*-<a href="qh-user.htm#TOC" 00783 >--------------------------------</a><a name="WIDEcoplanar">-</a> 00784 00785 qh_WIDEcoplanar 00786 n*MAXcoplanar or n*MINvisible for a WIDEfacet 00787 00788 if vertex is further than qh.WIDEfacet from the hyperplane 00789 then its ridges are not counted in computing the area, and 00790 the facet's centrum is frozen. 00791 00792 notes: 00793 qh.WIDEfacet= max(qh.MAXoutside,qh_WIDEcoplanar*qh.MAXcoplanar, 00794 qh_WIDEcoplanar * qh.MINvisible); 00795 */ 00796 #define qh_WIDEcoplanar 6 00797 00798 /*-<a href="qh-user.htm#TOC" 00799 >--------------------------------</a><a name="MAXnarrow">-</a> 00800 00801 qh_MAXnarrow 00802 max. cosine in initial hull that sets qh.NARROWhull 00803 00804 notes: 00805 If qh.NARROWhull, the initial partition does not make 00806 coplanar points. If narrow, a coplanar point can be 00807 coplanar to two facets of opposite orientations and 00808 distant from the exact convex hull. 00809 00810 Conservative estimate. Don't actually see problems until it is -1.0 00811 */ 00812 #define qh_MAXnarrow -0.99999999 00813 00814 /*-<a href="qh-user.htm#TOC" 00815 >--------------------------------</a><a name="WARNnarrow">-</a> 00816 00817 qh_WARNnarrow 00818 max. cosine in initial hull to warn about qh.NARROWhull 00819 00820 notes: 00821 this is a conservative estimate. 00822 Don't actually see problems until it is -1.0. See qh-impre.htm 00823 */ 00824 #define qh_WARNnarrow -0.999999999999999 00825 00826 /*-<a href="qh-user.htm#TOC" 00827 >--------------------------------</a><a name="ZEROdelaunay">-</a> 00828 00829 qh_ZEROdelaunay 00830 a zero Delaunay facet occurs for input sites coplanar with their convex hull 00831 the last normal coefficient of a zero Delaunay facet is within 00832 qh_ZEROdelaunay * qh.ANGLEround of 0 00833 00834 notes: 00835 qh_ZEROdelaunay does not allow for joggled input ('QJ'). 00836 00837 You can avoid zero Delaunay facets by surrounding the input with a box. 00838 00839 Use option 'PDk:-n' to explicitly define zero Delaunay facets 00840 k= dimension of input sites (e.g., 3 for 3-d Delaunay triangulation) 00841 n= the cutoff for zero Delaunay facets (e.g., 'PD3:-1e-12') 00842 */ 00843 #define qh_ZEROdelaunay 2 00844 00845 #endif /* qh_DEFuser */ 00846 00847 00848