Go to the documentation of this file.
   43 const char qh_version2[]= 
"qhull_r 7.2.0 (2015.2.r 2016/01/18)";
 
   57     if (!
qh->PRINTout[i]) {
 
   58       qh->PRINTout[i]= format;
 
   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);
 
  168   qh->GOODpointp= NULL;
 
  171   qh->GOODvertexp= NULL;
 
  196   for (k=
qh->input_dim+1; k--; ) {  
 
  207   if (!
qh->qhull_commandsiz2)
 
  208       qh->qhull_commandsiz2= (int)strlen(
qh->qhull_command); 
 
  210       qh->qhull_command[
qh->qhull_commandsiz2]= 
'\0';
 
  212   if (!
qh->qhull_optionsiz2)
 
  213     qh->qhull_optionsiz2= (int)strlen(
qh->qhull_options);  
 
  215     qh->qhull_options[
qh->qhull_optionsiz2]= 
'\0';
 
  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"));
 
  279   qh->NEARzero= 
qh->lower_threshold= 
qh->upper_threshold= NULL;
 
  280   qh->lower_bound= 
qh->upper_bound= NULL;
 
  292   if (
qh->feasible_point)      
 
  294   if (
qh->feasible_string)     
 
  296   qh->line= 
qh->feasible_string= NULL;
 
  297   qh->half_space= 
qh->feasible_point= 
qh->temp_malloc= NULL;
 
  299   if (
qh->first_point && 
qh->POINTSmalloc) {
 
  301     qh->first_point= NULL;
 
  303   if (
qh->input_points && 
qh->input_malloc) { 
 
  305     qh->input_points= NULL;
 
  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"));
 
  339   if (
qh->del_vertices)
 
  342     while ((vertex= 
qh->vertex_list)) {
 
  347         qh->newvertex_list= 
qh->vertex_list= NULL;
 
  350   }
else if (
qh->VERTEXneighbors) {
 
  355   qh->GOODclosest= NULL;
 
  369     while ((facet= 
qh->facet_list)) {
 
  386         qh->visible_list= 
qh->newfacet_list= 
qh->facet_list= NULL;
 
  402   qh->interior_point= NULL;
 
  405   qh->facet_mergeset= NULL;  
 
  406   qh->degen_mergeset= NULL;  
 
  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[]) {
 
  509   if (
qh->qhmem.LASTsize == 0)
 
  514   if (
qh->PROJECTinput || (
qh->DELAUNAY && 
qh->PROJECTdelaunay))
 
  518   if (
qh->ROTATErandom >= 0) {
 
  521       int k, lastk= 
qh->hull_dim-1;
 
  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",
 
  553           (
int)
sizeof(
qh->qhull_command));
 
  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.");
 
  598   if (command <= &qh->qhull_command[0] || command > &
qh->qhull_command[0] + 
sizeof(
qh->qhull_command)) {
 
  599     if (command != &
qh->qhull_command[0]) {
 
  600       *
qh->qhull_command= 
'\0';
 
  601       strncat(
qh->qhull_command, command, 
sizeof(
qh->qhull_command)-strlen(
qh->qhull_command)-1);
 
  603     while (*s && !isspace(*s))  
 
  607     while (*s && isspace(*s))
 
  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");
 
  674           qh_option(
qh, 
"Centrum-premerge-", NULL, &
qh->premerge_centrum);
 
  678           qh_option(
qh, 
"Centrum-postmerge", NULL, &
qh->postmerge_centrum);
 
  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");
 
  714         strncpy(
qh->feasible_string, start, (
size_t)(
t-start));
 
  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)) {
 
  818           if (
qh->PRINToptions1st) {
 
  822             qh->PRINToptions1st= 
True;
 
  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)) {
 
  884           qh->DOintersections= 
True;
 
  908           qh->PRINTtransparent= 
True;
 
  916             qh_fprintf(
qh, 
qh->ferr, 6035, 
"qhull input error: missing dimension for option 'GDn'\n");
 
  918             if (
qh->DROPdim >= 0)
 
  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)) {
 
  954           qh_option(
qh, 
"PGood-facet-neighbors", 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') {
 
 1012           if (key == 
'b' && *s == 
'b') {
 
 1025               while (*
t && !isspace(*
t)) {
 
 1026                 if (toupper(*
t++) == 
'B' 
 1031                   trace2((
qh, 
qh->ferr, 2004, 
"qh_initflags: project dimension %d\n", k));
 
 1041             if (lastproject == k && 
r == 0.0)
 
 1043             else if (key == 
'b') {
 
 1081           qh_option(
qh, 
"Qsearch-initial-simplex", NULL, NULL);
 
 1091             qh_fprintf(
qh, 
qh->ferr, 6039, 
"qhull input error: missing number of test points for option 'QTn'\n");
 
 1102           qh_option(
qh, 
"Qvertex-neighbors-convex", NULL, NULL);
 
 1103           qh->TESTvneighbors= 
True;
 
 1129             qh_option(
qh, 
"Q11-trinormals Qtriangulate", 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);
 
 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);
 
 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");
 
 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");
 
 1222             qh->GOODvertex= i - 1;
 
 1223             qh_option(
qh, 
"QV-good-facets-not-point", &i, NULL);
 
 1226             qh->GOODvertex= i + 1;
 
 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++) {
 
 1245           qh->ANNOTATEoutput= 
True;
 
 1249           qh->CHECKfrequently= 
True;
 
 1253           qh->PRINTstatistics= 
True;
 
 1264           }
else if (!
qh->fout)
 
 1265             qh_fprintf(
qh, 
qh->ferr, 7024, 
"qhull warning: output file undefined(stdout).  Option 'Tz' ignored.\n");
 
 1270             qh->qhmem.ferr= 
qh->fout;
 
 1275             qh_fprintf(
qh, 
qh->ferr, 7025, 
"qhull warning: missing point id for cone for trace option 'TCn'.  Ignored\n");
 
 1279             qh->STOPcone= i + 1;
 
 1284             qh_fprintf(
qh, 
qh->ferr, 7026, 
"qhull warning: missing frequency count for trace option 'TFn'.  Ignored\n");
 
 1288             qh->REPORTfreq2= 
qh->REPORTfreq/2;  
 
 1293             qh_fprintf(
qh, 
qh->ferr, 7027, 
"qhull warning: missing space between 'TI' and filename, %s\n", s);
 
 1302             if (!freopen(
filename, 
"r", stdin)) {
 
 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)) {
 
 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");
 
 1362             qh->STOPpoint= i - 1;
 
 1365             qh->STOPpoint= i + 1;
 
 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");
 
 1400   if (isgeom && !
qh->FORCEoutput && 
qh->PRINTout[1])
 
 1401     qh_fprintf(
qh, 
qh->ferr, 7037, 
"qhull warning: additional output formats are not compatible with Geomview\n");
 
 1419   if (
qh->TEMPsize <= 0 || 
qh->TEMPsize > 
qh->qhmem.LASTsize)
 
 1429   for (k=
qh->input_dim+1; k--; ) {  
 
 1470   int seed, pointsneeded, extra= 0, i, randi, k;
 
 1476   trace0((
qh, 
qh->ferr, 13, 
"qh_initqhull_globals: for %s | %s\n", 
qh->rbox_command,
 
 1477       qh->qhull_command));
 
 1478   qh->POINTSmalloc= ismalloc;
 
 1479   qh->first_point= points;
 
 1480   qh->num_points= numpoints;
 
 1481   qh->hull_dim= 
qh->input_dim= 
dim;
 
 1482   if (!
qh->NOpremerge && !
qh->MERGEexact && !
qh->PREmerge && 
qh->JOGGLEmax > 
REALmax/2) {
 
 1484     if (
qh->hull_dim <= 4) {
 
 1491   }
else if (
qh->MERGEexact)
 
 1493   if (!
qh->NOpremerge && 
qh->JOGGLEmax > 
REALmax/2) {
 
 1498   if (
qh->TRIangulate && 
qh->JOGGLEmax < 
REALmax/2 && 
qh->PRINTprecision)
 
 1499     qh_fprintf(
qh, 
qh->ferr, 7038, 
"qhull warning: joggle('QJ') always produces simplicial output.  Triangulated output('Qt') does nothing.\n");
 
 1500   if (
qh->JOGGLEmax < 
REALmax/2 && 
qh->DELAUNAY && !
qh->SCALEinput && !
qh->SCALElast) {
 
 1504   if (
qh->MERGING && !
qh->POSTmerge && 
qh->premerge_cos > 
REALmax/2
 
 1505   && 
qh->premerge_centrum == 0) {
 
 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");
 
 1519   if (
qh->DELAUNAY && 
qh->KEEPcoplanar && !
qh->KEEPinside) {
 
 1523   if (
qh->DELAUNAY && 
qh->HALFspace) {
 
 1524     qh_fprintf(
qh, 
qh->ferr, 6046, 
"qhull input error: can not use Delaunay('d') or Voronoi('v') with halfspace intersection('H')\n");
 
 1527   if (!
qh->DELAUNAY && (
qh->UPPERdelaunay || 
qh->ATinfinity)) {
 
 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");
 
 1531   if (
qh->UPPERdelaunay && 
qh->ATinfinity) {
 
 1532     qh_fprintf(
qh, 
qh->ferr, 6048, 
"qhull input error: can not use infinity-point('Qz') with upper-Delaunay('Qu')\n");
 
 1535   if (
qh->SCALElast && !
qh->DELAUNAY && 
qh->PRINTprecision)
 
 1536     qh_fprintf(
qh, 
qh->ferr, 7040, 
"qhull input warning: option 'Qbb' (scale-last-coordinate) is normally used with 'd' or 'v'\n");
 
 1537   qh->DOcheckmax= (!
qh->SKIPcheckmax && 
qh->MERGING );
 
 1538   qh->KEEPnearinside= (
qh->DOcheckmax && !(
qh->KEEPinside && 
qh->KEEPcoplanar)
 
 1539                           && !
qh->NOnearinside);
 
 1542   else if (
qh->VORONOI)
 
 1544   if (
qh->TESTvneighbors && !
qh->MERGING) {
 
 1545     qh_fprintf(
qh, 
qh->ferr, 6049, 
"qhull input error: test vertex neighbors('Qv') needs a merge option\n");
 
 1548   if (
qh->PROJECTinput || (
qh->DELAUNAY && 
qh->PROJECTdelaunay)) {
 
 1549     qh->hull_dim -= 
qh->PROJECTinput;
 
 1556   if (
qh->hull_dim <= 1) {
 
 1557     qh_fprintf(
qh, 
qh->ferr, 6050, 
"qhull error: dimension %d must be > 1\n", 
qh->hull_dim);
 
 1560   for (k=2, factorial=1.0; k < 
qh->hull_dim; k++)
 
 1562   qh->AREAfactor= 1.0 / factorial;
 
 1563   trace2((
qh, 
qh->ferr, 2005, 
"qh_initqhull_globals: initialize globals.  dim %d numpoints %d malloc? %d projected %d to hull_dim %d\n",
 
 1564         dim, numpoints, ismalloc, 
qh->PROJECTinput, 
qh->hull_dim));
 
 1565   qh->normal_size= 
qh->hull_dim * 
sizeof(
coordT);
 
 1566   qh->center_size= 
qh->normal_size - 
sizeof(
coordT);
 
 1567   pointsneeded= 
qh->hull_dim+1;
 
 1570     qh_option(
qh, 
"Q3-no-merge-vertices-dim-high", NULL, NULL);
 
 1575   if (
qh->IStracing) {
 
 1576     qh_fprintf(
qh, 
qh->ferr, 6051, 
"qhull input error: tracing is not installed(qh_NOtrace in user.h)");
 
 1580   if (
qh->RERUN > 1) {
 
 1581     qh->TRACElastrun= 
qh->IStracing; 
 
 1582     if (
qh->IStracing != -1)
 
 1585     qh->TRACElevel= (
qh->IStracing? 
qh->IStracing : 3);
 
 1588   if (
qh->ROTATErandom == 0 || 
qh->ROTATErandom == -1) {
 
 1589     seed= (int)time(&timedata);
 
 1590     if (
qh->ROTATErandom  == -1) {
 
 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",
 
 1625   qh->RANDOMb= 1.0 - 
qh->RANDOMfactor;
 
 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);
 
 1699   trace3((
qh, 
qh->ferr, 3024, 
"qh_initqhull_outputflags: %s\n", 
qh->qhull_command));
 
 1700   if (!(
qh->PRINTgood || 
qh->PRINTneighbors)) {
 
 1701     if (
qh->KEEParea || 
qh->KEEPminArea < 
REALmax/2 || 
qh->KEEPmerge || 
qh->DELAUNAY
 
 1702         || (!
qh->ONLYgood && (
qh->GOODvertex || 
qh->GOODpoint))) {
 
 1707   if (
qh->PRINTtransparent) {
 
 1708     if (
qh->hull_dim != 4 || !
qh->DELAUNAY || 
qh->VORONOI || 
qh->DROPdim >= 0) {
 
 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");
 
 1740   if (printcoplanar && 
qh->DELAUNAY && 
qh->JOGGLEmax < 
REALmax/2) {
 
 1741     if (
qh->PRINTprecision)
 
 1742       qh_fprintf(
qh, 
qh->ferr, 7041, 
"qhull input warning: 'QJ' (joggle) will usually prevent coincident input sites for options 'Fc' and 'FP'\n");
 
 1744   if (printmath && (
qh->hull_dim > 3 || 
qh->VORONOI)) {
 
 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");
 
 1749     if (
qh->hull_dim > 4) {
 
 1750       qh_fprintf(
qh, 
qh->ferr, 6057, 
"qhull input error: Geomview output is only available for 2-d, 3-d and 4-d\n");
 
 1753     if (
qh->PRINTnoplanes && !(
qh->PRINTcoplanar + 
qh->PRINTcentrums
 
 1754      + 
qh->PRINTdots + 
qh->PRINTspheres + 
qh->DOintersections + 
qh->PRINTridges)) {
 
 1755       qh_fprintf(
qh, 
qh->ferr, 6058, 
"qhull input error: no output specified for Geomview\n");
 
 1758     if (
qh->VORONOI && (
qh->hull_dim > 3 || 
qh->DROPdim >= 0)) {
 
 1759       qh_fprintf(
qh, 
qh->ferr, 6059, 
"qhull input error: Geomview output for Voronoi diagrams only for 2-d\n");
 
 1763     if (
qh->hull_dim == 4 && 
qh->DROPdim == -1 &&
 
 1764         (
qh->PRINTcoplanar || 
qh->PRINTspheres || 
qh->PRINTcentrums)) {
 
 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");
 
 1767       qh->PRINTcoplanar= 
qh->PRINTspheres= 
qh->PRINTcentrums= 
False;
 
 1770   if (!
qh->KEEPcoplanar && !
qh->KEEPinside && !
qh->ONLYgood) {
 
 1771     if ((
qh->PRINTcoplanar && 
qh->PRINTspheres) || printcoplanar) {
 
 1772       if (
qh->QHULLfinished) {
 
 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");
 
 1780   qh->PRINTdim= 
qh->hull_dim;
 
 1781   if (
qh->DROPdim >=0) {    
 
 1782     if (
qh->DROPdim < 
qh->hull_dim) {
 
 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);
 
 1788   }
else if (
qh->VORONOI) {
 
 1789     qh->DROPdim= 
qh->hull_dim-1;
 
 1790     qh->PRINTdim= 
qh->hull_dim-1;
 
 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;
 
 1862   qh->tracefacet_id= UINT_MAX;  
 
 1863   qh->tracevertex_id= UINT_MAX; 
 
 1864   seed= (int)time(&timedata);
 
 1870   strcat(
qh->qhull, 
"qhull");
 
 1899   maxdim= 
qh->input_dim;
 
 1900   if (
qh->DELAUNAY && (
qh->PROJECTdelaunay || 
qh->PROJECTinput))
 
 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",
 
 1915           if (idx >= 
qh->hull_dim) {
 
 1916             qh_fprintf(
qh, 
qh->ferr, 7045, 
"qhull warning: dimension %d for Print option '%c' is >= %d.  Ignored\n",
 
 1917                 idx, key, 
qh->hull_dim);
 
 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",
 
 1931             qh->lower_threshold[idx]= 
value;
 
 1933             qh->upper_threshold[idx]= 
value;
 
 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))
 
 1979   for (k=
qh->hull_dim; k--; ) {
 
 1980     if (
qh->lower_threshold[k] > -
REALmax/2) {
 
 1982       if (
qh->upper_threshold[k] < 
REALmax/2) {
 
 1983         qh->SPLITthresholds= 
True;
 
 1987     }
else if (
qh->upper_threshold[k] < 
REALmax/2)
 
 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);  
 
 2076   qh->qhull_optionlen += len;
 
 2077   maxlen= 
sizeof(
qh->qhull_options) - len -1;
 
 2080     qh->qhull_optionlen= len;
 
 2081     strncat(
qh->qhull_options, 
"\n", (
size_t)(maxlen--));
 
 2083   strncat(
qh->qhull_options, buf, (
size_t)maxlen);
 
 2096     memset((
char *)
qh, 0, 
sizeof(
qhT));   
 
  
double qh_strtod(const char *s, char **endp)
void qh_delvertex(vertexT *vertex)
void qh_zero(qhT *qh, FILE *errfile)
void seed(unsigned int seed_value)
#define FOREACHridge_(ridges)
void qh_freebuffers(qhT *qh)
void qh_meminitbuffers(int tracelevel, int alignment, int numsizes, int bufsize, int bufinit)
void qh_fprintf_stderr(int msgcode, const char *fmt,...)
char * qh_skipfilename(char *filename)
void qh_setfreelong(setT **setp)
void qh_lib_check(int qhullLibraryType, int qhTsize, int vertexTsize, int ridgeTsize, int facetTsize, int setTsize, int qhmemTsize)
int qh_argv_to_command(int argc, char *argv[], char *command, int max_size)
void qh_delfacet(facetT *facet)
void qh_rotateinput(realT **rows)
void qh_initqhull_outputflags(qhT *qh)
void qh_setfree(setT **setp)
int qh_strtol(const char *s, char **endp)
void qh_initqhull_start(qhT *qh, FILE *infile, FILE *outfile, FILE *errfile)
void qh_randommatrix(realT *buffer, int dim, realT **row)
void qh_memsize(int size)
#define qh_RANDOMseed_(seed)
#define QHULL_NON_REENTRANT
void qh_freebuild(qhT *qh, boolT allmem)
void qh_option(qhT *qh, const char *option, int *i, realT *r)
void qh_initstatistics(void)
void qh_initthresholds(qhT *qh, char *command)
void qh_initqhull_start2(qhT *qh, FILE *infile, FILE *outfile, FILE *errfile)
void qh_projectinput(void)
unsigned long qh_clock(qhT *qh)
#define otherfacet_(ridge, facet)
void qh_initqhull_buffers(qhT *qh)
void qh_settruncate(setT *set, int size)
void qh_errexit(int exitcode, facetT *facet, ridgeT *ridge)
void * qh_memalloc(int insize)
void qh_exit(int exitcode)
void qh_checkflags(qhT *qh, char *command, char *hiddenflags)
setT * qh_setnew(int setsize)
void qh_initqhull_globals(qhT *qh, coordT *points, int numpoints, int dim, boolT ismalloc)
void qh_initflags(qhT *qh, char *command)
void qh_freeqhull(qhT *qh, boolT allmem)
void qh_init_B(qhT *qh, coordT *points, int numpoints, int dim, boolT ismalloc)
void qh_clear_outputflags(qhT *qh)
#define FOREACHmerge_(merges)
void qh_settempfree_all(void)
void qh_initqhull_mem(qhT *qh)
boolT qh_gram_schmidt(int dim, realT **rows)
void qh_copyfilename(char *filename, int size, const char *source, int length)
void qh_init_A(qhT *qh, FILE *infile, FILE *outfile, FILE *errfile, int argc, char *argv[])
void qh_fprintf(FILE *fp, int msgcode, const char *fmt,...)
#define maximize_(maxval, val)
void qh_meminit(FILE *ferr)
void qh_init_qhull_command(qhT *qh, int argc, char *argv[])
void qh_memfree(void *object, int insize)
void qh_appendprint(qhT *qh, qh_PRINT format)
void qh_user_memsizes(void)
#define qh_DIMmergeVertex
hpp-fcl
Author(s): 
autogenerated on Fri Feb 14 2025 03:45:50