43 const char qh_version2[]=
"qhull_r 7.2.0 (2015.2.r 2016/01/18)";
79 char *s= command, *
t, *chkerr;
80 char key, opt, prevopt;
86 if (*hiddenflags !=
' ' || hiddenflags[strlen(hiddenflags)-1] !=
' ') {
87 qh_fprintf(qh, qh->
ferr, 6026,
"qhull error (qh_checkflags): hiddenflags must start and end with a space: \"%s\"", hiddenflags);
90 if (strpbrk(hiddenflags,
",\n\r\t")) {
91 qh_fprintf(qh, qh->
ferr, 6027,
"qhull error (qh_checkflags): hiddenflags contains commas, newlines, or tabs: \"%s\"", hiddenflags);
94 while (*s && !isspace(*s))
97 while (*s && isspace(*s))
105 if (key ==
'T' && (*s ==
'I' || *s ==
'O')) {
110 if (strstr(hiddenflags, chkkey)) {
112 }
else if (isupper(key)) {
117 while (!chkerr && *s && !isspace(*s)) {
121 if (strstr(hiddenflags, chkopt))
123 if (prevopt !=
' ') {
126 if (strstr(hiddenflags, chkopt2))
129 }
else if (key ==
'Q' && isdigit(opt) && prevopt !=
'b' 130 && (prevopt ==
' ' || islower(prevopt))) {
132 if (strstr(hiddenflags, chkopt))
144 chkerr[strlen(chkerr)-1]=
'\'';
145 qh_fprintf(qh, qh->
ferr, 6029,
"qhull error: option %s is not used with this program.\n It may be used with qhull.\n", chkerr);
233 #if (qh_CLOCKtype == 2) 240 if ((clktck= sysconf(_SC_CLK_TCK)) < 0) {
241 qh_fprintf(qh, qh->
ferr, 6030,
"qhull internal error (qh_clock): sysconf() failed. Use qh_CLOCKtype 1 in user.h\n");
245 if (times(&time) == -1) {
246 qh_fprintf(qh, qh->
ferr, 6031,
"qhull internal error (qh_clock): times() failed. Use qh_CLOCKtype 1 in user.h\n");
250 ticks= time.tms_utime * ratio;
253 qh_fprintf(qh, qh->
ferr, 6032,
"qhull internal error (qh_clock): use qh_CLOCKtype 2 in user.h\n");
270 trace5((qh, qh->
ferr, 5001,
"qh_freebuffers: freeing up global memory buffers\n"));
307 trace5((qh, qh->
ferr, 5002,
"qh_freebuffers: finished\n"));
338 trace1((qh, qh->
ferr, 1005,
"qh_freebuild: free memory from qh_inithull and qh_buildhull\n"));
434 trace1((qh, qh->
ferr, 1006,
"qh_freeqhull: free global memory\n"));
460 void qh_init_A(
qhT *
qh, FILE *infile, FILE *outfile, FILE *errfile,
int argc,
char *argv[]) {
522 for (k=0; k < lastk; k++) {
523 qh->
gm_row[k][lastk]= 0.0;
524 qh->
gm_row[lastk][k]= 0.0;
526 qh->
gm_row[lastk][lastk]= 1.0;
552 qh_fprintf(qh, qh->
ferr, 6033,
"qhull input error: more than %d characters in command line.\n",
589 int k, i, lastproject;
590 char *s= command, *
t, *prev_s, *start, key;
595 qh_fprintf(qh, qh->
ferr, 6245,
"qhull initflags error: qh.NOerrexit was not cleared before calling qh_initflags(). It should be cleared after setjmp(). Exit qhull.");
603 while (*s && !isspace(*s))
607 while (*s && isspace(*s))
628 qh_option(qh,
"mathematica", NULL, NULL);
653 if (!isdigit(*s) && *s !=
'.' && *s !=
'-')
654 qh_fprintf(qh, qh->
ferr, 7002,
"qhull warning: no maximum cosine angle given for option 'An'. Ignored.\n");
669 if (!isdigit(*s) && *s !=
'.' && *s !=
'-')
670 qh_fprintf(qh, qh->
ferr, 7003,
"qhull warning: no centrum radius given for option 'Cn'. Ignored.\n");
686 qh_fprintf(qh, qh->
ferr, 7004,
"qhull warning: negative maximum roundoff given for option 'An'. Ignored.\n");
687 else if (!isdigit(*s))
688 qh_fprintf(qh, qh->
ferr, 7005,
"qhull warning: no maximum roundoff given for option 'En'. Ignored.\n");
700 if (*t && !isspace(*t)) {
704 qh_fprintf(qh, qh->
ferr, 7006,
"qhull warning: origin for Halfspace intersection should be 'Hn,n,n,...'\n");
710 if (!(qh->
feasible_string= (
char*)calloc((
size_t)(t-start+1), (
size_t)1))) {
711 qh_fprintf(qh, qh->
ferr, 6034,
"qhull error: insufficient memory for 'Hn,n,n'\n");
715 qh_option(qh,
"Halfspace-about", NULL, NULL);
722 qh_fprintf(qh, qh->
ferr, 7007,
"qhull warning: missing random perturbation for option 'Rn'. Ignored\n");
730 if (!isdigit(*s) && *s !=
'-')
731 qh_fprintf(qh, qh->
ferr, 7008,
"qhull warning: missing visible distance for option 'Vn'. Ignored\n");
738 if (!isdigit(*s) && *s !=
'-')
739 qh_fprintf(qh, qh->
ferr, 7009,
"qhull warning: missing coplanar distance for option 'Un'. Ignored\n");
747 qh_fprintf(qh, qh->
ferr, 7010,
"qhull warning: negative outside width for option 'Wn'. Ignored.\n");
748 else if (!isdigit(*s))
749 qh_fprintf(qh, qh->
ferr, 7011,
"qhull warning: missing outside width for option 'Wn'. Ignored\n");
758 while (*s && !isspace(*s)) {
766 qh_option(qh,
"FArea-total", NULL, NULL);
786 qh_option(qh,
"FFacets-xridge", NULL, NULL);
810 qh_option(qh,
"FNeighbors-vertex", NULL, NULL);
825 qh_option(qh,
"Fpoint-intersect", NULL, NULL);
829 qh_option(qh,
"FPoint-nearest", NULL, NULL);
854 qh_option(qh,
"FVertex-average", NULL, NULL);
863 qh_fprintf(qh, qh->
ferr, 7012,
"qhull warning: unknown 'F' output option %c, rest ignored\n", (
int)s[0]);
864 while (*++s && !isspace(*s));
872 while (*s && !isspace(*s)) {
875 qh_option(qh,
"Gall-points", NULL, NULL);
883 qh_option(qh,
"Gintersections", NULL, NULL);
907 qh_option(qh,
"Gtransparent", NULL, NULL);
916 qh_fprintf(qh, qh->
ferr, 6035,
"qhull input error: missing dimension for option 'GDn'\n");
919 qh_fprintf(qh, qh->
ferr, 7013,
"qhull warning: can only drop one dimension. Previous 'GD%d' ignored\n",
927 qh_fprintf(qh, qh->
ferr, 7014,
"qhull warning: unknown 'G' print option %c, rest ignored\n", (
int)s[0]);
928 while (*++s && !isspace(*s));
934 while (*s && !isspace(*s)) {
945 qh_option(qh,
"Pdrop-facets-dim-less", &i, &r);
947 qh_option(qh,
"PDrop-facets-dim-more", &i, &r);
950 qh_option(qh,
"Pgood-facets", NULL, NULL);
954 qh_option(qh,
"PGood-facet-neighbors", NULL, NULL);
958 qh_option(qh,
"Poutput-forced", NULL, NULL);
962 qh_option(qh,
"Pprecision-ignore", NULL, NULL);
967 qh_fprintf(qh, qh->
ferr, 6036,
"qhull input error: missing facet count for keep area option 'PAn'\n");
976 qh_fprintf(qh, qh->
ferr, 6037,
"qhull input error: missing facet area for option 'PFn'\n");
985 qh_fprintf(qh, qh->
ferr, 6038,
"qhull input error: missing merge count for option 'PMn'\n");
993 qh_fprintf(qh, qh->
ferr, 7015,
"qhull warning: unknown 'P' print option %c, rest ignored\n", (
int)s[0]);
994 while (*++s && !isspace(*s));
1001 while (*s && !isspace(*s)) {
1005 if (key ==
'b' && *s ==
'B') {
1009 qh_option(qh,
"QbBound-unit-box", NULL, &r);
1012 if (key ==
'b' && *s ==
'b') {
1015 qh_option(qh,
"Qbbound-last", NULL, NULL);
1025 while (*t && !isspace(*t)) {
1026 if (toupper(*t++) ==
'B' 1031 trace2((qh, qh->
ferr, 2004,
"qh_initflags: project dimension %d\n", k));
1032 qh_option(qh,
"Qb-project-dim", &k, NULL);
1041 if (lastproject == k && r == 0.0)
1043 else if (key ==
'b') {
1047 qh_option(qh,
"Qbound-dim-low", &k, &r);
1052 qh_option(qh,
"QBound-dim-high", &k, &r);
1057 qh_option(qh,
"Qcoplanar-keep", NULL, NULL);
1061 qh_option(qh,
"Qfurthest-outside", NULL, NULL);
1065 qh_option(qh,
"Qgood-facets-only", NULL, NULL);
1069 qh_option(qh,
"Qinterior-keep", NULL, NULL);
1073 qh_option(qh,
"Qmax-outside-only", NULL, NULL);
1077 qh_option(qh,
"Qrandom-outside", NULL, NULL);
1081 qh_option(qh,
"Qsearch-initial-simplex", NULL, NULL);
1085 qh_option(qh,
"Qtriangulate", NULL, NULL);
1089 qh_option(qh,
"QTestPoints", NULL, NULL);
1091 qh_fprintf(qh, qh->
ferr, 6039,
"qhull input error: missing number of test points for option 'QTn'\n");
1098 qh_option(qh,
"QupperDelaunay", NULL, NULL);
1102 qh_option(qh,
"Qvertex-neighbors-convex", NULL, NULL);
1106 qh_option(qh,
"Qxact-merge", NULL, NULL);
1110 qh_option(qh,
"Qz-infinity-point", NULL, NULL);
1114 qh_option(qh,
"Q0-no-premerge", NULL, NULL);
1119 qh_option(qh,
"Q1-no-angle-sort", NULL, NULL);
1125 qh_option(qh,
"Q10-no-narrow", NULL, NULL);
1129 qh_option(qh,
"Q11-trinormals Qtriangulate", NULL, NULL);
1134 qh_option(qh,
"Q12-no-wide-dup", NULL, NULL);
1139 qh_fprintf(qh, qh->
ferr, 7016,
"qhull warning: unknown 'Q' qhull option 1%c, rest ignored\n", (
int)s[0]);
1140 while (*++s && !isspace(*s));
1145 qh_option(qh,
"Q2-no-merge-independent", NULL, NULL);
1147 goto LABELcheckdigit;
1150 qh_option(qh,
"Q3-no-merge-vertices", NULL, NULL);
1154 qh_fprintf(qh, qh->
ferr, 7017,
"qhull warning: can not follow '1', '2', or '3' with a digit. '%c' skipped.\n",
1158 qh_option(qh,
"Q4-avoid-old-into-new", NULL, NULL);
1162 qh_option(qh,
"Q5-no-check-outer", NULL, NULL);
1166 qh_option(qh,
"Q6-no-concave-merge", NULL, NULL);
1170 qh_option(qh,
"Q7-no-breadth-first", NULL, NULL);
1174 qh_option(qh,
"Q8-no-near-inside", NULL, NULL);
1178 qh_option(qh,
"Q9-pick-furthest", NULL, NULL);
1184 qh_fprintf(qh, qh->
ferr, 7018,
"qhull warning: good point already defined for option 'QGn'. Ignored\n");
1186 qh_fprintf(qh, qh->
ferr, 7019,
"qhull warning: missing good point id for option 'QGn'. Ignored\n");
1187 else if (i < 0 || *s ==
'-') {
1189 qh_option(qh,
"QGood-if-dont-see-point", &i, NULL);
1192 qh_option(qh,
"QGood-if-see-point", &i, NULL);
1197 if (!isdigit(*s) && *s !=
'-')
1205 if (!isdigit(*s) && *s !=
'-')
1206 qh_fprintf(qh, qh->
ferr, 7020,
"qhull warning: missing random seed for option 'QRn'. Ignored\n");
1212 qh_option(qh,
"QRandom-seed", &i, NULL );
1218 qh_fprintf(qh, qh->
ferr, 7021,
"qhull warning: good vertex already defined for option 'QVn'. Ignored\n");
1220 qh_fprintf(qh, qh->
ferr, 7022,
"qhull warning: no good point id given for option 'QVn'. Ignored\n");
1223 qh_option(qh,
"QV-good-facets-not-point", &i, NULL);
1225 qh_option(qh,
"QV-good-facets-point", &i, NULL);
1232 qh_fprintf(qh, qh->
ferr, 7023,
"qhull warning: unknown 'Q' qhull option %c, rest ignored\n", (
int)s[0]);
1233 while (*++s && !isspace(*s));
1239 while (*s && !isspace(*s)) {
1240 if (isdigit(*s) || *s ==
'-')
1242 else switch (*s++) {
1244 qh_option(qh,
"Tannotate-output", NULL, NULL);
1248 qh_option(qh,
"Tcheck-frequently", NULL, NULL);
1252 qh_option(qh,
"Tstatistics", NULL, NULL);
1264 }
else if (!qh->
fout)
1265 qh_fprintf(qh, qh->
ferr, 7024,
"qhull warning: output file undefined(stdout). Option 'Tz' ignored.\n");
1275 qh_fprintf(qh, qh->
ferr, 7025,
"qhull warning: missing point id for cone for trace option 'TCn'. Ignored\n");
1284 qh_fprintf(qh, qh->
ferr, 7026,
"qhull warning: missing frequency count for trace option 'TFn'. Ignored\n");
1293 qh_fprintf(qh, qh->
ferr, 7027,
"qhull warning: missing space between 'TI' and filename, %s\n", s);
1302 if (!freopen(filename,
"r", stdin)) {
1303 qh_fprintf(qh, qh->
ferr, 6041,
"qhull error: could not open file \"%s\".", filename);
1306 qh_option(qh,
"TInput-file", NULL, NULL);
1313 qh_fprintf(qh, qh->
ferr, 7028,
"qhull warning: missing space between 'TO' and filename, %s\n", s);
1323 qh_fprintf(qh, qh->
ferr, 6266,
"qhull input warning: qh.fout was not set by caller. Cannot use option 'TO' to redirect output. Ignoring option 'TO'\n");
1324 }
else if (!freopen(filename,
"w", qh->
fout)) {
1325 qh_fprintf(qh, qh->
ferr, 6044,
"qhull error: could not open file \"%s\".", filename);
1328 qh_option(qh,
"TOutput-file", NULL, NULL);
1335 qh_fprintf(qh, qh->
ferr, 7029,
"qhull warning: missing point id for trace option 'TPn'. Ignored\n");
1343 qh_fprintf(qh, qh->
ferr, 7030,
"qhull warning: missing merge id for trace option 'TMn'. Ignored\n");
1351 qh_fprintf(qh, qh->
ferr, 7031,
"qhull warning: missing rerun count for trace option 'TRn'. Ignored\n");
1360 qh_fprintf(qh, qh->
ferr, 7032,
"qhull warning: missing furthest point id for trace option 'TVn'. Ignored\n");
1363 qh_option(qh,
"TV-stop-before-point", &i, NULL);
1366 qh_option(qh,
"TV-stop-after-point", &i, NULL);
1372 qh_fprintf(qh, qh->
ferr, 7033,
"qhull warning: missing max width for trace option 'TWn'. Ignored\n");
1380 qh_fprintf(qh, qh->
ferr, 7034,
"qhull warning: unknown 'T' trace option %c, rest ignored\n", (
int)s[0]);
1381 while (*++s && !isspace(*s));
1387 qh_fprintf(qh, qh->
ferr, 7035,
"qhull warning: unknown flag %c(%x)\n", (
int)s[-1],
1391 if (s-1 == prev_s && *s && !isspace(*s)) {
1392 qh_fprintf(qh, qh->
ferr, 7036,
"qhull warning: missing space after flag %c(%x); reserved for menu. Skipped.\n",
1393 (
int)*prev_s, (
int)*prev_s);
1394 while (*s && !isspace(*s))
1399 qh_fprintf(qh, qh->
ferr, 7078,
"qhull warning: 'TCn' (stopCone) ignored when used with 'QJn' (joggle)\n");
1401 qh_fprintf(qh, qh->
ferr, 7037,
"qhull warning: additional output formats are not compatible with Geomview\n");
1470 int seed, pointsneeded, extra= 0, i, randi, k;
1486 qh_option(qh,
"_pre-merge", NULL, NULL);
1489 qh_option(qh,
"Qxact_merge", NULL, NULL);
1499 qh_fprintf(qh, qh->
ferr, 7038,
"qhull warning: joggle('QJ') always produces simplicial output. Triangulated output('Qt') does nothing.\n");
1502 qh_option(qh,
"Qbbound-last-qj", NULL, NULL);
1508 qh_option(qh,
"_zero-centrum", NULL, NULL);
1511 qh_fprintf(qh, qh->
ferr, 7039,
"qhull warning: real epsilon, %2.2g, is probably too large for joggle('QJn')\nRecompile with double precision reals(see user.h).\n",
1515 qh_fprintf(qh, qh->
ferr, 6045,
"qhull input error: merging not installed(qh_NOmerge + 'Qx', 'Cn' or 'An')\n");
1521 qh_option(qh,
"Qinterior-keep", NULL, NULL);
1524 qh_fprintf(qh, qh->
ferr, 6046,
"qhull input error: can not use Delaunay('d') or Voronoi('v') with halfspace intersection('H')\n");
1528 qh_fprintf(qh, qh->
ferr, 6047,
"qhull input error: use upper-Delaunay('Qu') or infinity-point('Qz') with Delaunay('d') or Voronoi('v')\n");
1532 qh_fprintf(qh, qh->
ferr, 6048,
"qhull input error: can not use infinity-point('Qz') with upper-Delaunay('Qu')\n");
1536 qh_fprintf(qh, qh->
ferr, 7040,
"qhull input warning: option 'Qbb' (scale-last-coordinate) is normally used with 'd' or 'v'\n");
1545 qh_fprintf(qh, qh->
ferr, 6049,
"qhull input error: test vertex neighbors('Qv') needs a merge option\n");
1560 for (k=2, factorial=1.0; k < qh->
hull_dim; k++)
1563 trace2((qh, qh->
ferr, 2005,
"qh_initqhull_globals: initialize globals. dim %d numpoints %d malloc? %d projected %d to hull_dim %d\n",
1570 qh_option(qh,
"Q3-no-merge-vertices-dim-high", NULL, NULL);
1576 qh_fprintf(qh, qh->
ferr, 6051,
"qhull input error: tracing is not installed(qh_NOtrace in user.h)");
1580 if (qh->
RERUN > 1) {
1589 seed= (int)time(&timedata);
1592 qh_option(qh,
"QRandom-seed", &seed, NULL );
1594 qh_option(qh,
"QRotate-random", &seed, NULL);
1598 if (seed == INT_MIN)
1604 for (i=1000; i--; ) {
1609 qhull configuration error (qh_RANDOMmax in user.h):\n\ 1610 random integer %d > qh_RANDOMmax(qh, %.8g)\n",
1620 qhull configuration warning (qh_RANDOMmax in user.h):\n\ 1621 average of 1000 random integers (%.2g) is much different than expected (%.2g).\n\ 1622 Is qh_RANDOMmax (%.2g) wrong?\n",
1627 qh_fprintf(qh, qh->
ferr, 6052,
"qhull internal error (qh_initqhull_globals): qh_HASHfactor %d must be at least 1.1. Qhull uses linear hash probing\n",
1631 if (numpoints+extra < pointsneeded) {
1632 qh_fprintf(qh, qh->
ferr, 6214,
"qhull input error: not enough points(%d) to construct initial simplex (need %d)\n",
1633 numpoints, pointsneeded);
1709 qh_fprintf(qh, qh->
ferr, 6215,
"qhull input error: transparent Delaunay('Gt') needs 3-d Delaunay('d') w/o 'GDn'\n");
1721 printcoplanar=
True;
1723 printcoplanar=
True;
1725 qh_fprintf(qh, qh->
ferr, 6053,
"qhull input error: option 'Fp' is only used for \nhalfspace intersection('Hn,n,n').\n");
1728 qh_fprintf(qh, qh->
ferr, 6054,
"qhull input error: option 'Ft' is not available for Voronoi vertices or halfspace intersection\n");
1731 qh_fprintf(qh, qh->
ferr, 6055,
"qhull input error: option 'FC' is not available for Voronoi vertices('v')\n");
1742 qh_fprintf(qh, qh->
ferr, 7041,
"qhull input warning: 'QJ' (joggle) will usually prevent coincident input sites for options 'Fc' and 'FP'\n");
1745 qh_fprintf(qh, qh->
ferr, 6056,
"qhull input error: Mathematica and Maple output is only available for 2-d and 3-d convex hulls and 2-d Delaunay triangulations\n");
1750 qh_fprintf(qh, qh->
ferr, 6057,
"qhull input error: Geomview output is only available for 2-d, 3-d and 4-d\n");
1755 qh_fprintf(qh, qh->
ferr, 6058,
"qhull input error: no output specified for Geomview\n");
1759 qh_fprintf(qh, qh->
ferr, 6059,
"qhull input error: Geomview output for Voronoi diagrams only for 2-d\n");
1765 qh_fprintf(qh, qh->
ferr, 7042,
"qhull input warning: coplanars, vertices, and centrums output not\n\ 1766 available for 4-d output(ignored). Could use 'GDn' instead.\n");
1773 qh_fprintf(qh, qh->
ferr, 7072,
"qhull output warning: ignoring coplanar points, option 'Qc' was not set for the first run of qhull.\n");
1784 if (!printgeom || qh->
hull_dim < 3)
1785 qh_fprintf(qh, qh->
ferr, 7043,
"qhull input warning: drop dimension 'GD%d' is only available for 3-d/4-d Geomview\n", qh->
DROPdim);
1826 qh->NOerrexit=
True;
1827 qh->ANGLEmerge=
True;
1839 qh->max_outside= 0.0;
1840 qh->max_vertex= 0.0;
1841 qh->MAXabs_coord= 0.0;
1842 qh->MAXsumcoord= 0.0;
1844 qh->MERGEindependent=
True;
1846 qh->MINoutside= 0.0;
1850 qh->premerge_centrum= 0.0;
1852 qh->PRINTprecision=
True;
1853 qh->PRINTradius= 0.0;
1855 qh->postmerge_centrum= 0.0;
1856 qh->ROTATErandom= INT_MIN;
1857 qh->MERGEvertices=
True;
1862 qh->tracefacet_id= UINT_MAX;
1863 qh->tracevertex_id= UINT_MAX;
1864 seed= (int)time(&timedata);
1869 qh_option(qh,
"run-id", &qh->run_id, NULL);
1870 strcat(qh->qhull,
"qhull");
1907 while (*s && !isspace(key= *s++)) {
1908 if (key ==
'd' || key ==
'D') {
1910 qh_fprintf(qh, qh->
ferr, 7044,
"qhull warning: no dimension given for Print option '%c' at: %s. Ignored\n",
1916 qh_fprintf(qh, qh->
ferr, 7045,
"qhull warning: dimension %d for Print option '%c' is >= %d. Ignored\n",
1923 if (fabs((
double)value) > 1.0) {
1924 qh_fprintf(qh, qh->
ferr, 7046,
"qhull warning: value %2.4g for Print option %c is > +1 or < -1. Ignored\n",
1936 }
else if (*s ==
'Q') {
1938 while (*s && !isspace(key= *s++)) {
1939 if (key ==
'b' && *s ==
'B') {
1941 for (k=maxdim; k--; ) {
1945 }
else if (key ==
'b' && *s ==
'b')
1947 else if (key ==
'b' || key ==
'B') {
1949 qh_fprintf(qh, qh->
ferr, 7047,
"qhull warning: no dimension given for Qhull option %c. Ignored\n",
1954 if (idx >= maxdim) {
1955 qh_fprintf(qh, qh->
ferr, 7048,
"qhull warning: dimension %d for Qhull option %c is >= %d. Ignored\n",
1962 }
else if (key ==
'b')
1973 while (*s && !isspace(*s))
2001 void qh_lib_check(
int qhullLibraryType,
int qhTsize,
int vertexTsize,
int ridgeTsize,
int facetTsize,
int setTsize,
int qhmemTsize) {
2004 #if defined(_MSC_VER) && defined(_DEBUG) && defined(QHULL_CRTDBG) 2006 _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_DELAY_FREE_MEM_DF | _CRTDBG_LEAK_CHECK_DF | _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) );
2007 _CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG );
2008 _CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDERR );
2009 _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG );
2010 _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDERR );
2011 _CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG );
2012 _CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDERR );
2016 qh_fprintf_stderr(6257,
"qh_lib_check: Incorrect qhull library called. Caller uses non-reentrant Qhull with a static qhT. Library is reentrant.\n");
2019 qh_fprintf_stderr(6258,
"qh_lib_check: Incorrect qhull library called. Caller uses non-reentrant Qhull with a dynamic qhT via qh_QHpointer. Library is reentrant.\n");
2022 qh_fprintf_stderr(6262,
"qh_lib_check: Expecting qhullLibraryType QHULL_NON_REENTRANT(0), QHULL_QH_POINTER(1), or QHULL_REENTRANT(2). Got %d\n", qhullLibraryType);
2025 if (qhTsize !=
sizeof(
qhT)) {
2026 qh_fprintf_stderr(6249,
"qh_lib_check: Incorrect qhull library called. Size of qhT for caller is %d, but for library is %d.\n", qhTsize,
sizeof(
qhT));
2029 if (vertexTsize !=
sizeof(
vertexT)) {
2030 qh_fprintf_stderr(6250,
"qh_lib_check: Incorrect qhull library called. Size of vertexT for caller is %d, but for library is %d.\n", vertexTsize,
sizeof(
vertexT));
2033 if (ridgeTsize !=
sizeof(
ridgeT)) {
2034 qh_fprintf_stderr(6251,
"qh_lib_check: Incorrect qhull library called. Size of ridgeT for caller is %d, but for library is %d.\n", ridgeTsize,
sizeof(
ridgeT));
2037 if (facetTsize !=
sizeof(
facetT)) {
2038 qh_fprintf_stderr(6252,
"qh_lib_check: Incorrect qhull library called. Size of facetT for caller is %d, but for library is %d.\n", facetTsize,
sizeof(
facetT));
2041 if (setTsize && setTsize !=
sizeof(
setT)) {
2042 qh_fprintf_stderr(6253,
"qh_lib_check: Incorrect qhull library called. Size of setT for caller is %d, but for library is %d.\n", setTsize,
sizeof(
setT));
2045 if (qhmemTsize && qhmemTsize !=
sizeof(
qhmemT)) {
2046 qh_fprintf_stderr(6254,
"qh_lib_check: Incorrect qhull library called. Size of qhmemT for caller is %d, but for library is %d.\n", qhmemTsize,
sizeof(
qhmemT));
2070 sprintf(buf,
" %s", option);
2072 sprintf(buf+strlen(buf),
" %d", *i);
2074 sprintf(buf+strlen(buf),
" %2.2g", *r);
2075 len= (int)strlen(buf);
2096 memset((
char *)qh, 0,
sizeof(
qhT));
2097 qh->NOerrexit=
True;
void qh_settempfree_all(void)
void qh_initqhull_start(qhT *qh, FILE *infile, FILE *outfile, FILE *errfile)
void seed(unsigned int seed_value)
double qh_strtod(const char *s, char **endp)
void qh_fprintf_stderr(int msgcode, const char *fmt,...)
void qh_lib_check(int qhullLibraryType, int qhTsize, int vertexTsize, int ridgeTsize, int facetTsize, int setTsize, int qhmemTsize)
void qh_settruncate(setT *set, int size)
#define otherfacet_(ridge, facet)
qh_PRINT PRINTout[qh_PRINTEND]
void qh_initqhull_outputflags(qhT *qh)
char * qh_skipfilename(char *filename)
boolT qh_gram_schmidt(int dim, realT **rows)
void qh_fprintf(FILE *fp, int msgcode, const char *fmt,...)
void qh_copyfilename(char *filename, int size, const char *source, int length)
void qh_init_qhull_command(qhT *qh, int argc, char *argv[])
int qh_strtol(const char *s, char **endp)
void qh_delvertex(vertexT *vertex)
void qh_user_memsizes(void)
void qh_delfacet(facetT *facet)
void qh_zero(qhT *qh, FILE *errfile)
void qh_initqhull_globals(qhT *qh, coordT *points, int numpoints, int dim, boolT ismalloc)
void qh_meminitbuffers(int tracelevel, int alignment, int numsizes, int bufsize, int bufinit)
void qh_init_B(qhT *qh, coordT *points, int numpoints, int dim, boolT ismalloc)
void qh_initqhull_start2(qhT *qh, FILE *infile, FILE *outfile, FILE *errfile)
#define FOREACHridge_(ridges)
void qh_freebuild(qhT *qh, boolT allmem)
#define maximize_(maxval, val)
void qh_initthresholds(qhT *qh, char *command)
void qh_memsize(int size)
void qh_exit(int exitcode)
unsigned long qh_clock(qhT *qh)
void qh_option(qhT *qh, const char *option, int *i, realT *r)
void qh_setfree(setT **setp)
#define FOREACHmerge_(merges)
void qh_initstatistics(void)
void qh_randommatrix(realT *buffer, int dim, realT **row)
void qh_init_A(qhT *qh, FILE *infile, FILE *outfile, FILE *errfile, int argc, char *argv[])
void qh_checkflags(qhT *qh, char *command, char *hiddenflags)
#define qh_DIMmergeVertex
int qh_argv_to_command(int argc, char *argv[], char *command, int max_size)
void qh_projectinput(void)
void qh_freeqhull(qhT *qh, boolT allmem)
void qh_memfree(void *object, int insize)
void qh_freebuffers(qhT *qh)
void qh_initqhull_buffers(qhT *qh)
void qh_errexit(int exitcode, facetT *facet, ridgeT *ridge)
void qh_appendprint(qhT *qh, qh_PRINT format)
void qh_rotateinput(realT **rows)
void qh_initflags(qhT *qh, char *command)
void qh_setfreelong(setT **setp)
void qh_clear_outputflags(qhT *qh)
void qh_meminit(FILE *ferr)
void * qh_memalloc(int insize)
setT * qh_setnew(int setsize)
#define qh_RANDOMseed_(seed)
#define QHULL_NON_REENTRANT
void qh_initqhull_mem(qhT *qh)