Re: bug in xibor..

Posted by Luigi Ballabio-2 on
URL: http://quantlib.414.s1.nabble.com/bug-in-xibor-tp2199p2205.html

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