add .asOptionlet() to MakeCapFloor ?

Posted by Chris Kenyon-2 on
URL: http://quantlib.414.s1.nabble.com/add-asOptionlet-to-MakeCapFloor-tp11828.html

Hi,

this would make life easier.  Effect: only the last cashflow is returned.  The extra code could be something like:

In .hpp after line 66

    //! Only get last coupon, i.e. get caplet version of cap
    //! or floorlet version of floor, etc.
    MakeCapFloor& asOptionlet();

Also before closing };

    bool asOptionlet_;

In .cpp after line 38 in constructor (and before {}):

    asOptionlet_(false)

after new line 53

    //! only leaves the last coupon
    if (asOptionlet_ && leg.size()>1)
        leg.erase(leg.begin(), --leg.end());

Best regards,
Chris


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev