Posted by
Lluis Pujol Bajador on
URL: http://quantlib.414.s1.nabble.com/Python-BlackIborCouponPricer-SwapRateHelper-solved-tp5560p5562.html
Hi,
I am also interested on using floating Rate Bonds on Python.
(unfortunatelly I am novice to both Quantlib and SWIG)
I am trying to create the shared_ptr<FloatingRateCouponPricer>
interface, as suggested I followed the shared_ptr<CashFlow>, but I got
lost with the private member and also the registerWith that cointains
IborCouponPricer.
This is the C++ version of IborCouponPricer, any help would be appreciated.
class IborCouponPricer : public FloatingRateCouponPricer {
public:
IborCouponPricer(const Handle<OptionletVolatilityStructure>& v =
Handle<OptionletVolatilityStructure>())
: capletVol_(v) { registerWith(capletVol_); }
Handle<OptionletVolatilityStructure> capletVolatility() const{
return capletVol_;
}
void setCapletVolatility(
const Handle<OptionletVolatilityStructure>& v =
Handle<OptionletVolatilityStructure>()) {
unregisterWith(capletVol_);
capletVol_ = v;
registerWith(capletVol_);
update();
}
private:
Handle<OptionletVolatilityStructure> capletVol_;
};
Lluís
Luigi Ballabio escribió:
> On Thu, 2009-09-17 at 12:53 -0400, Charles Swiger wrote:
>
>> Made much more progress with Bonds.cpp, now I'm stuck on how to
>> Pythonize:
>>
>> // Coupon pricers
>> boost::shared_ptr<IborCouponPricer> pricer(new BlackIborCouponPricer);
>>
>>
>> It exists in Quantlib-0.9.7/ql/cashflows/couponpricer.cpp, the closest I
>> can find in quantlib_wrap.cpp is IborCoupon
>>
>
> That's not exported. It should be added to the SWIG interface. Do you
> want to have a try? You should export
> shared_ptr<FloatingRateCouponPricer>. You can look at the way
> shared_ptr<CashFlow> is exported to get an example. I'll be here if you
> get stuck.
>
> Luigi
>
>
>
__________ Información de ESET NOD32 Antivirus, versión de la base de firmas de virus 4589 (20091109) __________
ESET NOD32 Antivirus ha comprobado este mensaje.
http://www.eset.com------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.
http://p.sf.net/sfu/bobj-july_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users