changeset 15885:065bc7944335 stable

fix incorrect results for convhulln in some cases (bug #38013) * convhulln.cc (Fconvhulln): Skip check for non-simplicial facets for 2-dimensional hull. New test.
author John W. Eaton <jwe@octave.org>
date Thu, 03 Jan 2013 11:16:40 -0500
parents 878623ca15e1
children 942d3b0a034e 8ced82e96b48
files src/DLD-FUNCTIONS/convhulln.cc
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/DLD-FUNCTIONS/convhulln.cc	Wed Jan 02 11:26:38 2013 -0500
+++ b/src/DLD-FUNCTIONS/convhulln.cc	Thu Jan 03 11:16:40 2013 -0500
@@ -179,7 +179,7 @@
         {
           octave_idx_type j = 0;
 
-          if (! nonsimp_seen && ! facet->simplicial)
+          if (! (nonsimp_seen || facet->simplicial || qh hull_dim == 2))
             {
               nonsimp_seen = true;
 
@@ -313,4 +313,9 @@
 %! h = sortrows (sort (h, 2), [1 2 3]);
 %! assert (h, [1 2 3;1 2 4; 1 3 4; 2 3 4]);
 %! assert (v, 8/3, 10*eps);
+
+%!testif HAVE_QHULL
+%! triangle=[0 0; 1 1; 1 0; 1 2];
+%! h = convhulln (triangle);
+%! assert (size (h), [3 2]);
 */