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