Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

stat.c File Reference

#include "qhull_a.h"

Go to the source code of this file.


Defines

#define NULLfield   " "

Functions

void qh_allstatA (void)
void qh_allstatB (void)
void qh_allstatC (void)
void qh_allstatD (void)
void qh_allstatE (void)
void qh_allstatF (void)
void qh_allstatG (void)
void qh_allstatH (void)
void qh_allstatI (void)
void qh_allstatistics (void)
void qh_collectstatistics (void)
void qh_freestatistics (void)
void qh_initstatistics (void)
boolT qh_newstats (int index, int *nextindex)
boolT qh_nostatistic (int i)
void qh_printallstatistics (FILE *fp, char *string)
void qh_printstatistics (FILE *fp, char *string)
void qh_printstatlevel (FILE *fp, int id, int start)
void qh_printstats (FILE *fp, int index, int *nextindex)
realT qh_stddev (int num, realT tot, realT tot2, realT *ave)

Variables

qhstatT qh_qhstat

Define Documentation

#define NULLfield   " "
 


Function Documentation

void qh_allstatA void   
 

Definition at line 34 of file stat.c.

References qhstat, wadd, wmax, wmin, Wmindenom, Wnewvertex, Wnewvertexmax, Wvertexmax, Wvertexmin, Zback0, Zconcaveridges, Zcoplanarhorizon, Zcoplanarpart, Zcoplanarridges, zdef_, zdoc, Zdoc2, Zdoc3, Zflippedfacets, Zgauss0, zinc, Zminnorm, Zmultiridge, Znearlysingular, Znewvertex, and zzdef_.

00034                         {
00035   
00036    /* zdef_(type,name,doc,average) */
00037   zzdef_(zdoc, Zdoc2, "precision statistics", -1);
00038   zdef_(zinc, Znewvertex, NULL, -1);
00039   zdef_(wadd, Wnewvertex, "ave. distance of a new vertex to a facet (not 0s)", Znewvertex);
00040   zzdef_(wmax, Wnewvertexmax, "max. distance of a new vertex to a facet", -1);
00041   zdef_(wmax, Wvertexmax, "max. distance of an output vertex to a facet", -1);
00042   zdef_(wmin, Wvertexmin, "min. distance of an output vertex to a facet", -1);
00043   zdef_(wmin, Wmindenom, "min. denominator in hyperplane computation", -1);
00044 
00045   qhstat precision= qhstat next;  /* call qh_precision for each of these */
00046   zzdef_(zdoc, Zdoc3, "precision problems", -1);
00047   zzdef_(zinc, Zcoplanarridges, "coplanar half ridges in output", -1);
00048   zzdef_(zinc, Zconcaveridges, "concave half ridges in output", -1);
00049   zzdef_(zinc, Zflippedfacets, "flipped facets", -1);
00050   zzdef_(zinc, Zcoplanarhorizon, "coplanar horizon facets for new vertices", -1);
00051   zzdef_(zinc, Zcoplanarpart, "coplanar points during partitioning", -1);
00052   zzdef_(zinc, Zminnorm, "degenerate hyperplanes recomputed with gaussian elimination", -1);
00053   zzdef_(zinc, Znearlysingular, "nearly singular or axis-parallel hyperplanes", -1);
00054   zzdef_(zinc, Zback0, "zero divisors during back substitute", -1);
00055   zzdef_(zinc, Zgauss0, "zero divisors during gaussian elimination", -1);
00056   zzdef_(zinc, Zmultiridge, "ridges with multiple neighbors", -1);
00057 }

void qh_allstatB void   
 

Definition at line 58 of file stat.c.

References wadd, Wangle, Wanglemax, Wanglemin, Wareamax, Wareamin, Wareatot, Wcpu, wmax, wmin, zadd, Zangle, zdef_, zdoc, Zdoc1, zinc, zmax, Zmaxneighbors, Zmaxridges, Zmaxvertices, Zmaxvneighbors, Znonsimplicial, Znowsimplicial, Znumfacets, Znummergemax, Znummergetot, Znumneighbors, Znumridges, Znumvertices, Znumvneighbors, Zpostfacets, Zsetplane, Ztotridges, Ztotvertices, Zvertices, and zzdef_.

00058                         {
00059   zzdef_(zdoc, Zdoc1, "summary information", -1);
00060   zdef_(zinc, Zvertices, "number of vertices in output", -1);
00061   zdef_(zinc, Znumfacets, "number of facets in output", -1);
00062   zdef_(zinc, Znonsimplicial, "number of non-simplicial facets in output", -1);
00063   zdef_(zinc, Znowsimplicial, "number of simplicial facets that were merged", -1);
00064   zdef_(zinc, Znumridges, "number of ridges in output", -1);
00065   zdef_(zadd, Znumridges, "average number of ridges per facet", Znumfacets);
00066   zdef_(zmax, Zmaxridges, "maximum number of ridges", -1);
00067   zdef_(zadd, Znumneighbors, "average number of neighbors per facet", Znumfacets);
00068   zdef_(zmax, Zmaxneighbors, "maximum number of neighbors", -1);
00069   zdef_(zadd, Znumvertices, "average number of vertices per facet", Znumfacets);
00070   zdef_(zmax, Zmaxvertices, "maximum number of vertices", -1);
00071   zdef_(zadd, Znumvneighbors, "average number of neighbors per vertex", Zvertices);
00072   zdef_(zmax, Zmaxvneighbors, "maximum number of neighbors", -1);
00073   zdef_(wadd, Wcpu, "cpu seconds for qhull after input", -1);
00074   zdef_(zinc, Ztotvertices, "vertices created altogether", -1);
00075   zzdef_(zinc, Zsetplane, "facets created altogether", -1);
00076   zdef_(zinc, Ztotridges, "ridges created altogether", -1);
00077   zdef_(zinc, Zpostfacets, "facets before post merge", -1);
00078   zdef_(zadd, Znummergetot, "average merges per facet (at most 511)", Znumfacets);
00079   zdef_(zmax, Znummergemax, "  maximum merges for a facet (at most 511)", -1);
00080   zdef_(zinc, Zangle, NULL, -1);
00081   zdef_(wadd, Wangle, "average angle (cosine) of facet normals for all ridges", Zangle);
00082   zdef_(wmax, Wanglemax, "  maximum angle (cosine) of facet normals across a ridge", -1);
00083   zdef_(wmin, Wanglemin, "  minimum angle (cosine) of facet normals across a ridge", -1);
00084   zdef_(wadd, Wareatot, "total area of facets", -1);
00085   zdef_(wmax, Wareamax, "  maximum facet area", -1);
00086   zdef_(wmin, Wareamin, "  minimum facet area", -1);
00087 }  

void qh_allstatC void   
 

Definition at line 88 of file stat.c.

References wadd, wmax, Wnewbalance, Wnewbalance2, Wpbalance, Wpbalance2, Wretrymax, zadd, Zcheckpart, zdef_, Zdelvertexmax, Zdelvertextot, Zdetsimplex, Zdistvertex, zdoc, Zdoc9, Zgoodfacet, zinc, Zinsidevisible, zmax, Zmaxvertex, Znewfacetmax, Znewfacettot, Znoarea, Znotgood, Znotgoodnew, Znotmax, Znumvisibility, Zpbalance, Zprocessed, Zretry, Zsearchpoints, Ztotcheck, Ztothorizon, Ztotvisible, Zvisfacetmax, Zvisfacettot, Zvisvertexmax, Zvisvertextot, and zzdef_.

00088                         {
00089   zdef_(zdoc, Zdoc9, "build hull statistics", -1);
00090   zzdef_(zinc, Zprocessed, "points processed", -1);
00091   zzdef_(zinc, Zretry, "retries due to precision problems", -1);
00092   zdef_(wmax, Wretrymax, "  max. random joggle", -1);
00093   zdef_(zmax, Zmaxvertex, "max. vertices at any one time", -1);
00094   zdef_(zinc, Ztotvisible, "ave. visible facets per iteration", Zprocessed);
00095   zdef_(zinc, Zinsidevisible, "  ave. visible facets without an horizon neighbor", Zprocessed);
00096   zdef_(zadd, Zvisfacettot,  "  ave. facets deleted per iteration", Zprocessed);
00097   zdef_(zmax, Zvisfacetmax,  "    maximum", -1);
00098   zdef_(zadd, Zvisvertextot, "ave. visible vertices per iteration", Zprocessed);
00099   zdef_(zmax, Zvisvertexmax, "    maximum", -1);
00100   zdef_(zadd, Zdelvertextot, "  ave. vertices deleted per iteration", Zprocessed);
00101   zdef_(zmax, Zdelvertexmax, "    maximum vertices deleted", -1);
00102   zdef_(zinc, Ztothorizon, "ave. horizon facets per iteration", Zprocessed);
00103   zdef_(zadd, Znewfacettot,  "ave. new or merged facets per iteration", Zprocessed);
00104   zdef_(zmax, Znewfacetmax,  "    maximum (includes initial simplex)", -1);
00105   zdef_(wadd, Wnewbalance, "average new facet balance", Zprocessed);
00106   zdef_(wadd, Wnewbalance2, "  standard deviation", -1);
00107   zdef_(wadd, Wpbalance, "average partition balance", Zpbalance);
00108   zdef_(wadd, Wpbalance2, "  standard deviation", -1);
00109   zdef_(zinc, Zpbalance, "  number of trials", -1);
00110   zdef_(zinc, Zsearchpoints, "searches of all points for initial simplex", -1);
00111   zdef_(zinc, Zdetsimplex, "determinants computed (area & initial hull)", -1);
00112   zdef_(zinc, Znoarea, "determinants not computed because vertex too low", -1);
00113   zdef_(zinc, Znotmax, "points ignored (not above max_outside)", -1);
00114   zdef_(zinc, Znotgood, "points ignored (not above a good facet)", -1);
00115   zdef_(zinc, Znotgoodnew, "points ignored (didn't create a good new facet)", -1);
00116   zdef_(zinc, Zgoodfacet, "good facets found", -1);
00117   zzdef_(zinc, Znumvisibility, "distance tests for facet visibility", -1);
00118   zdef_(zinc, Zdistvertex, "distance tests to report minimum vertex", -1);
00119   zdef_(zinc, Ztotcheck, "points checked for facets' outer planes", -1);
00120   zdef_(zinc, Zcheckpart, "  ave. distance tests per check", Ztotcheck);
00121 }

void qh_allstatD void   
 

Definition at line 122 of file stat.c.

References wadd, Wmaxout, Zcomputefurthest, Zcoplanarinside, zdef_, Zdistcheck, Zdistconvex, Zdistgood, Zdistio, Zdistplane, Zdiststat, zdoc, Zdoc4, zinc, Zpartcoplanar, Zpartinside, Zpartition, Zpartitionall, Zpartnear, Ztotpartcoplanar, Ztotpartition, and zzdef_.

00122                        {
00123   zdef_(zdoc, Zdoc4, "partitioning statistics", -1);
00124   zdef_(zinc, Zpartinside, "inside points", -1);
00125   zdef_(zinc, Zpartnear, "  inside points kept with a facet", -1);
00126   zdef_(zinc, Zcoplanarinside, "  inside points that were coplanar with a facet", -1);
00127   zdef_(wadd, Wmaxout, "difference in max_outside at final check", -1);
00128   
00129   zzdef_(zinc, Zpartitionall, "distance tests for initial partition", -1);
00130   zdef_(zinc, Ztotpartition, "partitions of a point", -1);
00131   zzdef_(zinc, Zpartition, "distance tests for partitioning", -1);
00132   zzdef_(zinc, Zdistcheck, "distance tests for checking flipped facets", -1); 
00133   zzdef_(zinc, Zdistconvex, "distance tests for checking convexity", -1); 
00134   zdef_(zinc, Zdistgood, "distance tests for checking good point", -1); 
00135   zdef_(zinc, Zdistio, "distance tests for output", -1); 
00136   zdef_(zinc, Zdiststat, "distance tests for statistics", -1); 
00137   zdef_(zinc, Zdistplane, "total number of distance tests", -1);
00138   zdef_(zinc, Ztotpartcoplanar, "partitions of coplanar points or deleted vertices", -1);
00139   zzdef_(zinc, Zpartcoplanar, "   distance tests for these partitions", -1);
00140   zdef_(zinc, Zcomputefurthest, "distance tests for computing furthest", -1);
00141 }

void qh_allstatE void   
 

Definition at line 142 of file stat.c.

References Zangletests, Zbestcentrum, Zbestdist, Zcentrumtests, Zconcaveridge, Zcoplanarangle, Zcoplanarcentrum, zdef_, Zdistzero, zdoc, Zdoc5, Zdoc6, Zdupflip, Zdupsame, Zhashlookup, Zhashridge, Zhashridgetest, Zhashtests, zinc, and zzdef_.

00142                        {
00143   zdef_(zdoc, Zdoc5, "statistics for matching ridges", -1);
00144   zdef_(zinc, Zhashlookup, "total lookups for matching ridges of new facets", -1);
00145   zdef_(zinc, Zhashtests, "average number of tests to match a ridge", Zhashlookup);
00146   zdef_(zinc, Zhashridge, "total lookups of subridges (duplicates and boundary)", -1);
00147   zdef_(zinc, Zhashridgetest, "average number of tests per subridge", Zhashridge);
00148   zdef_(zinc, Zdupsame, "duplicated ridges in same merge cycle", -1);
00149   zdef_(zinc, Zdupflip, "duplicated ridges with flipped facets", -1);
00150 
00151   zdef_(zdoc, Zdoc6, "statistics for determining merges", -1);
00152   zdef_(zinc, Zangletests, "angles computed for ridge convexity", -1);
00153   zdef_(zinc, Zbestcentrum, "best merges used centrum instead of vertices",-1);
00154   zzdef_(zinc, Zbestdist, "distance tests for best merge", -1);
00155   zzdef_(zinc, Zcentrumtests, "distance tests for centrum convexity", -1);
00156   zzdef_(zinc, Zdistzero, "distance tests for checking simplicial convexity", -1);
00157   zdef_(zinc, Zcoplanarangle, "coplanar angles in getmergeset", -1);
00158   zdef_(zinc, Zcoplanarcentrum, "coplanar centrums in getmergeset", -1);
00159   zdef_(zinc, Zconcaveridge, "concave ridges in getmergeset", -1);
00160 }

void qh_allstatF void   
 

Definition at line 161 of file stat.c.

References wmax, Wmaxoutside, wmin, Wminvertex, zadd, Zcyclefacetmax, Zcyclefacettot, Zcyclehorizon, Zcyclevertex, zdef_, Zdegenvertex, zdoc, Zdoc7, zinc, zmax, Zmergeflipdup, Zmergehorizon, Zmergeinitmax, Zmergeinittot, Zmergeinittot2, Zmergeintohorizon, Zmergenew, Zmergesetmax, Zmergesettot, Zmergesettot2, Zmergesimplex, Zmergevertex, Zneighbor, Zonehorizon, Zpremergetot, Ztestvneighbor, Ztotmerge, Zwidefacet, Zwidevertices, and zzdef_.

00161                        {
00162   zdef_(zdoc, Zdoc7, "statistics for merging", -1);
00163   zdef_(zinc, Zpremergetot, "merge iterations", -1);
00164   zdef_(zadd, Zmergeinittot, "ave. initial non-convex ridges per iteration", Zpremergetot);
00165   zdef_(zadd, Zmergeinitmax, "  maximum", -1);
00166   zdef_(zadd, Zmergesettot, "  ave. additional non-convex ridges per iteration", Zpremergetot);
00167   zdef_(zadd, Zmergesetmax, "  maximum additional in one pass", -1);
00168   zdef_(zadd, Zmergeinittot2, "initial non-convex ridges for post merging", -1);
00169   zdef_(zadd, Zmergesettot2, "  additional non-convex ridges", -1);
00170   zdef_(wmax, Wmaxoutside, "max distance of vertex or coplanar point above facet (w/roundoff)", -1);
00171   zdef_(wmin, Wminvertex, "max distance of merged vertex below facet (or roundoff)", -1);
00172   zdef_(zinc, Zwidefacet, "centrums frozen due to a wide merge", -1);
00173   zdef_(zinc, Zwidevertices, "centrums frozen due to extra vertices", -1);
00174   zzdef_(zinc, Ztotmerge, "total number of facets or cycles of facets merged", -1);
00175   zdef_(zinc, Zmergesimplex, "merged a simplex", -1);
00176   zdef_(zinc, Zonehorizon, "simplices merged into coplanar horizon", -1);
00177   zzdef_(zinc, Zcyclehorizon, "cycles of facets merged into coplanar horizon", -1);
00178   zzdef_(zadd, Zcyclefacettot, "  ave. facets per cycle", Zcyclehorizon);
00179   zdef_(zmax, Zcyclefacetmax, "  max. facets", -1);
00180   zdef_(zinc, Zmergeintohorizon, "new facets merged into horizon", -1);
00181   zdef_(zinc, Zmergenew, "new facets merged", -1);
00182   zdef_(zinc, Zmergehorizon, "horizon facets merged into new facets", -1);
00183   zdef_(zinc, Zmergevertex, "vertices deleted by merging", -1);
00184   zdef_(zinc, Zcyclevertex, "vertices deleted by merging into coplanar horizon", -1);
00185   zdef_(zinc, Zdegenvertex, "vertices deleted by degenerate facet", -1);
00186   zdef_(zinc, Zmergeflipdup, "merges due to flipped facets in duplicated ridge", -1);
00187   zdef_(zinc, Zneighbor, "merges due to redundant neighbors", -1);
00188   zdef_(zadd, Ztestvneighbor, "non-convex vertex neighbors", -1); 
00189 }

void qh_allstatG void   
 

Definition at line 190 of file stat.c.

References Wacoplanarmax, Wacoplanartot, wadd, Wavoidoldmax, Wavoidoldtot, Wconcavemax, Wconcavetot, Wcoplanarmax, Wcoplanartot, Wdegenmax, Wdegentot, Wduplicatemax, Wduplicatetot, Wflippedmax, Wflippedtot, wmax, Zacoplanar, Zavoidold, Zconcave, Zcoplanar, zdef_, Zdegen, Zduplicate, Zflipped, and zinc.

Referenced by qh_initstatistics().

00190                        {
00191   zdef_(zinc, Zacoplanar, "merges due to angle coplanar facets", -1);
00192   zdef_(wadd, Wacoplanartot, "  average merge distance", Zacoplanar);
00193   zdef_(wmax, Wacoplanarmax, "  maximum merge distance", -1);
00194   zdef_(zinc, Zcoplanar, "merges due to coplanar facets", -1);
00195   zdef_(wadd, Wcoplanartot, "  average merge distance", Zcoplanar);
00196   zdef_(wmax, Wcoplanarmax, "  maximum merge distance", -1);
00197   zdef_(zinc, Zconcave, "merges due to concave facets", -1);
00198   zdef_(wadd, Wconcavetot, "  average merge distance", Zconcave);
00199   zdef_(wmax, Wconcavemax, "  maximum merge distance", -1);
00200   zdef_(zinc, Zavoidold, "coplanar/concave merges due to avoiding old merge", -1);
00201   zdef_(wadd, Wavoidoldtot, "  average merge distance", Zavoidold);
00202   zdef_(wmax, Wavoidoldmax, "  maximum merge distance", -1);
00203   zdef_(zinc, Zdegen, "merges due to degenerate facets", -1);
00204   zdef_(wadd, Wdegentot, "  average merge distance", Zdegen);
00205   zdef_(wmax, Wdegenmax, "  maximum merge distance", -1);
00206   zdef_(zinc, Zflipped, "merges due to removing flipped facets", -1);
00207   zdef_(wadd, Wflippedtot, "  average merge distance", Zflipped);
00208   zdef_(wmax, Wflippedmax, "  maximum merge distance", -1);
00209   zdef_(zinc, Zduplicate, "merges due to duplicated ridges", -1);
00210   zdef_(wadd, Wduplicatetot, "  average merge distance", Zduplicate);
00211   zdef_(wmax, Wduplicatemax, "  maximum merge distance", -1);
00212 }

void qh_allstatH void   
 

Definition at line 213 of file stat.c.

References zadd, zdef_, Zdelfacetdup, Zdelridge, zdoc, Zdoc10, Zdoc8, Zdropdegen, Zdropneighbor, Zdupridge, Zfindfail, zinc, Zintersect, Zintersectfail, Zintersectmax, Zintersectnum, Zintersecttot, zmax, Zmemfacets, Zmempoints, Zmemridges, Zmemvertices, Zremvertex, Zremvertexdel, Zrenameall, Zrenamepinch, Zrenameshare, Zvertexridge, Zvertexridgemax, and Zvertexridgetot.

Referenced by qh_initstatistics().

00213                        {
00214   zdef_(zdoc, Zdoc8, "renamed vertex statistics", -1);
00215   zdef_(zinc, Zrenameshare, "renamed vertices shared by two facets", -1);
00216   zdef_(zinc, Zrenamepinch, "renamed vertices in a pinched facet", -1);
00217   zdef_(zinc, Zrenameall, "renamed vertices shared by multiple facets", -1);
00218   zdef_(zinc, Zfindfail, "rename failures due to duplicated ridges", -1);
00219   zdef_(zinc, Zdupridge, "  duplicate ridges detected", -1);
00220   zdef_(zinc, Zdelridge, "deleted ridges due to renamed vertices", -1);
00221   zdef_(zinc, Zdropneighbor, "dropped neighbors due to renamed vertices", -1);
00222   zdef_(zinc, Zdropdegen, "degenerate facets due to dropped neighbors", -1);
00223   zdef_(zinc, Zdelfacetdup, "  facets deleted because of no neighbors", -1);
00224   zdef_(zinc, Zremvertex, "vertices removed from facets due to no ridges", -1);
00225   zdef_(zinc, Zremvertexdel, "  deleted", -1);
00226   zdef_(zinc, Zintersectnum, "vertex intersections for locating redundant vertices", -1);
00227   zdef_(zinc, Zintersectfail, "intersections failed to find a redundant vertex", -1);
00228   zdef_(zinc, Zintersect, "intersections found redundant vertices", -1);
00229   zdef_(zadd, Zintersecttot, "   ave. number found per vertex", Zintersect);
00230   zdef_(zmax, Zintersectmax, "   max. found for a vertex", -1);
00231   zdef_(zinc, Zvertexridge, NULL, -1);
00232   zdef_(zadd, Zvertexridgetot, "  ave. number of ridges per tested vertex", Zvertexridge);
00233   zdef_(zmax, Zvertexridgemax, "  max. number of ridges per tested vertex", -1);
00234 
00235   zdef_(zdoc, Zdoc10, "memory usage statistics (in bytes)", -1);
00236   zdef_(zadd, Zmemfacets, "for facets and their normals, neighbor and vertex sets", -1);
00237   zdef_(zadd, Zmemvertices, "for vertices and their neighbor sets", -1);
00238   zdef_(zadd, Zmempoints, "for input points and outside and coplanar sets",-1);
00239   zdef_(zadd, Zmemridges, "for ridges and their vertex sets", -1);
00240 } /* allstat */

void qh_allstatI void   
 

Definition at line 242 of file stat.c.

References qhstat, wadd, wmax, Wridge, Wridge0, Wridge0max, Wridgemax, Wridgemid, Wridgemidmax, Wridgeok, Wridgeokmax, zdoc, Zdoc11, zinc, Zridge, Zridge0, Zridgemid, Zridgeok, and zzdef_.

Referenced by qh_initstatistics().

00242                        {
00243   qhstat vridges= qhstat next;
00244   zzdef_(zdoc, Zdoc11, "Voronoi ridge statistics", -1);
00245   zzdef_(zinc, Zridge, "non-simplicial Voronoi vertices for all ridges", -1);
00246   zzdef_(wadd, Wridge, "  ave. distance to ridge", Zridge);
00247   zzdef_(wmax, Wridgemax, "  max. distance to ridge", -1);
00248   zzdef_(zinc, Zridgemid, "bounded ridges", -1);
00249   zzdef_(wadd, Wridgemid, "  ave. distance of midpoint to ridge", Zridgemid);
00250   zzdef_(wmax, Wridgemidmax, "  max. distance of midpoint to ridge", -1);
00251   zzdef_(zinc, Zridgeok, "bounded ridges with ok normal", -1);
00252   zzdef_(wadd, Wridgeok, "  ave. angle to ridge", Zridgeok);
00253   zzdef_(wmax, Wridgeokmax, "  max. angle to ridge", -1);
00254   zzdef_(zinc, Zridge0, "bounded ridges with near-zero normal", -1);
00255   zzdef_(wadd, Wridge0, "  ave. angle to ridge", Zridge0);
00256   zzdef_(wmax, Wridge0max, "  max. angle to ridge", -1);
00257 } /* allstat */

void qh_allstatistics void   
 

Definition at line 265 of file stat.c.

References i, qhstat, and ZEND.

Referenced by qh_printallstatistics(), and qh_produce_output().

00265                              {
00266   int i;
00267   
00268   for (i=ZEND; i--; ) 
00269     qhstat printed[i]= False;
00270 } /* allstatistics */

void qh_collectstatistics void   
 

Definition at line 280 of file stat.c.

References facetT::coplanarset, vertexT::deleted, FORALLfacets, FORALLvertices, FOREACHneighbor_, FOREACHvertex_, i, MERGING, facetT::neighbors, vertexT::neighbors, facetT::normal, num_points, facetT::nummerge, facetT::outsideset, vertexT::point, qh, qh_distplane(), qh_DUPLICATEridge, qh_getangle(), qh_MERGEridge, qh_setsize(), REALmax, realT, facetT::ridges, facetT::seen, SETelemsize, facetT::simplicial, facetT::upperdelaunay, facetT::vertices, facetT::visible, wadd_, Wangle, Wanglemax, Wanglemin, wmax_, Wmaxoutside, wmin_, Wminvertex, wval_, Wvertexmax, Wvertexmin, zadd_, Zangle, Zdiststat, zinc_, zmax_, Zmaxneighbors, Zmaxridges, Zmaxvertices, Zmaxvneighbors, Zmemfacets, Zmempoints, Zmemridges, Zmemvertices, Znonsimplicial, Znowsimplicial, Znumfacets, Znummergemax, Znummergetot, Znumneighbors, Znumridges, Znumvertices, Znumvneighbors, zval_, and Zvertices.

00280                                  {
00281   facetT *facet, *neighbor, **neighborp;
00282   vertexT *vertex, **vertexp;
00283   realT dotproduct, dist;
00284   int sizneighbors, sizridges, sizvertices, i;
00285   
00286   qh old_randomdist= qh RANDOMdist;
00287   qh RANDOMdist= False;
00288   zval_(Zmempoints)= qh num_points * qh normal_size + 
00289                              sizeof (qhT) + sizeof (qhstatT);
00290   zval_(Zmemfacets)= 0;
00291   zval_(Zmemridges)= 0;
00292   zval_(Zmemvertices)= 0;
00293   zval_(Zangle)= 0;
00294   wval_(Wangle)= 0.0;
00295   zval_(Znumridges)= 0;
00296   zval_(Znumfacets)= 0;
00297   zval_(Znumneighbors)= 0;
00298   zval_(Znumvertices)= 0;
00299   zval_(Znumvneighbors)= 0;
00300   zval_(Znummergetot)= 0;
00301   zval_(Znummergemax)= 0;
00302   zval_(Zvertices)= qh num_vertices - qh_setsize (qh del_vertices);
00303   if (qh MERGING || qh APPROXhull || qh JOGGLEmax < REALmax/2)
00304     wmax_(Wmaxoutside, qh max_outside);
00305   if (qh MERGING)
00306     wmin_(Wminvertex, qh min_vertex);
00307   FORALLfacets
00308     facet->seen= False;
00309   if (qh DELAUNAY) {
00310     FORALLfacets {
00311       if (facet->upperdelaunay != qh UPPERdelaunay)
00312         facet->seen= True; /* remove from angle statistics */
00313     }
00314   }
00315   FORALLfacets {
00316     if (facet->visible && qh NEWfacets)
00317       continue;
00318     sizvertices= qh_setsize (facet->vertices);
00319     sizneighbors= qh_setsize (facet->neighbors);
00320     sizridges= qh_setsize (facet->ridges);
00321     zinc_(Znumfacets);
00322     zadd_(Znumvertices, sizvertices);
00323     zmax_(Zmaxvertices, sizvertices);
00324     zadd_(Znumneighbors, sizneighbors);
00325     zmax_(Zmaxneighbors, sizneighbors);
00326     zadd_(Znummergetot, facet->nummerge);
00327     i= facet->nummerge; /* avoid warnings */
00328     zmax_(Znummergemax, i); 
00329     if (!facet->simplicial) {
00330       if (sizvertices == qh hull_dim) {
00331         zinc_(Znowsimplicial);
00332       }else {
00333         zinc_(Znonsimplicial);
00334       }
00335     }
00336     if (sizridges) {
00337       zadd_(Znumridges, sizridges);
00338       zmax_(Zmaxridges, sizridges);
00339     }
00340     zadd_(Zmemfacets, sizeof (facetT) + qh normal_size + 2*sizeof (setT) 
00341        + SETelemsize * (sizneighbors + sizvertices));
00342     if (facet->ridges) {
00343       zadd_(Zmemridges,
00344          sizeof (setT) + SETelemsize * sizridges + sizridges * 
00345          (sizeof (ridgeT) + sizeof (setT) + SETelemsize * (qh hull_dim-1))/2);
00346     }
00347     if (facet->outsideset)
00348       zadd_(Zmempoints, sizeof (setT) + SETelemsize * qh_setsize (facet->outsideset));
00349     if (facet->coplanarset)
00350       zadd_(Zmempoints, sizeof (setT) + SETelemsize * qh_setsize (facet->coplanarset));
00351     if (facet->seen) /* Delaunay upper envelope */
00352       continue;
00353     facet->seen= True;
00354     FOREACHneighbor_(facet) {
00355       if (neighbor == qh_DUPLICATEridge || neighbor == qh_MERGEridge
00356           || neighbor->seen || !facet->normal || !neighbor->normal)
00357         continue;
00358       dotproduct= qh_getangle(facet->normal, neighbor->normal);
00359       zinc_(Zangle);
00360       wadd_(Wangle, dotproduct);
00361       wmax_(Wanglemax, dotproduct)
00362       wmin_(Wanglemin, dotproduct)
00363     }
00364     if (facet->normal) {
00365       FOREACHvertex_(facet->vertices) {
00366         zinc_(Zdiststat);
00367         qh_distplane(vertex->point, facet, &dist);
00368         wmax_(Wvertexmax, dist);
00369         wmin_(Wvertexmin, dist);
00370       }
00371     }
00372   }
00373   FORALLvertices {
00374     if (vertex->deleted)
00375       continue;
00376     zadd_(Zmemvertices, sizeof (vertexT));
00377     if (vertex->neighbors) {
00378       sizneighbors= qh_setsize (vertex->neighbors);
00379       zadd_(Znumvneighbors, sizneighbors);
00380       zmax_(Zmaxvneighbors, sizneighbors);
00381       zadd_(Zmemvertices, sizeof (vertexT) + SETelemsize * sizneighbors);
00382     }
00383   }
00384   qh RANDOMdist= qh old_randomdist;
00385 } /* collectstatistics */

void qh_freestatistics void   
 

Definition at line 394 of file stat.c.

References free.

Referenced by qh_freeqhull().

00394                               {
00395 
00396 #if qh_QHpointer
00397   free (qh_qhstat);
00398   qh_qhstat= NULL;
00399 #endif
00400 } /* freestatistics */

void qh_initstatistics void   
 

Definition at line 411 of file stat.c.

References i, malloc, qh_allstatA(), qh_allstatB(), qh_allstatC(), qh_allstatD(), qh_allstatE(), qh_allstatF(), qh_allstatG(), qh_allstatH(), qh_allstatI(), qhstat, REALmax, realT, wadd, wmax, wmin, zadd, zdoc, ZEND, zinc, zmax, zmin, and ZTYPEreal.

Referenced by qh_initqhull_start().

00411                               {
00412   int i;
00413   realT realx;
00414   int intx;
00415 
00416 #if qh_QHpointer
00417   if (!(qh_qhstat= (qhstatT *)malloc (sizeof(qhstatT)))) {
00418     fprintf (qhmem.ferr, "qhull error (qh_initstatistics): insufficient memory\n");
00419     exit (1);  /* can not use qh_errexit() */
00420   }
00421 #endif
00422   
00423   qhstat next= 0;
00424   qh_allstatA();
00425   qh_allstatB();
00426   qh_allstatC();
00427   qh_allstatD();
00428   qh_allstatE();
00429   qh_allstatF();
00430   qh_allstatG();
00431   qh_allstatH();
00432   qh_allstatI();
00433   if (qhstat next > sizeof(qhstat id)) {
00434     fprintf (qhmem.ferr, "qhull error (qh_initstatistics): increase size of qhstat.id[].\n\
00435       qhstat.next %d should be <= sizeof(qhstat id) %d\n", qhstat next, sizeof(qhstat id));
00436 #if 0 /* for locating error, Znumridges should be duplicated */
00437     for (i=0; i < ZEND; i++) {
00438       int j;
00439       for (j=i+1; j < ZEND; j++) {
00440         if (qhstat id[i] == qhstat id[j]) {
00441           fprintf (qhmem.ferr, "qhull error (qh_initstatistics): duplicated statistic %d at indices %d and %d\n", 
00442               qhstat id[i], i, j);
00443         }
00444       }
00445     }
00446 #endif 
00447     exit (1);  /* can not use qh_errexit() */
00448   }
00449   qhstat init[zinc].i= 0;
00450   qhstat init[zadd].i= 0;
00451   qhstat init[zmin].i= INT_MAX;
00452   qhstat init[zmax].i= INT_MIN;
00453   qhstat init[wadd].r= 0;
00454   qhstat init[wmin].r= REALmax;
00455   qhstat init[wmax].r= -REALmax;
00456   for (i=0; i < ZEND; i++) {
00457     if (qhstat type[i] > ZTYPEreal) {
00458       realx= qhstat init[(unsigned char)(qhstat type[i])].r;
00459       qhstat stats[i].r= realx;
00460     }else if (qhstat type[i] != zdoc) {
00461       intx= qhstat init[(unsigned char)(qhstat type[i])].i;
00462       qhstat stats[i].i= intx;
00463     }
00464   }
00465 } /* initstatistics */

boolT qh_newstats int    index,
int *    nextindex
 

Definition at line 476 of file stat.c.

References boolT, i, qh_nostatistic(), qhstat, and zdoc.

Referenced by qh_check_output(), and qh_printstats().

00476                                               {
00477   boolT isnew= False;
00478   int start, i;
00479 
00480   if (qhstat type[qhstat id[index]] == zdoc) 
00481     start= index+1;
00482   else
00483     start= index;
00484   for (i= start; i < qhstat next && qhstat type[qhstat id[i]] != zdoc; i++) {
00485     if (!qh_nostatistic(qhstat id[i]) && !qhstat printed[qhstat id[i]])
00486         isnew= True;
00487   }
00488   *nextindex= i;
00489   return isnew;
00490 } /* newstats */

boolT qh_nostatistic int    i
 

Definition at line 498 of file stat.c.

References boolT, i, qhstat, and ZTYPEreal.

Referenced by qh_newstats(), and qh_printstatlevel().

00498                              {
00499   
00500   if ((qhstat type[i] > ZTYPEreal
00501        &&qhstat stats[i].r == qhstat init[(unsigned char)(qhstat type[i])].r)
00502       || (qhstat type[i] < ZTYPEreal
00503           &&qhstat stats[i].i == qhstat init[(unsigned char)(qhstat type[i])].i))
00504     return True;
00505   return False;
00506 } /* nostatistic */

void qh_printallstatistics FILE *    fp,
char *    string
 

Definition at line 515 of file stat.c.

References qh_allstatistics(), qh_collectstatistics(), qh_memstatistics(), and qh_printstatistics().

Referenced by qh_postmerge().

00515                                                     {
00516 
00517   qh_allstatistics();
00518   qh_collectstatistics();
00519   qh_printstatistics (fp, string);
00520   qh_memstatistics (fp);
00521 }

void qh_printstatistics FILE *    fp,
char *    string
 

Definition at line 534 of file stat.c.

References i, num_points, qh, qh_printstats(), qh_stddev(), qhstat, REALepsilon, REALmax, realT, Wnewbalance, Wnewbalance2, Wpbalance, Wpbalance2, wval_, Zpbalance, Zprocessed, and zval_.

Referenced by qh_errexit(), qh_printallstatistics(), and qh_produce_output().

00534                                                  {
00535   int i, k;
00536   realT ave;
00537   
00538   if (qh num_points != qh num_vertices) {
00539     wval_(Wpbalance)= 0;
00540     wval_(Wpbalance2)= 0;
00541   }else
00542     wval_(Wpbalance2)= qh_stddev (zval_(Zpbalance), wval_(Wpbalance), 
00543                                  wval_(Wpbalance2), &ave);
00544   wval_(Wnewbalance2)= qh_stddev (zval_(Zprocessed), wval_(Wnewbalance), 
00545                                  wval_(Wnewbalance2), &ave);
00546   fprintf (fp, "\n\
00547 %s\n\
00548  qhull invoked by: %s | %s\n%s with options:\n%s\n", string, qh rbox_command, 
00549      qh qhull_command, qh_version, qh qhull_options);
00550   fprintf (fp, "\nprecision constants:\n\
00551  %6.2g max. abs. coordinate in the (transformed) input ('Qbd:n')\n\
00552  %6.2g max. roundoff error for distance computation ('En')\n\
00553  %6.2g max. roundoff error for angle computations\n\
00554  %6.2g min. distance for outside points ('Wn')\n\
00555  %6.2g min. distance for visible facets ('Vn')\n\
00556  %6.2g max. distance for coplanar facets ('Un')\n\
00557  %6.2g max. facet width for recomputing centrum and area\n\
00558 ", 
00559   qh MAXabs_coord, qh DISTround, qh ANGLEround, qh MINoutside, 
00560         qh MINvisible, qh MAXcoplanar, qh WIDEfacet);
00561   if (qh KEEPnearinside)
00562     fprintf(fp, "\
00563  %6.2g max. distance for near-inside points\n", qh NEARinside);
00564   if (qh premerge_cos < REALmax/2) fprintf (fp, "\
00565  %6.2g max. cosine for pre-merge angle\n", qh premerge_cos);
00566   if (qh PREmerge) fprintf (fp, "\
00567  %6.2g radius of pre-merge centrum\n", qh premerge_centrum);
00568   if (qh postmerge_cos < REALmax/2) fprintf (fp, "\
00569  %6.2g max. cosine for post-merge angle\n", qh postmerge_cos);
00570   if (qh POSTmerge) fprintf (fp, "\
00571  %6.2g radius of post-merge centrum\n", qh postmerge_centrum);
00572   fprintf (fp, "\
00573  %6.2g max. distance for merging two simplicial facets\n\
00574  %6.2g max. roundoff error for arithmetic operations\n\
00575  %6.2g min. denominator for divisions\n\
00576   zero diagonal for Gauss: ", qh ONEmerge, REALepsilon, qh MINdenom);
00577   for (k=0; k < qh hull_dim; k++)
00578     fprintf (fp, "%6.2e ", qh NEARzero[k]);
00579   fprintf (fp, "\n\n");
00580   for (i=0 ; i < qhstat next; ) 
00581     qh_printstats (fp, i, &i);
00582 } /* printstatistics */

void qh_printstatlevel FILE *    fp,
int    id,
int    start
 

Definition at line 594 of file stat.c.

References i, qh_nostatistic(), qhstat, r, realT, zdoc, ZEND, and ZTYPEreal.

Referenced by qh_printstats().

00594                                                      {
00595 #define NULLfield "       "
00596 
00597   if (id >= ZEND || qhstat printed[id])
00598     return;
00599   if (qhstat type[id] == zdoc) {
00600     fprintf (fp, "%s\n", qhstat doc[id]);
00601     return;
00602   }
00603   start= 0; /* not used */
00604   if (qh_nostatistic(id) || !qhstat doc[id])
00605     return;
00606   qhstat printed[id]= True;
00607   if (qhstat count[id] != -1 
00608       && qhstat stats[(unsigned char)(qhstat count[id])].i == 0)
00609     fprintf (fp, " *0 cnt*");
00610   else if (qhstat type[id] >= ZTYPEreal && qhstat count[id] == -1)
00611     fprintf (fp, "%7.2g", qhstat stats[id].r);
00612   else if (qhstat type[id] >= ZTYPEreal && qhstat count[id] != -1)
00613     fprintf (fp, "%7.2g", qhstat stats[id].r/ qhstat stats[(unsigned char)(qhstat count[id])].i);
00614   else if (qhstat type[id] < ZTYPEreal && qhstat count[id] == -1)
00615     fprintf (fp, "%7d", qhstat stats[id].i);
00616   else if (qhstat type[id] < ZTYPEreal && qhstat count[id] != -1)
00617     fprintf (fp, "%7.3g", (realT) qhstat stats[id].i / qhstat stats[(unsigned char)(qhstat count[id])].i);
00618   fprintf (fp, " %s\n", qhstat doc[id]);
00619 } /* printstatlevel */

void qh_printstats FILE *    fp,
int    index,
int *    nextindex
 

Definition at line 631 of file stat.c.

References qh_newstats(), qh_printstatlevel(), and qhstat.

Referenced by qh_errexit(), qh_printstatistics(), and qh_produce_output().

00631                                                          {
00632   int j, nexti;
00633 
00634   if (qh_newstats (index, &nexti)) {
00635     fprintf (fp, "\n");
00636     for (j=index; j<nexti; j++)
00637       qh_printstatlevel (fp, qhstat id[j], 0);
00638   }
00639   if (nextindex)
00640     *nextindex= nexti;
00641 } /* printstats */

realT qh_stddev int    num,
realT    tot,
realT    tot2,
realT *    ave
 

Definition at line 659 of file stat.c.

References realT.

Referenced by qh_printstatistics(), and qh_printsummary().

00659                                                              {
00660   realT stddev;
00661 
00662   *ave= tot/num;
00663   stddev= sqrt (tot2/num - *ave * *ave);
00664   return stddev;
00665 } /* stddev */

Variable Documentation

qhstatT qh_qhstat
 

Definition at line 19 of file stat.c.

 

Powered by Plone

This site conforms to the following standards: