[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: qhull6 and octave
From: |
Tatsuro MATSUOKA |
Subject: |
Re: qhull6 and octave |
Date: |
Thu, 1 Dec 2011 17:01:22 +0900 (JST) |
Hello
On MinGW,qhull2011 gives errors.
(The qhull library was created using GCC-4.6.1)
For example,
src\DLD-FUNCTIONS\convhulln.cc ......................... PASS 0/3 FAIL 3
***** 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]); assert (v, 1, 10*eps);!!!!! test failedassert (size (h),[6, 4]) expected
6 4but got 0 3values do not match ***** 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, "QJ");
assert (size (h), [12 3]); assert (sortrows (sort (h, 2), [1:3]), [1 2 4; 1 2
5; 1 4 5; 2 3 4; 2 3 6; 2 5 6; 3 4 8; 3 6 7; 3 7 8; 4 5 8; 5 6 8; 6 7 8]);
assert (v, 1.0, 1e6*eps);!!!!! test failedassert (size (h),[12, 3]) expected
12 3but got 0 3values do not match ***** testif HAVE_QHULL tetrahedron
= [1 1 1;-1 -1 1;-1 1 -1;1 -1 -1]; [h, v] = convhulln (tetrahedron); 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);!!!!! test failedassert (h,[1, 2, 3; 1, 2, 4; 1,
3, 4; 2, 3, 4]) expected 1 2 3 1 2 4 1 3 4 2 3 4but
got[](0x3)Dimensions don't match
This error did not occur on qull2010.
Regards
Tatsuro--- On Thu, 2011/12/1, Brad Barber wrote:
> Hi Petr,
>
> Glad it worked. Without seeing the whole build system that was used, here's
> my guess from what you showed me.
>
> Some news first. I've released qhull 2011.2 with several changes, mostly
> minor. Octave may be interested in the fix to qh_new_qhull (call
> qh_prepare_output if !outfile). qh_prepare_output handles options that are
> processed after building the convex hull (e.g., compute area and volume).
> There's a new, simple Makefile for static builds (in src/libqhull).
>
> Please let me know when the Debian builds are available. The qhull download
> page is rather out-of-date. Can someone produce a rpm build? I've also lost
> my archive/mirror site for old Qhull downloads. Let me know if someone would
> like to host it.
> http://www.qhull.org/download/
>
> qhull5 was apparently built with qh_QHpointer=0 [user.h]. The global data
> structure for qhull is defined as a static array qh_qh [libqhull.h]. qhull6
> was built with qh_QHpointer=1. The global data structure for qhull is
> allocated on the heap with a pointer from the global variable qh_qh. This
> allows for multiple global data structures that can be swapped by updating
> qh_qh. Two other pointers/static structures are similarly defined (qh_qhmem
> for the memory allocator and qh_qhstat for statistics).
>
> The extra flexibility comes at some cost. The last time I measured it, the
> cost was 4% overhead in space and 4% in time. The C++ interface for qhull
> uses qh_QHpointer=1. The same effect could be achieved by copying data
> from statically defined structures to/from the heap.
>
> The code references these representations with the 'qh', 'qhmem', and
> 'qhstat' macros. That's why the code has an odd appearance. These macros
> allow the data structures to be allocated elsewhere (e.g., thread-local
> storage or an extra function parameter).
>
> Many thanks for keeping Qhull part of Octave.
>
> --Brad
>
> At 06:09 AM 11/30/2011, Petr Gajdos wrote:
> >Hi Brad,
> >
> >very well, defining qh_QHpointer to 1, i. e.
> >
> >#include <stdio.h>
> >#if defined QHULL5
> >#include <qhull/qhull_a.h>
> >#warning qhull5
> >#else
> >#define qh_QHpointer 1
> >#include <libqhull/qhull_a.h>
> >#warning qhull6
> >#endif
> >...
> >
> >gives same results for qhull6 as for qhull5.
> >
> >When you find time, could you please give me
> >an explanation (maybe cc octave-help@ too)?
> >
> >Have a nice day & thanks a lot,
> >Petr
> >
> >
>
>
- Re: qhull6 and octave,
Tatsuro MATSUOKA <=