Trying the example code

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Trying the example code

Andre Louw-2
I'm trying to get the SwapValuation example going. It dumps when looking for
History in the Xibor index. What to do?


 
-------------------------------------------------------------------------
This e-mail is intended only for the use of the individual or entity named
above and may contain information that is confidential and privileged,
proprietary to the company and protected by law. If you are not the intended
recipient, you are hereby notified that any dissemination, distribution or
copying of this e-mail is strictly prohibited. Opinions, conclusions and
other information in this message that do not relate to the official
business of our company shall be understood as neither given nor endorsed by
it.


Reply | Threaded
Open this post in threaded view
|

Re: Trying the example code

Luigi Ballabio-4
At 11:03 AM 3/20/02 +0200, Andre Louw wrote:
>I'm trying to get the SwapValuation example going. It dumps when looking for
>History in the Xibor index. What to do?

Any details?

Bye,
         Luigi



Reply | Threaded
Open this post in threaded view
|

Re: Trying the example code

Ferdinando M. Ametrano-2
In reply to this post by Andre Louw-2
At 11:03 AM 3/20/02 +0200, Andre Louw wrote:
>I'm trying to get the SwapValuation example going. It dumps when looking for
>History in the Xibor index. What to do?
as with every bug report we would need more info: QuantLib version,
platform, compiler, etc

Using the current CVS version with MS VC++ 6.0 on a Win NT 4 sp 6 there are
no problems: I select the Swap project, hit Ctrl+F5, and everything
compiles and run

ciao -- Nando



Reply | Threaded
Open this post in threaded view
|

RE: Trying the example code

Andre Louw-2
In reply to this post by Andre Louw-2
I have retrieved Quantlib version 0.2.1 from the CVS repository, 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?

Appreciate any help.
 
-------------------------------------------------------------------------
This e-mail is intended only for the use of the individual or entity named
above and may contain information that is confidential and privileged,
proprietary to the company and protected by law. If you are not the intended
recipient, you are hereby notified that any dissemination, distribution or
copying of this e-mail is strictly prohibited. Opinions, conclusions and
other information in this message that do not relate to the official
business of our company shall be understood as neither given nor endorsed by
it.


Reply | Threaded
Open this post in threaded view
|

RE: Trying the example code

Luigi Ballabio-4
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




Reply | Threaded
Open this post in threaded view
|

RE: Trying the example code

Luigi Ballabio-4
In reply to this post by Andre Louw-2
Hi Andre,
         sorry for the delay.

At 04:19 PM 3/20/02 +0200, Andre Louw wrote:
>When stepping thru it looks like it's a throw that's not being caught! It
>throws the "History not loaded" exception, when next you wake up, your
>coffee's cold and you're sitting in libgcc2's default_terminate() after
>which the app aborts!?

Looks like very bad medicine. Is it g++ or gcc that your system is using?
If it is gcc, does the problem persist if you switch to g++?

Bye,
         Luigi



Reply | Threaded
Open this post in threaded view
|

RE: Trying the example code

Andre Louw-2
In reply to this post by Andre Louw-2
Gents,

Sorry for the confusion, it looks like the problem was using gcc3 with the
normal c++ compiler. Switching to gcc3 with g++3 solved the problem!

Thanx for all the comments!

Andre

>Hi Andre,
>         sorry for the delay.
>
>At 04:19 PM 3/20/02 +0200, Andre Louw wrote:
>>When stepping thru it looks like it's a throw that's not being caught! It
>>throws the "History not loaded" exception, when next you wake up, your
>>coffee's cold and you're sitting in libgcc2's default_terminate() after
>>which the app aborts!?
>
>Looks like very bad medicine. Is it g++ or gcc that your system is using?
>If it is gcc, does the problem persist if you switch to g++?
>
>Bye,
>         Luigi
 
-------------------------------------------------------------------------
This e-mail is intended only for the use of the individual or entity named
above and may contain information that is confidential and privileged,
proprietary to the company and protected by law. If you are not the intended
recipient, you are hereby notified that any dissemination, distribution or
copying of this e-mail is strictly prohibited. Opinions, conclusions and
other information in this message that do not relate to the official
business of our company shall be understood as neither given nor endorsed by
it.