Changeset 330
- Timestamp:
- 03/26/08 15:34:19 (8 months ago)
- Files:
-
- 1 modified
-
trunk/matml/src/ternary/qhull.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/matml/src/ternary/qhull.c
r329 r330 2 2 $Header$ 3 3 4 This file includes the function swhich interact with qhull to compute the4 This file includes the function(s) which interact with qhull to compute the 5 5 convex hull of the free energy function points. 6 6 ***************************************/ … … 14 14 15 15 /*++++++++++++++++++++++++++++++++++++++ 16 This calculates the convex hull of a set of points. 16 This calculates the convex hull of a set of ternary compositions, clipping 17 everything above the plane with the three corners, and removing all 18 non-simplical facets. It should return only the facets making up the minimum 19 energy surface. 17 20 18 21 int qhullCalcHull It returns zero or an error code. … … 28 31 29 32 int **facetverts Pointer which contains the array of facet vertices on 30 return. 33 return. This is changed by realloc() each time the function is called, so it 34 should be NULL when first called. 31 35 32 char **version Pointer which contains the pointer to qh_version on return. 36 char **version Pointer which contains the pointer to qh_version on return, or 37 NULL to ignore this. 33 38 ++++++++++++++++++++++++++++++++++++++*/ 34 39 … … 43 48 { printf ("qhullCalcHull: Non-3-D spaces not supported\n"); return -1; } 44 49 50 /*+ This first re-creates the points array for three reasons: the coordT type 51 may or may not be the same as double, the qhull array needs to have just 52 three entries per point vs. 10+ for ternary_point, and this provides the 53 opportunity to clip or otherwise transform the array. +*/ 45 54 if (!(qpoints = malloc (dim*numpoints*sizeof(coordT)))) 46 55 { printf ("qhullCalcHull: could not allocate memory for points\n"); … … 61 70 #endif 62 71 72 /*+ After qhull runs, this reallocates the array pointed to by facetverts, 73 then fills it, eliminating non-simplical facets along the way (which seem 74 to typically be the binaries). +*/ 63 75 *numfacets = qh num_facets; 64 76 printf ("%d total facets\n", *numfacets); … … 97 109 i--; 98 110 } 111 /* TODO: remove the trivial three-corners facet */ 99 112 } 100 113