[Scipy-svn] r6814 - trunk/scipy/spatial
scipy-svn at scipy.org
scipy-svn at scipy.org
Wed Sep 22 05:00:45 EDT 2010
Author: ptvirtan
Date: 2010-09-22 04:00:45 -0500 (Wed, 22 Sep 2010)
New Revision: 6814
Modified:
trunk/scipy/spatial/qhull.pyx
Log:
BUG: spatial/qhull: handle degenerate simplices correctly in _find_simplex_directed
Modified: trunk/scipy/spatial/qhull.pyx
===================================================================
--- trunk/scipy/spatial/qhull.pyx 2010-09-22 09:00:38 UTC (rev 6813)
+++ trunk/scipy/spatial/qhull.pyx 2010-09-22 09:00:45 UTC (rev 6814)
@@ -713,24 +713,20 @@
if c[k] < -eps:
# The target point is in the direction of neighbor `k`!
-
m = d.neighbors[(ndim+1)*isimplex + k]
if m == -1:
# The point is outside the triangulation: bail out
start[0] = isimplex
return -1
- # Check that the target simplex is not degenerate.
- v = d.transform[m*ndim*(ndim+1)]
- if v != v:
- # nan
- continue
- else:
- isimplex = m
- inside = -1
- break
- elif c[k] > 1 + eps:
- # we're outside this simplex
+ isimplex = m
+ inside = -1
+ break
+ elif c[k] <= 1 + eps:
+ # we're inside this simplex
+ pass
+ else:
+ # we're outside (or the coordinate is nan; a degenerate simplex)
inside = 0
if inside == -1:
More information about the Scipy-svn
mailing list