octave-maintainers
[Top][All Lists]
Advanced

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

Re: qh_new_qhull calling conventions


From: Tatsuro MATSUOKA
Subject: Re: qh_new_qhull calling conventions
Date: Wed, 1 Feb 2012 18:33:08 +0900 (JST)

Hello

On Ubuntu 11.10 (32bit), the results are :

$ ./qhulltst2012
Options selected for Qhull 2012.1 2012/01/26:
  run-id 240157318  Qtriangulate  incidence  _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
Number of facets: 12

$ LD_LIBRARY_PATH=/usr/local/qhull-2009.1.3/lib:$LD_LIBRARY_PATH ./qhulltst2009
Options selected for Qhull 2009.1.3 2011/12/06:
  Qtriangulate  incidence  _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
Number of facets: 6

$ LD_LIBRARY_PATH=/usr/local/qhull-2009.1.3/lib:$LD_LIBRARY_PATH 
./qhulltst2009FIX
Options selected for Qhull 2009.1.3 2011/12/06:
  Qtriangulate  incidence  _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
Number of facets: 12

The result of qhulltst2009FIX is different from that in MinGW.

Regards

Tatsuro

--- On Wed, 2012/2/1, Rik  wrote:

> 1/31/12
> 
> Brad,
> 
> I built a small C++ test case to verify the problem with Qhull returning
> either 6 or 12 facets when given a 3D cube input.  I was correct that the
> behavior changed from 2009 to 2012.  But, you were correct that something
> was wrong with the Octave code.
> 
> The prototype for the function qh_new_qhull is:
> 
> int qh_new_qhull(int dim, int numpoints, coordT *points, boolT ismalloc,
>                  char *qhull_cmd, FILE *outfile, FILE *errfile);
> 
> In Octave, the FILE pointers are initialized as
> 
> // Replace the 0 pointer with stdout for debugging information.
> FILE *outfile = 0;
> FILE *errfile = stderr;
> 
> In Qhull2012 this causes no problems.  In Qhull2009, however, I get a hull
> with only 6 facets.  However, if I initialize outfile to a valid FILE
> pointer such as stdout or a pointer returned from fopen() then Qhull2009
> returns 12 facets.  If I had to guess, I'd say that Qhull2009 is not
> checking the argument for a NULL pointer and there is some sort of memory
> corruption happening.
> 
> In my test case, I solved the problem by using
> 
> FILE *outfile = fopen ("/dev/null", "w");
> 
> Octave Maintainer's:
> 
> This should be solved before the 3.6.1 release.  Does anybody have a good
> way to create a throw-away FILE pointer?
> 
> The "/dev/null" solution would be fine except I'm not certain it would work
> on MinGW and Cygwin platforms.  My little bit of a web search seemed to
> indicate that they DO implement this special file.
> 
> Otherwise, we could always use fopen with a temporary file name created
> through tmpnam and then delete it afterwards but this seems like a lot of
> work for every convhull, voronoi, or delaunay call.  
> 
> I've attached my test case and Makefile.  On my machine I had Qhull2009
> installed by the package manager in /usr and Qhull2012 installed by hand in
> /usr/local and used -L options to flip between the two.
> 
> --Rik
> 
>


reply via email to

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