66
77 see qh-geom.htm and geom.h
88
9- Copyright (c) 1993-2012 The Geometry Center.
10- $Id: //main/2011 /qhull/src/libqhull/geom.c#3 $$Change: 1464 $
11- $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
9+ Copyright (c) 1993-2015 The Geometry Center.
10+ $Id: //main/2015 /qhull/src/libqhull/geom.c#2 $$Change: 1995 $
11+ $DateTime: 2015/10/13 21:59:42 $$Author: bbarber $
1212
1313 infrequent code goes into geom2.c
1414*/
@@ -465,7 +465,7 @@ facetT *qh_findbestnew(pointT *point, facetT *startfacet,
465465 } /* end of !flipped */
466466 } /* FORALLfacet from startfacet or qh newfacet_list */
467467 }
468- if (testhorizon || !bestfacet )
468+ if (testhorizon || !bestfacet ) /* testhorizon is always True. Keep the same code as qh_findbest */
469469 bestfacet = qh_findbesthorizon (!qh_IScheckmax , point , bestfacet ? bestfacet : startfacet ,
470470 !qh_NOupper , & bestdist , numpart );
471471 * dist = bestdist ;
@@ -502,7 +502,7 @@ facetT *qh_findbestnew(pointT *point, facetT *startfacet,
502502 notes:
503503 assumes numrow == numcol-1
504504
505- see Golub & van Loan 4.4-9 for back substitution
505+ see Golub & van Loan, 1983, Eq. 4.4-9 for "Gaussian elimination with complete pivoting"
506506
507507 solves Ux=b where Ax=b and PA=LU
508508 b= [0,...,0,sign or 0] (sign is either -1 or +1)
@@ -682,7 +682,7 @@ pointT *qh_getcenter(setT *vertices) {
682682 * coord = 0.0 ;
683683 FOREACHvertex_ (vertices )
684684 * coord += vertex -> point [k ];
685- * coord /= count ;
685+ * coord /= count ; /* count>=2 by QH6003 */
686686 }
687687 return (center );
688688} /* getcenter */
@@ -801,7 +801,7 @@ void qh_normalize(coordT *normal, int dim, boolT toporient) {
801801 if nearzero
802802 sets norm to direction of maximum value
803803*/
804- void qh_normalize2 (coordT * normal , int dim , boolT toporient ,
804+ void qh_normalize2 (coordT * normal , int dim , boolT toporient ,
805805 realT * minnorm , boolT * ismin ) {
806806 int k ;
807807 realT * colp , * maxp , norm = 0 , temp , * norm1 , * norm2 , * norm3 ;
@@ -894,7 +894,7 @@ pointT *qh_projectpoint(pointT *point, facetT *facet, realT dist) {
894894 pointT * newpoint , * np , * normal ;
895895 int normsize = qh normal_size ;
896896 int k ;
897- void * * freelistp ; /* used !qh_NOmem */
897+ void * * freelistp ; /* used if !qh_NOmem by qh_memalloc_() */
898898
899899 qh_memalloc_ (normsize , freelistp , newpoint , pointT );
900900 np = newpoint ;
@@ -932,7 +932,7 @@ void qh_setfacetplane(facetT *facet) {
932932 int normsize = qh normal_size ;
933933 int k ,i , oldtrace = 0 ;
934934 realT dist ;
935- void * * freelistp ; /* used !qh_NOmem */
935+ void * * freelistp ; /* used if !qh_NOmem by qh_memalloc_() */
936936 coordT * coord , * gmcoord ;
937937 pointT * point0 = SETfirstt_ (facet -> vertices , vertexT )-> point ;
938938 boolT nearzero = False ;
@@ -1110,7 +1110,7 @@ void qh_sethyperplane_det(int dim, coordT **rows, coordT *point0,
11101110 if (dim == 2 ) {
11111111 normal [0 ]= dY (1 ,0 );
11121112 normal [1 ]= dX (0 ,1 );
1113- qh_normalize2 (normal , dim , toporient , NULL , NULL );
1113+ qh_normalize2 (normal , dim , toporient , NULL , NULL );
11141114 * offset = - (point0 [0 ]* normal [0 ]+ point0 [1 ]* normal [1 ]);
11151115 * nearzero = False ; /* since nearzero norm => incident points */
11161116 }else if (dim == 3 ) {
@@ -1120,7 +1120,7 @@ void qh_sethyperplane_det(int dim, coordT **rows, coordT *point0,
11201120 dX (2 ,0 ), dZ (2 ,0 ));
11211121 normal [2 ]= det2_ (dX (2 ,0 ), dY (2 ,0 ),
11221122 dX (1 ,0 ), dY (1 ,0 ));
1123- qh_normalize2 (normal , dim , toporient , NULL , NULL );
1123+ qh_normalize2 (normal , dim , toporient , NULL , NULL );
11241124 * offset = - (point0 [0 ]* normal [0 ] + point0 [1 ]* normal [1 ]
11251125 + point0 [2 ]* normal [2 ]);
11261126 maxround = qh DISTround ;
@@ -1148,7 +1148,7 @@ void qh_sethyperplane_det(int dim, coordT **rows, coordT *point0,
11481148 normal [3 ]= det3_ (dX (2 ,0 ), dY (2 ,0 ), dZ (2 ,0 ),
11491149 dX (1 ,0 ), dY (1 ,0 ), dZ (1 ,0 ),
11501150 dX (3 ,0 ), dY (3 ,0 ), dZ (3 ,0 ));
1151- qh_normalize2 (normal , dim , toporient , NULL , NULL );
1151+ qh_normalize2 (normal , dim , toporient , NULL , NULL );
11521152 * offset = - (point0 [0 ]* normal [0 ] + point0 [1 ]* normal [1 ]
11531153 + point0 [2 ]* normal [2 ] + point0 [3 ]* normal [3 ]);
11541154 maxround = qh DISTround ;
@@ -1229,3 +1229,6 @@ void qh_sethyperplane_gauss(int dim, coordT **rows, pointT *point0,
12291229 for (k = dim - 1 ; k -- ; )
12301230 * offset -= * pointcoord ++ * * normalcoef ++ ;
12311231} /* sethyperplane_gauss */
1232+
1233+
1234+
0 commit comments