Hi, Does anybody
know how to call the JumpDiffusionEngine constructor properly? Because I am new to QuantLib I called the
constructor as it is shown in the example EquityOption: // Black-Scholes
for European method = "Black-Scholes"; europeanOption.setPricingEngine(boost::shared_ptr<PricingEngine>(
new
AnalyticEuropeanEngine)); I modified the corresponding lines to: //
Jump-Diffusion
method = "Jump-Diffusion";
europeanOption.setPricingEngine(boost::shared_ptr<PricingEngine>(
new
JumpDiffusionEngine)); After compiling the code the following error-message
is displayed: error C2512:
'QuantLib::JumpDiffusionEngine': There is no appropriate default-constructor
available How can I implement
the JumpDiffusionEngine properly? Thanks to all, Markus ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Hi Markus,
The prototype of the constructor is as follow: JumpDiffusionEngine(const boost::shared_ptr<VanillaOption::engine>&, Real relativeAccuracy_ = 1e-4, Size maxIterations = 100); You need to pass at least a shared_ptr<VanillaOption::engine> in the arguments. I guess the code should be as follow: boost::shared_ptr<PricingEngine> vanillaEngine( new AnalyticEuropeanEngine)); boost::shared_ptr<PricingEngine> jumpEngine (new JumpDiffusionEngine( vanillaEngine ) )); Regards
|
Free forum by Nabble | Edit this page |