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     Znonsimplicial,
00178     Znowsimplicial,
00179     Znotgood,
00180     Znotgoodnew,
00181     Znotmax,
00182     Znumfacets,
00183     Znummergemax,
00184     Znummergetot,
00185     Znumneighbors,
00186     Znumridges,
00187     Znumvertices,
00188     Znumvisibility,
00189     Znumvneighbors,
00190     Zonehorizon,
00191     Zpartcoplanar,
00192     Zpartinside,
00193     Zpartition, 
00194     Zpartitionall,
00195     Zpartnear,
00196     Zpbalance,
00197     Wpbalance,
00198     Wpbalance2, 
00199     Zpostfacets, 
00200     Zpremergetot,
00201     Zprocessed,
00202     Zremvertex,
00203     Zremvertexdel,
00204     Zrenameall,
00205     Zrenamepinch,
00206     Zrenameshare,
00207     Zretry,
00208     Wretrymax,
00209     Zridge,
00210     Wridge,
00211     Wridgemax,
00212     Zridge0,
00213     Wridge0,
00214     Wridge0max,
00215     Zridgemid,
00216     Wridgemid,
00217     Wridgemidmax,
00218     Zridgeok,
00219     Wridgeok,
00220     Wridgeokmax,
00221     Zsearchpoints,
00222     Zsetplane,
00223     Ztestvneighbor,
00224     Ztotcheck,
00225     Ztothorizon,
00226     Ztotmerge,
00227     Ztotpartcoplanar,
00228     Ztotpartition,
00229     Ztotridges,
00230     Ztotvertices,
00231     Ztotvisible,
00232     Wvertexmax,
00233     Wvertexmin,
00234     Zvertexridge,
00235     Zvertexridgetot,
00236     Zvertexridgemax,
00237     Zvertices,
00238     Zvisfacettot,
00239     Zvisfacetmax,
00240     Zvisvertextot,
00241     Zvisvertexmax,
00242     Zwidefacet,
00243     Zwidevertices,
00244     ZEND};
00245 
00246 
00247 
00248 
00249 
00250 
00251 
00252 
00253 
00254 #else
00255 enum statistics {     
00256   Zback0,
00257   Zbestdist,
00258   Zcentrumtests,
00259   Zconcaveridges,
00260   Zcoplanarhorizon,
00261   Zcoplanarpart,
00262   Zcoplanarridges,
00263   Zcyclefacettot,
00264   Zcyclehorizon,
00265   Zdistcheck,
00266   Zdistconvex,
00267   Zdistzero,
00268   Zdoc1,
00269   Zdoc2,
00270   Zdoc3,
00271   Zdoc11,
00272   Zflippedfacets,
00273   Zgauss0,
00274   Zminnorm,
00275   Zmultiridge,
00276   Znearlysingular,
00277   Wnewvertexmax,
00278   Znumvisibility,
00279   Zpartcoplanar,
00280   Zpartition,
00281   Zpartitionall,
00282   Zprocessed,
00283   Zretry,
00284   Zridge,
00285   Wridge,
00286   Wridgemax,
00287   Zridge0,
00288   Wridge0,
00289   Wridge0max,
00290   Zridgemid,
00291   Wridgemid,
00292   Wridgemidmax,
00293   Zridgeok,
00294   Wridgeok,
00295   Wridgeokmax,
00296   Zsetplane,
00297   Ztotmerge,
00298     ZEND};
00299 #endif
00300 
00301 
00302 
00303 
00304 
00305 
00306 
00307 
00308 
00309 
00310 enum ztypes {zdoc,zinc,zadd,zmax,zmin,ZTYPEreal,wadd,wmax,wmin,ZTYPEend};
00311 
00312 
00313 
00314 
00315 
00316 
00317 
00318 
00319 
00320 #define MAYdebugx 
00321 
00322 
00323 
00324 
00325 
00326 
00327 
00328 
00329 
00330 
00331 
00332 #define zzdef_(stype,name,string,cnt) qhstat id[qhstat next++]=name; \
00333    qhstat doc[name]= string; qhstat count[name]= cnt; qhstat type[name]= stype
00334 #if qh_KEEPstatistics
00335 #define zdef_(stype,name,string,cnt) qhstat id[qhstat next++]=name; \
00336    qhstat doc[name]= string; qhstat count[name]= cnt; qhstat type[name]= stype
00337 #else
00338 #define zdef_(type,name,doc,count)
00339 #endif
00340 
00341 
00342 
00343 
00344 
00345 
00346 
00347 #define zzinc_(id) {MAYdebugx; qhstat stats[id].i++;}
00348 #if qh_KEEPstatistics
00349 #define zinc_(id) {MAYdebugx; qhstat stats[id].i++;}
00350 #else
00351 #define zinc_(id) {}
00352 #endif
00353 
00354 
00355 
00356 
00357 
00358 
00359 
00360 #define zzadd_(id, val) {MAYdebugx; qhstat stats[id].i += (val);}
00361 #define wwadd_(id, val) {MAYdebugx; qhstat stats[id].r += (val);}
00362 #if qh_KEEPstatistics
00363 #define zadd_(id, val) {MAYdebugx; qhstat stats[id].i += (val);}
00364 #define wadd_(id, val) {MAYdebugx; qhstat stats[id].r += (val);}
00365 #else
00366 #define zadd_(id, val) {}
00367 #define wadd_(id, val) {}
00368 #endif
00369 
00370 
00371 
00372 
00373 
00374 
00375 
00376 #define zzval_(id) ((qhstat stats[id]).i)
00377 #define wwval_(id) ((qhstat stats[id]).r)
00378 #if qh_KEEPstatistics
00379 #define zval_(id) ((qhstat stats[id]).i)
00380 #define wval_(id) ((qhstat stats[id]).r)
00381 #else
00382 #define zval_(id) qhstat tempi
00383 #define wval_(id) qhstat tempr
00384 #endif
00385 
00386 
00387 
00388 
00389 
00390 
00391 
00392 #define wwmax_(id, val) {MAYdebugx; maximize_(qhstat stats[id].r,(val));}
00393 #if qh_KEEPstatistics
00394 #define zmax_(id, val) {MAYdebugx; maximize_(qhstat stats[id].i,(val));}
00395 #define wmax_(id, val) {MAYdebugx; maximize_(qhstat stats[id].r,(val));}
00396 #else
00397 #define zmax_(id, val) {}
00398 #define wmax_(id, val) {}
00399 #endif
00400 
00401 
00402 
00403 
00404 
00405 
00406 
00407 #if qh_KEEPstatistics
00408 #define zmin_(id, val) {MAYdebugx; minimize_(qhstat stats[id].i,(val));}
00409 #define wmin_(id, val) {MAYdebugx; minimize_(qhstat stats[id].r,(val));}
00410 #else
00411 #define zmin_(id, val) {}
00412 #define wmin_(id, val) {}
00413 #endif
00414 
00415 
00416 
00417 
00418 
00419 
00420 
00421 
00422 
00423 
00424 typedef union intrealT intrealT;    
00425 union intrealT {
00426     int i;
00427     realT r;
00428 };
00429 
00430 
00431 
00432 
00433 
00434 
00435 
00436 
00437 
00438 
00439 
00440 
00441 
00442 
00443 
00444 
00445 
00446 
00447 typedef struct qhstatT qhstatT; 
00448 #if qh_QHpointer
00449 #define qhstat qh_qhstat->
00450 extern qhstatT *qh_qhstat;
00451 #else
00452 #define qhstat qh_qhstat.
00453 extern qhstatT qh_qhstat; 
00454 #endif
00455 struct qhstatT {  
00456   intrealT   stats[ZEND];     
00457   unsigned   char id[ZEND+10]; 
00458   char      *doc[ZEND];       
00459   short int  count[ZEND];     
00460   char       type[ZEND];      
00461   char       printed[ZEND];   
00462   intrealT   init[ZTYPEend];  
00463 
00464   int        next;            
00465   int        precision;       
00466   int        vridges;         
00467   int        tempi;
00468   realT      tempr;
00469 };
00470 
00471 
00472 
00473 void    qh_allstatA(void);
00474 void    qh_allstatB(void);
00475 void    qh_allstatC(void);
00476 void    qh_allstatD(void);
00477 void    qh_allstatE(void);
00478 void    qh_allstatF(void);
00479 void    qh_allstatG(void);
00480 void    qh_allstatH(void);
00481 void    qh_allstatI(void);
00482 void    qh_allstatistics (void);
00483 void    qh_collectstatistics (void);
00484 void    qh_freestatistics (void);
00485 void    qh_initstatistics (void);
00486 boolT   qh_newstats (int index, int *nextindex);
00487 boolT   qh_nostatistic (int i);
00488 void    qh_printallstatistics (FILE *fp, char *string);
00489 void    qh_printstatistics (FILE *fp, char *string);
00490 void    qh_printstatlevel (FILE *fp, int id, int start);
00491 void    qh_printstats (FILE *fp, int index, int *nextindex);
00492 realT   qh_stddev (int num, realT tot, realT tot2, realT *ave);
00493 
00494 #endif