lballabio / QuantLib-SWIG

QuantLib wrappers to other languages
Other
343 stars 286 forks source link

Unable to use solvers #9

Closed dave-fl closed 8 years ago

dave-fl commented 8 years ago

Is there anything that must be done to use the solvers that are available? It doesn't seem like there are any solve() methods being generated. Tried Bisection and Brent.

lballabio commented 8 years ago

I've been using them successfully in Python, but they might not be supported in other bindings. In what language are you trying to use them?

dave-fl commented 8 years ago

.NET specifically C# or F#

lballabio commented 8 years ago

I see. Yes, there's no solve method exported to C#, probably because none of us knew the C# interface to C++ well enough to make it work. By looking at https://github.com/lballabio/QuantLib-SWIG/blob/master/SWIG/functions.i and https://github.com/lballabio/QuantLib-SWIG/blob/master/SWIG/optimizers.i, I think it could be done by replicating the approach used for Java.

dave-fl commented 8 years ago

Updated the config slightly. Basically copied java, renamed () operator and added %module(directors="1") NQuantLibc

I could not get required director code to generate without the last piece.

lballabio commented 8 years ago

Great. May you submit your changes as a pull request?

dave-fl commented 8 years ago

Yes no problem.

lballabio commented 8 years ago

Solved by #10