Debian Codegraph @

vendor/qhull/libqhull_r/user_r.c

raw symbols SCIP
1 /*<html><pre> -<a href="qh-user_r.htm"
2 >-------------------------------</a><a name="TOP">-</a>
3
4 user_r.c
5 user redefinable functions
6
7 see user2_r.c for qh_fprintf, qh_malloc, qh_free
8
9 see README.txt see COPYING.txt for copyright information.
10
11 see libqhull_r.h for data structures, macros, and user-callable functions.
12
13 see user_eg_r.c, user_eg2_r.c, and unix_r.c for examples.
14
15 see user_r.h for user-definable constants
16
17 use qh_NOmem in mem_r.h to turn off memory management
18 use qh_NOmerge in user_r.h to turn off facet merging
19 set qh_KEEPstatistics in user_r.h to 0 to turn off statistics
20
21 This is unsupported software. You're welcome to make changes,
22 but you're on your own if something goes wrong. Use 'Tc' to
23 check frequently. Usually qhull will report an error if
24 a data structure becomes inconsistent. If so, it also reports
25 the last point added to the hull, e.g., 102. You can then trace
26 the execution of qhull with "T4P102".
27
28 Please report any errors that you fix to [email protected]
29
30 Qhull-template is a template for calling qhull from within your application
31
32 if you recompile and load this module, then user.o will not be loaded
33 from qhull.a
34
35 you can add additional quick allocation sizes in qh_user_memsizes
36
37 if the other functions here are redefined to not use qh_print...,
38 then io.o will not be loaded from qhull.a. See user_eg_r.c for an
39 example. We recommend keeping io.o for the extra debugging
40 information it supplies.
41 */
42
43 #include "qhull_ra.h"cxx . . $ `<file>/vendor/qhull/libqhull_r/qhull_ra.h`/
44
45 #include <stdarg.h>
46
47 /*-<a href="qh-user_r.htm#TOC"
48 >-------------------------------</a><a name="qhull_template">-</a>
49
50 Qhull-template
51 Template for calling qhull from inside your program
52
53 returns:
54 exit code(see qh_ERR... in libqhull_r.h)
55 all memory freed
56
57 notes:
58 This can be called any number of times.
59 */
60 #if 0
61 {
62 int dim; /* dimension of points */
63 int numpoints; /* number of points */
64 coordT *points; /* array of coordinates for each point */
65 boolT ismalloc; /* True if qhull should free points in qh_freeqhull() or reallocation */
66 char flags[]= "qhull Tv"; /* option flags for qhull, see html/qh-quick.htm */
67 FILE *outfile= stdout; /* output from qh_produce_output
68 use NULL to skip qh_produce_output */
69 FILE *errfile= stderr; /* error messages from qhull code */
70 int exitcode; /* 0 if no error from qhull */
71 facetT *facet; /* set by FORALLfacets */
72 int curlong, totlong; /* memory remaining after qh_memfreeshort */
73
74 qhT qh_qh; /* Qhull's data structure. First argument of most calls */
75 qhT *qh= &qh_qh; /* Alternatively -- qhT *qh= (qhT *)malloc(sizeof(qhT)) */
76
77 QHULL_LIB_CHECK /* Check for compatible library */
78
79 qh_zero(qh, errfile);
80
81 /* initialize dim, numpoints, points[], ismalloc here */
82 exitcode= qh_new_qhull(qh, dim, numpoints, points, ismalloc,
83 flags, outfile, errfile);
84 if (!exitcode) { /* if no error */
85 /* 'qh->facet_list' contains the convex hull */
86 FORALLfacets {
87 /* ... your code ... */
88 }
89 }
90 qh_freeqhull(qh, !qh_ALL);
91 qh_memfreeshort(qh, &curlong, &totlong);
92 if (curlong || totlong)
93 qh_fprintf(qh, errfile, 7079, "qhull internal warning (main): did not free %d bytes of long memory(%d pieces)\n", totlong, curlong);
94 }
95 #endif
96
97 /*-<a href="qh-user_r.htm#TOC"
98 >-------------------------------</a><a name="new_qhull">-</a>
99
100 qh_new_qhull(qh, dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile )
101 Run qhull
102 Before first call, either call qh_zero(qh, errfile), or set qh to all zero.
103
104 returns:
105 results in qh
106 exitcode (0 if no errors).
107
108 notes:
109 do not modify points until finished with results.
110 The qhull data structure contains pointers into the points array.
111 do not call qhull functions before qh_new_qhull().
112 The qhull data structure is not initialized until qh_new_qhull().
113 do not call qh_init_A (global_r.c)
114
115 Default errfile is stderr, outfile may be null
116 qhull_cmd must start with "qhull "
117 projects points to a new point array for Delaunay triangulations ('d' and 'v')
118 transforms points into a new point array for halfspace intersection ('H')
119
120 see:
121 Qhull-template at the beginning of this file.
122 An example of using qh_new_qhull is user_eg_r.c
123 */
124 int qh_new_qhullcxx . . $ qh_new_qhull(c76e09a5389a42d3).(qhTcxx . . $ qhT# *qh, int dim, int numpoints, coordTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:89:9`! *points, boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! ismalloc,
125 char *qhull_cmd, FILEcxx . . $ FILE# *outfile, FILEcxx . . $ FILE# *errfile) {
126 /* gcc may issue a "might be clobbered" warning for dim, points, and ismalloc [-Wclobbered].
127 These parameters are not referenced after a longjmp() and hence not clobbered.
128 See http://stackoverflow.com/questions/7721854/what-sense-do-these-clobbered-variable-warnings-make */
129 int exitcode, hulldim;
130 boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! new_ismalloc;
131 coordTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:89:9`! *new_points;
132
133 if(!errfile){
134 errfile= stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!;
135 }
136 if (!qh->qhmemcxx . . $ qhT#qhmem..ferrcxx . . $ qhmemT#ferr.) {
137 qh_meminitcxx . . $ qh_meminit(92be47226f66e56f).(qh, errfile);
138 } else {
139 qh_memcheckcxx . . $ qh_memcheck(fb32973c8cc8eae9).(qh);
140 }
141 if (strncmpcxx . . $ strncmp(fd278af2f295fa2e).(qhull_cmd, "qhull ", (size_tcxx . . $ size_t#)6) && strcmpcxx . . $ strcmp(5ae29d726ae57f88).(qhull_cmd, "qhull") != 0) {
142 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, errfile, 6186, "qhull error (qh_new_qhull): start qhull_cmd argument with \"qhull \" or set to \"qhull\"\n");
143 return qh_ERRinputcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:203:9`!;
144 }
145 qh_initqhull_startcxx . . $ qh_initqhull_start(8e12da8b7c58f4de).(qh, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, outfile, errfile);
146 if(numpoints==0 && points==NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!){
147 trace1cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:88:9`!((qh, qh->ferr, 1047, "qh_new_qhull: initialize Qhull\n"));
148 return 0;
149 }
150 trace1cxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:88:9`!((qh, qh->ferr, 1044, "qh_new_qhull: build new Qhull for %d %d-d points with %s\n", numpoints, dim, qhull_cmd));
151 exitcode= setjmpcxx . . $ `<external>/4367339001007250937/setjmp.h:49:9`!(qh->errexit);
152 if (!exitcode) {
153 qh->NOerrexitcxx . . $ qhT#NOerrexit.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
154 qh_initflagscxx . . $ qh_initflags(f78886e8a38e0ae0).(qh, qhull_cmd);
155 if (qh->DELAUNAYcxx . . $ qhT#DELAUNAY.)
156 qh->PROJECTdelaunaycxx . . $ qhT#PROJECTdelaunay.= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
157 if (qh->HALFspacecxx . . $ qhT#HALFspace.) {
158 /* points is an array of halfspaces,
159 the last coordinate of each halfspace is its offset */
160 hulldim= dim-1;
161 qh_setfeasiblecxx . . $ qh_setfeasible(dc2080372857db46).(qh, hulldim);
162 new_points= qh_sethalfspace_allcxx . . $ qh_sethalfspace_all(69715eb35686482e).(qh, dim, numpoints, points, qh->feasible_pointcxx . . $ qhT#feasible_point.);
163 new_ismalloc= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
164 if (ismalloc)
165 qh_freecxx . . $ qh_free(5d22bdacc48458e8).(points);
166 }else {
167 hulldim= dim;
168 new_points= points;
169 new_ismalloc= ismalloc;
170 }
171 qh_init_Bcxx . . $ qh_init_B(52615dbb821f3f00).(qh, new_points, numpoints, hulldim, new_ismalloc);
172 qh_qhullcxx . . $ qh_qhull(fb32973c8cc8eae9).(qh);
173 qh_check_outputcxx . . $ qh_check_output(fb32973c8cc8eae9).(qh);
174 if (outfile) {
175 qh_produce_outputcxx . . $ qh_produce_output(fb32973c8cc8eae9).(qh);
176 }else {
177 qh_prepare_outputcxx . . $ qh_prepare_output(fb32973c8cc8eae9).(qh);
178 }
179 if (qh->VERIFYoutputcxx . . $ qhT#VERIFYoutput. && !qh->FORCEoutputcxx . . $ qhT#FORCEoutput. && !qh->STOPaddcxx . . $ qhT#STOPadd. && !qh->STOPconecxx . . $ qhT#STOPcone. && !qh->STOPpointcxx . . $ qhT#STOPpoint.)
180 qh_check_pointscxx . . $ qh_check_points(fb32973c8cc8eae9).(qh);
181 }
182 qh->NOerrexitcxx . . $ qhT#NOerrexit.= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
183 return exitcode;
184 } /* new_qhull */
185
186 /*-<a href="qh-user_r.htm#TOC"
187 >-------------------------------</a><a name="errexit">-</a>
188
189 qh_errexit(qh, exitcode, facet, ridge )
190 report and exit from an error
191 report facet and ridge if non-NULL
192 reports useful information such as last point processed
193 set qh.FORCEoutput to print neighborhood of facet
194
195 see:
196 qh_errexit2() in libqhull_r.c for printing 2 facets
197
198 design:
199 check for error within error processing
200 compute qh.hulltime
201 print facet and ridge (if any)
202 report commandString, options, qh.furthest_id
203 print summary and statistics (including precision statistics)
204 if qh_ERRsingular
205 print help text for singular data set
206 exit program via long jump (if defined) or exit()
207 */
208 void qh_errexitcxx . . $ qh_errexit(6867cd51ab709aa0).(qhTcxx . . $ qhT# *qh, int exitcode, facetTcxx . . $ facetT# *facet, ridgeTcxx . . $ ridgeT# *ridge) {
209
210 qh->tracefacetcxx . . $ qhT#tracefacet.= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; /* avoid infinite recursion through qh_fprintf */
211 qh->traceridgecxx . . $ qhT#traceridge.= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
212 qh->tracevertexcxx . . $ qhT#tracevertex.= NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
213 if (qh->ERREXITcalledcxx . . $ qhT#ERREXITcalled.) {
214 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 8126, "\nqhull error while handling previous error in qh_errexit. Exit program\n");
215 qh_exitcxx . . $ qh_exit(3ca292c338df9bb3).(qh_ERRothercxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:208:9`!);
216 }
217 qh->ERREXITcalledcxx . . $ qhT#ERREXITcalled.= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
218 if (!qh->QHULLfinishedcxx . . $ qhT#QHULLfinished.)
219 qh->hulltimecxx . . $ qhT#hulltime.= qh_CPUclockcxx . . $ `vendor/qhull/libqhull_r/user_r.h:234:9`! - qh->hulltimecxx . . $ qhT#hulltime.;
220 qh_errprintcxx . . $ qh_errprint(d88e80dd7941fe88).(qh, "ERRONEOUS", facet, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, ridge, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
221 qh_optioncxx . . $ qh_option(621c3f0e421c7a14).(qh, "_maxoutside", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, &qh->MAXoutsidecxx . . $ qhT#MAXoutside.);
222 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 8127, "\nWhile executing: %s | %s\n", qh->rbox_commandcxx . . $ qhT#rbox_command., qh->qhull_commandcxx . . $ qhT#qhull_command.);
223 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 8128, "Options selected for Qhull %s:\n%s\n", qh_versioncxx . . $ qh_version., qh->qhull_optionscxx . . $ qhT#qhull_options.);
224 if (qh->furthest_idcxx . . $ qhT#furthest_id. >= 0) {
225 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 8129, "Last point added to hull was p%d.", qh->furthest_idcxx . . $ qhT#furthest_id.);
226 if (zzval_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:453:9`!(Ztotmerge))
227 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 8130, " Last merge was #%d.", zzval_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:453:9`!(Ztotmerge));
228 if (qh->QHULLfinishedcxx . . $ qhT#QHULLfinished.)
229 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 8131, "\nQhull has finished constructing the hull.");
230 else if (qh->POSTmergingcxx . . $ qhT#POSTmerging.)
231 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 8132, "\nQhull has started post-merging.");
232 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 8133, "\n");
233 }
234 if (qh->FORCEoutputcxx . . $ qhT#FORCEoutput. && (qh->QHULLfinishedcxx . . $ qhT#QHULLfinished. || (!facet && !ridge)))
235 qh_produce_outputcxx . . $ qh_produce_output(fb32973c8cc8eae9).(qh);
236 else if (exitcode != qh_ERRinputcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:203:9`!) {
237 if (exitcode != qh_ERRsingularcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:204:9`! && zzval_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:453:9`!(Zsetplane) > qh->hull_dimcxx . . $ qhT#hull_dim.+1) {
238 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 8134, "\nAt error exit:\n");
239 qh_printsummarycxx . . $ qh_printsummary(92be47226f66e56f).(qh, qh->ferrcxx . . $ qhT#ferr.);
240 if (qh->PRINTstatisticscxx . . $ qhT#PRINTstatistics.) {
241 qh_collectstatisticscxx . . $ qh_collectstatistics(fb32973c8cc8eae9).(qh);
242 qh_allstatisticscxx . . $ qh_allstatistics(fb32973c8cc8eae9).(qh);
243 qh_printstatisticscxx . . $ qh_printstatistics(66d0735a834f4f6e).(qh, qh->ferrcxx . . $ qhT#ferr., "at error exit");
244 qh_memstatisticscxx . . $ qh_memstatistics(92be47226f66e56f).(qh, qh->ferrcxx . . $ qhT#ferr.);
245 }
246 }
247 if (qh->PRINTprecisioncxx . . $ qhT#PRINTprecision.)
248 qh_printstatscxx . . $ qh_printstats(952604d7261c4dd3).(qh, qh->ferrcxx . . $ qhT#ferr., qh->qhstatcxx . . $ qhT#qhstat..precisioncxx . . $ qhstatT#precision., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
249 }
250 if (!exitcode)
251 exitcode= qh_ERRothercxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:208:9`!;
252 else if (exitcode == qh_ERRpreccxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:205:9`! && !qh->PREmergecxx . . $ qhT#PREmerge.)
253 qh_printhelp_degeneratecxx . . $ qh_printhelp_degenerate(92be47226f66e56f).(qh, qh->ferrcxx . . $ qhT#ferr.);
254 else if (exitcode == qh_ERRqhullcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:207:9`!)
255 qh_printhelp_internalcxx . . $ qh_printhelp_internal(92be47226f66e56f).(qh, qh->ferrcxx . . $ qhT#ferr.);
256 else if (exitcode == qh_ERRsingularcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:204:9`!)
257 qh_printhelp_singularcxx . . $ qh_printhelp_singular(92be47226f66e56f).(qh, qh->ferrcxx . . $ qhT#ferr.);
258 else if (exitcode == qh_ERRdebugcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:211:9`!)
259 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 8016, "qhull exit due to qh_ERRdebug\n");
260 else if (exitcode == qh_ERRtopologycxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:209:9`! || exitcode == qh_ERRwidecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:210:9`! || exitcode == qh_ERRpreccxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:205:9`!) {
261 if (qh->NOpremergecxx . . $ qhT#NOpremerge. && !qh->MERGINGcxx . . $ qhT#MERGING.)
262 qh_printhelp_degeneratecxx . . $ qh_printhelp_degenerate(92be47226f66e56f).(qh, qh->ferrcxx . . $ qhT#ferr.);
263 else if (exitcode == qh_ERRtopologycxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:209:9`!)
264 qh_printhelp_topologycxx . . $ qh_printhelp_topology(92be47226f66e56f).(qh, qh->ferrcxx . . $ qhT#ferr.);
265 else if (exitcode == qh_ERRwidecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:210:9`!)
266 qh_printhelp_widecxx . . $ qh_printhelp_wide(92be47226f66e56f).(qh, qh->ferrcxx . . $ qhT#ferr.);
267 }else if (exitcode > 255) {
268 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6426, "qhull internal error (qh_errexit): exit code %d is greater than 255. Invalid argument for exit(). Replaced with 255\n", exitcode);
269 exitcode= 255;
270 }
271 if (qh->NOerrexitcxx . . $ qhT#NOerrexit.) {
272 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 6187, "qhull internal error (qh_errexit): either error while reporting error QH%d, or qh.NOerrexit not cleared after setjmp(). Exit program with error status %d\n",
273 qh->last_errcodecxx . . $ qhT#last_errcode., exitcode);
274 qh_exitcxx . . $ qh_exit(3ca292c338df9bb3).(exitcode);
275 }
276 qh->ERREXITcalledcxx . . $ qhT#ERREXITcalled.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!;
277 qh->NOerrexitcxx . . $ qhT#NOerrexit.= Truecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:138:9`!;
278 qh->ALLOWrestartcxx . . $ qhT#ALLOWrestart.= Falsecxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:137:9`!; /* longjmp will undo qh_build_withrestart */
279 longjmpcxx . . $ longjmp(d25daf25a2f573dc).(qh->errexitcxx . . $ qhT#errexit., exitcode);
280 } /* errexit */
281
282 /*-<a href="qh-user_r.htm#TOC"
283 >-------------------------------</a><a name="errprint">-</a>
284
285 qh_errprint(qh, fp, string, atfacet, otherfacet, atridge, atvertex )
286 prints out the information of facets and ridges to fp
287 also prints neighbors and geomview output
288
289 notes:
290 except for string, any parameter may be NULL
291 */
292 void qh_errprintcxx . . $ qh_errprint(d88e80dd7941fe88).(qhTcxx . . $ qhT# *qh, const char *string, facetTcxx . . $ facetT# *atfacet, facetTcxx . . $ facetT# *otherfacet, ridgeTcxx . . $ ridgeT# *atridge, vertexTcxx . . $ vertexT# *atvertex) {
293 int i;
294
295 if (atvertex) {
296 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 8138, "%s VERTEX:\n", string);
297 qh_printvertexcxx . . $ qh_printvertex(2bb0a16c81852ba).(qh, qh->ferrcxx . . $ qhT#ferr., atvertex);
298 }
299 if (atridge) {
300 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 8137, "%s RIDGE:\n", string);
301 qh_printridgecxx . . $ qh_printridge(3fc4799c2545a0a6).(qh, qh->ferrcxx . . $ qhT#ferr., atridge);
302 if (!atfacet)
303 atfacet= atridge->topcxx . . $ ridgeT#top.;
304 if (!otherfacet)
305 otherfacet= otherfacet_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:891:9`!(atridge, atfacet);
306 if (atridge->topcxx . . $ ridgeT#top. && atridge->topcxx . . $ ridgeT#top. != atfacet && atridge->topcxx . . $ ridgeT#top. != otherfacet)
307 qh_printfacetcxx . . $ qh_printfacet(bc484eec098e5a15).(qh, qh->ferrcxx . . $ qhT#ferr., atridge->topcxx . . $ ridgeT#top.);
308 if (atridge->bottomcxx . . $ ridgeT#bottom. && atridge->bottomcxx . . $ ridgeT#bottom. != atfacet && atridge->bottomcxx . . $ ridgeT#bottom. != otherfacet)
309 qh_printfacetcxx . . $ qh_printfacet(bc484eec098e5a15).(qh, qh->ferrcxx . . $ qhT#ferr., atridge->bottomcxx . . $ ridgeT#bottom.);
310 }
311 if (atfacet) {
312 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 8135, "%s FACET:\n", string);
313 qh_printfacetcxx . . $ qh_printfacet(bc484eec098e5a15).(qh, qh->ferrcxx . . $ qhT#ferr., atfacet);
314 }
315 if (otherfacet) {
316 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 8136, "%s OTHER FACET:\n", string);
317 qh_printfacetcxx . . $ qh_printfacet(bc484eec098e5a15).(qh, qh->ferrcxx . . $ qhT#ferr., otherfacet);
318 }
319 if (qh->foutcxx . . $ qhT#fout. && qh->FORCEoutputcxx . . $ qhT#FORCEoutput. && atfacet && !qh->QHULLfinishedcxx . . $ qhT#QHULLfinished. && !qh->IStracingcxx . . $ qhT#IStracing.) {
320 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 8139, "ERRONEOUS and NEIGHBORING FACETS to output\n");
321 for (i=0; i < qh_PRINTENDcxx . . $ qh_PRINTEND.; i++) /* use fout for geomview output */
322 qh_printneighborhoodcxx . . $ qh_printneighborhood(b3110e25e447dfdb).(qh, qh->foutcxx . . $ qhT#fout., qh->PRINToutcxx . . $ qhT#PRINTout.[i], atfacet, otherfacet,
323 !qh_ALLcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:189:9`!);
324 }
325 } /* errprint */
326
327
328 /*-<a href="qh-user_r.htm#TOC"
329 >-------------------------------</a><a name="printfacetlist">-</a>
330
331 qh_printfacetlist(qh, fp, facetlist, facets, printall )
332 print all fields for a facet list and/or set of facets to fp
333 if !printall,
334 only prints good facets
335
336 notes:
337 also prints all vertices
338 */
339 void qh_printfacetlistcxx . . $ qh_printfacetlist(6a91645e88e2e23a).(qhTcxx . . $ qhT# *qh, facetTcxx . . $ facetT# *facetlist, setTcxx . . $ setT# *facets, boolTcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:130:9`! printall) {
340 facetTcxx . . $ facetT# *facet, **facetp;
341
342 if (facetlist)
343 qh_checklistscxx . . $ qh_checklists(c5e9f8858b71e4e4).(qh, facetlist);
344 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 9424, "printfacetlist: vertices\n");
345 qh_printbegincxx . . $ qh_printbegin(61081687350e89d0).(qh, qh->ferrcxx . . $ qhT#ferr., qh_PRINTfacetscxx . . $ qh_PRINTfacets., facetlist, facets, printall);
346 if (facetlist) {
347 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 9413, "printfacetlist: facetlist\n");
348 FORALLfacet_cxx . . $ `vendor/qhull/libqhull_r/poly_r.h:78:9`!(facetlist)
349 qh_printafacetcxx . . $ qh_printafacet(c90f4dc3fce9e9b9).(qh, qh->ferrcxx . . $ qhT#ferr., qh_PRINTfacetscxx . . $ qh_PRINTfacets., facet, printall);
350 }
351 if (facets) {
352 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 9414, "printfacetlist: %d facets\n", qh_setsizecxx . . $ qh_setsize(8330125fbf155b5c).(qh, facets));
353 FOREACHfacet_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:978:9`!(facets)
354 qh_printafacetcxx . . $ qh_printafacet(c90f4dc3fce9e9b9).(qh, qh->ferrcxx . . $ qhT#ferr., qh_PRINTfacetscxx . . $ qh_PRINTfacets., facet, printall);
355 }
356 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, qh->ferrcxx . . $ qhT#ferr., 9412, "printfacetlist: end\n");
357 qh_printendcxx . . $ qh_printend(61081687350e89d0).(qh, qh->ferrcxx . . $ qhT#ferr., qh_PRINTfacetscxx . . $ qh_PRINTfacets., facetlist, facets, printall);
358 } /* printfacetlist */
359
360
361 /*-<a href="qh-user_r.htm#TOC"
362 >-------------------------------</a><a name="printhelp_degenerate">-</a>
363
364 qh_printhelp_degenerate(qh, fp )
365 prints descriptive message for precision error with qh_ERRprec
366
367 notes:
368 no message if qh_QUICKhelp
369 */
370 void qh_printhelp_degeneratecxx . . $ qh_printhelp_degenerate(92be47226f66e56f).(qhTcxx . . $ qhT# *qh, FILEcxx . . $ FILE# *fp) {
371
372 if (qh->MERGEexactcxx . . $ qhT#MERGEexact. || qh->PREmergecxx . . $ qhT#PREmerge. || qh->JOGGLEmaxcxx . . $ qhT#JOGGLEmax. < REALmaxcxx . . $ `vendor/qhull/libqhull_r/user_r.h:160:9`!/2)
373 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, fp, 9368, "\n\
374 A Qhull error has occurred. Qhull should have corrected the above\n\
375 precision error. Please send the input and all of the output to\n\
376 [email protected]\n");
377 else if (!qh_QUICKhelpcxx . . $ `vendor/qhull/libqhull_r/user_r.h:642:9`!) {
378 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, fp, 9369, "\n\
379 Precision problems were detected during construction of the convex hull.\n\
380 This occurs because convex hull algorithms assume that calculations are\n\
381 exact, but floating-point arithmetic has roundoff errors.\n\
382 \n\
383 To correct for precision problems, do not use 'Q0'. By default, Qhull\n\
384 selects 'C-0' or 'Qx' and merges non-convex facets. With option 'QJ',\n\
385 Qhull joggles the input to prevent precision problems. See \"Imprecision\n\
386 in Qhull\" (qh-impre.htm).\n\
387 \n\
388 If you use 'Q0', the output may include\n\
389 coplanar ridges, concave ridges, and flipped facets. In 4-d and higher,\n\
390 Qhull may produce a ridge with four neighbors or two facets with the same \n\
391 vertices. Qhull reports these events when they occur. It stops when a\n\
392 concave ridge, flipped facet, or duplicate facet occurs.\n");
393 #if REALfloatcxx . . $ `vendor/qhull/libqhull_r/user_r.h:146:9`!
394 qh_fprintf(qh, fp, 9370, "\
395 \n\
396 Qhull is currently using single precision arithmetic. The following\n\
397 will probably remove the precision problems:\n\
398 - recompile qhull for realT precision(#define REALfloat 0 in user_r.h).\n");
399 #endif
400 if (qh->DELAUNAYcxx . . $ qhT#DELAUNAY. && !qh->SCALElastcxx . . $ qhT#SCALElast. && qh->MAXabs_coordcxx . . $ qhT#MAXabs_coord. > 1e4)
401 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, fp, 9371, "\
402 \n\
403 When computing the Delaunay triangulation of coordinates > 1.0,\n\
404 - use 'Qbb' to scale the last coordinate to [0,m] (max previous coordinate)\n");
405 if (qh->DELAUNAYcxx . . $ qhT#DELAUNAY. && !qh->ATinfinitycxx . . $ qhT#ATinfinity.)
406 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, fp, 9372, "\
407 When computing the Delaunay triangulation:\n\
408 - use 'Qz' to add a point at-infinity. This reduces precision problems.\n");
409
410 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, fp, 9373, "\
411 \n\
412 If you need triangular output:\n\
413 - use option 'Qt' to triangulate the output\n\
414 - use option 'QJ' to joggle the input points and remove precision errors\n\
415 - use option 'Ft'. It triangulates non-simplicial facets with added points.\n\
416 \n\
417 If you must use 'Q0',\n\
418 try one or more of the following options. They can not guarantee an output.\n\
419 - use 'QbB' to scale the input to a cube.\n\
420 - use 'Po' to produce output and prevent partitioning for flipped facets\n\
421 - use 'V0' to set min. distance to visible facet as 0 instead of roundoff\n\
422 - use 'En' to specify a maximum roundoff error less than %2.2g.\n\
423 - options 'Qf', 'Qbb', and 'QR0' may also help\n",
424 qh->DISTroundcxx . . $ qhT#DISTround.);
425 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, fp, 9374, "\
426 \n\
427 To guarantee simplicial output:\n\
428 - use option 'Qt' to triangulate the output\n\
429 - use option 'QJ' to joggle the input points and remove precision errors\n\
430 - use option 'Ft' to triangulate the output by adding points\n\
431 - use exact arithmetic (see \"Imprecision in Qhull\", qh-impre.htm)\n\
432 ");
433 }
434 } /* printhelp_degenerate */
435
436 /*-<a href="qh-user_r.htm#TOC"
437 >-------------------------------</a><a name="printhelp_internal">-</a>
438
439 qh_printhelp_internal(qh, fp )
440 prints descriptive message for qhull internal error with qh_ERRqhull
441
442 notes:
443 no message if qh_QUICKhelp
444 */
445 void qh_printhelp_internalcxx . . $ qh_printhelp_internal(92be47226f66e56f).(qhTcxx . . $ qhT# *qh, FILEcxx . . $ FILE# *fp) {
446
447 if (!qh_QUICKhelpcxx . . $ `vendor/qhull/libqhull_r/user_r.h:642:9`!) {
448 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, fp, 9426, "\n\
449 A Qhull internal error has occurred. Please send the input and output to\n\
450 [email protected]. If you can duplicate the error with logging ('T4z'), please\n\
451 include the log file.\n");
452 }
453 } /* printhelp_internal */
454
455 /*-<a href="qh-user_r.htm#TOC"
456 >-------------------------------</a><a name="printhelp_narrowhull">-</a>
457
458 qh_printhelp_narrowhull(qh, minangle )
459 Warn about a narrow hull
460
461 notes:
462 Alternatively, reduce qh_WARNnarrow in user_r.h
463
464 */
465 void qh_printhelp_narrowhullcxx . . $ qh_printhelp_narrowhull(ba8ce234b89861a5).(qhTcxx . . $ qhT# *qh, FILEcxx . . $ FILE# *fp, realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`! minangle) {
466
467 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, fp, 7089, "qhull precision warning: The initial hull is narrow. Is the input lower\n\
468 dimensional (e.g., a square in 3-d instead of a cube)? Cosine of the minimum\n\
469 angle is %.16f. If so, Qhull may produce a wide facet.\n\
470 Options 'Qs' (search all points), 'Qbb' (scale last coordinate), or\n\
471 'QbB' (scale to unit box) may remove this warning.\n\
472 See 'Limitations' in qh-impre.htm. Use 'Pp' to skip this warning.\n",
473 -minangle); /* convert from angle between normals to angle between facets */
474 } /* printhelp_narrowhull */
475
476 /*-<a href="qh-user_r.htm#TOC"
477 >-------------------------------</a><a name="printhelp_singular">-</a>
478
479 qh_printhelp_singular(qh, fp )
480 prints descriptive message for singular input
481 */
482 void qh_printhelp_singularcxx . . $ qh_printhelp_singular(92be47226f66e56f).(qhTcxx . . $ qhT# *qh, FILEcxx . . $ FILE# *fp) {
483 facetTcxx . . $ facetT# *facet;
484 vertexTcxx . . $ vertexT# *vertex, **vertexp;
485 realTcxx . . $ `vendor/qhull/libqhull_r/user_r.h:159:9`! min, max, *coord, dist;
486 int i,k;
487
488 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, fp, 9376, "\n\
489 The input to qhull appears to be less than %d dimensional, or a\n\
490 computation has overflowed.\n\n\
491 Qhull could not construct a clearly convex simplex from points:\n",
492 qh->hull_dimcxx . . $ qhT#hull_dim.);
493 qh_printvertexlistcxx . . $ qh_printvertexlist(1a7a22fa7a4dcf13).(qh, fp, "", qh->facet_listcxx . . $ qhT#facet_list., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, qh_ALLcxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:189:9`!);
494 if (!qh_QUICKhelpcxx . . $ `vendor/qhull/libqhull_r/user_r.h:642:9`!)
495 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, fp, 9377, "\n\
496 The center point is coplanar with a facet, or a vertex is coplanar\n\
497 with a neighboring facet. The maximum round off error for\n\
498 computing distances is %2.2g. The center point, facets and distances\n\
499 to the center point are as follows:\n\n", qh->DISTroundcxx . . $ qhT#DISTround.);
500 qh_printpointidcxx . . $ qh_printpointid(7b729c5bae78d2a4).(qh, fp, "center point", qh->hull_dimcxx . . $ qhT#hull_dim., qh->interior_pointcxx . . $ qhT#interior_point., qh_IDunknowncxx . . $ qh_IDunknown.);
501 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, fp, 9378, "\n");
502 FORALLfacetscxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:920:9`! {
503 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, fp, 9379, "facet");
504 FOREACHvertex_cxx . . $ `vendor/qhull/libqhull_r/libqhull_r.h:1049:9`!(facet->vertices)
505 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, fp, 9380, " p%d", qh_pointidcxx . . $ qh_pointid(dcb1157715d34ae8).(qh, vertex->pointcxx . . $ vertexT#point.));
506 zinc_cxx . . $ `vendor/qhull/libqhull_r/stat_r.h:428:9`!(Zdistio);
507 qh_distplanecxx . . $ qh_distplane(4b1ba4cb548df22).(qh, qh->interior_pointcxx . . $ qhT#interior_point., facet, &dist);
508 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, fp, 9381, " distance= %4.2g\n", dist);
509 }
510 if (!qh_QUICKhelpcxx . . $ `vendor/qhull/libqhull_r/user_r.h:642:9`!) {
511 if (qh->HALFspacecxx . . $ qhT#HALFspace.)
512 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, fp, 9382, "\n\
513 These points are the dual of the given halfspaces. They indicate that\n\
514 the intersection is degenerate.\n");
515 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, fp, 9383,"\n\
516 These points either have a maximum or minimum x-coordinate, or\n\
517 they maximize the determinant for k coordinates. Trial points\n\
518 are first selected from points that maximize a coordinate.\n");
519 if (qh->hull_dimcxx . . $ qhT#hull_dim. >= qh_INITIALmaxcxx . . $ `vendor/qhull/libqhull_r/user_r.h:461:9`!)
520 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, fp, 9384, "\n\
521 Because of the high dimension, the min x-coordinate and max-coordinate\n\
522 points are used if the determinant is non-zero. Option 'Qs' will\n\
523 do a better, though much slower, job. Instead of 'Qs', you can change\n\
524 the points by randomly rotating the input with 'QR0'.\n");
525 }
526 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, fp, 9385, "\nThe min and max coordinates for each dimension are:\n");
527 for (k=0; k < qh->hull_dimcxx . . $ qhT#hull_dim.; k++) {
528 min= REALmaxcxx . . $ `vendor/qhull/libqhull_r/user_r.h:160:9`!;
529 max= -REALmaxcxx . . $ `vendor/qhull/libqhull_r/user_r.h:160:9`!;
530 for (i=qh->num_pointscxx . . $ qhT#num_points., coord= qh->first_pointcxx . . $ qhT#first_point.+k; i--; coord += qh->hull_dimcxx . . $ qhT#hull_dim.) {
531 maximize_cxx . . $ `vendor/qhull/libqhull_r/geom_r.h:51:9`!(max, *coord);
532 minimize_cxx . . $ `vendor/qhull/libqhull_r/geom_r.h:59:9`!(min, *coord);
533 }
534 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, fp, 9386, " %d: %8.4g %8.4g difference= %4.4g\n", k, min, max, max-min);
535 }
536 if (!qh_QUICKhelpcxx . . $ `vendor/qhull/libqhull_r/user_r.h:642:9`!) {
537 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, fp, 9387, "\n\
538 If the input should be full dimensional, you have several options that\n\
539 may determine an initial simplex:\n\
540 - use 'QJ' to joggle the input and make it full dimensional\n\
541 - use 'QbB' to scale the points to the unit cube\n\
542 - use 'QR0' to randomly rotate the input for different maximum points\n\
543 - use 'Qs' to search all points for the initial simplex\n\
544 - use 'En' to specify a maximum roundoff error less than %2.2g.\n\
545 - trace execution with 'T3' to see the determinant for each point.\n",
546 qh->DISTroundcxx . . $ qhT#DISTround.);
547 #if REALfloatcxx . . $ `vendor/qhull/libqhull_r/user_r.h:146:9`!
548 qh_fprintf(qh, fp, 9388, "\
549 - recompile qhull for realT precision(#define REALfloat 0 in libqhull_r.h).\n");
550 #endif
551 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, fp, 9389, "\n\
552 If the input is lower dimensional:\n\
553 - use 'QJ' to joggle the input and make it full dimensional\n\
554 - use 'Qbk:0Bk:0' to delete coordinate k from the input. You should\n\
555 pick the coordinate with the least range. The hull will have the\n\
556 correct topology.\n\
557 - determine the flat containing the points, rotate the points\n\
558 into a coordinate plane, and delete the other coordinates.\n\
559 - add one or more points to make the input full dimensional.\n\
560 ");
561 }
562 } /* printhelp_singular */
563
564 /*-<a href="qh-user_r.htm#TOC"
565 >-------------------------------</a><a name="printhelp_topology">-</a>
566
567 qh_printhelp_topology(qh, fp )
568 prints descriptive message for qhull topology error with qh_ERRtopology
569
570 notes:
571 no message if qh_QUICKhelp
572 */
573 void qh_printhelp_topologycxx . . $ qh_printhelp_topology(92be47226f66e56f).(qhTcxx . . $ qhT# *qh, FILEcxx . . $ FILE# *fp) {
574
575 if (!qh_QUICKhelpcxx . . $ `vendor/qhull/libqhull_r/user_r.h:642:9`!) {
576 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, fp, 9427, "\n\
577 A Qhull topology error has occurred. Qhull did not recover from facet merges and vertex merges.\n\
578 This usually occurs when the input is nearly degenerate and substantial merging has occurred.\n\
579 See http://www.qhull.org/html/qh-impre.htm#limit\n");
580 }
581 } /* printhelp_topology */
582
583 /*-<a href="qh-user_r.htm#TOC"
584 >-------------------------------</a><a name="printhelp_wide">-</a>
585
586 qh_printhelp_wide(qh, fp )
587 prints descriptive message for qhull wide facet with qh_ERRwide
588
589 notes:
590 no message if qh_QUICKhelp
591 */
592 void qh_printhelp_widecxx . . $ qh_printhelp_wide(92be47226f66e56f).(qhTcxx . . $ qhT# *qh, FILEcxx . . $ FILE# *fp) {
593
594 if (!qh_QUICKhelpcxx . . $ `vendor/qhull/libqhull_r/user_r.h:642:9`!) {
595 qh_fprintfcxx . . $ qh_fprintf(8ec5d2aaf35eb28b).(qh, fp, 9428, "\n\
596 A wide merge error has occurred. Qhull has produced a wide facet due to facet merges and vertex merges.\n\
597 This usually occurs when the input is nearly degenerate and substantial merging has occurred.\n\
598 See http://www.qhull.org/html/qh-impre.htm#limit\n");
599 }
600 } /* printhelp_wide */
601
602 /*-<a href="qh-user_r.htm#TOC"
603 >-------------------------------</a><a name="user_memsizes">-</a>
604
605 qh_user_memsizes(qh)
606 allocate up to 10 additional, quick allocation sizes
607
608 notes:
609 increase maximum number of allocations in qh_initqhull_mem()
610 */
611 void qh_user_memsizescxx . . $ qh_user_memsizes(fb32973c8cc8eae9).(qhTcxx . . $ qhT# *qh) {
612
613 QHULL_UNUSEDcxx . . $ `vendor/qhull/libqhull_r/qhull_ra.h:109:11`!(qh)
614 /* qh_memsize(qh, size); */
615 } /* user_memsizes */
616
617