Re: Subclassing (the RateHelper) in Python

Posted by Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/Subclassing-the-RateHelper-in-Python-tp4133p4134.html

On 10/14/2005 11:24:10 AM, ago wrote:
> I am trying to subclass the RateHelper using python, so that the
> derived class (Inflation Linked Bond) can be used within the
> bootstrapper. I am struggling my way through c++, swig and the  
> wrapper code, and so far I failed miserably with the error:
>
> NotImplementedError: No matching function for overloaded
> 'new_PiecewiseFlatForward'

I guess the wrappers didn't recognize instances of your class as rate  
helpers. What was the interface you exported? Can you post the relevant  
bit of the .i file?


> I then tried the "easier" task of subclassing (in python) the
> SwapRateHelper, overriding some of the methods for testing purposes.

That won't work. SWIG must be told to generate special code for that  
(see the SWIG documentation for "directors".) However, I'm under the  
impression that it would not work because we're exporting smart  
pointers rather than the actual classes.

Later,
        Luigi


----------------------------------------

To err is human -- to blame it on a computer is even more so.
-- unknown