Re: Adding a payoff function

Posted by Luigi Ballabio-2 on
URL: http://quantlib.414.s1.nabble.com/Adding-a-payoff-function-tp2939p2948.html

On 2004.05.19 11:20, Nicolas Magnette wrote:

> Here is my modified payoff. I had to add a
> funstion "eval" as I need the calculation of the
> payoff to take more than one argument and this is
> impossible with the operator which is standard for all
> payoffs.
>
>     class MyPayoff : public StrikedTypePayoff {
>     public:
>         MyPayoff(...)
>         : ...  {}
>         double operator()(double price) const;
>         double eval(double price, Time time_elapsed) const;
>         ...
>      private:
>          ...
>     };
>
>     inline double MyPayoff::eval(double price, Time
> time_elapsed) const {
> ...
> }

Nicolas,
        besides declaring it, did you actually define operator()  
somewhere?

Later,
        Luigi