|
From: Nigel S. <nig...@gm...> - 2015-05-11 22:20:14
|
QuantLib Developers, Reference http://quantlib.org/slides/dima-ql-intro-2.pdf, page 23 In Dimitri Reiswich's QuantLib Solver example, he sets up a boost function and binds this to his function impliedVolProblem() which returns the calculation of the Black Scholes Option Price - price. Are the following two steps required, or is there a way to refactor and simplify the code and use a function pointer directly in the QuantLib Solver.solve method without having to use the boost::function and boost::bind? // Step 1 - Setup a boost function boost::function < Real(Volatility) > VolatilityFunc ; // Step 2 - Bind the boost function to all market parameters, keep volatility as variant VolatilityFunc = boost::bind(&impliedVolatilityProblem, spot, strikeprice, rd, rf, _1, tau, phi, price); Real res1 = bisectionSolver.solve(VolatilityFunc, accuracy, guess, min, max); Very best regards Nigel Sperinck |