octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Qhull test changes


From: Brad Barber
Subject: Re: Qhull test changes
Date: Mon, 30 Jan 2012 19:12:53 -0500

At 03:09 PM 1/30/2012, Rik wrote:
On 01/30/2012 06:39 AM, Ben Abbott wrote:
>> Rik,
>>
>> I pushed a changeset to fix the tests.
>>
>>        http://hg.savannah.gnu.org/hgweb/octave/rev/2633baa831e2
>>
>> Ben
>>
I now get an error the other direction.  See below.

  ***** testif HAVE_QHULL
 cube = [0 0 0;1 0 0;1 1 0;0 1 0;0 0 1;1 0 1;1 1 1;0 1 1];
 [h, v] = convhulln (cube, "Qt");
 assert (size (h), [12 3]);
 h = sortrows (sort (h, 2), [1:3]);
 assert (h, [1 2 4; 1 2 6; 1 4 8; 1 5 6; 1 5 8; 2 3 4; 2 3 7; 2 6 7; 3 4 7;
4 7 8; 5 6 7; 5 7 8]);
 assert (v, 1, 10*eps);
 [h2, v2] = convhulln (cube); % Test defaut option = "Qt"
 assert (size (h2), size (h))
 h2 = sortrows (sort (h2, 2), [1:3]);
 assert (h2, h);
 assert (v2, v, 10*eps);
!!!!! test failed
assert (size (h),[12, 3]) expected
   12    3
but got
   6   4
values do not match

Previously the tests were matched to Qhull <= 2010.  Now the tests are
matched to Qhull >= 2011.  In either case, if Octave is linked against the
other version then a test error results and users are going to think it is
Octave's fault.  This is absolutely up-to-date Octave code from Mercurial
with your changeset, but linked against the default Qhull in Kubuntu 10.04
which is version 2009.

A couple of quick ways to solve this.

1) Don't check the result.  Check only that h = convhulln (..., "Qt")
matches h2 = convhulln (...) which shows that Octave is passing Qt as the
default option.

2) Check the size of the result (12 x 3 or 6 x 4) and then compare against
the appropriate array.

3) Embody the test in configure.ac so that Octave can identify which
version of Qhull it is linking against.  Then you could use two testif
macros, say HAVE_QHULL or HAVE_QHULL_NEW.

Cheers,
Rik

Rik,

This is a strange result.   As demonstrated below, Qhull 2003.1 recognized option Qt.  Early versions of qhull would have reported an error for an unknown option if given Qt.  So I'm fairly confident that Octave is not passing 'Qt' as the default option to Qhull 2003.1.  That would explain the '6   4' result.

ISPY-/c/backup/qhull/qhull-2003.1-win> rbox c | qhull Qt i
12
6 2 0
4 6 0
5 4 0
1 5 0
5 6 4
6 5 7
2 3 0
3 1 0
6 3 2
3 6 7
3 5 1
5 3 7

---
Your previously reported result for 2009.1 doesn't agree with my copy of 2009.1. 

# Your result
convhulln (cube, 'Qt FO')
Options selected for Qhull 2009.1 2009/06/14:
  Qtriangulate  _pre-merge  _zero-centrum  _max-width  1
  Error-roundoff 1.4e-15  _one-merge 9.7e-15  _near-inside 4.9e-14
  Visible-distance 2.8e-15  U-coplanar-distance 2.8e-15  Width-outside 5.5e-15
  _wide-facet 1.7e-14
ans =

   4   1   2   3
   5   6   2   1
   8   5   1   4
   6   7   3   2
   7   8   4   3
   8   7   6   5

# Using qhull 2009.1
ISPY-/c/download/installers/qhull-2009.1/src> rbox c | qhull Qt FO i
Options selected for Qhull 2009.1 2009/06/14:
  Qtriangulate  incidence  _pre-merge  _zero-centrum  _max-width  1
  Error-roundoff 6.9e-016  _one-merge 4.9e-015  _near-inside 2.4e-014
  Visible-distance 1.4e-015  U-coplanar-distance 1.4e-015
  Width-outside 2.8e-015  _wide-facet 8.3e-015
12
6 2 0
4 6 0
5 4 0
1 5 0
5 6 4
6 5 7
2 3 0
3 1 0
6 3 2
3 6 7
3 5 1
5 3 7

Something odd is going on.
                                            --Brad

reply via email to

[Prev in Thread] Current Thread [Next in Thread]