Re: SingleAssetOption::setUnderlying needed
Posted by Rod Pienaar on Apr 24, 2002; 2:43am
URL: http://quantlib.414.s1.nabble.com/SingleAssetOption-setUnderlying-needed-tp2007p2008.html
Vadim
<Vadim Wrote>I seem to need a method to set underlying on a SingleAssetOption.
Unfortunately, there is no such method.
I had exactly the same thoughts. I get around this by constructing a new option with new attribute values each time they change. Its not the most efficient way of doing things and additional get/set methods would be useful.
<Vadim Wrote>Why the methods are virtual? I looked at the default implementation of
setVolatility() and found it more than adequate.
The method may be adequate but what if a developer wants to provide a sub-class of single asset option and also provide his own implementation? If the method were not declared virtual he might get some unexpected behaviour when in fact he wanted it to behave polymorphically. The class is just future proofing itself.
Regs
Rod
--
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.