Skip to content

Commit

Permalink
merged branches/R01000x-branch into trunk, respecting ancestry
Browse files Browse the repository at this point in the history
  • Loading branch information
Ferdinando Ametrano committed Apr 13, 2010
1 parent dfb2fb6 commit 1e09506
Show file tree
Hide file tree
Showing 31 changed files with 365 additions and 145 deletions.
67 changes: 67 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,70 @@
2010-04-06 13:38 Luigi Ballabio

* [r17236] ql/patterns/singleton.hpp:

Fix: manage Singleton correctly in .Net (thanks to Nathan Abbott.)

2010-03-08 08:59 Luigi Ballabio

* [r17212] ql/experimental/callablebonds/callablebond.cpp:

Bug fix: create exercise-date vector correctly.

Previously, the actual exercise dates were stored after a number
of null dates. For most choices of day counter, this resulted in
negative exercise times that were simply discarded. For some
(e.g., ActualActual::Bond) it resulted in an exception instead.

2010-03-08 08:57 Luigi Ballabio

* [r17211] ql/time/calendars/china.cpp, ql/time/calendars/china.hpp,
ql/time/calendars/hongkong.cpp, ql/time/calendars/hongkong.hpp,
ql/time/calendars/india.cpp, ql/time/calendars/india.hpp,
ql/time/calendars/indonesia.cpp, ql/time/calendars/indonesia.hpp,
ql/time/calendars/singapore.cpp, ql/time/calendars/singapore.hpp,
ql/time/calendars/southkorea.cpp, ql/time/calendars/taiwan.cpp,
ql/time/calendars/taiwan.hpp, ql/time/calendars/turkey.cpp,
ql/time/calendars/turkey.hpp:

Update: added 2010 moving holidays for Eastern calendars.

2010-03-01 09:32 Luigi Ballabio

* [r17180] ql/instruments/zerocouponinflationswap.cpp,
ql/instruments/zerocouponinflationswap.hpp:

Bug fix: added missing method implementations.

2010-03-01 09:32 Luigi Ballabio

* [r17179] ql/cashflows/indexedcashflow.hpp:

Bug fix: let an IndexedCashFlow observe its index.

Previously, index changes would not be propagated to the cash flow
and thus to any observers of the latter. This affected zero-coupon
inflation swaps.

2010-02-24 11:22 Luigi Ballabio

* [r17170] Docs/Makefile.am:



2010-02-24 11:10 Luigi Ballabio

* [r17167] Docs/images/QL-small.jpg, Docs/images/QL-title.jpg,
Docs/images/QL.bmp, Docs/images/QL.jpg, Docs/images/favicon.ico,
Docs/quantlibheader.html, Docs/quantlibheaderonline.html:

Replaced unlicensed font in logo.

2010-02-23 15:08 Luigi Ballabio

* [r17153] ChangeLog.txt:

Updated ChangeLogs.

2010-02-23 14:33 Luigi Ballabio

* [r17148] ql/cashflows/cashflows.cpp, ql/cashflows/cashflows.hpp,
Expand Down
8 changes: 4 additions & 4 deletions Contributors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ Robert Lopez, Andr
Mariani, Slava Mazur, Enrico Michelotti, Radu Mondescu, Bart Mosley,
Tiziano M�ller, Bojan Nikolic, Jean Nkeng, Adrian O'Neill, Andrea
Odetti, Mike Parker, Guillaume Pealat, Gilbert Peffer, Walter
Penschke, Adrien Pinatton, Gianni Piolanti, Mario Pucci, J. Erik
Radmall, Fabio Ramponi, Maria Cristina Recchioni, Dimitri Reiswich,
Sadruddin Rejeb, Alessandro Roveda, Mohamed Amine Sadaoui, Alpha Sanou
Toure, Tamas Sashalmi, Peter Schmitteckert, Ralph Schreyer, David
Penschke, Francesco Perissin, Adrien Pinatton, Gianni Piolanti,
Mario Pucci, J. Erik Radmall, Fabio Ramponi, Maria Cristina Recchioni,
Dimitri Reiswich, Sadruddin Rejeb, Alessandro Roveda, Mohamed Amine Sadaoui,
Alpha Sanou Toure, Tamas Sashalmi, Peter Schmitteckert, Ralph Schreyer, David
Schwartz, Eugene Shevkoplyas, Enrico Sirola, Maxim Sokolov, Niels
Elken S�nderby, Andreas Spengler, Roland Stamm, Marco Tarenghi,
Fran�ois du Vignaud, Charles Whitmore, Bernd Johannes Wuebben, Sun
Expand Down
97 changes: 37 additions & 60 deletions News.txt
Original file line number Diff line number Diff line change
@@ -1,62 +1,39 @@

Notable changes for QuantLib 1.0:

PORTABILITY

- Fixes for x64 Visual Studio compilation (thanks to Craig Miller.)

- Enabled language extensions in Visual Studio projects.

- Prevented make errors with older shells (thanks to Walter Eaves.)

DATE/TIME

- Changes to end-of-month adjustment. In a schedule, the Unadjusted
convention now supersedes a non-null calendar and causes dates to
roll on the unadjusted end of month (possibly a holiday.)

- Added new date-generation rule for CDS (thanks to Jose Aparicio.)

- Fix for CDS fair-upfront calculation (thanks to Jose Aparicio.)
Previously, fair-upfront calculation required a non-null upfront
to begin with. This is no longer the case.

INSTRUMENTS

- Fixed discounting of dividends on convertible-bond grid (thanks to
Benoit Houzelle and Samuel Lerouge.)

CASH FLOWS

- A number of CashFlows methods now return a meaningful result even
if the passed leg is empty.

PROCESSES

- Changed default discretization for Heston process. The new
default (giving a better performance) is quadratic exponential
with Martingale correction.

TERM STRUCTURES

- Removed ambiguous parRate member functions from YieldTermStructure
interface.

EXAMPLES

- Added market-model example.

EXPERIMENTAL FOLDER

The ql/experimental folder contains code which is still not fully
integrated with the library or even fully tested, but is released in
order to get user feedback. Experimental classes are considered
unstable; their interfaces might change in future releases.
New contributions for this release were:

- Longstaff-Schwartz algorithm for basket products including coupon
payments (thanks to Andrea Odetti;)

- added sparse incomplete LU preconditioner for 2D finite-difference
models (thanks to Ralph Schreyer.)
Changes for QuantLib 1.0.1:

- Added moving holidays for 2010 to Eastern calendars.

- The Singleton class should now work correctly when used on the .Net
platform (thanks to Nathan Abbott.)

- Bug fix: let an IndexedCashFlow observe its index.
Previously, index changes would not be propagated to the cash flow
and thus to any observers of the latter. This affected zero-coupon
inflation swaps.

- Bug fix: added missing method implementations to zero-coupon
inflation swaps.
A couple of methods were declared but not defined.

- Bug fix: create exercise-date vector correctly for callable bonds.
Previously, the actual exercise dates were stored after a number
of null dates. For most choices of day counter, this resulted in
negative exercise times that were harmlessly discarded. For some
day counters (e.g., ActualActual::Bond) the null dates caused an
exception instead.

- Bug fix: properly account for CDS protection-start date.
During bootstrap of the default-probability curve, the
protection-start date was taken into account when calculating the
coupon schedule of the underlying CDS but not when calculating its
value (a few days of protection could be lost.)
Also, sometimes the protection-start date was compared incorrectly
to the accrual-start date leading to false positives when checking
requirements.

- Bug fix: coupon pricers now properly check for the result of the
dynamic_cast they perform.
Previously, setting a pricer to a coupon of the wrong type would
cause an access violation by dereferencing the null pointer
returned by the failed cast.

1 change: 1 addition & 0 deletions ql/cashflows/conundrumpricer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ namespace QuantLib {

void HaganPricer::initialize(const FloatingRateCoupon& coupon){
coupon_ = dynamic_cast<const CmsCoupon*>(&coupon);
QL_REQUIRE(coupon_, "CMS coupon needed");
gearing_ = coupon_->gearing();
spread_ = coupon_->spread();

Expand Down
1 change: 1 addition & 0 deletions ql/cashflows/couponpricer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ namespace QuantLib {

void BlackIborCouponPricer::initialize(const FloatingRateCoupon& coupon) {
coupon_ = dynamic_cast<const IborCoupon*>(&coupon);
QL_REQUIRE(coupon_, "Libor coupon required");
gearing_ = coupon_->gearing();
spread_ = coupon_->spread();
Date paymentDate = coupon_->date();
Expand Down
1 change: 1 addition & 0 deletions ql/cashflows/inflationcouponpricer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ namespace QuantLib {

void YoYInflationCouponPricer::initialize(const InflationCoupon& coupon) {
coupon_ = dynamic_cast<const YoYInflationCoupon*>(&coupon);
QL_REQUIRE(coupon_, "year-on-year inflation coupon needed");
gearing_ = coupon_->gearing();
spread_ = coupon_->spread();
paymentDate_ = coupon_->date();
Expand Down
1 change: 1 addition & 0 deletions ql/cashflows/rangeaccrual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ namespace QuantLib {

void RangeAccrualPricer::initialize(const FloatingRateCoupon& coupon){
coupon_ = dynamic_cast<const RangeAccrualFloatersCoupon*>(&coupon);
QL_REQUIRE(coupon_, "range-accrual coupon required");
gearing_ = coupon_->gearing();
spread_ = coupon_->spread();

Expand Down
4 changes: 2 additions & 2 deletions ql/experimental/callablebonds/callablebond.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ namespace QuantLib {
const Leg& cfs = cashflows();

arguments->couponDates.clear();
arguments->couponDates = std::vector<Date>(cfs.size()-1);
arguments->couponDates.reserve(cfs.size()-1);
arguments->couponAmounts.clear();
arguments->couponAmounts = std::vector<Real>(cfs.size()-1);
arguments->couponAmounts.reserve(cfs.size()-1);

for (Size i=0; i<cfs.size()-1; i++) {
if (!cfs[i]->hasOccurred(settlement, false)) {
Expand Down
1 change: 1 addition & 0 deletions ql/experimental/coupons/subperiodcoupons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ namespace QuantLib {

void SubPeriodsPricer::initialize(const FloatingRateCoupon& coupon) {
coupon_ = dynamic_cast<const SubPeriodsCoupon*>(&coupon);
QL_REQUIRE(coupon_, "sub-periods coupon required");
gearing_ = coupon_->gearing();
spread_ = coupon_->spread();

Expand Down
2 changes: 1 addition & 1 deletion ql/instruments/creditdefaultswap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ namespace QuantLib {
paysAtDefaultTime_(paysAtDefaultTime), claim_(claim),
protectionStart_(protectionStart == Null<Date>() ? schedule[0] :
protectionStart) {
QL_REQUIRE(protectionStart_ >= schedule[0],
QL_REQUIRE(protectionStart_ <= schedule[0],
"protection can not start after accrual");
leg_ = FixedRateLeg(schedule)
.withNotionals(notional)
Expand Down
28 changes: 20 additions & 8 deletions ql/patterns/singleton.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@

namespace QuantLib {

#if defined(QL_ENABLE_SESSIONS)
// definition must be provided by the user
Integer sessionId();
#endif

// this is required on VC++ (with a slightly different syntax depending
// on the compiler version) when CLR support is enabled
#if defined(QL_PATCH_MSVC71)
#pragma unmanaged
#elif defined(QL_PATCH_MSVC)
#pragma managed(push, off)
#endif

//! Basic support for the singleton pattern.
/*! The typical use of this class is:
\code
Expand Down Expand Up @@ -58,17 +71,9 @@ namespace QuantLib {
Singleton() {}
};

#if defined(QL_ENABLE_SESSIONS)
// definition must be provided by the user
Integer sessionId();
#endif

// template definitions

template <class T>
#if defined(QL_PATCH_MSVC) && defined(_MANAGED)
inline // this seems to be required when CLR support is enabled
#endif
T& Singleton<T>::instance() {
static std::map<Integer, boost::shared_ptr<T> > instances_;
#if defined(QL_ENABLE_SESSIONS)
Expand All @@ -82,6 +87,13 @@ namespace QuantLib {
return *instance;
}

// reverts the change above
#if defined(QL_PATCH_MSVC71)
#pragma managed
#elif defined(QL_PATCH_MSVC)
#pragma managed(pop)
#endif

}


Expand Down
2 changes: 1 addition & 1 deletion ql/termstructures/credit/defaultprobabilityhelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ namespace QuantLib {
}

void CdsHelper::initializeDates() {
Date protectionStart_ = evaluationDate_ + settlementDays_;
protectionStart_ = evaluationDate_ + settlementDays_;
Date startDate = calendar_.adjust(protectionStart_,
paymentConvention_);
Date endDate = evaluationDate_ + tenor_;
Expand Down
11 changes: 8 additions & 3 deletions ql/time/calendars/china.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
Copyright (C) 2004 FIMAT Group
Copyright (C) 2007, 2009 StatPro Italia srl
Copyright (C) 2007, 2009, 2010 StatPro Italia srl
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
Expand Down Expand Up @@ -52,8 +52,7 @@ namespace QuantLib {
|| (y == 2006 && (d == 2 || d == 3) && m == January)
|| (y == 2007 && d <= 3 && m == January)
|| (y == 2007 && d == 31 && m == December)
|| (y == 2008 && d == 1 && m == January)
|| (y == 2009 && (d == 1 || d == 2) && m == January)
|| (y == 2009 && d == 2 && m == January)
// Chinese New Year
|| (y == 2004 && d >= 19 && d <= 28 && m == January)
|| (y == 2005 && d >= 7 && d <= 15 && m == February)
Expand All @@ -62,23 +61,29 @@ namespace QuantLib {
|| (y == 2007 && d >= 17 && d <= 25 && m == February)
|| (y == 2008 && d >= 6 && d <= 12 && m == February)
|| (y == 2009 && d >= 26 && d <= 30 && m == January)
|| (y == 2010 && d >= 15 && d <= 19 && m == January)
// Ching Ming Festival
|| (y <= 2008 && d == 4 && m == April)
|| (y == 2009 && d == 6 && m == April)
|| (y == 2010 && d == 5 && m == April)
// Labor Day
|| (y <= 2007 && d >= 1 && d <= 7 && m == May)
|| (y == 2008 && d >= 1 && d <= 2 && m == May)
|| (y == 2009 && d == 1 && m == May)
|| (y == 2010 && d == 3 && m == May)
// Tuen Ng Festival
|| (y <= 2008 && d == 9 && m == June)
|| (y == 2009 && (d == 28 || d == 29) && m == May)
|| (y == 2010 && d >= 14 && d <= 16 && m == June)
// Mid-Autumn Festival
|| (y <= 2008 && d == 15 && m == September)
|| (y == 2010 && d >= 22 && d <= 24 && m == September)
// National Day
|| (y <= 2007 && d >= 1 && d <= 7 && m == October)
|| (y == 2008 && ((d >= 29 && m == September) ||
(d <= 3 && m == October)))
|| (y == 2009 && d >= 1 && d <= 8 && m == October)
|| (y == 2010 && d >= 1 && d <= 7 && m == October)
)
return false;
return true;
Expand Down
6 changes: 3 additions & 3 deletions ql/time/calendars/china.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
Copyright (C) 2004 FIMAT Group
Copyright (C) 2008, 2009 StatPro Italia srl
Copyright (C) 2008, 2009, 2010 StatPro Italia srl
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
Expand Down Expand Up @@ -41,15 +41,15 @@ namespace QuantLib {
</ul>
Other holidays for which no rule is given (data available for
2004-2009 only):
2004-2010 only):
<ul>
<li>Chinese New Year</li>
<li>Ching Ming Festival</li>
<li>Tuen Ng Festival</li>
<li>Mid-Autumn Festival</li>
</ul>
Data from <http://www.sse.com.cn/sseportal/en_us/ps/home.shtml>
Data from <http://www.sse.com.cn/sseportal/en/home/home.shtml>
\ingroup calendars
*/
Expand Down
Loading

0 comments on commit 1e09506

Please sign in to comment.