Re: Adding functions to QuantLib SWIG

Posted by Billy Ng-5 on
URL: http://quantlib.414.s1.nabble.com/Adding-functions-to-QuantLib-SWIG-tp6140p6150.html

In the swap valuation example.
The following change will cause a boostrapping of the curves

        boost::shared_ptr<SimpleQuote> fiveYearsRate =
            boost::dynamic_pointer_cast<SimpleQuote>(s5yRate);
        fiveYearsRate->setValue(0.0460);

How do I do a similar dynamic pointer casting in SWIG/Java?

Billy
-----Original Message-----
From: Luigi Ballabio [mailto:[hidden email]]
Sent: Thursday, April 19, 2012 3:16 PM
To: Billy Ng
Cc: [hidden email]
Subject: Re: [Quantlib-users] Adding functions to QuantLib SWIG


The CallableBonds example.

Luigi

On Thu, Apr 19, 2012 at 1:53 AM, Billy Ng <[hidden email]> wrote:

> Hi Luigi,
>
> I am wondering which example has classese that have not exported yet so that I can give it a trial.
> That should be a good reference to try out the SWIG
>
> Many Thanks for your help
>
> Billy
>
> -----Original Message-----
> From: Billy Ng [mailto:[hidden email]]
> Sent: Thursday, April 19, 2012 12:51 AM
> To: Luigi Ballabio
> Cc: [hidden email]
> Subject: Re: [Quantlib-users] Adding functions to QuantLib SWIG
>
>
>
> Thank you.
> It should generate all the needed template classes
>
> Billy
>
> -----Original Message-----
> From: Luigi Ballabio [mailto:[hidden email]]
> Sent: Thursday, April 19, 2012 12:15 AM
> To: Billy Ng
> Cc: Billy Ng; [hidden email]
> Subject: Re: [Quantlib-users] Adding functions to QuantLib SWIG
>
>
> Right now there's a PiecewiseFlatForward exported which is
> PiecewiseYieldCurve<ForwardRate, BackwardFlat>.
>
> If you want more combinations, you have to modify
> piecewiseyieldcurve.i (look at the bottom of the file; there's a few
> examples) and regenerate the wrappers.
>
> Luigi
>
> On Wed, Apr 18, 2012 at 6:07 PM, Billy Ng <[hidden email]> wrote:
>> How to translate this YieldTermStructure?
>> There is no PiecewiseYieldCurve<Discount, Lognormal>
>> Billy
>> --
>> Sent from my Defy
>>
>>
>> Luigi Ballabio <[hidden email]> wrote:
>>>
>>> It doesn't really answer the question, but you should already have all
>>> the classes you need for swap valuation (you can see how it's done in
>>> the Python examples, for instance).
>>>
>>> As for how to convert new classes, I'll have to write down some docs
>>> on that when I have some time.  In the meantime, I'm afraid you'll
>>> have to look at the existing interfaces and do some cargo-cult
>>> programming.  Do post again if you get stuck (it's easier to find time
>>> for a specific problem with some code).
>>>
>>> Luigi
>>>
>>> On Wed, Apr 18, 2012 at 1:27 PM, Billy Ng <[hidden email]> wrote:
>>> > Hi,
>>> >
>>> > As an exercise, I am trying to convert the SwapValuation example into
>>> > Java.
>>> > Any example in how to convert new classes with SWIG, e.g.
>>> > PieceWiseYieldCurve?
>>>
>>
> ------------------------------------------------------------------------------
> Better than sec? Nothing is better than sec when it comes to
> monitoring Big Data applications. Try Boundary one-second
> resolution app monitoring today. Free.
> http://p.sf.net/sfu/Boundary-dev2dev
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users