It gives the following benefits:

1) Uses inheritance from abstract base class "OptimProblem", as
opposed to the default "nlopt.hpp" where one has to set function
pointers properly and externally manage any persistent data that those
functions use.

So, using nlopt this way, the code becomes simpler; here's a sample:
https://github.com/pkarasev3/nlmagick/blob/master/unittest/nlmagick_test_fmincon.cpp

And actually "nlopt.hpp" as seen by the api user is radically
different, with the complicated stuff having been moved internally.
The only header the user sees is:
https://github.com/pkarasev3/nlmagick/blob/master/include/nlmagick/nlopt.hpp


2) it uses CMake to build, which handles the "building for windows"
issues and alleviates clutter in headers, and makes it generally
easier to link into projects with other libraries. And you can add
flags for using OpenMP, SSSE3, and so on conveniently.

Defining executables that use nlopt/nlmagick is just a matter then of
declaring the CMakeLists.txt file, such as:
https://github.com/pkarasev3/nlmagick/blob/master/samples/CMakeLists.txt
which will generate either makefiles on linux / cygwin or VS solution
files on windows.


3) samples / tests show how to use it together with the Boost
libraries, so you get automatic parsing of command-line flags and
other nice features.


Peter K.






On Thu, Sep 1, 2011 at 5:53 PM, Steven G. Johnson <[email protected]> wrote:
> Thanks Peter,
>
> Your site doesn't have documentation; could you elaborate a little about
> what your wrapper provides in addition to the usual nlopt.hpp interface?
>
> On Sep 1, 2011, at 11:19 AM, Peter Karasev wrote:
>
>> Hi,
>>
>> Just wanted to let users of nlopt know about a C++ wrapper a friend
>> and I put together, with source hosted here:
>> https://github.com/pkarasev3/nlmagick
>>
>> It uses CMake to simplify the build / test procedure, and is geared
>> largely towards computer-vision applications. For example, rigid pose
>> estimation without "feature points":
>> http://www.youtube.com/watch?v=72pyG2GL_IM
>>
>>
>> Best,
>> Peter Karasev
>>
>> _______________________________________________
>> NLopt-discuss mailing list
>> [email protected]
>> http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss
>
>
> _______________________________________________
> NLopt-discuss mailing list
> [email protected]
> http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss
>

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

Reply via email to