00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef qhDEFstat
00022 #define qhDEFstat 1
00023
00024 #include "libqhull.h"
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef qh_KEEPstatistics
00033 #define qh_KEEPstatistics 1
00034 #endif
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 #if qh_KEEPstatistics
00050 enum statistics {
00051 Zacoplanar,
00052 Wacoplanarmax,
00053 Wacoplanartot,
00054 Zangle,
00055 Wangle,
00056 Wanglemax,
00057 Wanglemin,
00058 Zangletests,
00059 Wareatot,
00060 Wareamax,
00061 Wareamin,
00062 Zavoidold,
00063 Wavoidoldmax,
00064 Wavoidoldtot,
00065 Zback0,
00066 Zbestcentrum,
00067 Zbestdist,
00068 Zbestlower,
00069 Zbestlowerv,
00070 Zcentrumtests,
00071 Zcheckpart,
00072 Zcomputefurthest,
00073 Zconcave,
00074 Wconcavemax,
00075 Wconcavetot,
00076 Zconcaveridges,
00077 Zconcaveridge,
00078 Zcoplanar,
00079 Wcoplanarmax,
00080 Wcoplanartot,
00081 Zcoplanarangle,
00082 Zcoplanarcentrum,
00083 Zcoplanarhorizon,
00084 Zcoplanarinside,
00085 Zcoplanarpart,
00086 Zcoplanarridges,
00087 Wcpu,
00088 Zcyclefacetmax,
00089 Zcyclefacettot,
00090 Zcyclehorizon,
00091 Zcyclevertex,
00092 Zdegen,
00093 Wdegenmax,
00094 Wdegentot,
00095 Zdegenvertex,
00096 Zdelfacetdup,
00097 Zdelridge,
00098 Zdelvertextot,
00099 Zdelvertexmax,
00100 Zdetsimplex,
00101 Zdistcheck,
00102 Zdistconvex,
00103 Zdistgood,
00104 Zdistio,
00105 Zdistplane,
00106 Zdiststat,
00107 Zdistvertex,
00108 Zdistzero,
00109 Zdoc1,
00110 Zdoc2,
00111 Zdoc3,
00112 Zdoc4,
00113 Zdoc5,
00114 Zdoc6,
00115 Zdoc7,
00116 Zdoc8,
00117 Zdoc9,
00118 Zdoc10,
00119 Zdoc11,
00120 Zdoc12,
00121 Zdropdegen,
00122 Zdropneighbor,
00123 Zdupflip,
00124 Zduplicate,
00125 Wduplicatemax,
00126 Wduplicatetot,
00127 Zdupridge,
00128 Zdupsame,
00129 Zflipped,
00130 Wflippedmax,
00131 Wflippedtot,
00132 Zflippedfacets,
00133 Zfindbest,
00134 Zfindbestmax,
00135 Zfindbesttot,
00136 Zfindcoplanar,
00137 Zfindfail,
00138 Zfindhorizon,
00139 Zfindhorizonmax,
00140 Zfindhorizontot,
00141 Zfindjump,
00142 Zfindnew,
00143 Zfindnewmax,
00144 Zfindnewtot,
00145 Zfindnewjump,
00146 Zfindnewsharp,
00147 Zgauss0,
00148 Zgoodfacet,
00149 Zhashlookup,
00150 Zhashridge,
00151 Zhashridgetest,
00152 Zhashtests,
00153 Zinsidevisible,
00154 Zintersect,
00155 Zintersectfail,
00156 Zintersectmax,
00157 Zintersectnum,
00158 Zintersecttot,
00159 Zmaxneighbors,
00160 Wmaxout,
00161 Wmaxoutside,
00162 Zmaxridges,
00163 Zmaxvertex,
00164 Zmaxvertices,
00165 Zmaxvneighbors,
00166 Zmemfacets,
00167 Zmempoints,
00168 Zmemridges,
00169 Zmemvertices,
00170 Zmergeflipdup,
00171 Zmergehorizon,
00172 Zmergeinittot,
00173 Zmergeinitmax,
00174 Zmergeinittot2,
00175 Zmergeintohorizon,
00176 Zmergenew,
00177 Zmergesettot,
00178 Zmergesetmax,
00179 Zmergesettot2,
00180 Zmergesimplex,
00181 Zmergevertex,
00182 Wmindenom,
00183 Wminvertex,
00184 Zminnorm,
00185 Zmultiridge,
00186 Znearlysingular,
00187 Zneighbor,
00188 Wnewbalance,
00189 Wnewbalance2,
00190 Znewfacettot,
00191 Znewfacetmax,
00192 Znewvertex,
00193 Wnewvertex,
00194 Wnewvertexmax,
00195 Znoarea,
00196 Znonsimplicial,
00197 Znowsimplicial,
00198 Znotgood,
00199 Znotgoodnew,
00200 Znotmax,
00201 Znumfacets,
00202 Znummergemax,
00203 Znummergetot,
00204 Znumneighbors,
00205 Znumridges,
00206 Znumvertices,
00207 Znumvisibility,
00208 Znumvneighbors,
00209 Zonehorizon,
00210 Zpartangle,
00211 Zpartcoplanar,
00212 Zpartflip,
00213 Zparthorizon,
00214 Zpartinside,
00215 Zpartition,
00216 Zpartitionall,
00217 Zpartnear,
00218 Zpbalance,
00219 Wpbalance,
00220 Wpbalance2,
00221 Zpostfacets,
00222 Zpremergetot,
00223 Zprocessed,
00224 Zremvertex,
00225 Zremvertexdel,
00226 Zrenameall,
00227 Zrenamepinch,
00228 Zrenameshare,
00229 Zretry,
00230 Wretrymax,
00231 Zridge,
00232 Wridge,
00233 Wridgemax,
00234 Zridge0,
00235 Wridge0,
00236 Wridge0max,
00237 Zridgemid,
00238 Wridgemid,
00239 Wridgemidmax,
00240 Zridgeok,
00241 Wridgeok,
00242 Wridgeokmax,
00243 Zsearchpoints,
00244 Zsetplane,
00245 Ztestvneighbor,
00246 Ztotcheck,
00247 Ztothorizon,
00248 Ztotmerge,
00249 Ztotpartcoplanar,
00250 Ztotpartition,
00251 Ztotridges,
00252 Ztotvertices,
00253 Ztotvisible,
00254 Ztricoplanar,
00255 Ztricoplanarmax,
00256 Ztricoplanartot,
00257 Ztridegen,
00258 Ztrimirror,
00259 Ztrinull,
00260 Wvertexmax,
00261 Wvertexmin,
00262 Zvertexridge,
00263 Zvertexridgetot,
00264 Zvertexridgemax,
00265 Zvertices,
00266 Zvisfacettot,
00267 Zvisfacetmax,
00268 Zvisit,
00269 Zvisit2max,
00270 Zvisvertextot,
00271 Zvisvertexmax,
00272 Zvvisit,
00273 Zvvisit2max,
00274 Zwidefacet,
00275 Zwidevertices,
00276 ZEND};
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286 #else
00287 enum statistics {
00288 Zback0,
00289 Zbestdist,
00290 Zcentrumtests,
00291 Zcheckpart,
00292 Zconcaveridges,
00293 Zcoplanarhorizon,
00294 Zcoplanarpart,
00295 Zcoplanarridges,
00296 Zcyclefacettot,
00297 Zcyclehorizon,
00298 Zdelvertextot,
00299 Zdistcheck,
00300 Zdistconvex,
00301 Zdistzero,
00302 Zdoc1,
00303 Zdoc2,
00304 Zdoc3,
00305 Zdoc11,
00306 Zflippedfacets,
00307 Zgauss0,
00308 Zminnorm,
00309 Zmultiridge,
00310 Znearlysingular,
00311 Wnewvertexmax,
00312 Znumvisibility,
00313 Zpartcoplanar,
00314 Zpartition,
00315 Zpartitionall,
00316 Zprocessed,
00317 Zretry,
00318 Zridge,
00319 Wridge,
00320 Wridgemax,
00321 Zridge0,
00322 Wridge0,
00323 Wridge0max,
00324 Zridgemid,
00325 Wridgemid,
00326 Wridgemidmax,
00327 Zridgeok,
00328 Wridgeok,
00329 Wridgeokmax,
00330 Zsetplane,
00331 Ztotcheck,
00332 Ztotmerge,
00333 ZEND};
00334 #endif
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345 enum ztypes {zdoc,zinc,zadd,zmax,zmin,ZTYPEreal,wadd,wmax,wmin,ZTYPEend};
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355 #define MAYdebugx
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367 #define zzdef_(stype,name,string,cnt) qhstat id[qhstat next++]=name; \
00368 qhstat doc[name]= string; qhstat count[name]= cnt; qhstat type[name]= stype
00369 #if qh_KEEPstatistics
00370 #define zdef_(stype,name,string,cnt) qhstat id[qhstat next++]=name; \
00371 qhstat doc[name]= string; qhstat count[name]= cnt; qhstat type[name]= stype
00372 #else
00373 #define zdef_(type,name,doc,count)
00374 #endif
00375
00376
00377
00378
00379
00380
00381
00382 #define zzinc_(id) {MAYdebugx; qhstat stats[id].i++;}
00383 #if qh_KEEPstatistics
00384 #define zinc_(id) {MAYdebugx; qhstat stats[id].i++;}
00385 #else
00386 #define zinc_(id) {}
00387 #endif
00388
00389
00390
00391
00392
00393
00394
00395 #define zzadd_(id, val) {MAYdebugx; qhstat stats[id].i += (val);}
00396 #define wwadd_(id, val) {MAYdebugx; qhstat stats[id].r += (val);}
00397 #if qh_KEEPstatistics
00398 #define zadd_(id, val) {MAYdebugx; qhstat stats[id].i += (val);}
00399 #define wadd_(id, val) {MAYdebugx; qhstat stats[id].r += (val);}
00400 #else
00401 #define zadd_(id, val) {}
00402 #define wadd_(id, val) {}
00403 #endif
00404
00405
00406
00407
00408
00409
00410
00411 #define zzval_(id) ((qhstat stats[id]).i)
00412 #define wwval_(id) ((qhstat stats[id]).r)
00413 #if qh_KEEPstatistics
00414 #define zval_(id) ((qhstat stats[id]).i)
00415 #define wval_(id) ((qhstat stats[id]).r)
00416 #else
00417 #define zval_(id) qhstat tempi
00418 #define wval_(id) qhstat tempr
00419 #endif
00420
00421
00422
00423
00424
00425
00426
00427 #define wwmax_(id, val) {MAYdebugx; maximize_(qhstat stats[id].r,(val));}
00428 #if qh_KEEPstatistics
00429 #define zmax_(id, val) {MAYdebugx; maximize_(qhstat stats[id].i,(val));}
00430 #define wmax_(id, val) {MAYdebugx; maximize_(qhstat stats[id].r,(val));}
00431 #else
00432 #define zmax_(id, val) {}
00433 #define wmax_(id, val) {}
00434 #endif
00435
00436
00437
00438
00439
00440
00441
00442 #if qh_KEEPstatistics
00443 #define zmin_(id, val) {MAYdebugx; minimize_(qhstat stats[id].i,(val));}
00444 #define wmin_(id, val) {MAYdebugx; minimize_(qhstat stats[id].r,(val));}
00445 #else
00446 #define zmin_(id, val) {}
00447 #define wmin_(id, val) {}
00448 #endif
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459 typedef union intrealT intrealT;
00460 union intrealT {
00461 int i;
00462 realT r;
00463 };
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482 #ifndef DEFqhstatT
00483 #define DEFqhstatT 1
00484 typedef struct qhstatT qhstatT;
00485 #endif
00486
00487 #if qh_QHpointer_dllimport
00488 #define qhstat qh_qhstat->
00489 __declspec(dllimport) extern qhstatT *qh_qhstat;
00490 #elif qh_QHpointer
00491 #define qhstat qh_qhstat->
00492 extern qhstatT *qh_qhstat;
00493 #else
00494 #define qhstat qh_qhstat.
00495 extern qhstatT qh_qhstat;
00496 #endif
00497 struct qhstatT {
00498 intrealT stats[ZEND];
00499 unsigned char id[ZEND+10];
00500 const char *doc[ZEND];
00501 short int count[ZEND];
00502 char type[ZEND];
00503 char printed[ZEND];
00504 intrealT init[ZTYPEend];
00505
00506 int next;
00507 int precision;
00508 int vridges;
00509 int tempi;
00510 realT tempr;
00511 };
00512
00513
00514
00515 void qh_allstatA(void);
00516 void qh_allstatB(void);
00517 void qh_allstatC(void);
00518 void qh_allstatD(void);
00519 void qh_allstatE(void);
00520 void qh_allstatE2(void);
00521 void qh_allstatF(void);
00522 void qh_allstatG(void);
00523 void qh_allstatH(void);
00524 void qh_allstatI(void);
00525 void qh_allstatistics(void);
00526 void qh_collectstatistics(void);
00527 void qh_freestatistics(void);
00528 void qh_initstatistics(void);
00529 boolT qh_newstats(int idx, int *nextindex);
00530 boolT qh_nostatistic(int i);
00531 void qh_printallstatistics(FILE *fp, const char *string);
00532 void qh_printstatistics(FILE *fp, const char *string);
00533 void qh_printstatlevel(FILE *fp, int id, int start);
00534 void qh_printstats(FILE *fp, int idx, int *nextindex);
00535 realT qh_stddev(int num, realT tot, realT tot2, realT *ave);
00536
00537 #endif