Re: american options delta leads to seg.fault.
Posted by Luigi Ballabio-2 on
URL: http://quantlib.414.s1.nabble.com/american-options-delta-leads-to-seg-fault-tp10543p10544.html
On 2004.04.05 05:54, Dirk Eddelbuettel wrote:
> This is similar to the one I reported last week concerning barrier
> options.
> In this case a simple delta() call on an American option leads to a
> seg.fault. There is a fair chance that I am setting this up the
> wrong--suggestions would be welcome -- but I guess QL should not
> segfault.
Dirk,
write your main() as:
int main() {
try {
... your stuff here ...
} catch (std::exception& e) {
std::cout << e.what() << std::endl;
}
}
and the segfault will go away. What happens is that the current
implementation of binomial engines do not provide greeks, and QuantLib
signals it by throwing an exception when delta() is called.
HTH,
Luigi