Tuesday, October 5, 2010

IPOPT and F#

Theoretically, the C# interface that I developed for IPOPT should make it possible to access IPOPT from all .NET languages. To illustrate this, I recently implemented the basic HS071 example in C# and VB.NET versions.

As a proof-of-concept and as a first attempt to learn F#, I have now also implemented the HS071 example in F#. The F# source code can be found here. This is my first F# program ever, so I am sure it can be substantially improved. Nonetheless, it did compile and efficiently solved the HS071 example. Needless to say, I am pleased to have reached this far :-)

I have not yet packaged the F# example in a regular csipopt release, but the latest revision of the source code can be downloaded via a Subversion client. For further instructions, see this page.

3 comments:

  1. I found out today that someone else had beaten me to it, implementing an F# program that is using csipopt :-)

    Read more about this parallel effort on http://caxelrud.blogspot.com/2010/09/large-scale-nonlinear-optimization-for.html

    ReplyDelete
  2. Thanks for sharing your work on csipopt. As you mention, I am testing it with F#. I have a question. For a problem, did you compare execution time between the implementation in .Net and in C (native)?

    ReplyDelete
  3. So far, I have not tested any larger problems on csipopt, so I do not have any benchmarks available right away. When I tested the HS071 example on my two year old workstation, the total time was less than 0.02 seconds. I cannot say for sure, but I do not think the C version of HS071 performed any better.
    Have you experienced any bottlenecks in the csipopt execution?

    ReplyDelete