OK, problem solved. I did not think that the test "if (!grad.empty())" was necessary in the case of a derivative-based algorithm like LD_SLSQP.
On Fri, Sep 28, 2012 at 6:10 PM, John Deas <[email protected]> wrote: > Hello, > > I have modified my code to remove the classe. The problem is quite simple, > a quadratic cost function centered in xF, and a quadratic constraint > centered in xC. The feasible domain is a disc of radius rad around xC. The > updated version can be found at: http://pastebin.com/3vtjMn7B . What > happens is that, using LD_SLSQP, at the third evaluation of f the > referenced std::vec grad is of dimension 0 instead of 2, which results in a > segmentation fault. > > Can somebody give me a hand on this ? > > Thanks, > > JD > > > On Wed, Sep 19, 2012 at 3:31 PM, John Deas <[email protected]> wrote: > >> Hello everyone ! >> >> I am newto nlopt,and I am trying to integrate nlopt algorithms into an >> optimization process. The cost and constraint function can not be described >> in a simple way, therefore I need to use a class with this function as a >> method. I use a wrapper function which I can pass to the nlopt routine. >> When I use MMA, the process run fine, but seem quite slow to converge (cost >> and constraints are quadratic, and there only are 2 variables). With SLSQP >> however I get a segmentation fault. The code had been posted at >> http://pastebin.com/W99r5rXb . >> >> Can somebody help me ? >> >> Thanks, >> >> JD >> > >
_______________________________________________ NLopt-discuss mailing list [email protected] http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss
