geom.h   geom.h 
/*<html><pre> -<a href="qh-geom.htm" /*<html><pre> -<a href="qh-geom.htm"
>-------------------------------</a><a name="TOP">-</a> >-------------------------------</a><a name="TOP">-</a>
geom.h geom.h
header file for geometric routines header file for geometric routines
see qh-geom.htm and geom.c see qh-geom.htm and geom.c
copyright (c) 1993-2003 The Geometry Center Copyright (c) 1993-2011 The Geometry Center.
$Id: //main/2011/qhull/src/libqhull/geom.h#2 $$Change: 1342 $
$DateTime: 2011/03/07 21:55:47 $$Author: bbarber $
*/ */
#ifndef qhDEFgeom #ifndef qhDEFgeom
#define qhDEFgeom 1 #define qhDEFgeom 1
#include "libqhull.h"
/* ============ -macros- ======================== */ /* ============ -macros- ======================== */
/*-<a href="qh-geom.htm#TOC" /*-<a href="qh-geom.htm#TOC"
>--------------------------------</a><a name="fabs_">-</a> >--------------------------------</a><a name="fabs_">-</a>
fabs_(a) fabs_(a)
returns the absolute value of a returns the absolute value of a
*/ */
#define fabs_( a ) ((( a ) < 0 ) ? -( a ):( a )) #define fabs_( a ) ((( a ) < 0 ) ? -( a ):( a ))
skipping to change at line 47 skipping to change at line 51
returns the minimum value of a and b returns the minimum value of a and b
*/ */
#define fmin_( a,b ) ( ( a ) > ( b ) ? ( b ) : ( a ) ) #define fmin_( a,b ) ( ( a ) > ( b ) ? ( b ) : ( a ) )
/*-<a href="qh-geom.htm#TOC" /*-<a href="qh-geom.htm#TOC"
>--------------------------------</a><a name="maximize_">-</a> >--------------------------------</a><a name="maximize_">-</a>
maximize_(maxval, val) maximize_(maxval, val)
set maxval to val if val is greater than maxval set maxval to val if val is greater than maxval
*/ */
#define maximize_( maxval, val ) {if (( maxval ) < ( val )) ( maxval )= ( v al );} #define maximize_( maxval, val ) { if (( maxval ) < ( val )) ( maxval )= ( val ); }
/*-<a href="qh-geom.htm#TOC" /*-<a href="qh-geom.htm#TOC"
>--------------------------------</a><a name="minimize_">-</a> >--------------------------------</a><a name="minimize_">-</a>
minimize_(minval, val) minimize_(minval, val)
set minval to val if val is less than minval set minval to val if val is less than minval
*/ */
#define minimize_( minval, val ) {if (( minval ) > ( val )) ( minval )= ( v al );} #define minimize_( minval, val ) { if (( minval ) > ( val )) ( minval )= ( val ); }
/*-<a href="qh-geom.htm#TOC" /*-<a href="qh-geom.htm#TOC"
>--------------------------------</a><a name="det2_">-</a> >--------------------------------</a><a name="det2_">-</a>
det2_(a1, a2, det2_(a1, a2,
b1, b2) b1, b2)
compute a 2-d determinate compute a 2-d determinate
*/ */
#define det2_( a1,a2,b1,b2 ) (( a1 )*( b2 ) - ( a2 )*( b1 )) #define det2_( a1,a2,b1,b2 ) (( a1 )*( b2 ) - ( a2 )*( b1 ))
skipping to change at line 97 skipping to change at line 101
compute the difference between X, Y, or Z coordinates compute the difference between X, Y, or Z coordinates
*/ */
#define dX( p1,p2 ) ( *( rows[p1] ) - *( rows[p2] )) #define dX( p1,p2 ) ( *( rows[p1] ) - *( rows[p2] ))
#define dY( p1,p2 ) ( *( rows[p1]+1 ) - *( rows[p2]+1 )) #define dY( p1,p2 ) ( *( rows[p1]+1 ) - *( rows[p2]+1 ))
#define dZ( p1,p2 ) ( *( rows[p1]+2 ) - *( rows[p2]+2 )) #define dZ( p1,p2 ) ( *( rows[p1]+2 ) - *( rows[p2]+2 ))
#define dW( p1,p2 ) ( *( rows[p1]+3 ) - *( rows[p2]+3 )) #define dW( p1,p2 ) ( *( rows[p1]+3 ) - *( rows[p2]+3 ))
/*============= prototypes in alphabetical order, infrequent at end ======= */ /*============= prototypes in alphabetical order, infrequent at end ======= */
void qh_backnormal (realT **rows, int numrow, int numcol, boolT sign, co void qh_backnormal(realT **rows, int numrow, int numcol, boolT sign, coo
ordT *normal, boolT *nearzero); rdT *normal, boolT *nearzero);
void qh_distplane (pointT *point, facetT *facet, realT *dist); void qh_distplane(pointT *point, facetT *facet, realT *dist);
facetT *qh_findbest (pointT *point, facetT *startfacet, facetT *qh_findbest(pointT *point, facetT *startfacet,
boolT bestoutside, boolT isnewfacets, boolT noupper, boolT bestoutside, boolT isnewfacets, boolT noupper,
realT *dist, boolT *isoutside, int *numpart); realT *dist, boolT *isoutside, int *numpart);
facetT *qh_findbesthorizon (boolT ischeckmax, pointT *point, facetT *qh_findbesthorizon(boolT ischeckmax, pointT *point,
facetT *startfacet, boolT noupper, realT *bestdist, int facetT *startfacet, boolT noupper, realT *bestdist, in
*numpart); t *numpart);
facetT *qh_findbestnew (pointT *point, facetT *startfacet, realT *dist, facetT *qh_findbestnew(pointT *point, facetT *startfacet, realT *dist,
boolT bestoutside, boolT *isoutside, int *numpart); boolT bestoutside, boolT *isoutside, int *numpart);
void qh_gausselim(realT **rows, int numrow, int numcol, boolT *sign, bool void qh_gausselim(realT **rows, int numrow, int numcol, boolT *sign, boo
T *nearzero); lT *nearzero);
realT qh_getangle(pointT *vect1, pointT *vect2); realT qh_getangle(pointT *vect1, pointT *vect2);
pointT *qh_getcenter(setT *vertices); pointT *qh_getcenter(setT *vertices);
pointT *qh_getcentrum(facetT *facet); pointT *qh_getcentrum(facetT *facet);
realT qh_getdistance(facetT *facet, facetT *neighbor, realT *mindist, rea lT *maxdist); realT qh_getdistance(facetT *facet, facetT *neighbor, realT *mindist, rea lT *maxdist);
void qh_normalize (coordT *normal, int dim, boolT toporient); void qh_normalize(coordT *normal, int dim, boolT toporient);
void qh_normalize2 (coordT *normal, int dim, boolT toporient, void qh_normalize2 (coordT *normal, int dim, boolT toporient,
realT *minnorm, boolT *ismin); realT *minnorm, boolT *ismin);
pointT *qh_projectpoint(pointT *point, facetT *facet, realT dist); pointT *qh_projectpoint(pointT *point, facetT *facet, realT dist);
void qh_setfacetplane(facetT *newfacets); void qh_setfacetplane(facetT *newfacets);
void qh_sethyperplane_det (int dim, coordT **rows, coordT *point0, void qh_sethyperplane_det(int dim, coordT **rows, coordT *point0,
boolT toporient, coordT *normal, realT *offset, boolT *nearze ro); boolT toporient, coordT *normal, realT *offset, boolT *nearze ro);
void qh_sethyperplane_gauss (int dim, coordT **rows, pointT *point0, void qh_sethyperplane_gauss(int dim, coordT **rows, pointT *point0,
boolT toporient, coordT *normal, coordT *offset, boolT *nearzer boolT toporient, coordT *normal, coordT *offset, boolT *nearze
o); ro);
boolT qh_sharpnewfacets (void); boolT qh_sharpnewfacets(void);
/*========= infrequently used code in geom2.c =============*/ /*========= infrequently used code in geom2.c =============*/
coordT *qh_copypoints (coordT *points, int numpoints, int dimension); coordT *qh_copypoints(coordT *points, int numpoints, int dimension);
void qh_crossproduct (int dim, realT vecA[3], realT vecB[3], realT vecC[ void qh_crossproduct(int dim, realT vecA[3], realT vecB[3], realT vecC[3
3]); ]);
realT qh_determinant (realT **rows, int dim, boolT *nearzero); realT qh_determinant(realT **rows, int dim, boolT *nearzero);
realT qh_detjoggle (pointT *points, int numpoints, int dimension); realT qh_detjoggle(pointT *points, int numpoints, int dimension);
void qh_detroundoff (void); void qh_detroundoff(void);
realT qh_detsimplex(pointT *apex, setT *points, int dim, boolT *nearzero) ; realT qh_detsimplex(pointT *apex, setT *points, int dim, boolT *nearzero) ;
realT qh_distnorm (int dim, pointT *point, pointT *normal, realT *offsetp realT qh_distnorm(int dim, pointT *point, pointT *normal, realT *offsetp)
); ;
realT qh_distround (int dimension, realT maxabs, realT maxsumabs); realT qh_distround(int dimension, realT maxabs, realT maxsumabs);
realT qh_divzero(realT numer, realT denom, realT mindenom1, boolT *zerodi v); realT qh_divzero(realT numer, realT denom, realT mindenom1, boolT *zerodi v);
realT qh_facetarea (facetT *facet); realT qh_facetarea(facetT *facet);
realT qh_facetarea_simplex (int dim, coordT *apex, setT *vertices, realT qh_facetarea_simplex(int dim, coordT *apex, setT *vertices,
vertexT *notvertex, boolT toporient, coordT *normal, realT *offs et); vertexT *notvertex, boolT toporient, coordT *normal, realT *offs et);
pointT *qh_facetcenter (setT *vertices); pointT *qh_facetcenter(setT *vertices);
facetT *qh_findgooddist (pointT *point, facetT *facetA, realT *distp, facet facetT *qh_findgooddist(pointT *point, facetT *facetA, realT *distp, facetT
T **facetlist); **facetlist);
void qh_getarea (facetT *facetlist); void qh_getarea(facetT *facetlist);
boolT qh_gram_schmidt(int dim, realT **rows); boolT qh_gram_schmidt(int dim, realT **rows);
boolT qh_inthresholds (coordT *normal, realT *angle); boolT qh_inthresholds(coordT *normal, realT *angle);
void qh_joggleinput (void); void qh_joggleinput(void);
realT *qh_maxabsval (realT *normal, int dim); realT *qh_maxabsval(realT *normal, int dim);
setT *qh_maxmin(pointT *points, int numpoints, int dimension); setT *qh_maxmin(pointT *points, int numpoints, int dimension);
realT qh_maxouter (void); realT qh_maxouter(void);
void qh_maxsimplex (int dim, setT *maxpoints, pointT *points, int numpoi void qh_maxsimplex(int dim, setT *maxpoints, pointT *points, int numpoin
nts, setT **simplex); ts, setT **simplex);
realT qh_minabsval (realT *normal, int dim); realT qh_minabsval(realT *normal, int dim);
int qh_mindiff (realT *vecA, realT *vecB, int dim); int qh_mindiff(realT *vecA, realT *vecB, int dim);
boolT qh_orientoutside (facetT *facet); boolT qh_orientoutside(facetT *facet);
void qh_outerinner (facetT *facet, realT *outerplane, realT *innerplane) void qh_outerinner(facetT *facet, realT *outerplane, realT *innerplane);
;
coordT qh_pointdist(pointT *point1, pointT *point2, int dim); coordT qh_pointdist(pointT *point1, pointT *point2, int dim);
void qh_printmatrix (FILE *fp, char *string, realT **rows, int numrow, i void qh_printmatrix(FILE *fp, const char *string, realT **rows, int numr
nt numcol); ow, int numcol);
void qh_printpoints (FILE *fp, char *string, setT *points); void qh_printpoints(FILE *fp, const char *string, setT *points);
void qh_projectinput (void); void qh_projectinput(void);
void qh_projectpoints (signed char *project, int n, realT *points, void qh_projectpoints(signed char *project, int n, realT *points,
int numpoints, int dim, realT *newpoints, int newdim); int numpoints, int dim, realT *newpoints, int newdim);
int qh_rand( void); void qh_rotateinput(realT **rows);
void qh_srand( int seed); void qh_rotatepoints(realT *points, int numpoints, int dim, realT **rows
realT qh_randomfactor (void); );
void qh_randommatrix (realT *buffer, int dim, realT **row); void qh_scaleinput(void);
void qh_rotateinput (realT **rows); void qh_scalelast(coordT *points, int numpoints, int dim, coordT low,
void qh_rotatepoints (realT *points, int numpoints, int dim, realT **row coordT high, coordT newhigh);
s); void qh_scalepoints(pointT *points, int numpoints, int dim,
void qh_scaleinput (void); realT *newlows, realT *newhighs);
void qh_scalelast (coordT *points, int numpoints, int dim, coordT low, boolT qh_sethalfspace(int dim, coordT *coords, coordT **nextp,
coordT high, coordT newhigh);
void qh_scalepoints (pointT *points, int numpoints, int dim,
realT *newlows, realT *newhighs);
boolT qh_sethalfspace (int dim, coordT *coords, coordT **nextp,
coordT *normal, coordT *offset, coordT *feasible); coordT *normal, coordT *offset, coordT *feasible);
coordT *qh_sethalfspace_all (int dim, int count, coordT *halfspaces, pointT coordT *qh_sethalfspace_all(int dim, int count, coordT *halfspaces, pointT
*feasible); *feasible);
pointT *qh_voronoi_center (int dim, setT *points); pointT *qh_voronoi_center(int dim, setT *points);
#endif /* qhDEFgeom */ #endif /* qhDEFgeom */
 End of changes. 17 change blocks. 
69 lines changed or deleted 68 lines changed or added


 io.h   io.h 
/*<html><pre> -<a href="qh-io.htm" /*<html><pre> -<a href="qh-io.htm"
>-------------------------------</a><a name="TOP">-</a> >-------------------------------</a><a name="TOP">-</a>
io.h io.h
declarations of Input/Output functions declarations of Input/Output functions
see README, qhull.h and io.c see README, libqhull.h and io.c
copyright (c) 1993-2003, The Geometry Center Copyright (c) 1993-2011 The Geometry Center.
$Id: //main/2011/qhull/src/libqhull/io.h#2 $$Change: 1342 $
$DateTime: 2011/03/07 21:55:47 $$Author: bbarber $
*/ */
#ifndef qhDEFio #ifndef qhDEFio
#define qhDEFio 1 #define qhDEFio 1
#include "libqhull.h"
/*============ constants and flags ==================*/ /*============ constants and flags ==================*/
/*-<a href="qh-io.htm#TOC" /*-<a href="qh-io.htm#TOC"
>--------------------------------</a><a name="qh_MAXfirst">-</a> >--------------------------------</a><a name="qh_MAXfirst">-</a>
qh_MAXfirst qh_MAXfirst
maximum length of first two lines of stdin maximum length of first two lines of stdin
*/ */
#define qh_MAXfirst 200 #define qh_MAXfirst 200
skipping to change at line 75 skipping to change at line 79
printvridgeT printvridgeT
prints results of qh_printvdiagram prints results of qh_printvdiagram
see: see:
<a href="io.c#printvridge">qh_printvridge</a> for an example <a href="io.c#printvridge">qh_printvridge</a> for an example
*/ */
typedef void (*printvridgeT)(FILE *fp, vertexT *vertex, vertexT *vertexA, s etT *centers, boolT unbounded); typedef void (*printvridgeT)(FILE *fp, vertexT *vertex, vertexT *vertexA, s etT *centers, boolT unbounded);
/*============== -prototypes in alphabetical order =========*/ /*============== -prototypes in alphabetical order =========*/
void dfacet( unsigned id); void dfacet(unsigned id);
void dvertex( unsigned id); void dvertex(unsigned id);
int qh_compare_facetarea(const void *p1, const void *p2); int qh_compare_facetarea(const void *p1, const void *p2);
int qh_compare_facetmerge(const void *p1, const void *p2); int qh_compare_facetmerge(const void *p1, const void *p2);
int qh_compare_facetvisit(const void *p1, const void *p2); int qh_compare_facetvisit(const void *p1, const void *p2);
int qh_compare_vertexpoint(const void *p1, const void *p2); /* not used int qh_compare_vertexpoint(const void *p1, const void *p2); /* not used
*/ */
void qh_copyfilename(char *filename, int size, const char* source, int l
void qh_countfacets (facetT *facetlist, setT *facets, boolT printall, ength);
void qh_countfacets(facetT *facetlist, setT *facets, boolT printall,
int *numfacetsp, int *numsimplicialp, int *totneighborsp, int *numfacetsp, int *numsimplicialp, int *totneighborsp,
int *numridgesp, int *numcoplanarsp, int *numnumtricoplanarsp ); int *numridgesp, int *numcoplanarsp, int *numnumtricoplanarsp );
pointT *qh_detvnorm (vertexT *vertex, vertexT *vertexA, setT *centers, real pointT *qh_detvnorm(vertexT *vertex, vertexT *vertexA, setT *centers, realT
T *offsetp); *offsetp);
setT *qh_detvridge (vertexT *vertex); setT *qh_detvridge(vertexT *vertex);
setT *qh_detvridge3 (vertexT *atvertex, vertexT *vertex); setT *qh_detvridge3 (vertexT *atvertex, vertexT *vertex);
int qh_eachvoronoi (FILE *fp, printvridgeT printvridge, vertexT *atvert int qh_eachvoronoi(FILE *fp, printvridgeT printvridge, vertexT *atverte
ex, boolT visitall, qh_RIDGE innerouter, boolT inorder); x, boolT visitall, qh_RIDGE innerouter, boolT inorder);
int qh_eachvoronoi_all (FILE *fp, printvridgeT printvridge, boolT isupp int qh_eachvoronoi_all(FILE *fp, printvridgeT printvridge, boolT isUppe
er, qh_RIDGE innerouter, boolT inorder); r, qh_RIDGE innerouter, boolT inorder);
void qh_facet2point(facetT *facet, pointT **point0, pointT **point1, real void qh_facet2point(facetT *facet, pointT **point0, pointT **point1, rea
T *mindist); lT *mindist);
setT *qh_facetvertices (facetT *facetlist, setT *facets, boolT allfacets) setT *qh_facetvertices(facetT *facetlist, setT *facets, boolT allfacets);
; void qh_geomplanes(facetT *facet, realT *outerplane, realT *innerplane);
void qh_geomplanes (facetT *facet, realT *outerplane, realT *innerplane) void qh_markkeep(facetT *facetlist);
; setT *qh_markvoronoi(facetT *facetlist, setT *facets, boolT printall, boo
void qh_markkeep (facetT *facetlist); lT *isLowerp, int *numcentersp);
setT *qh_markvoronoi (facetT *facetlist, setT *facets, boolT printall, bo
olT *islowerp, int *numcentersp);
void qh_order_vertexneighbors(vertexT *vertex); void qh_order_vertexneighbors(vertexT *vertex);
void qh_printafacet(FILE *fp, int format, facetT *facet, boolT printall); void qh_prepare_output(void);
void qh_printbegin (FILE *fp, int format, facetT *facetlist, setT *facet void qh_printafacet(FILE *fp, qh_PRINT format, facetT *facet, boolT prin
s, boolT printall); tall);
void qh_printcenter (FILE *fp, int format, char *string, facetT *facet); void qh_printbegin(FILE *fp, qh_PRINT format, facetT *facetlist, setT *f
void qh_printcentrum (FILE *fp, facetT *facet, realT radius); acets, boolT printall);
void qh_printend (FILE *fp, int format, facetT *facetlist, setT *facets, void qh_printcenter(FILE *fp, qh_PRINT format, const char *string, facet
boolT printall); T *facet);
void qh_printend4geom (FILE *fp, facetT *facet, int *num, boolT printall void qh_printcentrum(FILE *fp, facetT *facet, realT radius);
); void qh_printend(FILE *fp, qh_PRINT format, facetT *facetlist, setT *fac
void qh_printextremes (FILE *fp, facetT *facetlist, setT *facets, int pr ets, boolT printall);
intall); void qh_printend4geom(FILE *fp, facetT *facet, int *num, boolT printall)
void qh_printextremes_2d (FILE *fp, facetT *facetlist, setT *facets, int ;
printall); void qh_printextremes(FILE *fp, facetT *facetlist, setT *facets, boolT p
void qh_printextremes_d (FILE *fp, facetT *facetlist, setT *facets, int rintall);
printall); void qh_printextremes_2d(FILE *fp, facetT *facetlist, setT *facets, bool
void qh_printfacet(FILE *fp, facetT *facet); T printall);
void qh_printfacet2math(FILE *fp, facetT *facet, int format, int notfirst void qh_printextremes_d(FILE *fp, facetT *facetlist, setT *facets, boolT
); printall);
void qh_printfacet2geom(FILE *fp, facetT *facet, realT color[3]); void qh_printfacet(FILE *fp, facetT *facet);
void qh_printfacet2math(FILE *fp, facetT *facet, qh_PRINT format, int no
tfirst);
void qh_printfacet2geom(FILE *fp, facetT *facet, realT color[3]);
void qh_printfacet2geom_points(FILE *fp, pointT *point1, pointT *point2, void qh_printfacet2geom_points(FILE *fp, pointT *point1, pointT *point2,
facetT *facet, realT offset, realT color[3]); facetT *facet, realT offset, realT color[3])
void qh_printfacet3math (FILE *fp, facetT *facet, int format, int notfirs ;
t); void qh_printfacet3math(FILE *fp, facetT *facet, qh_PRINT format, int no
void qh_printfacet3geom_nonsimplicial(FILE *fp, facetT *facet, realT colo tfirst);
r[3]); void qh_printfacet3geom_nonsimplicial(FILE *fp, facetT *facet, realT col
void qh_printfacet3geom_points(FILE *fp, setT *points, facetT *facet, rea or[3]);
lT offset, realT color[3]); void qh_printfacet3geom_points(FILE *fp, setT *points, facetT *facet, re
void qh_printfacet3geom_simplicial(FILE *fp, facetT *facet, realT color[3 alT offset, realT color[3]);
]); void qh_printfacet3geom_simplicial(FILE *fp, facetT *facet, realT color[
void qh_printfacet3vertex(FILE *fp, facetT *facet, int format); 3]);
void qh_printfacet4geom_nonsimplicial(FILE *fp, facetT *facet, realT colo void qh_printfacet3vertex(FILE *fp, facetT *facet, qh_PRINT format);
r[3]); void qh_printfacet4geom_nonsimplicial(FILE *fp, facetT *facet, realT col
void qh_printfacet4geom_simplicial(FILE *fp, facetT *facet, realT color[3 or[3]);
]); void qh_printfacet4geom_simplicial(FILE *fp, facetT *facet, realT color[
void qh_printfacetNvertex_nonsimplicial(FILE *fp, facetT *facet, int id, 3]);
int format); void qh_printfacetNvertex_nonsimplicial(FILE *fp, facetT *facet, int id,
void qh_printfacetNvertex_simplicial(FILE *fp, facetT *facet, int format) qh_PRINT format);
; void qh_printfacetNvertex_simplicial(FILE *fp, facetT *facet, qh_PRINT f
ormat);
void qh_printfacetheader(FILE *fp, facetT *facet); void qh_printfacetheader(FILE *fp, facetT *facet);
void qh_printfacetridges(FILE *fp, facetT *facet); void qh_printfacetridges(FILE *fp, facetT *facet);
void qh_printfacets(FILE *fp, int format, facetT *facetlist, setT *facets void qh_printfacets(FILE *fp, qh_PRINT format, facetT *facetlist, setT *
, boolT printall); facets, boolT printall);
void qh_printhelp_degenerate(FILE *fp); void qh_printhyperplaneintersection(FILE *fp, facetT *facet1, facetT *fa
void qh_printhelp_singular(FILE *fp); cet2,
void qh_printhyperplaneintersection(FILE *fp, facetT *facet1, facetT *fac setT *vertices, realT color[3]);
et2, void qh_printneighborhood(FILE *fp, qh_PRINT format, facetT *facetA, fac
setT *vertices, realT color[3]); etT *facetB, boolT printall);
void qh_printneighborhood (FILE *fp, int format, facetT *facetA, facetT * void qh_printline3geom(FILE *fp, pointT *pointA, pointT *pointB, realT c
facetB, boolT printall); olor[3]);
void qh_printline3geom (FILE *fp, pointT *pointA, pointT *pointB, realT void qh_printpoint(FILE *fp, const char *string, pointT *point);
color[3]); void qh_printpointid(FILE *fp, const char *string, int dim, pointT *poin
void qh_printpoint(FILE *fp, char *string, pointT *point); t, int id);
void qh_printpointid(FILE *fp, char *string, int dim, pointT *point, int
id);
void qh_printpoint3 (FILE *fp, pointT *point); void qh_printpoint3 (FILE *fp, pointT *point);
void qh_printpoints_out (FILE *fp, facetT *facetlist, setT *facets, int void qh_printpoints_out(FILE *fp, facetT *facetlist, setT *facets, boolT
printall); printall);
void qh_printpointvect (FILE *fp, pointT *point, coordT *normal, pointT void qh_printpointvect(FILE *fp, pointT *point, coordT *normal, pointT *
*center, realT radius, realT color[3]); center, realT radius, realT color[3]);
void qh_printpointvect2 (FILE *fp, pointT *point, coordT *normal, pointT *center, realT radius); void qh_printpointvect2 (FILE *fp, pointT *point, coordT *normal, pointT *center, realT radius);
void qh_printridge(FILE *fp, ridgeT *ridge); void qh_printridge(FILE *fp, ridgeT *ridge);
void qh_printspheres(FILE *fp, setT *vertices, realT radius); void qh_printspheres(FILE *fp, setT *vertices, realT radius);
void qh_printvdiagram (FILE *fp, int format, facetT *facetlist, setT *fa cets, boolT printall); void qh_printvdiagram(FILE *fp, qh_PRINT format, facetT *facetlist, setT *facets, boolT printall);
int qh_printvdiagram2 (FILE *fp, printvridgeT printvridge, setT *vertic es, qh_RIDGE innerouter, boolT inorder); int qh_printvdiagram2 (FILE *fp, printvridgeT printvridge, setT *vertic es, qh_RIDGE innerouter, boolT inorder);
void qh_printvertex(FILE *fp, vertexT *vertex); void qh_printvertex(FILE *fp, vertexT *vertex);
void qh_printvertexlist (FILE *fp, char* string, facetT *facetlist, void qh_printvertexlist(FILE *fp, const char* string, facetT *facetlist,
setT *facets, boolT printall); setT *facets, boolT printall);
void qh_printvertices (FILE *fp, char* string, setT *vertices); void qh_printvertices(FILE *fp, const char* string, setT *vertices);
void qh_printvneighbors (FILE *fp, facetT* facetlist, setT *facets, bool void qh_printvneighbors(FILE *fp, facetT* facetlist, setT *facets, boolT
T printall); printall);
void qh_printvoronoi (FILE *fp, int format, facetT *facetlist, setT *fac void qh_printvoronoi(FILE *fp, qh_PRINT format, facetT *facetlist, setT
ets, boolT printall); *facets, boolT printall);
void qh_printvnorm (FILE *fp, vertexT *vertex, vertexT *vertexA, setT *c void qh_printvnorm(FILE *fp, vertexT *vertex, vertexT *vertexA, setT *ce
enters, boolT unbounded); nters, boolT unbounded);
void qh_printvridge (FILE *fp, vertexT *vertex, vertexT *vertexA, setT * void qh_printvridge(FILE *fp, vertexT *vertex, vertexT *vertexA, setT *c
centers, boolT unbounded); enters, boolT unbounded);
void qh_produce_output(void); void qh_produce_output(void);
void qh_produce_output2(void);
void qh_projectdim3 (pointT *source, pointT *destination); void qh_projectdim3 (pointT *source, pointT *destination);
int qh_readfeasible (int dim, char *remainder); int qh_readfeasible(int dim, const char *curline);
coordT *qh_readpoints(int *numpoints, int *dimension, boolT *ismalloc); coordT *qh_readpoints(int *numpoints, int *dimension, boolT *ismalloc);
void qh_setfeasible (int dim); void qh_setfeasible(int dim);
boolT qh_skipfacet(facetT *facet); boolT qh_skipfacet(facetT *facet);
char *qh_skipfilename(char *filename);
#endif /* qhDEFio */ #endif /* qhDEFio */
 End of changes. 16 change blocks. 
99 lines changed or deleted 106 lines changed or added


 mem.h   mem.h 
/*<html><pre> -<a href="qh-mem.htm" /*<html><pre> -<a href="qh-mem.htm"
>-------------------------------</a><a name="TOP">-</a> >-------------------------------</a><a name="TOP">-</a>
mem.h mem.h
prototypes for memory management functions prototypes for memory management functions
see qh-mem.htm, mem.c and qset.h see qh-mem.htm, mem.c and qset.h
for error handling, writes message and calls for error handling, writes message and calls
qh_errexit (qhmem_ERRmem, NULL, NULL) if insufficient memory qh_errexit(qhmem_ERRmem, NULL, NULL) if insufficient memory
and and
qh_errexit (qhmem_ERRqhull, NULL, NULL) otherwise qh_errexit(qhmem_ERRqhull, NULL, NULL) otherwise
copyright (c) 1993-2003, The Geometry Center Copyright (c) 1993-2011 The Geometry Center.
$Id: //main/2011/qhull/src/libqhull/mem.h#3 $$Change: 1356 $
$DateTime: 2011/04/03 09:01:22 $$Author: bbarber $
*/ */
#ifndef qhDEFmem #ifndef qhDEFmem
#define qhDEFmem #define qhDEFmem 1
#include <stdio.h>
/*-<a href="qh-mem.htm#TOC" /*-<a href="qh-mem.htm#TOC"
>-------------------------------</a><a name="NOmem">-</a> >-------------------------------</a><a name="NOmem">-</a>
qh_NOmem qh_NOmem
turn off quick-fit memory allocation turn off quick-fit memory allocation
notes: notes:
mem.c implements Quickfit memory allocation for about 20% time mem.c implements Quickfit memory allocation for about 20% time
savings. If it fails on your machine, try to locate the savings. If it fails on your machine, try to locate the
problem, and send the answer to qhull@qhull.org. If this can problem, and send the answer to qhull@qhull.org. If this can
not be done, define qh_NOmem to use malloc/free instead. not be done, define qh_NOmem to use malloc/free instead.
#define qh_NOmem #define qh_NOmem
*/ */
/*-<a href="qh-mem.htm#TOC"
>-------------------------------</a><a name="TRACEshort">-</a>
qh_TRACEshort
Trace short and quick memory allocations at T5
*/
#define qh_TRACEshort
/*------------------------------------------- /*-------------------------------------------
to avoid bus errors, memory allocation must consider alignment requirem ents. to avoid bus errors, memory allocation must consider alignment requirem ents.
malloc() automatically takes care of alignment. Since mem.c manages malloc() automatically takes care of alignment. Since mem.c manages
its own memory, we need to explicitly specify alignment in its own memory, we need to explicitly specify alignment in
qh_meminitbuffers(). qh_meminitbuffers().
A safe choice is sizeof(double). sizeof(float) may be used if doubles A safe choice is sizeof(double). sizeof(float) may be used if doubles
do not occur in data structures and pointers are the same size. Be car eful do not occur in data structures and pointers are the same size. Be car eful
of machines (e.g., DEC Alpha) with large pointers. If gcc is available , of machines (e.g., DEC Alpha) with large pointers. If gcc is available ,
use __alignof__(double) or fmax_(__alignof__(float), __alignof__(void * )). use __alignof__(double) or fmax_(__alignof__(float), __alignof__(void * )).
see <a href="user.h#MEMalign">qh_MEMalign</a> in user.h for qhull's alig nment see <a href="user.h#MEMalign">qh_MEMalign</a> in user.h for qhull's alig nment
*/ */
#define qhmem_ERRmem 4 /* matches qh_ERRmem in qhull.h */ #define qhmem_ERRmem 4 /* matches qh_ERRmem in libqhull.h */
#define qhmem_ERRqhull 5 /* matches qh_ERRqhull in qhull.h */ #define qhmem_ERRqhull 5 /* matches qh_ERRqhull in libqhull.h */
/*-<a href="qh-mem.htm#TOC" /*-<a href="qh-mem.htm#TOC"
>--------------------------------</a><a name="ptr_intT">-</a> >--------------------------------</a><a name="ptr_intT">-</a>
ptr_intT ptr_intT
for casting a void* to an integer-type for casting a void * to an integer-type that holds a pointer
Used for integer expressions (e.g., computing qh_gethash() in poly.c)
notes: notes:
WARN64 -- these notes indicate 64-bit issues
On 64-bit machines, a pointer may be larger than an 'int'. On 64-bit machines, a pointer may be larger than an 'int'.
qh_meminit() checks that 'long' holds a 'void*' qh_meminit()/mem.c checks that 'ptr_intT' holds a 'void*'
*/ ptr_intT is typically a signed value, but not necessarily so
typedef unsigned long ptr_intT; size_t is typically unsigned, but should match the parameter type
Qhull uses int instead of size_t except for system calls such as malloc
, qsort, qh_malloc, etc.
This matches Qt convention and is easier to work with.
*/
#if _MSC_VER && defined(_WIN64)
typedef long long ptr_intT;
#else
typedef long ptr_intT;
#endif
/*-<a href="qh-mem.htm#TOC" /*-<a href="qh-mem.htm#TOC"
>--------------------------------</a><a name="qhmemT">-</a> >--------------------------------</a><a name="qhmemT">-</a>
qhmemT qhmemT
global memory structure for mem.c global memory structure for mem.c
notes: notes:
users should ignore qhmem except for writing extensions users should ignore qhmem except for writing extensions
qhmem is allocated in mem.c qhmem is allocated in mem.c
skipping to change at line 85 skipping to change at line 108
multiple qh's and qhmem's would need to keep in synch. multiple qh's and qhmem's would need to keep in synch.
A swapable qhmem would also waste memory buffers. As long A swapable qhmem would also waste memory buffers. As long
as memory operations are atomic, there is no problem with as memory operations are atomic, there is no problem with
multiple qh structures being active at the same time. multiple qh structures being active at the same time.
If you need separate address spaces, you can swap the If you need separate address spaces, you can swap the
contents of qhmem. contents of qhmem.
*/ */
typedef struct qhmemT qhmemT; typedef struct qhmemT qhmemT;
extern qhmemT qhmem; extern qhmemT qhmem;
#ifndef DEFsetT
#define DEFsetT 1
typedef struct setT setT; /* defined in qset.h */
#endif
/* Update qhmem in mem.c if add or remove fields */
struct qhmemT { /* global memory management variables */ struct qhmemT { /* global memory management variables */
int BUFsize; /* size of memory allocation buffer */ int BUFsize; /* size of memory allocation buffer */
int BUFinit; /* initial size of memory allocation buffer */ int BUFinit; /* initial size of memory allocation buffer *
/
int TABLEsize; /* actual number of sizes in free list table */ int TABLEsize; /* actual number of sizes in free list table */
int NUMsizes; /* maximum number of sizes in free list table */ int NUMsizes; /* maximum number of sizes in free list table */
int LASTsize; /* last size in free list table */ int LASTsize; /* last size in free list table */
int ALIGNmask; /* worst-case alignment, must be 2^n-1 */ int ALIGNmask; /* worst-case alignment, must be 2^n-1 */
void **freelists; /* free list table, linked by offset 0 */ void **freelists; /* free list table, linked by offset 0 */
int *sizetable; /* size of each freelist */ int *sizetable; /* size of each freelist */
int *indextable; /* size->index table */ int *indextable; /* size->index table */
void *curbuffer; /* current buffer, linked by offset 0 */ void *curbuffer; /* current buffer, linked by offset 0 */
void *freemem; /* free memory in curbuffer */ void *freemem; /* free memory in curbuffer */
int freesize; /* size of free memory in bytes */ int freesize; /* size of freemem in bytes */
void *tempstack; /* stack of temporary memory, managed setT *tempstack; /* stack of temporary memory, managed by user
by users */ s */
FILE *ferr; /* file for reporting errors */ FILE *ferr; /* file for reporting errors, only user is qh
_fprintf() */
int IStracing; /* =5 if tracing memory allocations */ int IStracing; /* =5 if tracing memory allocations */
int cntquick; /* count of quick allocations */ int cntquick; /* count of quick allocations */
/* remove statistics doesn't effect speed */ /* Note: removing statistics doesn't effect s peed */
int cntshort; /* count of short allocations */ int cntshort; /* count of short allocations */
int cntlong; /* count of long allocations */ int cntlong; /* count of long allocations */
int curlong; /* current count of inuse, long allocations * int freeshort; /* count of short memfrees */
/ int freelong; /* count of long memfrees */
int freeshort; /* count of short memfrees */ int totbuffer; /* total short memory buffers minus buffer li
int freelong; /* count of long memfrees */ nks */
int totshort; /* total size of short allocations */ int totdropped; /* total dropped memory at end of short memor
int totlong; /* total size of long allocations */ y buffers (e.g., freesize) */
int maxlong; /* maximum totlong */ int totfree; /* total size of free, short memory on freeli
sts */
int totlong; /* total size of long memory in use */
int maxlong; /* maximum totlong */
int totshort; /* total size of short memory in use */
int totunused; /* total unused short memory (estimated, shor
t size - request size of first allocations) */
int cntlarger; /* count of setlarger's */ int cntlarger; /* count of setlarger's */
int totlarger; /* total copied by setlarger */ int totlarger; /* total copied by setlarger */
}; };
/*==================== -macros ====================*/ /*==================== -macros ====================*/
/*-<a href="qh-mem.htm#TOC" /*-<a href="qh-mem.htm#TOC"
>--------------------------------</a><a name="memalloc_">-</a> >--------------------------------</a><a name="memalloc_">-</a>
qh_memalloc_(size, object, type) qh_memalloc_(insize, object, type)
returns object of size bytes returns object of size bytes
assumes size<=qhmem.LASTsize and void **freelistp is a temp assumes size<=qhmem.LASTsize and void **freelistp is a temp
*/ */
#ifdef qh_NOmem #if defined qh_NOmem
#define qh_memalloc_(size, freelistp, object, type) {\ #define qh_memalloc_(insize, freelistp, object, type) {\
object= (type*)qh_memalloc (size); } object= (type*)qh_memalloc(insize); }
#elif defined qh_TRACEshort
#define qh_memalloc_(insize, freelistp, object, type) {\
freelistp= NULL; /* Avoid warnings */ \
object= (type*)qh_memalloc(insize); }
#else /* !qh_NOmem */ #else /* !qh_NOmem */
#define qh_memalloc_(size, freelistp, object, type) {\ #define qh_memalloc_(insize, freelistp, object, type) {\
freelistp= qhmem.freelists + qhmem.indextable[size];\ freelistp= qhmem.freelists + qhmem.indextable[insize];\
if ((object= (type*)*freelistp)) {\ if ((object= (type*)*freelistp)) {\
qhmem.totshort += qhmem.sizetable[qhmem.indextable[insize]]; \
qhmem.totfree -= qhmem.sizetable[qhmem.indextable[insize]]; \
qhmem.cntquick++; \ qhmem.cntquick++; \
*freelistp= *((void **)*freelistp);\ *freelistp= *((void **)*freelistp);\
}else object= (type*)qh_memalloc (size);} }else object= (type*)qh_memalloc(insize);}
#endif #endif
/*-<a href="qh-mem.htm#TOC" /*-<a href="qh-mem.htm#TOC"
>--------------------------------</a><a name="memfree_">-</a> >--------------------------------</a><a name="memfree_">-</a>
qh_memfree_(object, size) qh_memfree_(object, insize)
free up an object free up an object
notes: notes:
object may be NULL object may be NULL
assumes size<=qhmem.LASTsize and void **freelistp is a temp assumes size<=qhmem.LASTsize and void **freelistp is a temp
*/ */
#ifdef qh_NOmem #if defined qh_NOmem
#define qh_memfree_(object, size, freelistp) {\ #define qh_memfree_(object, insize, freelistp) {\
qh_memfree (object, size); } qh_memfree(object, insize); }
#elif defined qh_TRACEshort
#define qh_memfree_(object, insize, freelistp) {\
freelistp= NULL; /* Avoid warnings */ \
qh_memfree(object, insize); }
#else /* !qh_NOmem */ #else /* !qh_NOmem */
#define qh_memfree_(object, size, freelistp) {\ #define qh_memfree_(object, insize, freelistp) {\
if (object) { \ if (object) { \
qhmem .freeshort++;\ qhmem .freeshort++;\
freelistp= qhmem.freelists + qhmem.indextable[size];\ freelistp= qhmem.freelists + qhmem.indextable[insize];\
qhmem.totshort -= qhmem.sizetable[qhmem.indextable[insize]]; \
qhmem.totfree += qhmem.sizetable[qhmem.indextable[insize]]; \
*((void **)object)= *freelistp;\ *((void **)object)= *freelistp;\
*freelistp= object;}} *freelistp= object;}}
#endif #endif
/*=============== prototypes in alphabetical order ============*/ /*=============== prototypes in alphabetical order ============*/
void *qh_memalloc(int insize); void *qh_memalloc(int insize);
void qh_memfree (void *object, int size); void qh_memfree(void *object, int insize);
void qh_memfreeshort (int *curlong, int *totlong); void qh_memfreeshort(int *curlong, int *totlong);
void qh_meminit (FILE *ferr); void qh_meminit(FILE *ferr);
void qh_meminitbuffers (int tracelevel, int alignment, int numsizes, void qh_meminitbuffers(int tracelevel, int alignment, int numsizes,
int bufsize, int bufinit); int bufsize, int bufinit);
void qh_memsetup (void); void qh_memsetup(void);
void qh_memsize(int size); void qh_memsize(int size);
void qh_memstatistics (FILE *fp); void qh_memstatistics(FILE *fp);
void qh_memtotal(int *totlong, int *curlong, int *totshort, int *curshort,
int *maxlong, int *totbuffer);
#endif /* qhDEFmem */ #endif /* qhDEFmem */
 End of changes. 27 change blocks. 
46 lines changed or deleted 98 lines changed or added


 merge.h   merge.h 
/*<html><pre> -<a href="qh-merge.htm" /*<html><pre> -<a href="qh-merge.htm"
>-------------------------------</a><a name="TOP">-</a> >-------------------------------</a><a name="TOP">-</a>
merge.h merge.h
header file for merge.c header file for merge.c
see qh-merge.htm and merge.c see qh-merge.htm and merge.c
copyright (c) 1993-2003, The Geometry Center Copyright (c) 1993-2011 C.B. Barber.
$Id: //main/2011/qhull/src/libqhull/merge.h#2 $$Change: 1342 $
$DateTime: 2011/03/07 21:55:47 $$Author: bbarber $
*/ */
#ifndef qhDEFmerge #ifndef qhDEFmerge
#define qhDEFmerge 1 #define qhDEFmerge 1
#include "libqhull.h"
/*============ -constants- ==============*/ /*============ -constants- ==============*/
/*-<a href="qh-merge.htm#TOC" /*-<a href="qh-merge.htm#TOC"
>--------------------------------</a><a name="qh_ANGLEredundant">-</a> >--------------------------------</a><a name="qh_ANGLEredundant">-</a>
qh_ANGLEredundant qh_ANGLEredundant
indicates redundant merge in mergeT->angle indicates redundant merge in mergeT->angle
*/ */
#define qh_ANGLEredundant 6.0 #define qh_ANGLEredundant 6.0
skipping to change at line 51 skipping to change at line 55
roundoff error may make the angle less than 2 roundoff error may make the angle less than 2
*/ */
#define qh_ANGLEconcave 1.5 #define qh_ANGLEconcave 1.5
/*-<a href="qh-merge.htm#TOC" /*-<a href="qh-merge.htm#TOC"
>--------------------------------</a><a name="MRG">-</a> >--------------------------------</a><a name="MRG">-</a>
MRG... (mergeType) MRG... (mergeType)
indicates the type of a merge (mergeT->type) indicates the type of a merge (mergeT->type)
*/ */
typedef enum { /* in sort order for facet_mergeset */ typedef enum { /* in sort order for facet_mergeset */
MRGnone= 0, MRGnone= 0,
MRGcoplanar, /* centrum coplanar */ MRGcoplanar, /* centrum coplanar */
MRGanglecoplanar, /* angle coplanar */ MRGanglecoplanar, /* angle coplanar */
/* could detect half concave ridges */ /* could detect half concave ridges */
MRGconcave, /* concave ridge */ MRGconcave, /* concave ridge */
MRGflip, /* flipped facet. facet1 == facet2 */ MRGflip, /* flipped facet. facet1 == facet2 */
MRGridge, /* duplicate ridge (qh_MERGEridge) */ MRGridge, /* duplicate ridge (qh_MERGEridge) */
/* degen and redundant go onto degen_mergeset */ /* degen and redundant go onto degen_mergeset */
MRGdegen, /* degenerate facet (not enough neighbors) facet1 == MRGdegen, /* degenerate facet (!enough neighbors) facet1 == f
facet2 */ acet2 */
MRGredundant, /* redundant facet (vertex subset) */ MRGredundant, /* redundant facet (vertex subset) */
/* merge_degenredundant assumes degen < redundant */ /* merge_degenredundant assumes degen < redundant *
MRGmirror, /* mirror facet from qh_triangulate */ /
MRGmirror, /* mirror facet from qh_triangulate */
ENDmrg ENDmrg
} mergeType; } mergeType;
/*-<a href="qh-merge.htm#TOC" /*-<a href="qh-merge.htm#TOC"
>--------------------------------</a><a name="qh_MERGEapex">-</a> >--------------------------------</a><a name="qh_MERGEapex">-</a>
qh_MERGEapex qh_MERGEapex
flag for qh_mergefacet() to indicate an apex merge flag for qh_mergefacet() to indicate an apex merge
*/ */
#define qh_MERGEapex True #define qh_MERGEapex True
skipping to change at line 85 skipping to change at line 89
/*============ -structures- ====================*/ /*============ -structures- ====================*/
/*-<a href="qh-merge.htm#TOC" /*-<a href="qh-merge.htm#TOC"
>--------------------------------</a><a name="mergeT">-</a> >--------------------------------</a><a name="mergeT">-</a>
mergeT mergeT
structure used to merge facets structure used to merge facets
*/ */
typedef struct mergeT mergeT; typedef struct mergeT mergeT;
struct mergeT { /* initialize in qh_appendmergeset */ struct mergeT { /* initialize in qh_appendmergeset */
realT angle; /* angle between normals of facet1 and facet2 */ realT angle; /* angle between normals of facet1 and facet2 */
facetT *facet1; /* will merge facet1 into facet2 */ facetT *facet1; /* will merge facet1 into facet2 */
facetT *facet2; facetT *facet2;
mergeType type; mergeType type;
}; };
/*=========== -macros- =========================*/ /*=========== -macros- =========================*/
/*-<a href="qh-merge.htm#TOC" /*-<a href="qh-merge.htm#TOC"
>--------------------------------</a><a name="FOREACHmerge_">-</a> >--------------------------------</a><a name="FOREACHmerge_">-</a>
FOREACHmerge_( merges ) {...} FOREACHmerge_( merges ) {...}
skipping to change at line 110 skipping to change at line 114
notes: notes:
uses 'mergeT *merge, **mergep;' uses 'mergeT *merge, **mergep;'
if qh_mergefacet(), if qh_mergefacet(),
restart since qh.facet_mergeset may change restart since qh.facet_mergeset may change
see <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a> see <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a>
*/ */
#define FOREACHmerge_( merges ) FOREACHsetelement_(mergeT, merges, merge) #define FOREACHmerge_( merges ) FOREACHsetelement_(mergeT, merges, merge)
/*============ prototypes in alphabetical order after pre/postmerge ======= */ /*============ prototypes in alphabetical order after pre/postmerge ======= */
void qh_premerge (vertexT *apex, realT maxcentrum, realT maxangle); void qh_premerge(vertexT *apex, realT maxcentrum, realT maxangle);
void qh_postmerge (char *reason, realT maxcentrum, realT maxangle, void qh_postmerge(const char *reason, realT maxcentrum, realT maxangle,
boolT vneighbors); boolT vneighbors);
void qh_all_merges (boolT othermerge, boolT vneighbors); void qh_all_merges(boolT othermerge, boolT vneighbors);
void qh_appendmergeset(facetT *facet, facetT *neighbor, mergeType merget ype, realT *angle); void qh_appendmergeset(facetT *facet, facetT *neighbor, mergeType merget ype, realT *angle);
setT *qh_basevertices( facetT *samecycle); setT *qh_basevertices( facetT *samecycle);
void qh_checkconnect (void /* qh new_facets */); void qh_checkconnect(void /* qh new_facets */);
boolT qh_checkzero (boolT testall); boolT qh_checkzero(boolT testall);
int qh_compareangle(const void *p1, const void *p2); int qh_compareangle(const void *p1, const void *p2);
int qh_comparemerge(const void *p1, const void *p2); int qh_comparemerge(const void *p1, const void *p2);
int qh_comparevisit (const void *p1, const void *p2); int qh_comparevisit(const void *p1, const void *p2);
void qh_copynonconvex (ridgeT *atridge); void qh_copynonconvex(ridgeT *atridge);
void qh_degen_redundant_facet (facetT *facet); void qh_degen_redundant_facet(facetT *facet);
void qh_degen_redundant_neighbors (facetT *facet, facetT *delface void qh_degen_redundant_neighbors(facetT *facet, facetT *delfacet);
t); vertexT *qh_find_newvertex(vertexT *oldvertex, setT *vertices, setT *ridges
vertexT *qh_find_newvertex (vertexT *oldvertex, setT *vertices, setT *ridge );
s); void qh_findbest_test(boolT testcentrum, facetT *facet, facetT *neighbor
void qh_findbest_test (boolT testcentrum, facetT *facet, facetT *neighbo ,
r,
facetT **bestfacet, realT *distp, realT *mindistp, realT *maxdis tp); facetT **bestfacet, realT *distp, realT *mindistp, realT *maxdis tp);
facetT *qh_findbestneighbor(facetT *facet, realT *distp, realT *mindistp, r ealT *maxdistp); facetT *qh_findbestneighbor(facetT *facet, realT *distp, realT *mindistp, r ealT *maxdistp);
void qh_flippedmerges(facetT *facetlist, boolT *wasmerge); void qh_flippedmerges(facetT *facetlist, boolT *wasmerge);
void qh_forcedmerges( boolT *wasmerge); void qh_forcedmerges( boolT *wasmerge);
void qh_getmergeset(facetT *facetlist); void qh_getmergeset(facetT *facetlist);
void qh_getmergeset_initial (facetT *facetlist); void qh_getmergeset_initial(facetT *facetlist);
void qh_hashridge (setT *hashtable, int hashsize, ridgeT *ridge, vertexT void qh_hashridge(setT *hashtable, int hashsize, ridgeT *ridge, vertexT
*oldvertex); *oldvertex);
ridgeT *qh_hashridge_find (setT *hashtable, int hashsize, ridgeT *ridge, ridgeT *qh_hashridge_find(setT *hashtable, int hashsize, ridgeT *ridge,
vertexT *vertex, vertexT *oldvertex, int *hashslot); vertexT *vertex, vertexT *oldvertex, int *hashslot);
void qh_makeridges(facetT *facet); void qh_makeridges(facetT *facet);
void qh_mark_dupridges(facetT *facetlist); void qh_mark_dupridges(facetT *facetlist);
void qh_maydropneighbor (facetT *facet); void qh_maydropneighbor(facetT *facet);
int qh_merge_degenredundant (void); int qh_merge_degenredundant(void);
void qh_merge_nonconvex( facetT *facet1, facetT *facet2, mergeType merge type); void qh_merge_nonconvex( facetT *facet1, facetT *facet2, mergeType merge type);
void qh_mergecycle (facetT *samecycle, facetT *newfacet); void qh_mergecycle(facetT *samecycle, facetT *newfacet);
void qh_mergecycle_all (facetT *facetlist, boolT *wasmerge); void qh_mergecycle_all(facetT *facetlist, boolT *wasmerge);
void qh_mergecycle_facets( facetT *samecycle, facetT *newfacet); void qh_mergecycle_facets( facetT *samecycle, facetT *newfacet);
void qh_mergecycle_neighbors(facetT *samecycle, facetT *newfacet); void qh_mergecycle_neighbors(facetT *samecycle, facetT *newfacet);
void qh_mergecycle_ridges(facetT *samecycle, facetT *newfacet); void qh_mergecycle_ridges(facetT *samecycle, facetT *newfacet);
void qh_mergecycle_vneighbors( facetT *samecycle, facetT *newfacet); void qh_mergecycle_vneighbors( facetT *samecycle, facetT *newfacet);
void qh_mergefacet(facetT *facet1, facetT *facet2, realT *mindist, realT void qh_mergefacet(facetT *facet1, facetT *facet2, realT *mindist, realT
*maxdist, boolT mergeapex); *maxdist, boolT mergeapex);
void qh_mergefacet2d (facetT *facet1, facetT *facet2); void qh_mergefacet2d(facetT *facet1, facetT *facet2);
void qh_mergeneighbors(facetT *facet1, facetT *facet2); void qh_mergeneighbors(facetT *facet1, facetT *facet2);
void qh_mergeridges(facetT *facet1, facetT *facet2); void qh_mergeridges(facetT *facet1, facetT *facet2);
void qh_mergesimplex(facetT *facet1, facetT *facet2, boolT mergeapex); void qh_mergesimplex(facetT *facet1, facetT *facet2, boolT mergeapex);
void qh_mergevertex_del (vertexT *vertex, facetT *facet1, facetT *facet2 ); void qh_mergevertex_del(vertexT *vertex, facetT *facet1, facetT *facet2) ;
void qh_mergevertex_neighbors(facetT *facet1, facetT *facet2); void qh_mergevertex_neighbors(facetT *facet1, facetT *facet2);
void qh_mergevertices(setT *vertices1, setT **vertices); void qh_mergevertices(setT *vertices1, setT **vertices);
setT *qh_neighbor_intersections (vertexT *vertex); setT *qh_neighbor_intersections(vertexT *vertex);
void qh_newvertices (setT *vertices); void qh_newvertices(setT *vertices);
boolT qh_reducevertices (void); boolT qh_reducevertices(void);
vertexT *qh_redundant_vertex (vertexT *vertex); vertexT *qh_redundant_vertex(vertexT *vertex);
boolT qh_remove_extravertices (facetT *facet); boolT qh_remove_extravertices(facetT *facet);
vertexT *qh_rename_sharedvertex (vertexT *vertex, facetT *facet); vertexT *qh_rename_sharedvertex(vertexT *vertex, facetT *facet);
void qh_renameridgevertex(ridgeT *ridge, vertexT *oldvertex, vertexT *new void qh_renameridgevertex(ridgeT *ridge, vertexT *oldvertex, vertexT *ne
vertex); wvertex);
void qh_renamevertex(vertexT *oldvertex, vertexT *newvertex, setT *ridge s, void qh_renamevertex(vertexT *oldvertex, vertexT *newvertex, setT *ridge s,
facetT *oldfacet, facetT *neighborA); facetT *oldfacet, facetT *neighborA);
boolT qh_test_appendmerge (facetT *facet, facetT *neighbor); boolT qh_test_appendmerge(facetT *facet, facetT *neighbor);
boolT qh_test_vneighbors (void /* qh newfacet_list */); boolT qh_test_vneighbors(void /* qh newfacet_list */);
void qh_tracemerge (facetT *facet1, facetT *facet2); void qh_tracemerge(facetT *facet1, facetT *facet2);
void qh_tracemerging (void); void qh_tracemerging(void);
void qh_updatetested( facetT *facet1, facetT *facet2); void qh_updatetested( facetT *facet1, facetT *facet2);
setT *qh_vertexridges (vertexT *vertex); setT *qh_vertexridges(vertexT *vertex);
void qh_vertexridges_facet (vertexT *vertex, facetT *facet, setT **ridge void qh_vertexridges_facet(vertexT *vertex, facetT *facet, setT **ridges
s); );
void qh_willdelete (facetT *facet, facetT *replace); void qh_willdelete(facetT *facet, facetT *replace);
#endif /* qhDEFmerge */ #endif /* qhDEFmerge */
 End of changes. 20 change blocks. 
65 lines changed or deleted 69 lines changed or added


 poly.h   poly.h 
/*<html><pre> -<a href="qh-poly.htm" /*<html><pre> -<a href="qh-poly.htm"
>-------------------------------</a><a name="TOP">-</a> >-------------------------------</a><a name="TOP">-</a>
poly.h poly.h
header file for poly.c and poly2.c header file for poly.c and poly2.c
see qh-poly.htm, qhull.h and poly.c see qh-poly.htm, libqhull.h and poly.c
copyright (c) 1993-2003, The Geometry Center Copyright (c) 1993-2011 The Geometry Center.
$Id: //main/2011/qhull/src/libqhull/poly.h#2 $$Change: 1342 $
$DateTime: 2011/03/07 21:55:47 $$Author: bbarber $
*/ */
#ifndef qhDEFpoly #ifndef qhDEFpoly
#define qhDEFpoly 1 #define qhDEFpoly 1
#include "libqhull.h"
/*=============== constants ========================== */ /*=============== constants ========================== */
/*-<a href="qh-geom.htm#TOC" /*-<a href="qh-geom.htm#TOC"
>--------------------------------</a><a name="ALGORITHMfault">-</a> >--------------------------------</a><a name="ALGORITHMfault">-</a>
ALGORITHMfault ALGORITHMfault
use as argument to checkconvex() to report errors during buildhull use as argument to checkconvex() to report errors during buildhull
*/ */
#define qh_ALGORITHMfault 0 #define qh_ALGORITHMfault 0
skipping to change at line 42 skipping to change at line 46
/*-<a href="qh-poly.htm#TOC" /*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="DUPLICATEridge">-</a> >--------------------------------</a><a name="DUPLICATEridge">-</a>
DUPLICATEridge DUPLICATEridge
special value for facet->neighbor to indicate a duplicate ridge special value for facet->neighbor to indicate a duplicate ridge
notes: notes:
set by matchneighbor, used by matchmatch and mark_dupridge set by matchneighbor, used by matchmatch and mark_dupridge
*/ */
#define qh_DUPLICATEridge ( facetT * ) 1L #define qh_DUPLICATEridge (facetT *)1L
/*-<a href="qh-poly.htm#TOC" /*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="MERGEridge">-</a> >--------------------------------</a><a name="MERGEridge">-</a>
MERGEridge flag in facet MERGEridge flag in facet
special value for facet->neighbor to indicate a merged ridge special value for facet->neighbor to indicate a merged ridge
notes: notes:
set by matchneighbor, used by matchmatch and mark_dupridge set by matchneighbor, used by matchmatch and mark_dupridge
*/ */
#define qh_MERGEridge ( facetT * ) 2L #define qh_MERGEridge (facetT *)2L
/*============ -structures- ====================*/ /*============ -structures- ====================*/
/*=========== -macros- =========================*/ /*=========== -macros- =========================*/
/*-<a href="qh-poly.htm#TOC" /*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="FORALLfacet_">-</a> >--------------------------------</a><a name="FORALLfacet_">-</a>
FORALLfacet_( facetlist ) { ... } FORALLfacet_( facetlist ) { ... }
assign 'facet' to each facet in facetlist assign 'facet' to each facet in facetlist
notes: notes:
uses 'facetT *facet;' uses 'facetT *facet;'
assumes last facet is a sentinel assumes last facet is a sentinel
see: see:
FORALLfacets FORALLfacets
*/ */
#define FORALLfacet_( facetlist ) if ( facetlist ) for( facet=( facetlist ) ;facet && facet->next;facet=facet->next ) #define FORALLfacet_( facetlist ) if (facetlist ) for ( facet=( facetlist ) ; facet && facet->next; facet= facet->next )
/*-<a href="qh-poly.htm#TOC" /*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="FORALLnew_facets">-</a> >--------------------------------</a><a name="FORALLnew_facets">-</a>
FORALLnew_facets { ... } FORALLnew_facets { ... }
assign 'newfacet' to each facet in qh.newfacet_list assign 'newfacet' to each facet in qh.newfacet_list
notes: notes:
uses 'facetT *newfacet;' uses 'facetT *newfacet;'
at exit, newfacet==NULL at exit, newfacet==NULL
*/ */
#define FORALLnew_facets for( newfacet=qh newfacet_list;newfacet && newface t->next;newfacet=newfacet->next ) #define FORALLnew_facets for ( newfacet=qh newfacet_list;newfacet && newfac et->next;newfacet=newfacet->next )
/*-<a href="qh-poly.htm#TOC" /*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="FORALLvertex_">-</a> >--------------------------------</a><a name="FORALLvertex_">-</a>
FORALLvertex_( vertexlist ) { ... } FORALLvertex_( vertexlist ) { ... }
assign 'vertex' to each vertex in vertexlist assign 'vertex' to each vertex in vertexlist
notes: notes:
uses 'vertexT *vertex;' uses 'vertexT *vertex;'
at exit, vertex==NULL at exit, vertex==NULL
*/ */
#define FORALLvertex_( vertexlist ) for ( vertex=( vertexlist );vertex && v ertex->next;vertex= vertex->next ) #define FORALLvertex_( vertexlist ) for (vertex=( vertexlist );vertex && ve rtex->next;vertex= vertex->next )
/*-<a href="qh-poly.htm#TOC" /*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="FORALLvisible_facets">-</a> >--------------------------------</a><a name="FORALLvisible_facets">-</a>
FORALLvisible_facets { ... } FORALLvisible_facets { ... }
assign 'visible' to each visible facet in qh.visible_list assign 'visible' to each visible facet in qh.visible_list
notes: notes:
uses 'vacetT *visible;' uses 'vacetT *visible;'
at exit, visible==NULL at exit, visible==NULL
skipping to change at line 206 skipping to change at line 210
notes: notes:
uses 'vertexT *vertex, *vertexp;' uses 'vertexT *vertex, *vertexp;'
see <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a> see <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a>
*/ */
#define FOREACHvertexreverse12_(vertices) FOREACHsetelementreverse12_(verte xT, vertices, vertex) #define FOREACHvertexreverse12_(vertices) FOREACHsetelementreverse12_(verte xT, vertices, vertex)
/*=============== prototypes poly.c in alphabetical order ================* / /*=============== prototypes poly.c in alphabetical order ================* /
void qh_appendfacet(facetT *facet); void qh_appendfacet(facetT *facet);
void qh_appendvertex(vertexT *vertex); void qh_appendvertex(vertexT *vertex);
void qh_attachnewfacets (void); void qh_attachnewfacets(void);
boolT qh_checkflipped (facetT *facet, realT *dist, boolT allerror); boolT qh_checkflipped(facetT *facet, realT *dist, boolT allerror);
void qh_delfacet(facetT *facet); void qh_delfacet(facetT *facet);
void qh_deletevisible(void /*qh visible_list, qh horizon_list*/); void qh_deletevisible(void /*qh visible_list, qh horizon_list*/);
setT *qh_facetintersect (facetT *facetA, facetT *facetB, int *skipAp,int setT *qh_facetintersect(facetT *facetA, facetT *facetB, int *skipAp,int *
*skipBp, int extra); skipBp, int extra);
unsigned qh_gethash (int hashsize, setT *set, int size, int firstindex, voi int qh_gethash(int hashsize, setT *set, int size, int firstindex, void
d *skipelem); *skipelem);
facetT *qh_makenewfacet(setT *vertices, boolT toporient, facetT *facet); facetT *qh_makenewfacet(setT *vertices, boolT toporient, facetT *facet);
void qh_makenewplanes ( void /* newfacet_list */); void qh_makenewplanes(void /* newfacet_list */);
facetT *qh_makenew_nonsimplicial (facetT *visible, vertexT *apex, int *numn facetT *qh_makenew_nonsimplicial(facetT *visible, vertexT *apex, int *numne
ew); w);
facetT *qh_makenew_simplicial (facetT *visible, vertexT *apex, int *numnew) facetT *qh_makenew_simplicial(facetT *visible, vertexT *apex, int *numnew);
; void qh_matchneighbor(facetT *newfacet, int newskip, int hashsize,
void qh_matchneighbor (facetT *newfacet, int newskip, int hashsize, int *hashcount);
int *hashcount); void qh_matchnewfacets(void);
void qh_matchnewfacets (void); boolT qh_matchvertices(int firstindex, setT *verticesA, int skipA,
boolT qh_matchvertices (int firstindex, setT *verticesA, int skipA, setT *verticesB, int *skipB, boolT *same);
setT *verticesB, int *skipB, boolT *same);
facetT *qh_newfacet(void); facetT *qh_newfacet(void);
ridgeT *qh_newridge(void); ridgeT *qh_newridge(void);
int qh_pointid (pointT *point); int qh_pointid(pointT *point);
void qh_removefacet(facetT *facet); void qh_removefacet(facetT *facet);
void qh_removevertex(vertexT *vertex); void qh_removevertex(vertexT *vertex);
void qh_updatevertices (void); void qh_updatevertices(void);
/*========== -prototypes poly2.c in alphabetical order ===========*/ /*========== -prototypes poly2.c in alphabetical order ===========*/
void qh_addhash (void* newelem, setT *hashtable, int hashsize, unsigned void qh_addhash(void* newelem, setT *hashtable, int hashsize, int hash);
hash); void qh_check_bestdist(void);
void qh_check_bestdist (void); void qh_check_maxout(void);
void qh_check_maxout (void); void qh_check_output(void);
void qh_check_output (void); void qh_check_point(pointT *point, facetT *facet, realT *maxoutside, rea
void qh_check_point (pointT *point, facetT *facet, realT *maxoutside, re lT *maxdist, facetT **errfacet1, facetT **errfacet2);
alT *maxdist, facetT **errfacet1, facetT **errfacet2); void qh_check_points(void);
void qh_check_points(void); void qh_checkconvex(facetT *facetlist, int fault);
void qh_checkconvex(facetT *facetlist, int fault);
void qh_checkfacet(facetT *facet, boolT newmerge, boolT *waserrorp); void qh_checkfacet(facetT *facet, boolT newmerge, boolT *waserrorp);
void qh_checkflipped_all (facetT *facetlist); void qh_checkflipped_all(facetT *facetlist);
void qh_checkpolygon(facetT *facetlist); void qh_checkpolygon(facetT *facetlist);
void qh_checkvertex (vertexT *vertex); void qh_checkvertex(vertexT *vertex);
void qh_clearcenters (qh_CENTER type); void qh_clearcenters(qh_CENTER type);
void qh_createsimplex(setT *vertices); void qh_createsimplex(setT *vertices);
void qh_delridge(ridgeT *ridge); void qh_delridge(ridgeT *ridge);
void qh_delvertex (vertexT *vertex); void qh_delvertex(vertexT *vertex);
setT *qh_facet3vertex (facetT *facet); setT *qh_facet3vertex(facetT *facet);
facetT *qh_findbestfacet (pointT *point, boolT bestoutside, facetT *qh_findbestfacet(pointT *point, boolT bestoutside,
realT *bestdist, boolT *isoutside); realT *bestdist, boolT *isoutside);
facetT *qh_findbestlower (facetT *upperfacet, pointT *point, realT *bestdis facetT *qh_findbestlower(facetT *upperfacet, pointT *point, realT *bestdist
tp, int *numpart); p, int *numpart);
facetT *qh_findfacet_all (pointT *point, realT *bestdist, boolT *isoutside, facetT *qh_findfacet_all(pointT *point, realT *bestdist, boolT *isoutside,
int *numpart); int *numpart);
int qh_findgood (facetT *facetlist, int goodhorizon); int qh_findgood(facetT *facetlist, int goodhorizon);
void qh_findgood_all (facetT *facetlist); void qh_findgood_all(facetT *facetlist);
void qh_furthestnext (void /* qh facet_list */); void qh_furthestnext(void /* qh facet_list */);
void qh_furthestout (facetT *facet); void qh_furthestout(facetT *facet);
void qh_infiniteloop (facetT *facet); void qh_infiniteloop(facetT *facet);
void qh_initbuild(void); void qh_initbuild(void);
void qh_initialhull(setT *vertices); void qh_initialhull(setT *vertices);
setT *qh_initialvertices(int dim, setT *maxpoints, pointT *points, int nu mpoints); setT *qh_initialvertices(int dim, setT *maxpoints, pointT *points, int nu mpoints);
vertexT *qh_isvertex (pointT *point, setT *vertices); vertexT *qh_isvertex(pointT *point, setT *vertices);
vertexT *qh_makenewfacets (pointT *point /*horizon_list, visible_list*/); vertexT *qh_makenewfacets(pointT *point /*horizon_list, visible_list*/);
void qh_matchduplicates (facetT *atfacet, int atskip, int hashsize, int void qh_matchduplicates(facetT *atfacet, int atskip, int hashsize, int *
*hashcount); hashcount);
void qh_nearcoplanar ( void /* qh.facet_list */); void qh_nearcoplanar(void /* qh.facet_list */);
vertexT *qh_nearvertex (facetT *facet, pointT *point, realT *bestdistp); vertexT *qh_nearvertex(facetT *facet, pointT *point, realT *bestdistp);
int qh_newhashtable(int newsize); int qh_newhashtable(int newsize);
vertexT *qh_newvertex(pointT *point); vertexT *qh_newvertex(pointT *point);
ridgeT *qh_nextridge3d (ridgeT *atridge, facetT *facet, vertexT **vertexp); ridgeT *qh_nextridge3d(ridgeT *atridge, facetT *facet, vertexT **vertexp);
void qh_outcoplanar (void /* facet_list */); void qh_outcoplanar(void /* facet_list */);
pointT *qh_point (int id); pointT *qh_point(int id);
void qh_point_add (setT *set, pointT *point, void *elem); void qh_point_add(setT *set, pointT *point, void *elem);
setT *qh_pointfacet (void /*qh facet_list*/); setT *qh_pointfacet(void /*qh facet_list*/);
setT *qh_pointvertex (void /*qh facet_list*/); setT *qh_pointvertex(void /*qh facet_list*/);
void qh_prependfacet(facetT *facet, facetT **facetlist); void qh_prependfacet(facetT *facet, facetT **facetlist);
void qh_printhashtable(FILE *fp); void qh_printhashtable(FILE *fp);
void qh_printlists (void); void qh_printlists(void);
void qh_resetlists (boolT stats, boolT resetVisible /*qh newvertex_list void qh_resetlists(boolT stats, boolT resetVisible /*qh newvertex_list n
newfacet_list visible_list*/); ewfacet_list visible_list*/);
void qh_setvoronoi_all (void); void qh_setvoronoi_all(void);
void qh_triangulate (void /*qh facet_list*/); void qh_triangulate(void /*qh facet_list*/);
void qh_triangulate_facet (facetT *facetA, vertexT **first_vertex); void qh_triangulate_facet(facetT *facetA, vertexT **first_vertex);
void qh_triangulate_link (facetT *oldfacetA, facetT *facetA, facetT *old void qh_triangulate_link(facetT *oldfacetA, facetT *facetA, facetT *oldf
facetB, facetT *facetB); acetB, facetT *facetB);
void qh_triangulate_mirror (facetT *facetA, facetT *facetB); void qh_triangulate_mirror(facetT *facetA, facetT *facetB);
void qh_triangulate_null (facetT *facetA); void qh_triangulate_null(facetT *facetA);
void qh_vertexintersect(setT **vertexsetA,setT *vertexsetB); void qh_vertexintersect(setT **vertexsetA,setT *vertexsetB);
setT *qh_vertexintersect_new(setT *vertexsetA,setT *vertexsetB); setT *qh_vertexintersect_new(setT *vertexsetA,setT *vertexsetB);
void qh_vertexneighbors (void /*qh facet_list*/); void qh_vertexneighbors(void /*qh facet_list*/);
boolT qh_vertexsubset(setT *vertexsetA, setT *vertexsetB); boolT qh_vertexsubset(setT *vertexsetA, setT *vertexsetB);
#endif /* qhDEFpoly */ #endif /* qhDEFpoly */
 End of changes. 17 change blocks. 
85 lines changed or deleted 87 lines changed or added


 qhull_a.h   qhull_a.h 
/*<html><pre> -<a href="qh-qhull.htm" /*<html><pre> -<a href="qh-qhull.htm"
>-------------------------------</a><a name="TOP">-</a> >-------------------------------</a><a name="TOP">-</a>
qhull_a.h qhull_a.h
all header files for compiling qhull all header files for compiling qhull
see qh-qhull.htm see qh-qhull.htm
see qhull.h for user-level definitions see libqhull.h for user-level definitions
see user.h for user-defineable constants see user.h for user-defineable constants
defines internal functions for qhull.c global.c defines internal functions for libqhull.c global.c
copyright (c) 1993-2003, The Geometry Center Copyright (c) 1993-2011 The Geometry Center.
$Id: //main/2011/qhull/src/libqhull/qhull_a.h#2 $$Change: 1342 $
$DateTime: 2011/03/07 21:55:47 $$Author: bbarber $
Notes: grep for ((" and (" to catch fprintf("lkasdjf"); Notes: grep for ((" and (" to catch fprintf("lkasdjf");
full parens around (x?y:z) full parens around (x?y:z)
use '#include qhull/qhull_a.h' to avoid name clashes use '#include qhull/qhull_a.h' to avoid name clashes
*/ */
#ifndef qhDEFqhulla #ifndef qhDEFqhulla
#define qhDEFqhulla #define qhDEFqhulla 1
#include "libqhull.h" /* Defines data types */
#include "stat.h"
#include "random.h"
#include "mem.h"
#include "qset.h"
#include "geom.h"
#include "merge.h"
#include "poly.h"
#include "io.h"
#include <stdio.h>
#include <stdlib.h>
#include <setjmp.h> #include <setjmp.h>
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#include <float.h> /* some compilers will not need float.h */ #include <float.h> /* some compilers will not need float.h */
#include <limits.h> #include <limits.h>
#include <time.h> #include <time.h>
#include <ctype.h> #include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
/*** uncomment here and qset.c /*** uncomment here and qset.c
if string.h does not define memcpy() if string.h does not define memcpy()
#include <memory.h> #include <memory.h>
*/ */
#include "qhull.h"
#include "mem.h"
#include "qset.h"
#include "geom.h"
#include "merge.h"
#include "poly.h"
#include "io.h"
#include "stat.h"
#if qh_CLOCKtype == 2 /* defined in user.h from qhull.h */ #if qh_CLOCKtype == 2 /* defined in user.h from libqhull.h */
#include <sys/types.h> #include <sys/types.h>
#include <sys/times.h> #include <sys/times.h>
#include <unistd.h> #include <unistd.h>
#endif #endif
#ifdef _MSC_VER /* Microsoft Visual C++ */ #ifdef _MSC_VER /* Microsoft Visual C++ -- warning level 4 */
#pragma warning( disable : 4056) /* float constant expression. Looks like #pragma warning( disable : 4100) /* unreferenced formal parameter */
a compiler bug */ #pragma warning( disable : 4127) /* conditional expression is constant */
#pragma warning( disable : 4146) /* unary minus applied to unsigned type * #pragma warning( disable : 4706) /* assignment within conditional function
/ */
#pragma warning( disable : 4244) /* conversion from 'unsigned long' to 're #pragma warning( disable : 4996) /* function was declared deprecated(strcp
al' */ y, localtime, etc.) */
#pragma warning( disable : 4305) /* conversion from 'const double' to 'flo
at' */
#endif #endif
/* ======= -macros- =========== */ /* ======= -macros- =========== */
/*-<a href="qh-qhull.htm#TOC" /*-<a href="qh-qhull.htm#TOC"
>--------------------------------</a><a name="traceN">-</a> >--------------------------------</a><a name="traceN">-</a>
traceN((fp.ferr, "format\n", vars)); traceN((qh ferr, 0Nnnn, "format\n", vars));
calls fprintf if qh.IStracing >= N calls qh_fprintf if qh.IStracing >= N
Add debugging traps to the end of qh_fprintf
notes: notes:
removing tracing reduces code size but doesn't change execution speed removing tracing reduces code size but doesn't change execution speed
*/ */
#ifndef qh_NOtrace #ifndef qh_NOtrace
#define trace0(args) {if (qh IStracing) fprintf args;} #define trace0(args) {if (qh IStracing) qh_fprintf args;}
#define trace1(args) {if (qh IStracing >= 1) fprintf args;} #define trace1(args) {if (qh IStracing >= 1) qh_fprintf args;}
#define trace2(args) {if (qh IStracing >= 2) fprintf args;} #define trace2(args) {if (qh IStracing >= 2) qh_fprintf args;}
#define trace3(args) {if (qh IStracing >= 3) fprintf args;} #define trace3(args) {if (qh IStracing >= 3) qh_fprintf args;}
#define trace4(args) {if (qh IStracing >= 4) fprintf args;} #define trace4(args) {if (qh IStracing >= 4) qh_fprintf args;}
#define trace5(args) {if (qh IStracing >= 5) fprintf args;} #define trace5(args) {if (qh IStracing >= 5) qh_fprintf args;}
#else /* qh_NOtrace */ #else /* qh_NOtrace */
#define trace0(args) {} #define trace0(args) {}
#define trace1(args) {} #define trace1(args) {}
#define trace2(args) {} #define trace2(args) {}
#define trace3(args) {} #define trace3(args) {}
#define trace4(args) {} #define trace4(args) {}
#define trace5(args) {} #define trace5(args) {}
#endif /* qh_NOtrace */ #endif /* qh_NOtrace */
/***** -qhull.c prototypes (alphabetical after qhull) ********************/ /*-<a href="qh-qhull.htm#TOC"
>--------------------------------</a><a name="QHULL_UNUSED">-</a>
*/
/* See Qt's qglobal.h */
#if !defined(SAG_COM) && (defined(WIN64) || defined(_WIN64) || defined(__WI
N64__) || defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || define
d(__NT__))
# define QHULL_OS_WIN
#elif defined(__MWERKS__) && defined(__INTEL__)
# define QHULL_OS_WIN
#endif
#if defined(__INTEL_COMPILER) && !defined(QHULL_OS_WIN)
template <typename T>
inline void qhullUnused(T &x) { (void)x; }
# define QHULL_UNUSED(x) qhullUnused(x);
#else
# define QHULL_UNUSED(x) (void)x;
#endif
/***** -libqhull.c prototypes (alphabetical after qhull) ******************
**/
void qh_qhull (void); void qh_qhull(void);
boolT qh_addpoint (pointT *furthest, facetT *facet, boolT checkdist); boolT qh_addpoint(pointT *furthest, facetT *facet, boolT checkdist);
void qh_buildhull(void); void qh_buildhull(void);
void qh_buildtracing (pointT *furthest, facetT *facet); void qh_buildtracing(pointT *furthest, facetT *facet);
void qh_build_withrestart (void); void qh_build_withrestart(void);
void qh_errexit2(int exitcode, facetT *facet, facetT *otherfacet); void qh_errexit2(int exitcode, facetT *facet, facetT *otherfacet);
void qh_findhorizon(pointT *point, facetT *facet, int *goodvisible,int * goodhorizon); void qh_findhorizon(pointT *point, facetT *facet, int *goodvisible,int * goodhorizon);
pointT *qh_nextfurthest (facetT **visible); pointT *qh_nextfurthest(facetT **visible);
void qh_partitionall(setT *vertices, pointT *points,int npoints); void qh_partitionall(setT *vertices, pointT *points,int npoints);
void qh_partitioncoplanar (pointT *point, facetT *facet, realT *dist); void qh_partitioncoplanar(pointT *point, facetT *facet, realT *dist);
void qh_partitionpoint (pointT *point, facetT *facet); void qh_partitionpoint(pointT *point, facetT *facet);
void qh_partitionvisible(boolT allpoints, int *numpoints); void qh_partitionvisible(boolT allpoints, int *numpoints);
void qh_precision (char *reason); void qh_precision(const char *reason);
void qh_printsummary(FILE *fp); void qh_printsummary(FILE *fp);
/***** -global.c internal prototypes (alphabetical) *********************** / /***** -global.c internal prototypes (alphabetical) *********************** /
void qh_appendprint (qh_PRINT format); void qh_appendprint(qh_PRINT format);
void qh_freebuild (boolT allmem); void qh_freebuild(boolT allmem);
void qh_freebuffers (void); void qh_freebuffers(void);
void qh_initbuffers (coordT *points, int numpoints, int dim, boolT ismal void qh_initbuffers(coordT *points, int numpoints, int dim, boolT ismall
loc); oc);
int qh_strtol (const char *s, char **endp);
double qh_strtod (const char *s, char **endp);
/***** -stat.c internal prototypes (alphabetical) ***********************/ /***** -stat.c internal prototypes (alphabetical) ***********************/
void qh_allstatA (void); void qh_allstatA(void);
void qh_allstatB (void); void qh_allstatB(void);
void qh_allstatC (void); void qh_allstatC(void);
void qh_allstatD (void); void qh_allstatD(void);
void qh_allstatE (void); void qh_allstatE(void);
void qh_allstatE2 (void); void qh_allstatE2 (void);
void qh_allstatF (void); void qh_allstatF(void);
void qh_allstatG (void); void qh_allstatG(void);
void qh_allstatH (void); void qh_allstatH(void);
void qh_freebuffers (void); void qh_freebuffers(void);
void qh_initbuffers (coordT *points, int numpoints, int dim, boolT ismal void qh_initbuffers(coordT *points, int numpoints, int dim, boolT ismall
loc); oc);
#endif /* qhDEFqhulla */ #endif /* qhDEFqhulla */
 End of changes. 17 change blocks. 
66 lines changed or deleted 91 lines changed or added


 qset.h   qset.h 
skipping to change at line 12 skipping to change at line 12
>-------------------------------</a><a name="TOP">-</a> >-------------------------------</a><a name="TOP">-</a>
qset.h qset.h
header file for qset.c that implements set header file for qset.c that implements set
see qh-set.htm and qset.c see qh-set.htm and qset.c
only uses mem.c, malloc/free only uses mem.c, malloc/free
for error handling, writes message and calls for error handling, writes message and calls
qh_errexit (qhmem_ERRqhull, NULL, NULL); qh_errexit(qhmem_ERRqhull, NULL, NULL);
set operations satisfy the following properties: set operations satisfy the following properties:
- sets have a max size, the actual size (if different) is stored at the end - sets have a max size, the actual size (if different) is stored at the end
- every set is NULL terminated - every set is NULL terminated
- sets may be sorted or unsorted, the caller must distinguish this - sets may be sorted or unsorted, the caller must distinguish this
copyright (c) 1993-2003, The Geometry Center Copyright (c) 1993-2011 The Geometry Center.
$Id: //main/2011/qhull/src/libqhull/qset.h#2 $$Change: 1342 $
$DateTime: 2011/03/07 21:55:47 $$Author: bbarber $
*/ */
#ifndef qhDEFset #ifndef qhDEFset
#define qhDEFset 1 #define qhDEFset 1
#include <stdio.h>
/*================= -structures- ===============*/ /*================= -structures- ===============*/
#ifndef DEFsetT #ifndef DEFsetT
#define DEFsetT 1 #define DEFsetT 1
typedef struct setT setT; /* a set is a sorted or unsorted array of point ers */ typedef struct setT setT; /* a set is a sorted or unsorted array of point ers */
#endif #endif
/*-<a href="qh-set.htm#TOC" /*-<a href="qh-set.htm#TOC"
>----------------------------------------</a><a name="setT">-</a> >----------------------------------------</a><a name="setT">-</a>
setT setT
a set or list of pointers with maximum size and actual size. a set or list of pointers with maximum size and actual size.
variations: variations:
unsorted, unique -- a list of unique pointers with NULL terminator unsorted, unique -- a list of unique pointers with NULL terminator
user guarantees uniqueness user guarantees uniqueness
sorted -- a sorted list of unique pointers with NULL terminato sorted -- a sorted list of unique pointers with NULL terminat
r or
qset.c guarantees uniqueness qset.c guarantees uniqueness
unsorted -- a list of pointers terminated with NULL unsorted -- a list of pointers terminated with NULL
indexed -- an array of pointers with NULL elements indexed -- an array of pointers with NULL elements
structure for set of n elements: structure for set of n elements:
-------------- --------------
| maxsize | maxsize
-------------- --------------
| e[0] - a pointer, may be NULL for indexed sets | e[0] - a pointer, may be NULL for indexed sets
-------------- --------------
| e[1] | e[1]
-------------- --------------
| ... | ...
-------------- --------------
| e[n-1] | e[n-1]
-------------- --------------
| e[n] = NULL | e[n] = NULL
-------------- --------------
| ... | ...
-------------- --------------
| e[maxsize] - n+1 or NULL (determines actual size of set) | e[maxsize] - n+1 or NULL (determines actual size of set)
-------------- --------------
*/ */
/*-- setelemT -- internal type to allow both pointers and indices /*-- setelemT -- internal type to allow both pointers and indices
*/ */
typedef union setelemT setelemT; typedef union setelemT setelemT;
union setelemT { union setelemT {
void *p; void *p;
int i; /* integer used for e[maxSize] */ int i; /* integer used for e[maxSize] */
}; };
struct setT { struct setT {
int maxsize; /* maximum number of elements (except NULL) */ int maxsize; /* maximum number of elements (except NULL) */
setelemT e[1]; /* array of pointers, tail is NULL */ setelemT e[1]; /* array of pointers, tail is NULL */
/* last slot (unless NULL) is actual size+1 /* last slot (unless NULL) is actual size+1
e[maxsize]==NULL or e[e[maxsize]-1]==NULL */ e[maxsize]==NULL or e[e[maxsize]-1]==NULL */
/* this may generate a warning since e[] contains /* this may generate a warning since e[] contains
maxsize elements */ maxsize elements */
}; };
/*=========== -constants- =========================*/ /*=========== -constants- =========================*/
/*-<a href="qh-set.htm#TOC" /*-<a href="qh-set.htm#TOC"
>-----------------------------------</a><a name="SETelemsize">-</a> >-----------------------------------</a><a name="SETelemsize">-</a>
SETelemsize SETelemsize
size of a set element in bytes size of a set element in bytes
*/ */
#define SETelemsize sizeof(setelemT) #define SETelemsize ((int)sizeof(setelemT))
/*=========== -macros- =========================*/ /*=========== -macros- =========================*/
/*-<a href="qh-set.htm#TOC" /*-<a href="qh-set.htm#TOC"
>-----------------------------------</a><a name="FOREACHsetelement_">-</a > >-----------------------------------</a><a name="FOREACHsetelement_">-</a >
FOREACHsetelement_(type, set, variable) FOREACHsetelement_(type, set, variable)
define FOREACH iterator define FOREACH iterator
declare: declare:
skipping to change at line 131 skipping to change at line 135
notes: notes:
use FOREACHsetelement_i_() if need index or include NULLs use FOREACHsetelement_i_() if need index or include NULLs
WARNING: WARNING:
nested loops can't use the same variable (define another FOREACH) nested loops can't use the same variable (define another FOREACH)
needs braces if nested inside another FOREACH needs braces if nested inside another FOREACH
this includes intervening blocks, e.g. FOREACH...{ if () FOREACH...} ) this includes intervening blocks, e.g. FOREACH...{ if () FOREACH...} )
*/ */
#define FOREACHsetelement_(type, set, variable) \ #define FOREACHsetelement_(type, set, variable) \
if (((variable= NULL), set)) for(\ if (((variable= NULL), set)) for (\
variable##p= (type **)&((set)->e[0].p); \ variable##p= (type **)&((set)->e[0].p); \
(variable= *variable##p++);) (variable= *variable##p++);)
/*-<a href="qh-set.htm#TOC" /*-<a href="qh-set.htm#TOC"
>----------------------------------------</a><a name="FOREACHsetelement_i _">-</a> >----------------------------------------</a><a name="FOREACHsetelement_i _">-</a>
FOREACHsetelement_i_(type, set, variable) FOREACHsetelement_i_(type, set, variable)
define indexed FOREACH iterator define indexed FOREACH iterator
declare: declare:
type *variable, variable_n, variable_i; type *variable, variable_n, variable_i;
skipping to change at line 197 skipping to change at line 201
variable is NULL variable is NULL
example: example:
#define FOREACHvertexreverse_( vertices ) FOREACHsetelementreverse_( v ertexT, vertices, vertex ) #define FOREACHvertexreverse_( vertices ) FOREACHsetelementreverse_( v ertexT, vertices, vertex )
notes: notes:
use FOREACHsetelementreverse12_() to reverse first two elements use FOREACHsetelementreverse12_() to reverse first two elements
WARNING: needs braces if nested inside another FOREACH WARNING: needs braces if nested inside another FOREACH
*/ */
#define FOREACHsetelementreverse_(type, set, variable) \ #define FOREACHsetelementreverse_(type, set, variable) \
if (((variable= NULL), set)) for(\ if (((variable= NULL), set)) for (\
variable##temp= qh_setsize(set)-1, variable= qh_setlast(set);\ variable##temp= qh_setsize(set)-1, variable= qh_setlast(set);\
variable; variable= \ variable; variable= \
((--variable##temp >= 0) ? SETelemt_(set, variable##temp, type) : ((--variable##temp >= 0) ? SETelemt_(set, variable##temp, type)
NULL)) : NULL))
/*-<a href="qh-set.htm#TOC" /*-<a href="qh-set.htm#TOC"
>-----------------------------------</a><a name="FOREACHsetelementreverse 12_">-</a> >-----------------------------------</a><a name="FOREACHsetelementreverse 12_">-</a>
FOREACHsetelementreverse12_(type, set, variable)- FOREACHsetelementreverse12_(type, set, variable)-
define FOREACH iterator with e[1] and e[0] reversed define FOREACH iterator with e[1] and e[0] reversed
declare: declare:
assumes *variable and **variablep are declared assumes *variable and **variablep are declared
skipping to change at line 228 skipping to change at line 232
at exit: at exit:
variable is NULL at end of loop variable is NULL at end of loop
example example
#define FOREACHvertexreverse12_( vertices ) FOREACHsetelementreverse12 _( vertexT, vertices, vertex ) #define FOREACHvertexreverse12_( vertices ) FOREACHsetelementreverse12 _( vertexT, vertices, vertex )
notes: notes:
WARNING: needs braces if nested inside another FOREACH WARNING: needs braces if nested inside another FOREACH
*/ */
#define FOREACHsetelementreverse12_(type, set, variable) \ #define FOREACHsetelementreverse12_(type, set, variable) \
if (((variable= NULL), set)) for(\ if (((variable= NULL), set)) for (\
variable##p= (type **)&((set)->e[1].p); \ variable##p= (type **)&((set)->e[1].p); \
(variable= *variable##p); \ (variable= *variable##p); \
variable##p == ((type **)&((set)->e[0].p))?variable##p += 2: \ variable##p == ((type **)&((set)->e[0].p))?variable##p += 2: \
(variable##p == ((type **)&((set)->e[1].p))?variable##p--:vari able##p++)) (variable##p == ((type **)&((set)->e[1].p))?variable##p--:var iable##p++))
/*-<a href="qh-set.htm#TOC" /*-<a href="qh-set.htm#TOC"
>-----------------------------------</a><a name="FOREACHelem_">-</a> >-----------------------------------</a><a name="FOREACHelem_">-</a>
FOREACHelem_( set )- FOREACHelem_( set )-
iterate elements in a set iterate elements in a set
declare: declare:
void *elem, *elemp; void *elem, *elemp;
skipping to change at line 296 skipping to change at line 300
#define FOREACHset_(sets) FOREACHsetelement_(setT, sets, set) #define FOREACHset_(sets) FOREACHsetelement_(setT, sets, set)
/*-<a href="qh-set.htm#TOC" /*-<a href="qh-set.htm#TOC"
>-----------------------------------------</a><a name="SETindex_">-</a> >-----------------------------------------</a><a name="SETindex_">-</a>
SETindex_( set, elem ) SETindex_( set, elem )
return index of elem in set return index of elem in set
notes: notes:
for use with FOREACH iteration for use with FOREACH iteration
WARN64 -- Maximum set size is 2G
example: example:
i= SETindex_(ridges, ridge) i= SETindex_(ridges, ridge)
*/ */
#define SETindex_(set, elem) ((void **)elem##p - (void **)&(set)->e[1].p) #define SETindex_(set, elem) ((int)((void **)elem##p - (void **)&(set)->e[1 ].p))
/*-<a href="qh-set.htm#TOC" /*-<a href="qh-set.htm#TOC"
>---------------------------------------</a><a name="SETref_">-</a> >---------------------------------------</a><a name="SETref_">-</a>
SETref_( elem ) SETref_( elem )
l.h.s. for modifying the current element in a FOREACH iteration l.h.s. for modifying the current element in a FOREACH iteration
example: example:
SETref_(ridge)= anotherridge; SETref_(ridge)= anotherridge;
*/ */
skipping to change at line 388 skipping to change at line 393
return second element of set as a type return second element of set as a type
*/ */
#define SETsecondt_(set, type) ((type*)((set)->e[1].p)) #define SETsecondt_(set, type) ((type*)((set)->e[1].p))
/*-<a href="qh-set.htm#TOC" /*-<a href="qh-set.htm#TOC"
>---------------------------------------</a><a name="SETaddr_">-</a> >---------------------------------------</a><a name="SETaddr_">-</a>
SETaddr_(set, type) SETaddr_(set, type)
return address of set's elements return address of set's elements
*/ */
#define SETaddr_(set,type) ((type **)(&((set)->e[0].p))) #define SETaddr_(set,type) ((type **)(&((set)->e[0].p)))
/*-<a href="qh-set.htm#TOC" /*-<a href="qh-set.htm#TOC"
>---------------------------------------</a><a name="SETreturnsize_">-</a > >---------------------------------------</a><a name="SETreturnsize_">-</a >
SETreturnsize_(set, size) SETreturnsize_(set, size)
return size of a set return size of a set
notes: notes:
set must be defined set must be defined
use qh_setsize(set) unless speed is critical use qh_setsize(set) unless speed is critical
*/ */
#define SETreturnsize_(set, size) (((size)= ((set)->e[(set)->maxsize].i))?( --(size)):((size)= (set)->maxsize)) #define SETreturnsize_(set, size) (((size)= ((set)->e[(set)->maxsize].i))?( --(size)):((size)= (set)->maxsize))
/*-<a href="qh-set.htm#TOC" /*-<a href="qh-set.htm#TOC"
>---------------------------------------</a><a name="SETempty_">-</a> >---------------------------------------</a><a name="SETempty_">-</a>
SETempty_(set) SETempty_(set)
return true (1) if set is empty return true(1) if set is empty
notes: notes:
set may be NULL set may be NULL
*/ */
#define SETempty_(set) (!set || (SETfirst_(set) ? 0:1)) #define SETempty_(set) (!set || (SETfirst_(set) ? 0 : 1))
/*-<a href="qh-set.htm#TOC"
>-------------------------------<a name="SETsizeaddr_">-</a>
SETsizeaddr_(set)
return pointer to 'actual size+1' of set (set CANNOT be NULL!!)
notes:
*SETsizeaddr==NULL or e[*SETsizeaddr-1].p==NULL
*/
#define SETsizeaddr_(set) (&((set)->e[(set)->maxsize].i))
/*-<a href="qh-set.htm#TOC" /*-<a href="qh-set.htm#TOC"
>---------------------------------------</a><a name="SETtruncate_">-</a> >---------------------------------------</a><a name="SETtruncate_">-</a>
SETtruncate_(set) SETtruncate_(set)
return first element of set return first element of set
see: see:
qh_settruncate() qh_settruncate()
skipping to change at line 433 skipping to change at line 449
#define SETtruncate_(set, size) {set->e[set->maxsize].i= size+1; /* maybe o verwritten */ \ #define SETtruncate_(set, size) {set->e[set->maxsize].i= size+1; /* maybe o verwritten */ \
set->e[size].p= NULL;} set->e[size].p= NULL;}
/*======= prototypes in alphabetical order ============*/ /*======= prototypes in alphabetical order ============*/
void qh_setaddsorted(setT **setp, void *elem); void qh_setaddsorted(setT **setp, void *elem);
void qh_setaddnth(setT **setp, int nth, void *newelem); void qh_setaddnth(setT **setp, int nth, void *newelem);
void qh_setappend(setT **setp, void *elem); void qh_setappend(setT **setp, void *elem);
void qh_setappend_set(setT **setp, setT *setA); void qh_setappend_set(setT **setp, setT *setA);
void qh_setappend2ndlast(setT **setp, void *elem); void qh_setappend2ndlast(setT **setp, void *elem);
void qh_setcheck(setT *set, char *tname, int id); void qh_setcheck(setT *set, const char *tname, unsigned id);
void qh_setcompact(setT *set); void qh_setcompact(setT *set);
setT *qh_setcopy(setT *set, int extra); setT *qh_setcopy(setT *set, int extra);
void *qh_setdel(setT *set, void *elem); void *qh_setdel(setT *set, void *elem);
void *qh_setdellast(setT *set); void *qh_setdellast(setT *set);
void *qh_setdelnth(setT *set, int nth); void *qh_setdelnth(setT *set, int nth);
void *qh_setdelnthsorted(setT *set, int nth); void *qh_setdelnthsorted(setT *set, int nth);
void *qh_setdelsorted(setT *set, void *newelem); void *qh_setdelsorted(setT *set, void *newelem);
setT *qh_setduplicate( setT *set, int elemsize); setT *qh_setduplicate( setT *set, int elemsize);
int qh_setequal(setT *setA, setT *setB); int qh_setequal(setT *setA, setT *setB);
int qh_setequal_except (setT *setA, void *skipelemA, setT *setB, void *sk int qh_setequal_except(setT *setA, void *skipelemA, setT *setB, void *ski
ipelemB); pelemB);
int qh_setequal_skip (setT *setA, int skipA, setT *setB, int skipB); int qh_setequal_skip(setT *setA, int skipA, setT *setB, int skipB);
void qh_setfree(setT **set); void qh_setfree(setT **set);
void qh_setfree2( setT **setp, int elemsize); void qh_setfree2( setT **setp, int elemsize);
void qh_setfreelong(setT **set); void qh_setfreelong(setT **set);
int qh_setin(setT *set, void *setelem); int qh_setin(setT *set, void *setelem);
int qh_setindex(setT *set, void *setelem); int qh_setindex(setT *set, void *setelem);
void qh_setlarger(setT **setp); void qh_setlarger(setT **setp);
void *qh_setlast(setT *set); void *qh_setlast(setT *set);
setT *qh_setnew(int size); setT *qh_setnew(int size);
setT *qh_setnew_delnthsorted(setT *set, int size, int nth, int prepend); setT *qh_setnew_delnthsorted(setT *set, int size, int nth, int prepend);
void qh_setprint(FILE *fp, char* string, setT *set); void qh_setprint(FILE *fp, const char* string, setT *set);
void qh_setreplace(setT *set, void *oldelem, void *newelem); void qh_setreplace(setT *set, void *oldelem, void *newelem);
int qh_setsize(setT *set); int qh_setsize(setT *set);
setT *qh_settemp(int setsize); setT *qh_settemp(int setsize);
void qh_settempfree(setT **set); void qh_settempfree(setT **set);
void qh_settempfree_all(void); void qh_settempfree_all(void);
setT *qh_settemppop(void); setT *qh_settemppop(void);
void qh_settemppush(setT *set); void qh_settemppush(setT *set);
void qh_settruncate (setT *set, int size); void qh_settruncate(setT *set, int size);
int qh_setunique (setT **set, void *elem); int qh_setunique(setT **set, void *elem);
void qh_setzero (setT *set, int index, int size); void qh_setzero(setT *set, int idx, int size);
#endif /* qhDEFset */ #endif /* qhDEFset */
 End of changes. 23 change blocks. 
49 lines changed or deleted 65 lines changed or added


 stat.h   stat.h 
/*<html><pre> -<a href="qh-stat.htm" /*<html><pre> -<a href="qh-stat.htm"
>-------------------------------</a><a name="TOP">-</a> >-------------------------------</a><a name="TOP">-</a>
stat.h stat.h
contains all statistics that are collected for qhull contains all statistics that are collected for qhull
see qh-stat.htm and stat.c see qh-stat.htm and stat.c
copyright (c) 1993-2003, The Geometry Center Copyright (c) 1993-2011 The Geometry Center.
$Id: //main/2011/qhull/src/libqhull/stat.h#3 $$Change: 1368 $
$DateTime: 2011/04/16 08:12:32 $$Author: bbarber $
recompile qhull if you change this file recompile qhull if you change this file
Integer statistics are Z* while real statistics are W*. Integer statistics are Z* while real statistics are W*.
define maydebugx to call a routine at every statistic event define maydebugx to call a routine at every statistic event
*/ */
#ifndef qhDEFstat #ifndef qhDEFstat
#define qhDEFstat 1 #define qhDEFstat 1
#include "libqhull.h"
/*-<a href="qh-stat.htm#TOC" /*-<a href="qh-stat.htm#TOC"
>-------------------------------</a><a name="KEEPstatistics">-</a> >-------------------------------</a><a name="KEEPstatistics">-</a>
qh_KEEPstatistics qh_KEEPstatistics
0 turns off statistic gathering (except zzdef/zzinc/zzadd/zzval/wwval) 0 turns off statistic gathering (except zzdef/zzinc/zzadd/zzval/wwval)
*/ */
#ifndef qh_KEEPstatistics #ifndef qh_KEEPstatistics
#define qh_KEEPstatistics 1 #define qh_KEEPstatistics 1
#endif #endif
skipping to change at line 264 skipping to change at line 268
Ztrimirror, Ztrimirror,
Ztrinull, Ztrinull,
Wvertexmax, Wvertexmax,
Wvertexmin, Wvertexmin,
Zvertexridge, Zvertexridge,
Zvertexridgetot, Zvertexridgetot,
Zvertexridgemax, Zvertexridgemax,
Zvertices, Zvertices,
Zvisfacettot, Zvisfacettot,
Zvisfacetmax, Zvisfacetmax,
Zvisit,
Zvisit2max,
Zvisvertextot, Zvisvertextot,
Zvisvertexmax, Zvisvertexmax,
Zvvisit,
Zvvisit2max,
Zwidefacet, Zwidefacet,
Zwidevertices, Zwidevertices,
ZEND}; ZEND};
/*-<a href="qh-stat.htm#TOC" /*-<a href="qh-stat.htm#TOC"
>-------------------------------</a><a name="ZZstat">-</a> >-------------------------------</a><a name="ZZstat">-</a>
Zxxx/Wxxx statistics that remain defined if qh_KEEPstatistics=0 Zxxx/Wxxx statistics that remain defined if qh_KEEPstatistics=0
notes: notes:
skipping to change at line 323 skipping to change at line 331
Zridge0, Zridge0,
Wridge0, Wridge0,
Wridge0max, Wridge0max,
Zridgemid, Zridgemid,
Wridgemid, Wridgemid,
Wridgemidmax, Wridgemidmax,
Zridgeok, Zridgeok,
Wridgeok, Wridgeok,
Wridgeokmax, Wridgeokmax,
Zsetplane, Zsetplane,
Ztotcheck,
Ztotmerge, Ztotmerge,
ZEND}; ZEND};
#endif #endif
/*-<a href="qh-stat.htm#TOC" /*-<a href="qh-stat.htm#TOC"
>-------------------------------</a><a name="ztype">-</a> >-------------------------------</a><a name="ztype">-</a>
ztype ztype
the type of a statistic sets its initial value. the type of a statistic sets its initial value.
skipping to change at line 459 skipping to change at line 468
typedef union intrealT intrealT; /* union of int and realT */ typedef union intrealT intrealT; /* union of int and realT */
union intrealT { union intrealT {
int i; int i;
realT r; realT r;
}; };
/*-<a href="qh-stat.htm#TOC" /*-<a href="qh-stat.htm#TOC"
>--------------------------------</a><a name="qhstat">-</a> >--------------------------------</a><a name="qhstat">-</a>
qhstat qhstat
global data structure for statistics global data structure for statistics, similar to qh and qhrbox
notes: notes:
access to qh_qhstat is via the "qhstat" macro. There are two choices access to qh_qhstat is via the "qhstat" macro. There are two choices
qh_QHpointer = 1 access globals via a pointer qh_QHpointer = 1 access globals via a pointer
enables qh_saveqhull() and qh_restoreqhull() enables qh_saveqhull() and qh_restoreqhull()
= 0 qh_qhstat is a static data structure = 0 qh_qhstat is a static data structure
only one instance of qhull() can be active at a time only one instance of qhull() can be active at a tim
default value e
qh_QHpointer is defined in qhull.h default value
qh_QHpointer is defined in libqhull.h
allocated in stat.c allocated in stat.c using qh_malloc()
*/ */
#ifndef DEFqhstatT
#define DEFqhstatT 1
typedef struct qhstatT qhstatT; typedef struct qhstatT qhstatT;
#if qh_QHpointer #endif
#if qh_QHpointer_dllimport
#define qhstat qh_qhstat->
__declspec(dllimport) extern qhstatT *qh_qhstat;
#elif qh_QHpointer
#define qhstat qh_qhstat-> #define qhstat qh_qhstat->
extern qhstatT *qh_qhstat; extern qhstatT *qh_qhstat;
#else #else
#define qhstat qh_qhstat. #define qhstat qh_qhstat.
extern qhstatT qh_qhstat; extern qhstatT qh_qhstat;
#endif #endif
struct qhstatT { struct qhstatT {
intrealT stats[ZEND]; /* integer and real statistics */ intrealT stats[ZEND]; /* integer and real statistics */
unsigned char id[ZEND+10]; /* id's in print order */ unsigned char id[ZEND+10]; /* id's in print order */
char *doc[ZEND]; /* array of documentation strings */ const char *doc[ZEND]; /* array of documentation strings */
short int count[ZEND]; /* -1 if none, else index of count to use */ short int count[ZEND]; /* -1 if none, else index of count to use */
char type[ZEND]; /* type, see ztypes above */ char type[ZEND]; /* type, see ztypes above */
char printed[ZEND]; /* true, if statistic has been printed */ char printed[ZEND]; /* true, if statistic has been printed */
intrealT init[ZTYPEend]; /* initial values by types, set initstatistic s */ intrealT init[ZTYPEend]; /* initial values by types, set initstatistic s */
int next; /* next index for zdef_ */ int next; /* next index for zdef_ */
int precision; /* index for precision problems */ int precision; /* index for precision problems */
int vridges; /* index for Voronoi ridges */ int vridges; /* index for Voronoi ridges */
int tempi; int tempi;
realT tempr; realT tempr;
skipping to change at line 508 skipping to change at line 524
void qh_allstatA(void); void qh_allstatA(void);
void qh_allstatB(void); void qh_allstatB(void);
void qh_allstatC(void); void qh_allstatC(void);
void qh_allstatD(void); void qh_allstatD(void);
void qh_allstatE(void); void qh_allstatE(void);
void qh_allstatE2(void); void qh_allstatE2(void);
void qh_allstatF(void); void qh_allstatF(void);
void qh_allstatG(void); void qh_allstatG(void);
void qh_allstatH(void); void qh_allstatH(void);
void qh_allstatI(void); void qh_allstatI(void);
void qh_allstatistics (void); void qh_allstatistics(void);
void qh_collectstatistics (void); void qh_collectstatistics(void);
void qh_freestatistics (void); void qh_freestatistics(void);
void qh_initstatistics (void); void qh_initstatistics(void);
boolT qh_newstats (int index, int *nextindex); boolT qh_newstats(int idx, int *nextindex);
boolT qh_nostatistic (int i); boolT qh_nostatistic(int i);
void qh_printallstatistics (FILE *fp, char *string); void qh_printallstatistics(FILE *fp, const char *string);
void qh_printstatistics (FILE *fp, char *string); void qh_printstatistics(FILE *fp, const char *string);
void qh_printstatlevel (FILE *fp, int id, int start); void qh_printstatlevel(FILE *fp, int id, int start);
void qh_printstats (FILE *fp, int index, int *nextindex); void qh_printstats(FILE *fp, int idx, int *nextindex);
realT qh_stddev (int num, realT tot, realT tot2, realT *ave); realT qh_stddev(int num, realT tot, realT tot2, realT *ave);
#endif /* qhDEFstat */ #endif /* qhDEFstat */
 End of changes. 13 change blocks. 
21 lines changed or deleted 38 lines changed or added


 user.h   user.h 
/*<html><pre> -<a href="qh-user.htm" /*<html><pre> -<a href="qh-user.htm"
>-------------------------------</a><a name="TOP">-</a> >-------------------------------</a><a name="TOP">-</a>
user.h user.h
user redefinable constants user redefinable constants
see qh-user.htm. see COPYING for copyright information. see qh-user.htm. see COPYING for copyright information.
before reading any code, review qhull.h for data structure definitions a nd before reading any code, review libqhull.h for data structure definition s and
the "qh" macro. the "qh" macro.
Sections:
============= qhull library constants ======================
============= data types and configuration macros ==========
============= performance related constants ================
============= memory constants =============================
============= joggle constants =============================
============= conditional compilation ======================
============= -merge constants- ============================
Code flags --
NOerrors -- the code does not call qh_errexit()
WARN64 -- the code may be incompatible with 64-bit pointers
*/ */
#include <time.h>
#ifndef qhDEFuser #ifndef qhDEFuser
#define qhDEFuser 1 #define qhDEFuser 1
/*============================================================*/
/*============= qhull library constants ======================*/
/*============================================================*/
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="filenamelen">-</a>
FILENAMElen -- max length for TI and TO filenames
*/
#define qh_FILENAMElen 500
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="msgcode">-</a>
msgcode -- Unique message codes for qh_fprintf
If add new messages, assign these values and increment.
def counters = [27, 1047, 2059, 3025, 4068, 5003,
6235, 7079, 8143, 9410, 10000, 11026]
See: qh_ERR* [libqhull.h]
*/
#define MSG_TRACE0 0
#define MSG_TRACE1 1000
#define MSG_TRACE2 2000
#define MSG_TRACE3 3000
#define MSG_TRACE4 4000
#define MSG_TRACE5 5000
#define MSG_ERROR 6000 /* errors written to qh.ferr */
#define MSG_WARNING 7000
#define MSG_STDERR 8000 /* log messages Written to qh.ferr */
#define MSG_OUTPUT 9000
#define MSG_QHULL_ERROR 10000 /* errors thrown by QhullError [QhullError.h]
*/
#define MSG_FIXUP 11000 /* FIXUP QH11... */
#define MSG_MAXLEN 3000 /* qh_printhelp_degenerate() in user.c */
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="qh_OPTIONline">-</a>
qh_OPTIONline -- max length of an option line 'FO'
*/
#define qh_OPTIONline 80
/*============================================================*/
/*============= data types and configuration macros ==========*/ /*============= data types and configuration macros ==========*/
/*============================================================*/
/*-<a href="qh-user.htm#TOC" /*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="realT">-</a> >--------------------------------</a><a name="realT">-</a>
realT realT
set the size of floating point numbers set the size of floating point numbers
qh_REALdigits qh_REALdigits
maximimum number of significant digits maximimum number of significant digits
skipping to change at line 41 skipping to change at line 106
maximum and minimum (near zero) values maximum and minimum (near zero) values
qh_REALepsilon qh_REALepsilon
machine roundoff. Maximum roundoff error for addition and multiplicati on. machine roundoff. Maximum roundoff error for addition and multiplicati on.
notes: notes:
Select whether to store floating point numbers in single precision (floa t) Select whether to store floating point numbers in single precision (floa t)
or double precision (double). or double precision (double).
Use 'float' to save about 8% in time and 25% in space. This is particul arly Use 'float' to save about 8% in time and 25% in space. This is particul arly
help if high-d where convex hulls are space limited. Using 'float' also helpful if high-d where convex hulls are space limited. Using 'float' a lso
reduces the printed size of Qhull's output since numbers have 8 digits o f reduces the printed size of Qhull's output since numbers have 8 digits o f
precision. precision.
Use 'double' when greater arithmetic precision is needed. This is neede d Use 'double' when greater arithmetic precision is needed. This is neede d
for Delaunay triangulations and Voronoi diagrams when you are not mergin g for Delaunay triangulations and Voronoi diagrams when you are not mergin g
facets. facets.
If 'double' gives insufficient precision, your data probably includes If 'double' gives insufficient precision, your data probably includes
degeneracies. If so you should use facet merging (done by default) degeneracies. If so you should use facet merging (done by default)
or exact arithmetic (see imprecision section of manual, qh-impre.htm). or exact arithmetic (see imprecision section of manual, qh-impre.htm).
skipping to change at line 108 skipping to change at line 173
qh_SECticks qh_SECticks
the number of clock ticks per second the number of clock ticks per second
notes: notes:
looks for CLOCKS_PER_SEC, CLOCKS_PER_SECOND, or assumes microseconds looks for CLOCKS_PER_SEC, CLOCKS_PER_SECOND, or assumes microseconds
to define a custom clock, set qh_CLOCKtype to 0 to define a custom clock, set qh_CLOCKtype to 0
if your system does not use clock() to return CPU ticks, replace if your system does not use clock() to return CPU ticks, replace
qh_CPUclock with the corresponding function. It is converted qh_CPUclock with the corresponding function. It is converted
to unsigned long to prevent wrap-around during long runs. to 'unsigned long' to prevent wrap-around during long runs. By default
,
<time.h> defines clock_t as 'long'
Set qh_CLOCKtype to Set qh_CLOCKtype to
1 for CLOCKS_PER_SEC, CLOCKS_PER_SECOND, or microsecond 1 for CLOCKS_PER_SEC, CLOCKS_PER_SECOND, or microsecond
Note: may fail if more than 1 hour elapsed time Note: may fail if more than 1 hour elapsed time
2 use qh_clock() with POSIX times() (see global.c) 2 use qh_clock() with POSIX times() (see global.c)
*/ */
#define qh_CLOCKtype 1 /* change to the desired number */ #define qh_CLOCKtype 1 /* change to the desired number */
#if (qh_CLOCKtype == 1) #if (qh_CLOCKtype == 1)
#if defined (CLOCKS_PER_SECOND) #if defined(CLOCKS_PER_SECOND)
#define qh_CPUclock ((unsigned long)clock()) /* return CPU clock */ #define qh_CPUclock ((unsigned long)clock()) /* return CPU clock */
#define qh_SECticks CLOCKS_PER_SECOND #define qh_SECticks CLOCKS_PER_SECOND
#elif defined (CLOCKS_PER_SEC) #elif defined(CLOCKS_PER_SEC)
#define qh_CPUclock ((unsigned long)clock()) /* return CPU clock */ #define qh_CPUclock ((unsigned long)clock()) /* return CPU clock */
#define qh_SECticks CLOCKS_PER_SEC #define qh_SECticks CLOCKS_PER_SEC
#elif defined (CLK_TCK) #elif defined(CLK_TCK)
#define qh_CPUclock ((unsigned long)clock()) /* return CPU clock */ #define qh_CPUclock ((unsigned long)clock()) /* return CPU clock */
#define qh_SECticks CLK_TCK #define qh_SECticks CLK_TCK
#else #else
#define qh_CPUclock ((unsigned long)clock()) /* return CPU clock */ #define qh_CPUclock ((unsigned long)clock()) /* return CPU clock */
#define qh_SECticks 1E6 #define qh_SECticks 1E6
#endif #endif
#elif (qh_CLOCKtype == 2) #elif (qh_CLOCKtype == 2)
#define qh_CPUclock qh_clock() /* return CPU clock */ #define qh_CPUclock qh_clock() /* return CPU clock */
skipping to change at line 222 skipping to change at line 288
#endif #endif
/*-<a href="qh-user.htm#TOC" /*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="ORIENTclock">-</a> >--------------------------------</a><a name="ORIENTclock">-</a>
qh_ORIENTclock qh_ORIENTclock
0 for inward pointing normals by Geomview convention 0 for inward pointing normals by Geomview convention
*/ */
#define qh_ORIENTclock 0 #define qh_ORIENTclock 0
/*========= performance related constants =========*/ /*============================================================*/
/*============= joggle constants =============================*/
/*-<a href="qh-user.htm#TOC" /*============================================================*/
>--------------------------------</a><a name="HASHfactor">-</a>
/*-<a href="qh-user.htm#TOC"
qh_HASHfactor >--------------------------------</a><a name="JOGGLEdefault">-</a>
total hash slots / used hash slots. Must be at least 1.1.
qh_JOGGLEdefault
default qh.JOGGLEmax is qh.DISTround * qh_JOGGLEdefault
notes:
rbox s r 100 | qhull QJ1e-15 QR0 generates 90% faults at distround 7e-16
rbox s r 100 | qhull QJ1e-14 QR0 generates 70% faults
rbox s r 100 | qhull QJ1e-13 QR0 generates 35% faults
rbox s r 100 | qhull QJ1e-12 QR0 generates 8% faults
rbox s r 100 | qhull QJ1e-11 QR0 generates 1% faults
rbox s r 100 | qhull QJ1e-10 QR0 generates 0% faults
rbox 1000 W0 | qhull QJ1e-12 QR0 generates 86% faults
rbox 1000 W0 | qhull QJ1e-11 QR0 generates 20% faults
rbox 1000 W0 | qhull QJ1e-10 QR0 generates 2% faults
the later have about 20 points per facet, each of which may interfere
notes: pick a value large enough to avoid retries on most inputs
=2 for at worst 50% occupancy for qh hash_table and normally 25% occupa
ncy
*/ */
#define qh_HASHfactor 2 #define qh_JOGGLEdefault 30000.0
/*-<a href="qh-user.htm#TOC" /*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="VERIFYdirect">-</a> >--------------------------------</a><a name="JOGGLEincrease">-</a>
qh_VERIFYdirect
with 'Tv' verify all points against all facets if op count is smaller
notes: qh_JOGGLEincrease
if greater, calls qh_check_bestdist() instead factor to increase qh.JOGGLEmax on qh_JOGGLEretry or qh_JOGGLEagain
*/ */
#define qh_VERIFYdirect 1000000 #define qh_JOGGLEincrease 10.0
/*-<a href="qh-user.htm#TOC" /*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="INITIALsearch">-</a> >--------------------------------</a><a name="JOGGLEretry">-</a>
qh_INITIALsearch qh_JOGGLEretry
if qh_INITIALmax, search points up to this dimension if ZZretry = qh_JOGGLEretry, increase qh.JOGGLEmax
notes:
try twice at the original value in case of bad luck the first time
*/ */
#define qh_INITIALsearch 6 #define qh_JOGGLEretry 2
/*-<a href="qh-user.htm#TOC" /*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="INITIALmax">-</a> >--------------------------------</a><a name="JOGGLEagain">-</a>
qh_INITIALmax qh_JOGGLEagain
if dim >= qh_INITIALmax, use min/max coordinate points for initial simp every following qh_JOGGLEagain, increase qh.JOGGLEmax
lex
notes: notes:
from points with non-zero determinants 1 is OK since it's already failed qh_JOGGLEretry times
use option 'Qs' to override (much slower)
*/ */
#define qh_INITIALmax 8 #define qh_JOGGLEagain 1
/*-<a href="qh-user.htm#TOC" /*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="JOGGLEdefault">-</a> >--------------------------------</a><a name="JOGGLEmaxincrease">-</a>
qh_JOGGLEdefault qh_JOGGLEmaxincrease
default qh.JOGGLEmax is qh.DISTround * qh_JOGGLEdefault maximum qh.JOGGLEmax due to qh_JOGGLEincrease
relative to qh.MAXwidth
notes: notes:
rbox s r 100 | qhull QJ1e-15 QR0 generates 90% faults at distround 7e-1 qh.joggleinput will retry at this value until qh_JOGGLEmaxretry
6
rbox s r 100 | qhull QJ1e-14 QR0 generates 70% faults
rbox s r 100 | qhull QJ1e-13 QR0 generates 35% faults
rbox s r 100 | qhull QJ1e-12 QR0 generates 8% faults
rbox s r 100 | qhull QJ1e-11 QR0 generates 1% faults
rbox s r 100 | qhull QJ1e-10 QR0 generates 0% faults
rbox 1000 W0 | qhull QJ1e-12 QR0 generates 86% faults
rbox 1000 W0 | qhull QJ1e-11 QR0 generates 20% faults
rbox 1000 W0 | qhull QJ1e-10 QR0 generates 2% faults
the later have about 20 points per facet, each of which may interfere
pick a value large enough to avoid retries on most inputs
*/ */
#define qh_JOGGLEdefault 30000.0 #define qh_JOGGLEmaxincrease 1e-2
/*-<a href="qh-user.htm#TOC" /*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="JOGGLEincrease">-</a> >--------------------------------</a><a name="JOGGLEmaxretry">-</a>
qh_JOGGLEincrease qh_JOGGLEmaxretry
factor to increase qh.JOGGLEmax on qh_JOGGLEretry or qh_JOGGLEagain stop after qh_JOGGLEmaxretry attempts
*/ */
#define qh_JOGGLEincrease 10.0 #define qh_JOGGLEmaxretry 100
/*============================================================*/
/*============= performance related constants ================*/
/*============================================================*/
/*-<a href="qh-user.htm#TOC" /*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="JOGGLEretry">-</a> >--------------------------------</a><a name="HASHfactor">-</a>
qh_JOGGLEretry qh_HASHfactor
if ZZretry = qh_JOGGLEretry, increase qh.JOGGLEmax total hash slots / used hash slots. Must be at least 1.1.
notes: notes:
try twice at the original value in case of bad luck the first time =2 for at worst 50% occupancy for qh hash_table and normally 25% occupa ncy
*/ */
#define qh_JOGGLEretry 2 #define qh_HASHfactor 2
/*-<a href="qh-user.htm#TOC" /*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="JOGGLEagain">-</a> >--------------------------------</a><a name="VERIFYdirect">-</a>
qh_JOGGLEagain qh_VERIFYdirect
every following qh_JOGGLEagain, increase qh.JOGGLEmax with 'Tv' verify all points against all facets if op count is smaller
notes: notes:
1 is OK since it's already failed qh_JOGGLEretry times if greater, calls qh_check_bestdist() instead
*/ */
#define qh_JOGGLEagain 1 #define qh_VERIFYdirect 1000000
/*-<a href="qh-user.htm#TOC" /*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="JOGGLEmaxincrease">-</a> >--------------------------------</a><a name="INITIALsearch">-</a>
qh_JOGGLEmaxincrease
maximum qh.JOGGLEmax due to qh_JOGGLEincrease
relative to qh.MAXwidth
notes: qh_INITIALsearch
qh.joggleinput will retry at this value until qh_JOGGLEmaxretry if qh_INITIALmax, search points up to this dimension
*/ */
#define qh_JOGGLEmaxincrease 1e-2 #define qh_INITIALsearch 6
/*-<a href="qh-user.htm#TOC" /*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="JOGGLEmaxretry">-</a> >--------------------------------</a><a name="INITIALmax">-</a>
qh_INITIALmax
if dim >= qh_INITIALmax, use min/max coordinate points for initial simp
lex
qh_JOGGLEmaxretry notes:
stop after qh_JOGGLEmaxretry attempts from points with non-zero determinants
use option 'Qs' to override (much slower)
*/ */
#define qh_JOGGLEmaxretry 100 #define qh_INITIALmax 8
/*========= memory constants =========*/ /*============================================================*/
/*============= memory constants =============================*/
/*============================================================*/
/*-<a href="qh-user.htm#TOC" /*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="MEMalign">-</a> >--------------------------------</a><a name="MEMalign">-</a>
qh_MEMalign qh_MEMalign
memory alignment for qh_meminitbuffers() in global.c memory alignment for qh_meminitbuffers() in global.c
notes: notes:
to avoid bus errors, memory allocation must consider alignment requirem ents. to avoid bus errors, memory allocation must consider alignment requirem ents.
malloc() automatically takes care of alignment. Since mem.c manages malloc() automatically takes care of alignment. Since mem.c manages
its own memory, we need to explicitly specify alignment in its own memory, we need to explicitly specify alignment in
qh_meminitbuffers(). qh_meminitbuffers().
A safe choice is sizeof(double). sizeof(float) may be used if doubles A safe choice is sizeof(double). sizeof(float) may be used if doubles
do not occur in data structures and pointers are the same size. Be car eful do not occur in data structures and pointers are the same size. Be car eful
of machines (e.g., DEC Alpha) with large pointers. of machines (e.g., DEC Alpha) with large pointers.
If using gcc, best alignment is If using gcc, best alignment is
#define qh_MEMalign fmax_(__alignof__(realT),__alignof__(void *)) #define qh_MEMalign fmax_(__alignof__(realT),__alignof__(void *))
*/ */
#define qh_MEMalign fmax_(sizeof(realT), sizeof(void *)) #define qh_MEMalign ((int)(fmax_(sizeof(realT), sizeof(void *))))
/*-<a href="qh-user.htm#TOC" /*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="MEMbufsize">-</a> >--------------------------------</a><a name="MEMbufsize">-</a>
qh_MEMbufsize qh_MEMbufsize
size of additional memory buffers size of additional memory buffers
notes: notes:
used for qh_meminitbuffers() in global.c used for qh_meminitbuffers() in global.c
*/ */
skipping to change at line 396 skipping to change at line 470
qh_INFINITE qh_INFINITE
on output, indicates Voronoi center at infinity on output, indicates Voronoi center at infinity
*/ */
#define qh_INFINITE -10.101 #define qh_INFINITE -10.101
/*-<a href="qh-user.htm#TOC" /*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="DEFAULTbox">-</a> >--------------------------------</a><a name="DEFAULTbox">-</a>
qh_DEFAULTbox qh_DEFAULTbox
default box size (Geomview expects 0.5) default box size (Geomview expects 0.5)
qh_DEFAULTbox
default box size for integer coorindate (rbox only)
*/ */
#define qh_DEFAULTbox 0.5 #define qh_DEFAULTbox 0.5
#define qh_DEFAULTzbox 1e6
/*======= conditional compilation ============================*/ /*============================================================*/
/*============= conditional compilation ======================*/
/*============================================================*/
/*-<a href="qh-user.htm#TOC" /*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="compiler">-</a> >--------------------------------</a><a name="compiler">-</a>
__cplusplus __cplusplus
defined by C++ compilers defined by C++ compilers
__MSC_VER __MSC_VER
defined by Microsoft Visual C++ defined by Microsoft Visual C++
skipping to change at line 495 skipping to change at line 575
*/ */
/*-<a href="qh-user.htm#TOC" /*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="QHpointer">-</a> >--------------------------------</a><a name="QHpointer">-</a>
qh_QHpointer qh_QHpointer
access global data with pointer or static structure access global data with pointer or static structure
qh_QHpointer = 1 access globals via a pointer to allocated memory qh_QHpointer = 1 access globals via a pointer to allocated memory
enables qh_saveqhull() and qh_restoreqhull() enables qh_saveqhull() and qh_restoreqhull()
costs about 8% in time and 2% in space [2010, gcc] costs about 4% in time and 4% in space
[2003, msvc] costs about 8% in time and 2% in space
= 0 qh_qh and qh_qhstat are static data structures
only one instance of qhull() can be active at a tim
e
default value
= 0 qh_qh and qh_qhstat are static data structures qh_QHpointer_dllimport defines qh_qh as a __declspec(dllimport) [libqhull
only one instance of qhull() can be active at a time .h]
default value It is required for msvc-2005. It is not needed for gcc.
notes: notes:
all global variables for qhull are in qh, qhmem, and qhstat all global variables for qhull are in qh, qhmem, and qhstat
qh is defined in qhull.h qh is defined in libqhull.h
qhmem is defined in mem.h qhmem is defined in mem.h
qhstat is defined in stat.h qhstat is defined in stat.h
C++ build defines qh_QHpointer [libqhullp.pro, libqhullcpp.pro]
see: see:
user_eg.c for an example user_eg.c for an example
*/ */
#ifndef qh_QHpointer
#define qh_QHpointer 0 #define qh_QHpointer 0
#if qh_QHpointer_dllimport
#error QH6234 Qhull error: qh_QHpointer must be defined when using qh_QHpoi
nter_dllimport.
#endif
#endif
#if 0 /* sample code */ #if 0 /* sample code */
qhT *oldqhA, *oldqhB; qhT *oldqhA, *oldqhB;
exitcode= qh_new_qhull (dim, numpoints, points, ismalloc, exitcode= qh_new_qhull(dim, numpoints, points, ismalloc,
flags, outfile, errfile); flags, outfile, errfile);
/* use results from first call to qh_new_qhull */ /* use results from first call to qh_new_qhull */
oldqhA= qh_save_qhull(); oldqhA= qh_save_qhull();
exitcode= qh_new_qhull (dimB, numpointsB, pointsB, ismalloc, exitcode= qh_new_qhull(dimB, numpointsB, pointsB, ismalloc,
flags, outfile, errfile); flags, outfile, errfile);
/* use results from second call to qh_new_qhull */ /* use results from second call to qh_new_qhull */
oldqhB= qh_save_qhull(); oldqhB= qh_save_qhull();
qh_restore_qhull (&oldqhA); qh_restore_qhull(&oldqhA);
/* use results from first call to qh_new_qhull */ /* use results from first call to qh_new_qhull */
qh_freeqhull (qh_ALL); /* frees all memory used by first call */ qh_freeqhull(qh_ALL); /* frees all memory used by first call */
qh_restore_qhull (&oldqhB); qh_restore_qhull(&oldqhB);
/* use results from second call to qh_new_qhull */ /* use results from second call to qh_new_qhull */
qh_freeqhull (!qh_ALL); /* frees long memory used by second call */ qh_freeqhull(!qh_ALL); /* frees long memory used by second call */
qh_memfreeshort (&curlong, &totlong); /* frees short memory and memory qh_memfreeshort(&curlong, &totlong); /* frees short memory and memory
allocator */ allocator */
#endif #endif
/*-<a href="qh-user.htm#TOC" /*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="QUICKhelp">-</a> >--------------------------------</a><a name="QUICKhelp">-</a>
qh_QUICKhelp qh_QUICKhelp
=1 to use abbreviated help messages, e.g., for degenerate inputs =1 to use abbreviated help messages, e.g., for degenerate inputs
*/ */
#define qh_QUICKhelp 0 #define qh_QUICKhelp 0
/* ============ -merge constants- ==================== /*============================================================*/
/*============= -merge constants- ============================*/
/*============================================================*/
/*
These constants effect facet merging. You probably will not need These constants effect facet merging. You probably will not need
to modify these. They effect the performance of facet merging. to modify them. They effect the performance of facet merging.
*/ */
/*-<a href="qh-user.htm#TOC" /*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="DIMmergeVertex">-</a> >--------------------------------</a><a name="DIMmergeVertex">-</a>
qh_DIMmergeVertex qh_DIMmergeVertex
max dimension for vertex merging (it is not effective in high-d) max dimension for vertex merging (it is not effective in high-d)
*/ */
#define qh_DIMmergeVertex 6 #define qh_DIMmergeVertex 6
 End of changes. 64 change blocks. 
101 lines changed or deleted 196 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/