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