Login  Register

RE: Trying the example code

Posted by Luigi Ballabio-4 on Mar 20, 2002; 5:12am
URL: http://quantlib.414.s1.nabble.com/Trying-the-example-code-tp1927p1931.html

Hi Andre,

At 02:09 PM 3/20/02 +0200, Andre Louw wrote:
>I have retrieved Quantlib version 0.2.1 from the CVS repository,

Could you check what is returned by running
quantlib-config --version
? What is now in the CVS tree should give 0.3.0b1-cvs

>built it on a Redhat Linux box with gcc3. All well and fine.
>
>When running SwapValuation.C it core dumps, gdb shows the following:
>
>         1) TermStructures::PiecewiseFlatForward::bootstrap()
>         2) TermStructures::RateHelper::quoteError()
>         3) TermStructures::SwapRateHelper::impliedQuote()
>         4) Instruments::Swap::performCalculations()
>         5) CashFlows::FloatingRateCoupon::amount()
>         6) Indexes::XiborManager::getHistory(), as far as I can see the name
>it passes thru is empty ("")
>
>Am I suppose to do any additional configuration before trying these
>examples? Setting up currencies?

No, it should work as it is---and in fact, it does work on my Debian Linux
box with gcc3. I'm somewhat at a loss to explain what's happening on yours...

The sequence of method calls above is correct. The first coupon of each
swap used in the bootstrapping of the curve starts spot, so the coupon
instance (seeing that its fixing date is today's date) checks whether
today's fixing was fed to the system. We didn't do anything of the sort,
therefore the call to getHistory should fail raising an exception. The
latter should be caught by the calling coupon which would then happily
forecast the fixing itself.
However, it is kind of fishy that the passed string is null---it should be
"dummy6m" or something of the sort.

Sorry to put the burden on you, but as I said, the above works on my machine.
Could you please use gdb to step into the computations starting from
CashFlows::FloatingRateCoupon::amount() and see what the program flow is?

Bye for now,
                 Luigi