octave-maintainers
[Top][All Lists]
Advanced

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

Re: qhull6 and octave


From: Brad Barber
Subject: Re: qhull6 and octave
Date: Wed, 30 Nov 2011 20:47:43 -0500

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
>
>



reply via email to

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