Go to the documentation of this file.
67 char flags[]=
"qhull Tv";
68 FILE *outfile= stdout;
70 FILE *errfile= stderr;
84 flags, outfile, errfile);
93 if (curlong || totlong)
94 qh_fprintf(
qh, errfile, 7068,
"qhull internal warning (main): did not free %d bytes of long memory(%d pieces)\n", totlong, curlong);
123 char *qhull_cmd, FILE *outfile, FILE *errfile) {
124 int exitcode, hulldim;
131 if (!
qh->qhmem.ferr) {
136 if (strncmp(qhull_cmd,
"qhull ", (
size_t)6)) {
137 qh_fprintf(
qh, errfile, 6186,
"qhull error (qh_new_qhull): start qhull_cmd argument with \"qhull \"\n");
141 trace1((
qh,
qh->ferr, 1044,
"qh_new_qhull: build new Qhull for %d %d-d points with %s\n", numpoints,
dim, qhull_cmd));
142 exitcode = setjmp(
qh->errexit);
148 qh->PROJECTdelaunay=
True;
161 new_ismalloc= ismalloc;
163 qh_init_B(
qh, new_points, numpoints, hulldim, new_ismalloc);
171 if (
qh->VERIFYoutput && !
qh->STOPpoint && !
qh->STOPcone)
202 if (
qh->ERREXITcalled) {
203 qh_fprintf(
qh,
qh->ferr, 8126,
"\nqhull error while processing previous error. Exit program\n");
207 if (!
qh->QHULLfinished)
210 qh_fprintf(
qh,
qh->ferr, 8127,
"\nWhile executing: %s | %s\n",
qh->rbox_command,
qh->qhull_command);
212 if (
qh->furthest_id >= 0) {
213 qh_fprintf(
qh,
qh->ferr, 8129,
"Last point added to hull was p%d.",
qh->furthest_id);
216 if (
qh->QHULLfinished)
217 qh_fprintf(
qh,
qh->ferr, 8131,
"\nQhull has finished constructing the hull.");
218 else if (
qh->POSTmerging)
219 qh_fprintf(
qh,
qh->ferr, 8132,
"\nQhull has started post-merging.");
222 if (
qh->FORCEoutput && (
qh->QHULLfinished || (!facet && !ridge)))
228 if (
qh->PRINTstatistics) {
234 if (
qh->PRINTprecision)
244 qh_fprintf(
qh,
qh->ferr, 6187,
"qhull error while ending program, or qh->NOerrexit not cleared after setjmp(). Exit program with error.\n");
250 longjmp(
qh->errexit, exitcode);
278 if (atridge->
top && atridge->
top != atfacet && atridge->
top != otherfacet)
281 && atridge->
bottom != atfacet && atridge->
bottom != otherfacet)
284 atfacet= atridge->
top;
292 if (
qh->fout &&
qh->FORCEoutput && atfacet && !
qh->QHULLfinished && !
qh->IStracing) {
293 qh_fprintf(
qh,
qh->ferr, 8139,
"ERRONEOUS and NEIGHBORING FACETS to output\n");
335 if (
qh->MERGEexact ||
qh->PREmerge ||
qh->JOGGLEmax <
REALmax/2)
337 A Qhull error has occurred. Qhull should have corrected the above\n\
338 precision error. Please send the input and all of the output to\n\
339 qhull_bug@qhull.org\n");
342 Precision problems were detected during construction of the convex hull.\n\
343 This occurs because convex hull algorithms assume that calculations are\n\
344 exact, but floating-point arithmetic has roundoff errors.\n\
346 To correct for precision problems, do not use 'Q0'. By default, Qhull\n\
347 selects 'C-0' or 'Qx' and merges non-convex facets. With option 'QJ',\n\
348 Qhull joggles the input to prevent precision problems. See \"Imprecision\n\
349 in Qhull\" (qh-impre.htm).\n\
351 If you use 'Q0', the output may include\n\
352 coplanar ridges, concave ridges, and flipped facets. In 4-d and higher,\n\
353 Qhull may produce a ridge with four neighbors or two facets with the same \n\
354 vertices. Qhull reports these events when they occur. It stops when a\n\
355 concave ridge, flipped facet, or duplicate facet occurs.\n");
359 Qhull is currently using single precision arithmetic. The following\n\
360 will probably remove the precision problems:\n\
361 - recompile qhull for realT precision(#define REALfloat 0 in user.h).\n");
363 if (
qh->DELAUNAY && !
qh->SCALElast &&
qh->MAXabs_coord > 1e4)
366 When computing the Delaunay triangulation of coordinates > 1.0,\n\
367 - use 'Qbb' to scale the last coordinate to [0,m] (max previous coordinate)\n");
368 if (
qh->DELAUNAY && !
qh->ATinfinity)
370 When computing the Delaunay triangulation:\n\
371 - use 'Qz' to add a point at-infinity. This reduces precision problems.\n");
375 If you need triangular output:\n\
376 - use option 'Qt' to triangulate the output\n\
377 - use option 'QJ' to joggle the input points and remove precision errors\n\
378 - use option 'Ft'. It triangulates non-simplicial facets with added points.\n\
380 If you must use 'Q0',\n\
381 try one or more of the following options. They can not guarantee an output.\n\
382 - use 'QbB' to scale the input to a cube.\n\
383 - use 'Po' to produce output and prevent partitioning for flipped facets\n\
384 - use 'V0' to set min. distance to visible facet as 0 instead of roundoff\n\
385 - use 'En' to specify a maximum roundoff error less than %2.2g.\n\
386 - options 'Qf', 'Qbb', and 'QR0' may also help\n",
390 To guarantee simplicial output:\n\
391 - use option 'Qt' to triangulate the output\n\
392 - use option 'QJ' to joggle the input points and remove precision errors\n\
393 - use option 'Ft' to triangulate the output by adding points\n\
394 - use exact arithmetic (see \"Imprecision in Qhull\", qh-impre.htm)\n\
413 The initial hull is narrow (cosine of min. angle is %.16f).\n\
414 Is the input lower dimensional (e.g., on a plane in 3-d)? Qhull may\n\
415 produce a wide facet. Options 'QbB' (scale to unit box) or 'Qbb' (scale\n\
416 last coordinate) may remove this warning. Use 'Pp' to skip this warning.\n\
417 See 'Limitations' in qh-impre.htm.\n",
430 realT min, max, *coord, dist;
434 The input to qhull appears to be less than %d dimensional, or a\n\
435 computation has overflowed.\n\n\
436 Qhull could not construct a clearly convex simplex from points:\n",
441 The center point is coplanar with a facet, or a vertex is coplanar\n\
442 with a neighboring facet. The maximum round off error for\n\
443 computing distances is %2.2g. The center point, facets and distances\n\
444 to the center point are as follows:\n\n",
qh->DISTround);
458 These points are the dual of the given halfspaces. They indicate that\n\
459 the intersection is degenerate.\n");
461 These points either have a maximum or minimum x-coordinate, or\n\
462 they maximize the determinant for k coordinates. Trial points\n\
463 are first selected from points that maximize a coordinate.\n");
466 Because of the high dimension, the min x-coordinate and max-coordinate\n\
467 points are used if the determinant is non-zero. Option 'Qs' will\n\
468 do a better, though much slower, job. Instead of 'Qs', you can change\n\
469 the points by randomly rotating the input with 'QR0'.\n");
471 qh_fprintf(
qh, fp, 9385,
"\nThe min and max coordinates for each dimension are:\n");
472 for (k=0; k <
qh->hull_dim; k++) {
475 for (i=
qh->num_points, coord=
qh->first_point+k; i--; coord +=
qh->hull_dim) {
479 qh_fprintf(
qh, fp, 9386,
" %d: %8.4g %8.4g difference= %4.4g\n", k, min, max, max-min);
483 If the input should be full dimensional, you have several options that\n\
484 may determine an initial simplex:\n\
485 - use 'QJ' to joggle the input and make it full dimensional\n\
486 - use 'QbB' to scale the points to the unit cube\n\
487 - use 'QR0' to randomly rotate the input for different maximum points\n\
488 - use 'Qs' to search all points for the initial simplex\n\
489 - use 'En' to specify a maximum roundoff error less than %2.2g.\n\
490 - trace execution with 'T3' to see the determinant for each point.\n",
494 - recompile qhull for realT precision(#define REALfloat 0 in libqhull_r.h).\n");
497 If the input is lower dimensional:\n\
498 - use 'QJ' to joggle the input and make it full dimensional\n\
499 - use 'Qbk:0Bk:0' to delete coordinate k from the input. You should\n\
500 pick the coordinate with the least range. The hull will have the\n\
502 - determine the flat containing the points, rotate the points\n\
503 into a coordinate plane, and delete the other coordinates.\n\
504 - add one or more points to make the input full dimensional.\n\
void qh_zero(qhT *qh, FILE *errfile)
void qh_printvertex(FILE *fp, vertexT *vertex)
int qh_new_qhull(qhT *qh, int dim, int numpoints, coordT *points, boolT ismalloc, char *qhull_cmd, FILE *outfile, FILE *errfile)
#define FORALLfacet_(facetlist)
void qh_printfacet(FILE *fp, facetT *facet)
void qh_printvertexlist(FILE *fp, const char *string, facetT *facetlist, setT *facets, boolT printall)
#define FOREACHfacet_(facets)
void qh_printafacet(FILE *fp, qh_PRINT format, facetT *facet, boolT printall)
void qh_check_output(void)
void qh_printridge(FILE *fp, ridgeT *ridge)
void qh_printhelp_singular(qhT *qh, FILE *fp)
void qh_printstatistics(FILE *fp, const char *string)
void qh_check_points(void)
#define otherfacet_(ridge, facet)
void qh_freeqhull(boolT allmem)
void qh_printpointid(FILE *fp, const char *string, int dim, pointT *point, int id)
void qh_setfeasible(int dim)
void qh_printfacetlist(qhT *qh, facetT *facetlist, setT *facets, boolT printall)
coordT * qh_sethalfspace_all(int dim, int count, coordT *halfspaces, pointT *feasible)
void qh_errexit(qhT *qh, int exitcode, facetT *facet, ridgeT *ridge)
void qh_exit(int exitcode)
#define minimize_(minval, val)
void qh_printsummary(FILE *fp)
int qh_pointid(pointT *point)
void qh_distplane(pointT *point, facetT *facet, realT *dist)
void qh_prepare_output(void)
void qh_produce_output(void)
void qh_memfreeshort(int *curlong, int *totlong)
void qh_printend(FILE *fp, qh_PRINT format, facetT *facetlist, setT *facets, boolT printall)
void qh_initflags(char *command)
void qh_printhelp_narrowhull(qhT *qh, FILE *fp, realT minangle)
#define FOREACHvertex_(vertices)
void qh_printneighborhood(FILE *fp, qh_PRINT format, facetT *facetA, facetT *facetB, boolT printall)
void qh_printstats(FILE *fp, int idx, int *nextindex)
void qh_fprintf(FILE *fp, int msgcode, const char *fmt,...)
void qh_errprint(qhT *qh, const char *string, facetT *atfacet, facetT *otherfacet, ridgeT *atridge, vertexT *atvertex)
#define maximize_(maxval, val)
void qh_meminit(FILE *ferr)
void qh_printhelp_degenerate(qhT *qh, FILE *fp)
void qh_user_memsizes(qhT *qh)
void qh_init_B(coordT *points, int numpoints, int dim, boolT ismalloc)
void qh_initqhull_start(FILE *infile, FILE *outfile, FILE *errfile)
void qh_collectstatistics(void)
void qh_memstatistics(FILE *fp)
void qh_printbegin(FILE *fp, qh_PRINT format, facetT *facetlist, setT *facets, boolT printall)
hpp-fcl
Author(s):
autogenerated on Sat Nov 23 2024 03:44:59