Mercurial > hg > octave-nkf
changeset 14310:decea31ea010 stable
Fix qhull tests.
* convhulln.cc: Matlab uses "Qt" for num dimensions < 5 and "Qt Qx" otherwise.
Test modified to verify "Qt" is the default option for nd = 3, and to assert
the correct result.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Mon, 30 Jan 2012 08:22:32 -0500 |
parents | 824e5d362aba |
children | d4f37aa5d126 |
files | src/DLD-FUNCTIONS/convhulln.cc |
diffstat | 1 files changed, 9 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/DLD-FUNCTIONS/convhulln.cc +++ b/src/DLD-FUNCTIONS/convhulln.cc @@ -278,11 +278,16 @@ /* %!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); -%! assert (size (h), [6 4]); -%! h = sortrows (sort (h, 2), [1:4]); -%! assert (h, [1 2 3 4; 1 2 5 6; 1 4 5 8; 2 3 6 7; 3 4 7 8; 5 6 7 8]); +%! [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); %!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];