File indexing completed on 2025-12-16 10:19:26
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef qhDEFgeom
0015 #define qhDEFgeom 1
0016
0017 #include "libqhull_r.h"
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 #define fabs_( a ) ((( a ) < 0 ) ? -( a ):( a ))
0028
0029
0030
0031
0032
0033
0034
0035 #define fmax_( a,b ) ( ( a ) < ( b ) ? ( b ) : ( a ) )
0036
0037
0038
0039
0040
0041
0042
0043 #define fmin_( a,b ) ( ( a ) > ( b ) ? ( b ) : ( a ) )
0044
0045
0046
0047
0048
0049
0050
0051 #define maximize_( maxval, val ) { if (( maxval ) < ( val )) ( maxval )= ( val ); }
0052
0053
0054
0055
0056
0057
0058
0059 #define minimize_( minval, val ) { if (( minval ) > ( val )) ( minval )= ( val ); }
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069 #define det2_( a1,a2,b1,b2 ) (( a1 )*( b2 ) - ( a2 )*( b1 ))
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080 #define det3_( a1,a2,a3,b1,b2,b3,c1,c2,c3 ) ( ( a1 )*det2_( b2,b3,c2,c3 ) \
0081 - ( b1 )*det2_( a2,a3,c2,c3 ) + ( c1 )*det2_( a2,a3,b2,b3 ) )
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094 #define dX( p1,p2 ) ( *( rows[p1] ) - *( rows[p2] ))
0095 #define dY( p1,p2 ) ( *( rows[p1]+1 ) - *( rows[p2]+1 ))
0096 #define dZ( p1,p2 ) ( *( rows[p1]+2 ) - *( rows[p2]+2 ))
0097 #define dW( p1,p2 ) ( *( rows[p1]+3 ) - *( rows[p2]+3 ))
0098
0099
0100
0101 #ifdef __cplusplus
0102 extern "C" {
0103 #endif
0104
0105 void qh_backnormal(qhT *qh, realT **rows, int numrow, int numcol, boolT sign, coordT *normal, boolT *nearzero);
0106 void qh_distplane(qhT *qh, pointT *point, facetT *facet, realT *dist);
0107 facetT *qh_findbest(qhT *qh, pointT *point, facetT *startfacet,
0108 boolT bestoutside, boolT isnewfacets, boolT noupper,
0109 realT *dist, boolT *isoutside, int *numpart);
0110 facetT *qh_findbesthorizon(qhT *qh, boolT ischeckmax, pointT *point,
0111 facetT *startfacet, boolT noupper, realT *bestdist, int *numpart);
0112 facetT *qh_findbestnew(qhT *qh, pointT *point, facetT *startfacet, realT *dist,
0113 boolT bestoutside, boolT *isoutside, int *numpart);
0114 void qh_gausselim(qhT *qh, realT **rows, int numrow, int numcol, boolT *sign, boolT *nearzero);
0115 realT qh_getangle(qhT *qh, pointT *vect1, pointT *vect2);
0116 pointT *qh_getcenter(qhT *qh, setT *vertices);
0117 pointT *qh_getcentrum(qhT *qh, facetT *facet);
0118 coordT qh_getdistance(qhT *qh, facetT *facet, facetT *neighbor, coordT *mindist, coordT *maxdist);
0119 void qh_normalize(qhT *qh, coordT *normal, int dim, boolT toporient);
0120 void qh_normalize2(qhT *qh, coordT *normal, int dim, boolT toporient,
0121 realT *minnorm, boolT *ismin);
0122 pointT *qh_projectpoint(qhT *qh, pointT *point, facetT *facet, realT dist);
0123
0124 void qh_setfacetplane(qhT *qh, facetT *newfacets);
0125 void qh_sethyperplane_det(qhT *qh, int dim, coordT **rows, coordT *point0,
0126 boolT toporient, coordT *normal, realT *offset, boolT *nearzero);
0127 void qh_sethyperplane_gauss(qhT *qh, int dim, coordT **rows, pointT *point0,
0128 boolT toporient, coordT *normal, coordT *offset, boolT *nearzero);
0129 boolT qh_sharpnewfacets(qhT *qh);
0130
0131
0132
0133 coordT *qh_copypoints(qhT *qh, coordT *points, int numpoints, int dimension);
0134 void qh_crossproduct(int dim, realT vecA[3], realT vecB[3], realT vecC[3]);
0135 realT qh_determinant(qhT *qh, realT **rows, int dim, boolT *nearzero);
0136 realT qh_detjoggle(qhT *qh, pointT *points, int numpoints, int dimension);
0137 void qh_detmaxoutside(qhT *qh);
0138 void qh_detroundoff(qhT *qh);
0139 realT qh_detsimplex(qhT *qh, pointT *apex, setT *points, int dim, boolT *nearzero);
0140 realT qh_distnorm(int dim, pointT *point, pointT *normal, realT *offsetp);
0141 realT qh_distround(qhT *qh, int dimension, realT maxabs, realT maxsumabs);
0142 realT qh_divzero(realT numer, realT denom, realT mindenom1, boolT *zerodiv);
0143 realT qh_facetarea(qhT *qh, facetT *facet);
0144 realT qh_facetarea_simplex(qhT *qh, int dim, coordT *apex, setT *vertices,
0145 vertexT *notvertex, boolT toporient, coordT *normal, realT *offset);
0146 pointT *qh_facetcenter(qhT *qh, setT *vertices);
0147 facetT *qh_findgooddist(qhT *qh, pointT *point, facetT *facetA, realT *distp, facetT **facetlist);
0148 vertexT *qh_furthestnewvertex(qhT *qh, unsigned int unvisited, facetT *facet, realT *maxdistp );
0149 vertexT *qh_furthestvertex(qhT *qh, facetT *facetA, facetT *facetB, realT *maxdistp, realT *mindistp);
0150 void qh_getarea(qhT *qh, facetT *facetlist);
0151 boolT qh_gram_schmidt(qhT *qh, int dim, realT **rows);
0152 boolT qh_inthresholds(qhT *qh, coordT *normal, realT *angle);
0153 void qh_joggleinput(qhT *qh);
0154 realT *qh_maxabsval(realT *normal, int dim);
0155 setT *qh_maxmin(qhT *qh, pointT *points, int numpoints, int dimension);
0156 realT qh_maxouter(qhT *qh);
0157 void qh_maxsimplex(qhT *qh, int dim, setT *maxpoints, pointT *points, int numpoints, setT **simplex);
0158 realT qh_minabsval(realT *normal, int dim);
0159 int qh_mindiff(realT *vecA, realT *vecB, int dim);
0160 boolT qh_orientoutside(qhT *qh, facetT *facet);
0161 void qh_outerinner(qhT *qh, facetT *facet, realT *outerplane, realT *innerplane);
0162 coordT qh_pointdist(pointT *point1, pointT *point2, int dim);
0163 void qh_printmatrix(qhT *qh, FILE *fp, const char *string, realT **rows, int numrow, int numcol);
0164 void qh_printpoints(qhT *qh, FILE *fp, const char *string, setT *points);
0165 void qh_projectinput(qhT *qh);
0166 void qh_projectpoints(qhT *qh, signed char *project, int n, realT *points,
0167 int numpoints, int dim, realT *newpoints, int newdim);
0168 void qh_rotateinput(qhT *qh, realT **rows);
0169 void qh_rotatepoints(qhT *qh, realT *points, int numpoints, int dim, realT **rows);
0170 void qh_scaleinput(qhT *qh);
0171 void qh_scalelast(qhT *qh, coordT *points, int numpoints, int dim, coordT low,
0172 coordT high, coordT newhigh);
0173 void qh_scalepoints(qhT *qh, pointT *points, int numpoints, int dim,
0174 realT *newlows, realT *newhighs);
0175 boolT qh_sethalfspace(qhT *qh, int dim, coordT *coords, coordT **nextp,
0176 coordT *normal, coordT *offset, coordT *feasible);
0177 coordT *qh_sethalfspace_all(qhT *qh, int dim, int count, coordT *halfspaces, pointT *feasible);
0178 coordT qh_vertex_bestdist(qhT *qh, setT *vertices);
0179 coordT qh_vertex_bestdist2(qhT *qh, setT *vertices, vertexT **vertexp, vertexT **vertexp2);
0180 pointT *qh_voronoi_center(qhT *qh, int dim, setT *points);
0181
0182 #ifdef __cplusplus
0183 }
0184 #endif
0185
0186 #endif
0187
0188
0189