[Couenne] Call couenne from C++
Pietro Belotti
pbelott at clemson.edu
Mon Sep 12 12:52:42 EDT 2011
Marco,
>>> I would like to use the couenne solver from C++.
>>>
>>> The simplest way is by invoking Couenne as an external process (i.e.,
>>> by means of the system() standard C function).
>>> However this is very expensive in terms of resource consumption,
>>> especially in cases, like mine, when Couenne is to be invoked
>>> frequently.
>>>
>>> So I wonder if there a way to perform these steps in "native" C++
>>> (i.e., without calling external processes):
>>> 1. to dynamically create the problem model (or at least update a
>>> static description with new parameters)
>>> 2. to pass this problem to Couenne
>>> 3. to solve it and retrieve the results
>>>
>>> Is it actually possible?
Short answer: Not yet. This has been in the works for a while. There is a
working prototype of an interface to Ipopt that is created within Couenne
and not by AMPL, but that is, for now, only used in one of Couenne's
heuristics.
The aim is to make that code available throughout Couenne and allow users
to create their own MINLP using Couenne's library and then link their
program to it. I think something like this should be available in the next
stable version, so at the latest by summer next year.
> Do you mean the files ./Couenne/src/readnl/CouenneAmplInterface.[ch]pp
> in the Couenne source tree?
Those files contain, with ./Couenne/src/readnl/readnl.cpp, procedures to
input a MINLP. Note, however, that AMPL is (for now) still necessary as
Ipopt is reading the nonlinear program from an AMPL data structure.
Pietro
--
Pietro Belotti
Dept. of Mathematical Sciences
Clemson University
email: pbelott at clemson.edu
phone: 864-656-6765
web: myweb.clemson.edu/~pbelott
On Thu, 8 Sep 2011, sguazt wrote:
> On Thu, Sep 8, 2011 at 2:53 PM, Stefan Vigerske
> <stefan at math.hu-berlin.de> wrote:
>> Hi,
>>
>>> I would like to use the couenne solver from C++.
>>>
>>> The simplest way is by invoking Couenne as an external process (i.e.,
>>> by means of the system() standard C function).
>>> However this is very expensive in terms of resource consumption,
>>> especially in cases, like mine, when Couenne is to be invoked
>>> frequently.
>>>
>>> So I wonder if there a way to perform these steps in "native" C++
>>> (i.e., without calling external processes):
>>> 1. to dynamically create the problem model (or at least update a
>>> static description with new parameters)
>>> 2. to pass this problem to Couenne
>>> 3. to solve it and retrieve the results
>>>
>>> Is it actually possible?
>>
>> You can look at the Couenne/AMPL interface on how the problem is setup and
>> the solution is retrieved.
>
> Hi,
>
> Do you mean the files ./Couenne/src/readnl/CouenneAmplInterface.[ch]pp
> in the Couenne source tree?
>
> -- Marcp
>
>> Also the OS and GAMSlinks projects have interfaces to Couenne.
>>
>> Stefan
>>
>>>
>>> Thank you very much,
>>>
>>> -- Marco
>>>
>>> _______________________________________________
>>> Couenne mailing list
>>> Couenne at list.coin-or.org
>>> http://list.coin-or.org/mailman/listinfo/couenne
>>>
>>
>>
>> --
>> Stefan Vigerske
>> Humboldt University Berlin, Numerical Mathematics
>> http://www.math.hu-berlin.de/~stefan
>>
>
> _______________________________________________
> Couenne mailing list
> Couenne at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/couenne
>
More information about the Couenne
mailing list