• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..01-Aug-2021-

src/H01-Aug-2021-32,03919,878

README.scipyH A D21-Jan-20201.9 KiB4744

README.scipy

1The directory ./qhull_src/src ships unmodified Qhull 2019.1 "_r"
2version source code.
3
4The file scipy/spatial/qhull_misc.c additionally contains a function
5"qh_new_qhull_scipy" derived from Qhull sources, via the following
6patch:
7
8--- a/scipy/spatial/qhull_src/src/user_r.c
9+++ b/scipy/spatial/qhull_src/src/user_r.c
10@@ -122,7 +122,7 @@
11     An example of using qh_new_qhull is user_eg_r.c
12 */
13 int qh_new_qhull(qhT *qh, int dim, int numpoints, coordT *points, boolT ismalloc,
14-                char *qhull_cmd, FILE *outfile, FILE *errfile) {
15+                char *qhull_cmd, FILE *outfile, FILE *errfile, coordT* feaspoint) {
16   /* gcc may issue a "might be clobbered" warning for dim, points, and ismalloc [-Wclobbered].
17      These parameters are not referenced after a longjmp() and hence not clobbered.
18      See http://stackoverflow.com/questions/7721854/what-sense-do-these-clobbered-variable-warnings-make */
19@@ -158,7 +158,26 @@ int qh_new_qhull(qhT *qh, int dim, int numpoints, coordT *points, boolT ismalloc
20       /* points is an array of halfspaces,
21          the last coordinate of each halfspace is its offset */
22       hulldim= dim-1;
23-      qh_setfeasible(qh, hulldim);
24+      if(feaspoint)
25+      {
26+        coordT* coords;
27+        coordT* value;
28+        int i;
29+        if (!(qh->feasible_point= (pointT*)qh_malloc(hulldim * sizeof(coordT)))) {
30+          qh_fprintf(qh, qh->ferr, 6079, "qhull error: insufficient memory for 'Hn,n,n'\n");
31+          qh_errexit(qh, qh_ERRmem, NULL, NULL);
32+        }
33+        coords = qh->feasible_point;
34+        value = feaspoint;
35+        for(i = 0; i < hulldim; ++i)
36+        {
37+          *(coords++) = *(value++);
38+        }
39+      }
40+      else
41+      {
42+        qh_setfeasible(qh, hulldim);
43+      }
44       new_points= qh_sethalfspace_all(qh, dim, numpoints, points, qh->feasible_point);
45       new_ismalloc= True;
46       if (ismalloc)
47