There is no significant efficiency loss to going through the generic interface.

direct/tstc.c was a test program from a very early version of the code, and is 
not really intended for end users.  It doesn't even get compiled any more by my 
Makefile and I should probably just delete it.  However, I've pushed an update 
to github so that it compiles and runs (via, for example, gcc -I.. -I../util 
tstc.c -o tstc ../.libs/libnlopt.a)

On Mar 6, 2014, at 4:10 PM, Peter Rockett <[email protected]> wrote:

> Because it looks to be the simplest method rather than 'funnel' the call 
> through the generic interface; it would seem more efficient to call it 
> directly. And anyway, all (I think) I am trying to do initially is run the 
> test program (direct/tstc.c) you have provided.
> 
> Peter Rockett
> 
> 
> On 06/03/14 20:49, Steven G. Johnson wrote:
>> Why are you calling the direct.c code directly?   You can call it via the 
>> documented NLopt interface with the algorithm GN_DIRECT_L.
>> 
>> On Mar 6, 2014, at 5:00 AM, Peter Rockett <[email protected]> wrote:
>> 
>>> Hi
>>> 
>>> I was wanting to experiment with the DIRECT solver in nlopt. Downloaded, 
>>> built, OK. The test example tstc.c in the /direct directory looks 
>>> absolutely perfect for my use. But when I try to build this test case, I 
>>> get a compilation error. The call to direct_optimize() in /direct/tstc.c 
>>> has 17 arguments whereas the function prototype in /direct/direct.h has 20 
>>> arguments. Moreover, the following three parameters are undocumented in 
>>> /direct/direct_wrap.c
>>> 
>>> double start
>>> double maxtime
>>> int* force_stop
>>> 
>>> It is a little difficult to figure out what is missing because many of the 
>>> arguments in tstc.c call are literal constants but my guess is that i) the 
>>> above three have been added at some time but tstc.c has not been updated, 
>>> ii) updating the documentation in direct_wrap.c has been overlooked. I have 
>>> had a look at the code downstream but it very rapidly degenerates to the 
>>> output from f2c which is not the most readable stuff in the world!
>>> 
>>> Regardless, the nlopt code does not appear to build 'out of the box'.
>>> 
>>> Would you be able to advise on this?
>>> 
>>> Best wishes,
>>> 
>>> Peter Rockett
>>> EEE
>>> University of Sheffield
>>> 
>>> 
>>> 
> 


_______________________________________________
NLopt-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss

Reply via email to