Discussion:
[NLopt-discuss] C++: global algorithms and invalid argument exceptions
Rory Clune
2012-03-06 20:04:58 UTC
Permalink
Hello,

I have implemented the example in
C++<http://ab-initio.mit.edu/wiki/index.php/NLopt_Tutorial#Example_in_C.2B.2B>from
ab-initio, and added a few lines to set a local optimization algorithm
[nlopt::opt sub_opt(...)] and its stopping criteria.

Everything works fine when solving the example problem using AUGLAG as the
main algorithm with LD_MMA or LN_COBYLA as the local algorithm. When I
switch to GD_STOGO or GN_CRS2_LM as the local algorithm, however, I get an
invalid argument exception. The same exception is thrown when I use GD_MLSL
as the main algorithm and LD_MMA as the local algorithm.

Has anyone encountered this problem?

Thanks,
Rory

P.S. On a perhaps related note, does anyone know the difference between all
the variants of AUGLAG specified in the algorithm enum of nlopt.hpp?
(AUGLAG, LN_AUGLAG, LD_AUGLAG, ...) The reference
manual<http://ab-initio.mit.edu/wiki/index.php/NLopt_Algorithms#Augmented_Lagrangian_algorithm>talks
about AUGALG and AUGLAG_EQ, but I haven't found a reference to the
LN_, LD_ variants.
Steven G. Johnson
2012-03-06 22:49:20 UTC
Permalink
Post by Rory Clune
Hello,
I have implemented the example in C++ from ab-initio, and added a few lines to set a local optimization algorithm [nlopt::opt sub_opt(...)] and its stopping criteria.
Everything works fine when solving the example problem using AUGLAG as the main algorithm with LD_MMA or LN_COBYLA as the local algorithm. When I switch to GD_STOGO or GN_CRS2_LM as the local algorithm, however, I get an invalid argument exception.
Global optimization only works for a finite domain; you have to put upper and lower bounds on all the variables.
Loading...