Posted by
Xavier.Abulker on
URL: http://quantlib.414.s1.nabble.com/bug-in-xibor-tp2199p2200.html
Hi Luigi,
1) to avoid the crash I have to do the following change:
either
if (i != historyMap_.end())
throw Error(name + " history not loaded");
or
QL_REQUIRE(i == historyMap_.end(),
name + " history not loaded");
otherwise it doesn't work.
2) I agree with your second guess theoretically but I've tried just to add
XiborManager::HistoryMap XiborManager::historyMap_ =
XiborManager::HistoryMap(); and either gcc or c++ doesn't accept that.
With my fix it works fine with EuropeanOption and Zero curve generation.
Do you think it could be intergrated in CVS?
Thanks
Xavier
Luigi Ballabio
<luigi.ballabio@fast To:
[hidden email],
webnet.it>
[hidden email]
cc:
24/09/2002 12:33 Subject: Re: [Quantlib-users] bug in xibor..
At 11:14 AM 9/24/02 +0200,
[hidden email] wrote:
>Hello,
>the example SwapValuation.cpp and all the zero curve generation don't work
>on Unix Sun Solaris 2.8.
>We found where the problem comes from and this is a fix proposal:
Xavier,
thanks a lot. I've been puzzled by this for quite a while.
A few questions though:
>replace
>QL_REQUIRE(i != historyMap_.end(),
> name + " history not loaded");
>by
>if (i != historyMap_.end())
> throw Error(name + " history not loaded");
the if clause would be (i==historyMap_.end()) or (!(i!=historyMap_.end())),
right? Also, did you have problems with leaving QL_REQUIRE (which expands
to an if with the latter clause?)
>in xibormanager.hpp we add
>#ifdef quantlib_global_define
> XiborManager::HistoryMap XiborManager::historyMap_ =
>XiborManager::HistoryMap();
>#endif
>
>in xibor.cpp we add
># define quantlib_global_define
I'm not entirely getting the conditional compilation thing. Wouldn't it be
the same if we simply wrote
XiborManager::HistoryMap XiborManager::historyMap_ =
XiborManager::HistoryMap();
in xibormanager.cpp? The same goes for the other fix in europeanoption.cpp
(especially since if europeanoption.cpp happened to include indirectly
xibormanager.hpp, or the other way around, historyMap_ would be multiply
defined.)
Later,
Luigi
*************************************************************************
Ce message et toutes les pieces jointes (ci-apres le "message") sont
confidentiels et etablis a l'intention exclusive de ses destinataires.
Toute utilisation ou diffusion non autorisee est interdite.
Tout message electronique est susceptible d'alteration.
La Fimat et ses filiales declinent toute responsabilite au
titre de ce message s'il a ete altere, deforme ou falsifie.
********
This message and any attachments (the "message") are confidential and
intended solely for the addressees.
Any unauthorised use or dissemination is prohibited.
E-mails are susceptible to alteration.
Neither Fimat nor any of its subsidiaries or affiliates shall
be liable for the message if altered, changed or falsified.
*************************************************************************