You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(17) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(23) |
| 2002 |
Jan
(18) |
Feb
(20) |
Mar
(22) |
Apr
(41) |
May
(28) |
Jun
(25) |
Jul
(10) |
Aug
(7) |
Sep
(5) |
Oct
(20) |
Nov
(13) |
Dec
(11) |
| 2003 |
Jan
(28) |
Feb
(5) |
Mar
(6) |
Apr
(5) |
May
(17) |
Jun
(6) |
Jul
(45) |
Aug
(35) |
Sep
(24) |
Oct
(50) |
Nov
(53) |
Dec
(6) |
| 2004 |
Jan
(4) |
Feb
(10) |
Mar
(52) |
Apr
(46) |
May
(8) |
Jun
(25) |
Jul
(12) |
Aug
(6) |
Sep
(8) |
Oct
(8) |
Nov
(9) |
Dec
(7) |
| 2005 |
Jan
(18) |
Feb
(60) |
Mar
(19) |
Apr
(26) |
May
(14) |
Jun
(27) |
Jul
(8) |
Aug
(15) |
Sep
(19) |
Oct
(53) |
Nov
(20) |
Dec
(23) |
| 2006 |
Jan
(16) |
Feb
(27) |
Mar
(33) |
Apr
(51) |
May
(36) |
Jun
(25) |
Jul
(54) |
Aug
(30) |
Sep
(25) |
Oct
(67) |
Nov
(43) |
Dec
(13) |
| 2007 |
Jan
(23) |
Feb
(27) |
Mar
(55) |
Apr
(79) |
May
(60) |
Jun
(66) |
Jul
(46) |
Aug
(30) |
Sep
(90) |
Oct
(49) |
Nov
(85) |
Dec
(74) |
| 2008 |
Jan
(68) |
Feb
(59) |
Mar
(64) |
Apr
(28) |
May
(66) |
Jun
(35) |
Jul
(73) |
Aug
(76) |
Sep
(65) |
Oct
(46) |
Nov
(41) |
Dec
(19) |
| 2009 |
Jan
(46) |
Feb
(90) |
Mar
(51) |
Apr
(104) |
May
(13) |
Jun
(24) |
Jul
(20) |
Aug
(39) |
Sep
(109) |
Oct
(101) |
Nov
(117) |
Dec
(57) |
| 2010 |
Jan
(55) |
Feb
(42) |
Mar
(39) |
Apr
(22) |
May
(33) |
Jun
(41) |
Jul
(25) |
Aug
(52) |
Sep
(75) |
Oct
(60) |
Nov
(62) |
Dec
(52) |
| 2011 |
Jan
(70) |
Feb
(31) |
Mar
(26) |
Apr
(28) |
May
(17) |
Jun
(38) |
Jul
(51) |
Aug
(35) |
Sep
(27) |
Oct
(35) |
Nov
(10) |
Dec
(20) |
| 2012 |
Jan
(21) |
Feb
(29) |
Mar
(13) |
Apr
(37) |
May
(33) |
Jun
(12) |
Jul
(34) |
Aug
(27) |
Sep
(29) |
Oct
(35) |
Nov
(58) |
Dec
(27) |
| 2013 |
Jan
(27) |
Feb
(16) |
Mar
(40) |
Apr
(16) |
May
(34) |
Jun
(37) |
Jul
(6) |
Aug
(3) |
Sep
(4) |
Oct
(49) |
Nov
(13) |
Dec
(12) |
| 2014 |
Jan
(15) |
Feb
(21) |
Mar
(11) |
Apr
(13) |
May
(27) |
Jun
(60) |
Jul
(19) |
Aug
(29) |
Sep
(20) |
Oct
(28) |
Nov
(41) |
Dec
(15) |
| 2015 |
Jan
(33) |
Feb
(29) |
Mar
(26) |
Apr
(17) |
May
(2) |
Jun
(13) |
Jul
(21) |
Aug
(30) |
Sep
(22) |
Oct
(15) |
Nov
(46) |
Dec
(20) |
| 2016 |
Jan
(6) |
Feb
(5) |
Mar
(9) |
Apr
(15) |
May
(9) |
Jun
(4) |
Jul
(3) |
Aug
(4) |
Sep
(39) |
Oct
(8) |
Nov
(5) |
Dec
(8) |
| 2017 |
Jan
(4) |
Feb
(14) |
Mar
(4) |
Apr
(16) |
May
(5) |
Jun
(10) |
Jul
(25) |
Aug
(2) |
Sep
(5) |
Oct
(11) |
Nov
(8) |
Dec
(11) |
| 2018 |
Jan
(7) |
Feb
(4) |
Mar
|
Apr
(1) |
May
(4) |
Jun
(21) |
Jul
(8) |
Aug
(3) |
Sep
(2) |
Oct
(2) |
Nov
(1) |
Dec
|
| 2019 |
Jan
(1) |
Feb
(5) |
Mar
(18) |
Apr
(9) |
May
(5) |
Jun
(21) |
Jul
(25) |
Aug
(25) |
Sep
(4) |
Oct
(2) |
Nov
(2) |
Dec
(5) |
| 2020 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
(2) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
(1) |
Oct
(2) |
Nov
(6) |
Dec
|
| 2021 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
(1) |
May
(4) |
Jun
|
Jul
(1) |
Aug
|
Sep
(2) |
Oct
(9) |
Nov
(1) |
Dec
(5) |
| 2022 |
Jan
(7) |
Feb
(3) |
Mar
|
Apr
(2) |
May
(5) |
Jun
(3) |
Jul
(3) |
Aug
(3) |
Sep
(3) |
Oct
(14) |
Nov
|
Dec
(1) |
| 2023 |
Jan
(10) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
(2) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
(5) |
Nov
|
Dec
|
| 2024 |
Jan
(8) |
Feb
|
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
(4) |
Aug
(5) |
Sep
|
Oct
(4) |
Nov
(1) |
Dec
(1) |
| 2025 |
Jan
(3) |
Feb
(2) |
Mar
(2) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2026 |
Jan
(1) |
Feb
(12) |
Mar
|
Apr
(2) |
May
(8) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Luigi B. <lui...@gm...> - 2011-06-29 19:34:18
|
On Jun 29, 2011, at 8:01 PM, na...@us... wrote: > Revision: 17823 > http://quantlib.svn.sourceforge.net/quantlib/?rev=17823&view=rev > Author: nando > Date: 2011-06-29 18:01:02 +0000 (Wed, 29 Jun 2011) > > Log Message: > ----------- > - changed guess signature to allow for a more compact and clear > iterative bootstrap algorithm > - changed signature of minValueAfter and maxValueAfter to include > the curve pointer and validData information: this will allow more > effective bracketing Sorry, it breaks backwards compatibility. We'll have to think how to go about this, and it's ok to leave it for the time being, but it will have to be reverted. Luigi > > Modified Paths: > -------------- > trunk/QuantLib/ql/experimental/inflation/ > piecewiseyoyoptionletvolatility.hpp > trunk/QuantLib/ql/termstructures/credit/probabilitytraits.hpp > trunk/QuantLib/ql/termstructures/inflation/ > piecewiseyoyinflationcurve.hpp > trunk/QuantLib/ql/termstructures/inflation/ > piecewisezeroinflationcurve.hpp > trunk/QuantLib/ql/termstructures/iterativebootstrap.hpp > trunk/QuantLib/ql/termstructures/localbootstrap.hpp > trunk/QuantLib/ql/termstructures/yield/bootstraptraits.hpp > > Modified: trunk/QuantLib/ql/experimental/inflation/ > piecewiseyoyoptionletvolatility.hpp > =================================================================== > --- trunk/QuantLib/ql/experimental/inflation/ > piecewiseyoyoptionletvolatility.hpp 2011-06-29 17:50:59 UTC (rev > 17822) > +++ trunk/QuantLib/ql/experimental/inflation/ > piecewiseyoyoptionletvolatility.hpp 2011-06-29 18:01:02 UTC (rev > 17823) > @@ -2,6 +2,7 @@ > > /* > Copyright (C) 2009 Chris Kenyon > + Copyright (C) 2011 Ferdinando Ametrano > > This file is part of QuantLib, a free-software/open-source library > for financial quantitative analysts and developers - http://quantlib.org/ > @@ -46,19 +47,34 @@ > // assumptions on early options > // that are _not_ quoted > } > - static Volatility initialGuess() {return 0.005;} > - static Volatility guess(const YoYOptionletVolatilitySurface*, > - const Date &) { > + > + template <class C> > + static Volatility guess(Size i, > + const C* c, > + bool validData) { > + if (validData) // previous iteration value > + return c->data()[i]; > + > + if (i==1) // first pillar > + return 0.005; > + > + // could/should extrapolate > return 0.002; > } > - static Volatility minValueAfter(Size n, > - const > std::vector<Volatility> &v) { > - return std::max(0.0, v[n-1] - 0.02); // vol cannot be > negative > + > + template <class C> > + static Volatility minValueAfter(Size i, > + const C* c, > + bool validData) { > + return std::max(0.0, c->data()[i-1] - 0.02); // vol > cannot be negative > } > - static Volatility maxValueAfter(Size n, > - const > std::vector<Volatility> &v) { > - return v[n-1] + 0.02; > + template <class C> > + static Volatility maxValueAfter(Size i, > + const C* c, > + bool validData) { > + return c->data()[i-1] + 0.02; > } > + > static void updateGuess(std::vector<Volatility> &vols, > Volatility level, > Size i) { > @@ -198,4 +214,3 @@ > } > > #endif > - > > Modified: trunk/QuantLib/ql/termstructures/credit/ > probabilitytraits.hpp > =================================================================== > --- trunk/QuantLib/ql/termstructures/credit/probabilitytraits.hpp > 2011-06-29 17:50:59 UTC (rev 17822) > +++ trunk/QuantLib/ql/termstructures/credit/probabilitytraits.hpp > 2011-06-29 18:01:02 UTC (rev 17823) > @@ -5,7 +5,7 @@ > Copyright (C) 2008 Chris Kenyon > Copyright (C) 2008 Roland Lichters > Copyright (C) 2008 StatPro Italia srl > - Copyright (C) 2009 Ferdinando Ametrano > + Copyright (C) 2009, 2011 Ferdinando Ametrano > > This file is part of QuantLib, a free-software/open-source library > for financial quantitative analysts and developers - http://quantlib.org/ > @@ -56,24 +56,37 @@ > static Real initialValue(const > DefaultProbabilityTermStructure*) { > return 1.0; > } > - // initial guess > - static Real initialGuess() { > - return 1.0/(1.0+detail::avgHazardRate*0.25); > - } > - // further guesses > - static Real guess(const DefaultProbabilityTermStructure* c, > - const Date& d) { > + > + // guesses > + template <class C> > + static Real guess(Size i, > + const C* c, > + bool validData) { > + if (validData) // previous iteration value > + return c->data()[i]; > + > + if (i==1) // first pillar > + return 1.0/(1.0+detail::avgHazardRate*0.25); > + > + // extrapolate > + Date d = c->dates()[i]; > return c->survivalProbability(d,true); > } > + > // possible constraints based on previous values > - static Real minValueAfter(Size, > - const std::vector<Real>&) { > + template <class C> > + static Real minValueAfter(Size i, > + const C* c, > + bool validData) { > return QL_EPSILON; > } > + template <class C> > static Real maxValueAfter(Size i, > - const std::vector<Real>& data) { > - return data[i-1]; > + const C* c, > + bool validData) { > + return c->data()[i-1]; > } > + > // update with new guess > static void updateGuess(std::vector<Real>& data, > Probability p, > @@ -101,24 +114,39 @@ > static Real initialValue(const > DefaultProbabilityTermStructure*) { > return detail::avgHazardRate; > } > - // initial guess > - static Real initialGuess() { return detail::avgHazardRate; } > - // further guesses > - static Real guess(const DefaultProbabilityTermStructure* c, > - const Date& d) { > + > + // guesses > + template <class C> > + static Real guess(Size i, > + const C* c, > + bool validData) { > + if (validData) // previous iteration value > + return c->data()[i]; > + > + if (i==1) // first pillar > + return detail::avgHazardRate; > + > + // extrapolate > + Date d = c->dates()[i]; > return c->hazardRate(d, true); > } > + > // possible constraints based on previous values > - static Real minValueAfter(Size, > - const std::vector<Real>&) { > + template <class C> > + static Real minValueAfter(Size i, > + const C* c, > + bool validData) { > return QL_EPSILON; > } > - static Real maxValueAfter(Size, > - const std::vector<Real>&) { > + template <class C> > + static Real maxValueAfter(Size i, > + const C* c, > + bool validData) { > // no constraints. > // We choose as max a value very unlikely to be exceeded. > return 200.0; > } > + > // update with new guess > static void updateGuess(std::vector<Real>& data, > Real rate, > @@ -148,24 +176,39 @@ > static Real initialValue(const > DefaultProbabilityTermStructure*) { > return detail::avgHazardRate; > } > - // initial guess > - static Real initialGuess() { return detail::avgHazardRate; } > - // further guesses > - static Real guess(const DefaultProbabilityTermStructure* c, > - const Date& d) { > + > + // guesses > + template <class C> > + static Real guess(Size i, > + const C* c, > + bool validData) { > + if (validData) // previous iteration value > + return c->data()[i]; > + > + if (i==1) // first pillar > + return detail::avgHazardRate; > + > + // extrapolate > + Date d = c->dates()[i]; > return c->defaultDensity(d, true); > } > + > // possible constraints based on previous values > - static Real minValueAfter(Size, > - const std::vector<Real>&) { > + template <class C> > + static Real minValueAfter(Size i, > + const C* c, > + bool validData) { > return QL_EPSILON; > } > - static Real maxValueAfter(Size, > - const std::vector<Real>&) { > + template <class C> > + static Real maxValueAfter(Size i, > + const C* c, > + bool validData) { > // no constraints. > // We choose as max a value very unlikely to be exceeded. > return 3.0; > } > + > // update with new guess > static void updateGuess(std::vector<Real>& data, > Real density, > @@ -180,5 +223,4 @@ > > } > > - > #endif > > Modified: trunk/QuantLib/ql/termstructures/inflation/ > piecewiseyoyinflationcurve.hpp > =================================================================== > --- trunk/QuantLib/ql/termstructures/inflation/ > piecewiseyoyinflationcurve.hpp 2011-06-29 17:50:59 UTC (rev 17822) > +++ trunk/QuantLib/ql/termstructures/inflation/ > piecewiseyoyinflationcurve.hpp 2011-06-29 18:01:02 UTC (rev 17823) > @@ -3,6 +3,7 @@ > /* > Copyright (C) 2007 Chris Kenyon > Copyright (C) 2007, 2008 StatPro Italia srl > + Copyright (C) 2011 Ferdinando Ametrano > > This file is part of QuantLib, a free-software/open-source library > for financial quantitative analysts and developers - http://quantlib.org/ > @@ -49,18 +50,36 @@ > static Rate initialValue(const YoYInflationTermStructure* t) { > return t->baseRate(); > } > - static Rate initialGuess() { return 0.02; } > - // further guesses > - static Rate guess(const YoYInflationTermStructure*, const > Date&) { > + > + // guesses > + template <class C> > + static Rate guess(Size i, > + const C* c, > + bool validData) { > + if (validData) // previous iteration value > + return c->data()[i]; > + > + if (i==1) // first pillar > + return 0.02; // initial guess at flat inflation > + > + // could/should extrapolate > return 0.02; // initial guess at flat inflation > } > + > // possible constraints based on previous values > - static Rate minValueAfter(Size, const std::vector<Rate>&) { > + template <class C> > + static Rate minValueAfter(Size i, > + const C* c, > + bool validData) { > return -0.3 + QL_EPSILON; > } > - static Rate maxValueAfter(Size, const std::vector<Rate>&) { > + template <class C> > + static Rate maxValueAfter(Size i, > + const C* c, > + bool validData) { > return 0.5 - QL_EPSILON; > } > + > // update with new guess > static void updateGuess(std::vector<Rate>& data, > Rate level, > > Modified: trunk/QuantLib/ql/termstructures/inflation/ > piecewisezeroinflationcurve.hpp > =================================================================== > --- trunk/QuantLib/ql/termstructures/inflation/ > piecewisezeroinflationcurve.hpp 2011-06-29 17:50:59 UTC (rev 17822) > +++ trunk/QuantLib/ql/termstructures/inflation/ > piecewisezeroinflationcurve.hpp 2011-06-29 18:01:02 UTC (rev 17823) > @@ -3,6 +3,7 @@ > /* > Copyright (C) 2007 Chris Kenyon > Copyright (C) 2007, 2008 StatPro Italia srl > + Copyright (C) 2011 Ferdinando Ametrano > > This file is part of QuantLib, a free-software/open-source library > for financial quantitative analysts and developers - http://quantlib.org/ > @@ -49,18 +50,36 @@ > static Rate initialValue(const ZeroInflationTermStructure* > t) { > return t->baseRate(); > } > - static Rate initialGuess() { return 0.02; } > - // further guesses > - static Rate guess(const ZeroInflationTermStructure*, const > Date&) { > + > + // guesses > + template <class C> > + static Rate guess(Size i, > + const C* c, > + bool validData) { > + if (validData) // previous iteration value > + return c->data()[i]; > + > + if (i==1) // first pillar > + return 0.02; > + > + // could/should extrapolate > return 0.02; // initial guess at flat inflation > } > + > // possible constraints based on previous values > - static Real minValueAfter(Size, const std::vector<Rate>&) { > + template <class C> > + static Real minValueAfter(Size i, > + const C* c, > + bool validData) { > return -0.1 + QL_EPSILON; > } > - static Real maxValueAfter(Size, const std::vector<Rate>&) { > + template <class C> > + static Real maxValueAfter(Size i, > + const C* c, > + bool validData) { > return 0.3 - QL_EPSILON; > } > + > // update with new guess > static void updateGuess(std::vector<Rate>& data, > Rate level, > @@ -195,4 +214,3 @@ > } > > #endif > - > > Modified: trunk/QuantLib/ql/termstructures/iterativebootstrap.hpp > =================================================================== > --- trunk/QuantLib/ql/termstructures/iterativebootstrap.hpp > 2011-06-29 17:50:59 UTC (rev 17822) > +++ trunk/QuantLib/ql/termstructures/iterativebootstrap.hpp > 2011-06-29 18:01:02 UTC (rev 17823) > @@ -114,7 +114,7 @@ > ts_->data_[0] = Traits::initialValue(ts_); > // reasonable numbers needed for the starting > interpolation > for (Size i=1; i<alive_+1; ++i) > - ts_->data_[i] = Traits::initialGuess(); > + ts_->data_[i] = Traits::guess(1, ts_, false); > } > initialized_ = true; > } > @@ -149,21 +149,18 @@ > > bool validData = validCurve_ || iteration>0; > > - // bracket root > - Real min = Traits::minValueAfter(i, ts_->data_); > - Real max = Traits::maxValueAfter(i, ts_->data_); > + // bracket root and calculate guess > + Real min = Traits::minValueAfter(i, ts_, validData); > + Real max = Traits::maxValueAfter(i, ts_, validData); > + Real guess = Traits::guess(i, ts_, validData); > + // adjust guess if needed > + if (guess>=max) > + guess = max - (max-min)/5.0; > + else if (guess<=min) > + guess = min + (max-min)/5.0; > > - // calculate guess and extend interpolation if needed > - Real guess = 0.0; > - if (validData) { > - guess = ts_->data_[i]; // previous iteration > value > - } else { > - if (i==1) // special first pillar case > - guess = Traits::initialGuess(); > - else // most traits extrapolate (using only > - // the curve bootstrapped so far) > - guess = Traits::guess(ts_, ts_->dates_[i]); > - > + // extend interpolation if needed > + if (!validData) { > try { // extend interpolation a point at a time > // including the pillar to be boostrapped > ts_->interpolation_ = ts_- > >interpolator_.interpolate( > @@ -182,11 +179,6 @@ > ts_->interpolation_.update(); > } > } > - // adjust guess if needed > - if (guess>=max) > - guess = max - (max-min)/5.0; > - else if (guess<=min) > - guess = min + (max-min)/5.0; > > // the actual instrument used for the current pillar > boost::shared_ptr<typename Traits::helper> > instrument = > > Modified: trunk/QuantLib/ql/termstructures/localbootstrap.hpp > =================================================================== > --- trunk/QuantLib/ql/termstructures/localbootstrap.hpp 2011-06-29 > 17:50:59 UTC (rev 17822) > +++ trunk/QuantLib/ql/termstructures/localbootstrap.hpp 2011-06-29 > 18:01:02 UTC (rev 17823) > @@ -222,7 +222,7 @@ > > if (iInst >= localisation_) { > startArray[localisation_-dataAdjust] = > - Traits::guess(ts_, ts_->dates_[iInst]); > + Traits::guess(iInst, ts_, false); // ? > } else { > startArray[localisation_-dataAdjust] = ts_->data_[0]; > } > > Modified: trunk/QuantLib/ql/termstructures/yield/bootstraptraits.hpp > =================================================================== > --- trunk/QuantLib/ql/termstructures/yield/bootstraptraits.hpp > 2011-06-29 17:50:59 UTC (rev 17822) > +++ trunk/QuantLib/ql/termstructures/yield/bootstraptraits.hpp > 2011-06-29 18:01:02 UTC (rev 17823) > @@ -2,6 +2,7 @@ > > /* > Copyright (C) 2005, 2007 StatPro Italia srl > + Copyright (C) 2011 Ferdinando Ametrano > Copyright (C) 2007 Chris Kenyon > > This file is part of QuantLib, a free-software/open-source library > @@ -46,6 +47,7 @@ > }; > // helper class > typedef BootstrapHelper<YieldTermStructure> helper; > + > // start of curve data > static Date initialDate(const YieldTermStructure* c) { > return c->referenceDate(); > @@ -54,31 +56,44 @@ > static DiscountFactor initialValue(const > YieldTermStructure*) { > return 1.0; > } > - // initial guess > - static DiscountFactor initialGuess() { > - return 1.0/(1.0+detail::avgRate*0.25); > - } > - // further guesses > - static DiscountFactor guess(const YieldTermStructure* c, > - const Date& d) { > + > + // guesses > + template <class C> > + static DiscountFactor guess(Size i, > + const C* c, > + bool validData) { > + if (validData) // previous iteration value > + return c->data()[i]; > + > + if (i==1) // first pillar > + return 1.0/(1.0+detail::avgRate*0.25); > + > + // extrapolate > + Date d = c->dates()[i]; > return c->discount(d,true); > } > + > // possible constraints based on previous values > - static DiscountFactor minValueAfter(Size, > - const > std::vector<Real>&) { > + template <class C> > + static DiscountFactor minValueAfter(Size i, > + const C* c, > + bool validData) { > return QL_EPSILON; > } > + template <class C> > static DiscountFactor maxValueAfter(Size i, > - const > std::vector<Real>& data) { > + const C* c, > + bool validData) { > #if defined(QL_NEGATIVE_RATES) > // discount are not required to be decreasing--all bets > are off. > // We choose as max a value very unlikely to be exceeded. > return 1.1; > #else > // discounts cannot increase > - return data[i-1]; > + return c->data()[i-1]; > #endif > } > + > // update with new guess > static void updateGuess(std::vector<DiscountFactor>& data, > DiscountFactor discount, > @@ -107,16 +122,29 @@ > static Rate initialValue(const YieldTermStructure*) { > return detail::avgRate; > } > - // initial guess > - static Rate initialGuess() { return detail::avgRate; } > - // further guesses > - static Rate guess(const YieldTermStructure* c, > - const Date& d) { > + > + // guesses > + template <class C> > + static Rate guess(Size i, > + const C* c, > + bool validData) { > + if (validData) // previous iteration value > + return c->data()[i]; > + > + if (i==1) // first pillar > + return detail::avgRate; > + > + // extrapolate > + Date d = c->dates()[i]; > return c->zeroRate(d, c->dayCounter(), > Continuous, Annual, true); > } > + > // possible constraints based on previous values > - static Rate minValueAfter(Size, const std::vector<Real>&) { > + template <class C> > + static Rate minValueAfter(Size i, > + const C* c, > + bool validData) { > #if defined(QL_NEGATIVE_RATES) > // no constraints. > // We choose as min a value very unlikely to be exceeded. > @@ -125,11 +153,15 @@ > return QL_EPSILON; > #endif > } > - static Rate maxValueAfter(Size, const std::vector<Real>&) { > + template <class C> > + static Rate maxValueAfter(Size i, > + const C* c, > + bool validData) { > // no constraints. > // We choose as max a value very unlikely to be exceeded. > return detail::maxRate; > } > + > // update with new guess > static void updateGuess(std::vector<Rate>& data, > Rate rate, > @@ -160,16 +192,29 @@ > static Rate initialValue(const YieldTermStructure*) { > return detail::avgRate; > } > - // initial guess > - static Rate initialGuess() { return detail::avgRate; } > - // further guesses > - static Rate guess(const YieldTermStructure* c, > - const Date& d) { > + > + // guesses > + template <class C> > + static Rate guess(Size i, > + const C* c, > + bool validData) { > + if (validData) // previous iteration value > + return c->data()[i]; > + > + if (i==1) // first pillar > + return detail::avgRate; > + > + // extrapolate > + Date d = c->dates()[i]; > return c->forwardRate(d, d, c->dayCounter(), > Continuous, Annual, true); > } > + > // possible constraints based on previous values > - static Rate minValueAfter(Size, const std::vector<Real>&) { > + template <class C> > + static Rate minValueAfter(Size i, > + const C* c, > + bool validData) { > #if defined(QL_NEGATIVE_RATES) > // no constraints. > // We choose as min a value very unlikely to be exceeded. > @@ -178,11 +223,15 @@ > return QL_EPSILON; > #endif > } > - static Rate maxValueAfter(Size, const std::vector<Real>&) { > + template <class C> > + static Rate maxValueAfter(Size i, > + const C* c, > + bool validData) { > // no constraints. > // We choose as max a value very unlikely to be exceeded. > return detail::maxRate; > } > + > // update with new guess > static void updateGuess(std::vector<Rate>& data, > Rate forward, > > > This was sent by the SourceForge.net collaborative development > platform, the world's largest Open Source development site. > > ------------------------------------------------------------------------------ > All of the data generated in your IT infrastructure is seriously > valuable. > Why? It contains a definitive record of application performance, > security > threats, fraudulent activity, and more. Splunk takes this data and > makes > sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-d2d-c2 > _______________________________________________ > QuantLib-cvs mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-cvs |
|
From: Peter C. <pca...@vo...> - 2011-06-26 18:28:12
|
Hi, the main reason for the map<long,pointer> approach was to avoid using comparison between pointers, which is to my understanding comparison of memory addresses. What if two objects pointed to do not stay in the same memory block for example? Is the behaviour still well defined then? Even if it works technically, program execution will probably depend on many things not covered by the language specifications. It may be hard to get reproducible results then? Thank you and regards Peter -----Ursprüngliche Nachricht----- Von: Ferdinando Ametrano [mailto:na...@am...] Gesendet: Sonntag, 26. Juni 2011 18:58 An: Plamen Neykov Cc: qua...@li...; lui...@gm... Betreff: Re: [Quantlib-dev] destructor performance, observables with large observer lists On Sat, Jun 25, 2011 at 5:48 PM, Plamen Neykov <pla...@re...> wrote: > wouldn't it be simpler just to use std::set<Observer*> and save you the trouble with the long id or am I missing something here? great minds think alike... as a matter of fact in the trunk it has already been switched to std:set on June 7th :-) see http://quantlib.svn.sourceforge.net/viewvc/quantlib?view=revision&revision=1 7788 I was more concerned with possible non-unique elements than destructor's performance reason, and that's why I would keep it at std::set instead of having it as template parameter. Roland could you confirm that the trunk solution is OK for you? BTW in the current trunk there is a MAJOR performance improvement if you work in a real time environment with many changing rate quotes between recalculations: I patched a bug which triggered many useless notifications thanks to all for the report and help: it's refreshing to have contributors really stressing the library. ciao -- Nando ---------------------------------------------------------------------------- -- All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2 _______________________________________________ QuantLib-dev mailing list Qua...@li... https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
|
From: Ferdinando A. <na...@am...> - 2011-06-26 16:58:54
|
On Sat, Jun 25, 2011 at 5:48 PM, Plamen Neykov <pla...@re...> wrote: > wouldn't it be simpler just to use std::set<Observer*> and save you the trouble with the long id or am I missing something here? great minds think alike... as a matter of fact in the trunk it has already been switched to std:set on June 7th :-) see http://quantlib.svn.sourceforge.net/viewvc/quantlib?view=revision&revision=17788 I was more concerned with possible non-unique elements than destructor's performance reason, and that's why I would keep it at std::set instead of having it as template parameter. Roland could you confirm that the trunk solution is OK for you? BTW in the current trunk there is a MAJOR performance improvement if you work in a real time environment with many changing rate quotes between recalculations: I patched a bug which triggered many useless notifications thanks to all for the report and help: it's refreshing to have contributors really stressing the library. ciao -- Nando |
|
From: Amir A. A. <phd...@ya...> - 2011-06-26 15:08:42
|
Better still, make it a template parameter with std::set as a default argument... From: Roland Lichters <rol...@go...> To: Plamen Neykov <pla...@re...> Cc: Ferdinando Ametrano <na...@am...>; qua...@li...; lui...@gm... Sent: Sunday, June 26, 2011 7:37 PM Subject: Re: [Quantlib-dev] destructor performance, observables with large observer lists Hi Plamen, you are right, using std::set instead of std::list does it as well, same speed of termination as the previous proposal, and the test suite shows no errors. I'd definitely prefer this enhancement, see attached. Does anybody see a reason/need to keep track of the order of observer registration that we got with the original observable.hpp? Regards, Roland On 25.06.2011, at 17:48, Plamen Neykov wrote: > A very quick comment - wouldn't it be simpler just to use std::set<Observer*> and save you the trouble with the long id or am I missing something here? > > Regards, > Plamen > > On 25 Jun 2011, at 14:37, Roland Lichters <rol...@go...> wrote: > >> Hi all, >> >> we would like to share an observation here that we have made in a project developing an application based on QuantLib. The application loads market data and relatively large trade portfolio from a database, builds term structures, engines and instrument objects and finally does some pricing and portfolio analytics. Term structures and market data are stored "globally" (in some singleton manager) with many instruments "observing" relatively few term structures. We kept term structures "global" to allow for scenario analysis (such as zero rate shifts etc.) across the portfolio. >> >> What we have noticed is that the application spends significant amount of time at the very end (just before main returns 0). For example, the program loads/constructs about 4000 vanilla deals and related term structures in a minute, prices the deals within seconds and then spends more than 2 minutes terminating itself. Somewhat unsettled by this we investigated the delay further. Logging messages from all kinds of destructors showed that the time is spend - maybe not surprisingly - on instrument destruction. Moreover, the destruction time seemed to grow non-linearly with portfolio size (only 2sec destruction time for about 700 vanilla deals). These times were taken on a MacBook Pro with Intel Core 2 Duo, 2.8 GHz, gcc 4.2, optimization -O2. The attached test program observer.cpp demonstrates this behavior. If you run it with "./observer 2 2000 1" it builds and prices 2000 identical copies of vanilla swaps all linked to the same global term structure. >> >> The origin of this termination delay is in the observer/observable chains, see ql/pattern/observable.hpp: A single term structure is "observed" in the example by a large number of instruments. When an instrument is destroyed, it first unregisters from its observables (one term structure in our case and several floating rate coupons). This involves a lookup of the given observer in the observable's long list of observers (the term structure has thousands of observers). This lookup is the time consuming step. If we comment out all register/unregister code in observable.hpp, the delay vanishes completely. >> >> We have come up with the attached slight enhancement of observable.hpp where we have basically replaced list<Observer*> by map<long,Observer*> with some auto-generated id of type long so that the elements can be compared and retrieved more efficiently. With this change the delay upon program termination is gone, while we don't see noticeable increase in time spent on registering observers. >> >> We have also checked that the QuantLib test suite (1.0.1) completes without errors with both original and new observable.hpp. >> >> Did anybody else make a similar observation? Do you think it is worth adding the amendment or something similar to QuantLib? >> We would be interested in any feedback. >> >> Kind regards, >> Roland >> >> >> <observer.cpp> >> >> >> <observable.hpp> >> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> All the data continuously generated in your IT infrastructure contains a >> definitive record of customers, application performance, security >> threats, fraudulent activity and more. Splunk takes this data and makes >> sense of it. Business sense. IT sense. Common sense.. >> http://p.sf.net/sfu/splunk-d2d-c1 >> _______________________________________________ >> QuantLib-dev mailing list >> Qua...@li... >> https://lists.sourceforge.net/lists/listinfo/quantlib-dev ------------------------------------------------------------------------------ All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2 _______________________________________________ QuantLib-dev mailing list Qua...@li... https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
|
From: Roland L. <rol...@go...> - 2011-06-26 14:37:22
|
Hi Plamen, you are right, using std::set instead of std::list does it as well, same speed of termination as the previous proposal, and the test suite shows no errors. I'd definitely prefer this enhancement, see attached. Does anybody see a reason/need to keep track of the order of observer registration that we got with the original observable.hpp? Regards, Roland |
|
From: Amir A. A. <phd...@ya...> - 2011-06-26 08:46:16
|
I suppose the only problem would be if somebody wants to maintain a 'first in first served' order: Observers who subscribe first should get the first crack at handling events. I don't know if this adds any value though... From: Plamen Neykov <pla...@re...> To: Roland Lichters <rol...@go...> Cc: Ferdinando Ametrano <na...@am...>; "qua...@li..." <qua...@li...>; "lui...@gm..." <lui...@gm...> Sent: Saturday, June 25, 2011 8:48 PM Subject: Re: [Quantlib-dev] destructor performance, observables with large observer lists A very quick comment - wouldn't it be simpler just to use std::set<Observer*> and save you the trouble with the long id or am I missing something here? Regards, Plamen On 25 Jun 2011, at 14:37, Roland Lichters <rol...@go...> wrote: > Hi all, > > we would like to share an observation here that we have made in a project developing an application based on QuantLib. The application loads market data and relatively large trade portfolio from a database, builds term structures, engines and instrument objects and finally does some pricing and portfolio analytics. Term structures and market data are stored "globally" (in some singleton manager) with many instruments "observing" relatively few term structures. We kept term structures "global" to allow for scenario analysis (such as zero rate shifts etc.) across the portfolio. > > What we have noticed is that the application spends significant amount of time at the very end (just before main returns 0). For example, the program loads/constructs about 4000 vanilla deals and related term structures in a minute, prices the deals within seconds and then spends more than 2 minutes terminating itself. Somewhat unsettled by this we investigated the delay further. Logging messages from all kinds of destructors showed that the time is spend - maybe not surprisingly - on instrument destruction. Moreover, the destruction time seemed to grow non-linearly with portfolio size (only 2sec destruction time for about 700 vanilla deals). These times were taken on a MacBook Pro with Intel Core 2 Duo, 2.8 GHz, gcc 4.2, optimization -O2. The attached test program observer.cpp demonstrates this behavior. If you run it with "./observer 2 2000 1" it builds and prices 2000 identical copies of vanilla swaps all linked to the same global term structure. > > The origin of this termination delay is in the observer/observable chains, see ql/pattern/observable.hpp: A single term structure is "observed" in the example by a large number of instruments. When an instrument is destroyed, it first unregisters from its observables (one term structure in our case and several floating rate coupons). This involves a lookup of the given observer in the observable's long list of observers (the term structure has thousands of observers). This lookup is the time consuming step. If we comment out all register/unregister code in observable.hpp, the delay vanishes completely. > > We have come up with the attached slight enhancement of observable.hpp where we have basically replaced list<Observer*> by map<long,Observer*> with some auto-generated id of type long so that the elements can be compared and retrieved more efficiently. With this change the delay upon program termination is gone, while we don't see noticeable increase in time spent on registering observers. > > We have also checked that the QuantLib test suite (1.0.1) completes without errors with both original and new observable.hpp. > > Did anybody else make a similar observation? Do you think it is worth adding the amendment or something similar to QuantLib? > We would be interested in any feedback. > > Kind regards, > Roland > > > <observer.cpp> > > > <observable.hpp> > > > > > > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure contains a > definitive record of customers, application performance, security > threats, fraudulent activity and more. Splunk takes this data and makes > sense of it. Business sense. IT sense. Common sense.. > http://p.sf.net/sfu/splunk-d2d-c1 > _______________________________________________ > QuantLib-dev mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-dev ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense.. http://p.sf.net/sfu/splunk-d2d-c1 _______________________________________________ QuantLib-dev mailing list Qua...@li... https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
|
From: Plamen N. <pla...@re...> - 2011-06-25 16:04:26
|
A very quick comment - wouldn't it be simpler just to use std::set<Observer*> and save you the trouble with the long id or am I missing something here? Regards, Plamen On 25 Jun 2011, at 14:37, Roland Lichters <rol...@go...> wrote: > Hi all, > > we would like to share an observation here that we have made in a project developing an application based on QuantLib. The application loads market data and relatively large trade portfolio from a database, builds term structures, engines and instrument objects and finally does some pricing and portfolio analytics. Term structures and market data are stored "globally" (in some singleton manager) with many instruments "observing" relatively few term structures. We kept term structures "global" to allow for scenario analysis (such as zero rate shifts etc.) across the portfolio. > > What we have noticed is that the application spends significant amount of time at the very end (just before main returns 0). For example, the program loads/constructs about 4000 vanilla deals and related term structures in a minute, prices the deals within seconds and then spends more than 2 minutes terminating itself. Somewhat unsettled by this we investigated the delay further. Logging messages from all kinds of destructors showed that the time is spend - maybe not surprisingly - on instrument destruction. Moreover, the destruction time seemed to grow non-linearly with portfolio size (only 2sec destruction time for about 700 vanilla deals). These times were taken on a MacBook Pro with Intel Core 2 Duo, 2.8 GHz, gcc 4.2, optimization -O2. The attached test program observer.cpp demonstrates this behavior. If you run it with "./observer 2 2000 1" it builds and prices 2000 identical copies of vanilla swaps all linked to the same global term structure. > > The origin of this termination delay is in the observer/observable chains, see ql/pattern/observable.hpp: A single term structure is "observed" in the example by a large number of instruments. When an instrument is destroyed, it first unregisters from its observables (one term structure in our case and several floating rate coupons). This involves a lookup of the given observer in the observable's long list of observers (the term structure has thousands of observers). This lookup is the time consuming step. If we comment out all register/unregister code in observable.hpp, the delay vanishes completely. > > We have come up with the attached slight enhancement of observable.hpp where we have basically replaced list<Observer*> by map<long,Observer*> with some auto-generated id of type long so that the elements can be compared and retrieved more efficiently. With this change the delay upon program termination is gone, while we don't see noticeable increase in time spent on registering observers. > > We have also checked that the QuantLib test suite (1.0.1) completes without errors with both original and new observable.hpp. > > Did anybody else make a similar observation? Do you think it is worth adding the amendment or something similar to QuantLib? > We would be interested in any feedback. > > Kind regards, > Roland > > > <observer.cpp> > > > <observable.hpp> > > > > > > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure contains a > definitive record of customers, application performance, security > threats, fraudulent activity and more. Splunk takes this data and makes > sense of it. Business sense. IT sense. Common sense.. > http://p.sf.net/sfu/splunk-d2d-c1 > _______________________________________________ > QuantLib-dev mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
|
From: Roland L. <rol...@go...> - 2011-06-25 13:37:48
|
Hi all, we would like to share an observation here that we have made in a project developing an application based on QuantLib. The application loads market data and relatively large trade portfolio from a database, builds term structures, engines and instrument objects and finally does some pricing and portfolio analytics. Term structures and market data are stored "globally" (in some singleton manager) with many instruments "observing" relatively few term structures. We kept term structures "global" to allow for scenario analysis (such as zero rate shifts etc.) across the portfolio. What we have noticed is that the application spends significant amount of time at the very end (just before main returns 0). For example, the program loads/constructs about 4000 vanilla deals and related term structures in a minute, prices the deals within seconds and then spends more than 2 minutes terminating itself. Somewhat unsettled by this we investigated the delay further. Logging messages from all kinds of destructors showed that the time is spend - maybe not surprisingly - on instrument destruction. Moreover, the destruction time seemed to grow non-linearly with portfolio size (only 2sec destruction time for about 700 vanilla deals). These times were taken on a MacBook Pro with Intel Core 2 Duo, 2.8 GHz, gcc 4.2, optimization -O2. The attached test program observer.cpp demonstrates this behavior. If you run it with "./observer 2 2000 1" it builds and prices 2000 identical copies of vanilla swaps all linked to the same global term structure. The origin of this termination delay is in the observer/observable chains, see ql/pattern/observable.hpp: A single term structure is "observed" in the example by a large number of instruments. When an instrument is destroyed, it first unregisters from its observables (one term structure in our case and several floating rate coupons). This involves a lookup of the given observer in the observable's long list of observers (the term structure has thousands of observers). This lookup is the time consuming step. If we comment out all register/unregister code in observable.hpp, the delay vanishes completely. We have come up with the attached slight enhancement of observable.hpp where we have basically replaced list<Observer*> by map<long,Observer*> with some auto-generated id of type long so that the elements can be compared and retrieved more efficiently. With this change the delay upon program termination is gone, while we don't see noticeable increase in time spent on registering observers. We have also checked that the QuantLib test suite (1.0.1) completes without errors with both original and new observable.hpp. Did anybody else make a similar observation? Do you think it is worth adding the amendment or something similar to QuantLib? We would be interested in any feedback. Kind regards, Roland |
|
From: SourceForge.net <no...@so...> - 2011-06-23 13:54:52
|
Bugs item #3307791, was opened at 2011-05-26 12:37 Message generated for change (Comment added) made by benyam You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112740&aid=3307791&group_id=12740 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Duplicate Priority: 5 Private: No Submitted By: charas (benyam) Assigned to: Nobody/Anonymous (nobody) Summary: g++ complains about mutable variables Initial Comment: While building a package for quantlib on archlinux i got the following warning and error reference 'y2_' cannot be declared 'mutable' [-fpermissive] ../ql/math/interpolations/multicubicspline.hpp:277:34: warning: reference 'v_' cannot be declared 'mutable' [-fpermissive] ../ql/math/interpolations/multicubicspline.hpp:336:33: warning: reference 'y2_' cannot be declared 'mutable' [-fpermissive] ../ql/math/interpolations/multicubicspline.hpp:337:34: warning: reference 'v_' cannot be declared 'mutable' [-fpermissive] ../ql/math/interpolations/multicubicspline.hpp:337:39: warning: reference 'v1_' cannot be declared 'mutable' [-fpermissive] ../ql/math/interpolations/multicubicspline.hpp:337:45: warning: reference 'v2_' cannot be declared 'mutable' [-fpermissive] make[2]: *** [BermudanSwaption.o] Error 1 After compiling with -fpermissive I could get it compiled but the warnings are still there whenever the compiler encounters the mutable variables. Thanks for Quantlib ---------------------------------------------------------------------- >Comment By: charas (benyam) Date: 2011-06-24 00:24 Message: The issue is now resolved after upgrading to the latest version thanks for the replies ---------------------------------------------------------------------- Comment By: Fahad Khan (fak98) Date: 2011-06-22 20:18 Message: Looks like this issue was fixed by http://quantlib.svn.sourceforge.net/viewvc/quantlib/trunk/QuantLib/ql/math/interpolations/multicubicspline.hpp?r1=17506&r2=17505&pathrev=17506 There are no other mutable references in that file, or anywhere else in the source tree that I can find. This bug should be closed. ---------------------------------------------------------------------- Comment By: Hong Yu (hyu9910) Date: 2011-06-22 19:38 Message: I will be interested to help; however, I currently do not have sufficient computer space to install Fedora. So if you have Fedora and can let me access via SSH/SFTP etc., I will be happy to help tracing. My contact is: <hy...@ho...>, or, SourceForge account 'hyu9910'. ---------------------------------------------------------------------- Comment By: Fahad Khan (fak98) Date: 2011-06-22 03:37 Message: I don't get any such issues on Fedora 15. Both on QuantLib-1.1 and trunk $ gcc --version gcc (GCC) 4.6.0 20110509 (Red Hat 4.6.0-7) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112740&aid=3307791&group_id=12740 |
|
From: SourceForge.net <no...@so...> - 2011-06-22 09:48:36
|
Bugs item #3307791, was opened at 2011-05-26 03:07 Message generated for change (Comment added) made by fak98 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112740&aid=3307791&group_id=12740 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: charas (benyam) Assigned to: Nobody/Anonymous (nobody) Summary: g++ complains about mutable variables Initial Comment: While building a package for quantlib on archlinux i got the following warning and error reference 'y2_' cannot be declared 'mutable' [-fpermissive] ../ql/math/interpolations/multicubicspline.hpp:277:34: warning: reference 'v_' cannot be declared 'mutable' [-fpermissive] ../ql/math/interpolations/multicubicspline.hpp:336:33: warning: reference 'y2_' cannot be declared 'mutable' [-fpermissive] ../ql/math/interpolations/multicubicspline.hpp:337:34: warning: reference 'v_' cannot be declared 'mutable' [-fpermissive] ../ql/math/interpolations/multicubicspline.hpp:337:39: warning: reference 'v1_' cannot be declared 'mutable' [-fpermissive] ../ql/math/interpolations/multicubicspline.hpp:337:45: warning: reference 'v2_' cannot be declared 'mutable' [-fpermissive] make[2]: *** [BermudanSwaption.o] Error 1 After compiling with -fpermissive I could get it compiled but the warnings are still there whenever the compiler encounters the mutable variables. Thanks for Quantlib ---------------------------------------------------------------------- Comment By: Fahad Khan (fak98) Date: 2011-06-22 10:48 Message: Looks like this issue was fixed by http://quantlib.svn.sourceforge.net/viewvc/quantlib/trunk/QuantLib/ql/math/interpolations/multicubicspline.hpp?r1=17506&r2=17505&pathrev=17506 There are no other mutable references in that file, or anywhere else in the source tree that I can find. This bug should be closed. ---------------------------------------------------------------------- Comment By: Hong Yu (hyu9910) Date: 2011-06-22 10:08 Message: I will be interested to help; however, I currently do not have sufficient computer space to install Fedora. So if you have Fedora and can let me access via SSH/SFTP etc., I will be happy to help tracing. My contact is: <hy...@ho...>, or, SourceForge account 'hyu9910'. ---------------------------------------------------------------------- Comment By: Fahad Khan (fak98) Date: 2011-06-21 18:07 Message: I don't get any such issues on Fedora 15. Both on QuantLib-1.1 and trunk $ gcc --version gcc (GCC) 4.6.0 20110509 (Red Hat 4.6.0-7) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112740&aid=3307791&group_id=12740 |
|
From: Hong Y. <hy...@ho...> - 2011-06-22 09:29:05
|
Since I don’t hit such problems on Ubuntu-Linux, and I currently don’t have own computer space to install Fedora, therefore I am happy and interested to help, if I can get access to Fedora via SSH/SFTP etc. via any of your help. Thanks.
From: Amir Ahmed Ansari
Sent: Wednesday, June 22, 2011 5:23 PM
To: Qua...@li...
Subject: Re: [Quantlib-dev] [ quantlib-Bugs-3307791 ] g++ complains aboutmutable variables
I haven't looked at the code responsible for this, but for anyone wishing to resolve it, here is one tidbit that may be useful. The mutable C++ keyword is not meaningful on reference member variables. That is because the 'const' keyword applies ONLY to the class members, NOT what they might be pointing to. So, the following will execute without any compiler errors:
class A
{
public:
mutable int & i;
int a;
A() : i(a) {}
};
int main()
{
const A a;
a.i = 1;
return 0;
}
NOTE that this isn't an example you should copy, because changing those members of a const object that are not marked 'mutable' can lead to very subtle bugs. What I am trying to explain is that the mutable keyword is irrelevant on class members that are references. Hope this helps!!!!
----- Original Message -----
From: SourceForge.net <no...@so...>
To: no...@so...
Cc:
Sent: Tuesday, June 21, 2011 10:07 PM
Subject: [Quantlib-dev] [ quantlib-Bugs-3307791 ] g++ complains about mutable variables
Bugs item #3307791, was opened at 2011-05-26 03:07
Message generated for change (Comment added) made by fak98
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112740&aid=3307791&group_id=12740
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: charas (benyam)
Assigned to: Nobody/Anonymous (nobody)
Summary: g++ complains about mutable variables
Initial Comment:
While building a package for quantlib on archlinux i got the following warning and error
reference 'y2_' cannot be declared 'mutable' [-fpermissive]
../ql/math/interpolations/multicubicspline.hpp:277:34: warning: reference 'v_' cannot be declared 'mutable' [-fpermissive]
../ql/math/interpolations/multicubicspline.hpp:336:33: warning: reference 'y2_' cannot be declared 'mutable' [-fpermissive]
../ql/math/interpolations/multicubicspline.hpp:337:34: warning: reference 'v_' cannot be declared 'mutable' [-fpermissive]
../ql/math/interpolations/multicubicspline.hpp:337:39: warning: reference 'v1_' cannot be declared 'mutable' [-fpermissive]
../ql/math/interpolations/multicubicspline.hpp:337:45: warning: reference 'v2_' cannot be declared 'mutable' [-fpermissive]
make[2]: *** [BermudanSwaption.o] Error 1
After compiling with -fpermissive I could get it compiled but the warnings are still there whenever the compiler encounters
the mutable variables.
Thanks for Quantlib
----------------------------------------------------------------------
Comment By: Fahad Khan (fak98)
Date: 2011-06-21 18:07
Message:
I don't get any such issues on Fedora 15. Both on QuantLib-1.1 and trunk
$ gcc --version
gcc (GCC) 4.6.0 20110509 (Red Hat 4.6.0-7)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112740&aid=3307791&group_id=12740
------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev
_______________________________________________
QuantLib-dev mailing list
Qua...@li...
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
--------------------------------------------------------------------------------
------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev
--------------------------------------------------------------------------------
_______________________________________________
QuantLib-dev mailing list
Qua...@li...
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
|
|
From: Amir A. A. <phd...@ya...> - 2011-06-22 09:26:51
|
sorry, what I wanted to show was this compiles without any errors:
class A
{
public:
int & i;
int a;
A() : i(a) {}
};
int main()
{
const A a;
a.i = 1;
return 0;
}
________________________________
From: Amir Ahmed Ansari <phd...@ya...>
To: "Qua...@li..." <Qua...@li...>
Sent: Wednesday, June 22, 2011 2:23 PM
Subject: Re: [Quantlib-dev] [ quantlib-Bugs-3307791 ] g++ complains about mutable variables
I haven't looked at the code responsible for this, but for anyone wishing to resolve it, here is one tidbit that may be useful. The mutable C++ keyword is not meaningful on reference member variables. That is because the 'const' keyword applies ONLY to the class members, NOT what they might be pointing to. So, the following will execute without any compiler errors:
class A
{
public:
mutable int & i;
int a;
A() : i(a) {}
};
int main()
{
const A a;
a.i = 1;
return 0;
}
NOTE that this isn't an example you should copy, because changing those members of a const object that are not marked 'mutable' can lead to very subtle bugs. What I am trying to explain is that the mutable keyword is irrelevant on class members that are references. Hope this helps!!!!
----- Original Message -----
From: SourceForge.net <no...@so...>
To: no...@so...
Cc:
Sent: Tuesday, June 21, 2011 10:07 PM
Subject: [Quantlib-dev] [ quantlib-Bugs-3307791 ] g++ complains about mutable variables
Bugs item #3307791, was opened at 2011-05-26 03:07
Message generated for change (Comment added) made by fak98
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112740&aid=3307791&group_id=12740
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: charas (benyam)
Assigned to: Nobody/Anonymous (nobody)
Summary: g++ complains about mutable variables
Initial Comment:
While building a package for quantlib on archlinux i got the following warning and error
reference 'y2_' cannot be declared 'mutable'
[-fpermissive]
../ql/math/interpolations/multicubicspline.hpp:277:34: warning: reference 'v_' cannot be declared 'mutable' [-fpermissive]
../ql/math/interpolations/multicubicspline.hpp:336:33: warning: reference 'y2_' cannot be declared 'mutable' [-fpermissive]
../ql/math/interpolations/multicubicspline.hpp:337:34: warning: reference 'v_' cannot be declared 'mutable' [-fpermissive]
../ql/math/interpolations/multicubicspline.hpp:337:39: warning: reference 'v1_' cannot be declared 'mutable' [-fpermissive]
../ql/math/interpolations/multicubicspline.hpp:337:45: warning: reference 'v2_' cannot be declared 'mutable' [-fpermissive]
make[2]: *** [BermudanSwaption.o] Error 1
After compiling with -fpermissive I could get it compiled but the warnings are still there whenever the compiler encounters
the mutable variables.
Thanks for
Quantlib
----------------------------------------------------------------------
Comment By: Fahad Khan (fak98)
Date: 2011-06-21 18:07
Message:
I don't get any such issues on Fedora 15. Both on QuantLib-1.1 and trunk
$ gcc --version
gcc (GCC) 4.6.0 20110509 (Red Hat 4.6.0-7)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112740&aid=3307791&group_id=12740
------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection
magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev
_______________________________________________
QuantLib-dev mailing list
Qua...@li...
https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
|
From: Amir A. A. <phd...@ya...> - 2011-06-22 09:23:16
|
I haven't looked at the code responsible for this, but for anyone wishing to resolve it, here is one tidbit that may be useful. The mutable C++ keyword is not meaningful on reference member variables. That is because the 'const' keyword applies ONLY to the class members, NOT what they might be pointing to. So, the following will execute without any compiler errors:
class A
{
public:
mutable int & i;
int a;
A() : i(a) {}
};
int main()
{
const A a;
a.i = 1;
return 0;
}
NOTE that this isn't an example you should copy, because changing those members of a const object that are not marked 'mutable' can lead to very subtle bugs. What I am trying to explain is that the mutable keyword is irrelevant on class members that are references. Hope this helps!!!!
----- Original Message -----
From: SourceForge.net <no...@so...>
To: no...@so...
Cc:
Sent: Tuesday, June 21, 2011 10:07 PM
Subject: [Quantlib-dev] [ quantlib-Bugs-3307791 ] g++ complains about mutable variables
Bugs item #3307791, was opened at 2011-05-26 03:07
Message generated for change (Comment added) made by fak98
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112740&aid=3307791&group_id=12740
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: charas (benyam)
Assigned to: Nobody/Anonymous (nobody)
Summary: g++ complains about mutable variables
Initial Comment:
While building a package for quantlib on archlinux i got the following warning and error
reference 'y2_' cannot be declared 'mutable' [-fpermissive]
../ql/math/interpolations/multicubicspline.hpp:277:34: warning: reference 'v_' cannot be declared 'mutable' [-fpermissive]
../ql/math/interpolations/multicubicspline.hpp:336:33: warning: reference 'y2_' cannot be declared 'mutable' [-fpermissive]
../ql/math/interpolations/multicubicspline.hpp:337:34: warning: reference 'v_' cannot be declared 'mutable' [-fpermissive]
../ql/math/interpolations/multicubicspline.hpp:337:39: warning: reference 'v1_' cannot be declared 'mutable' [-fpermissive]
../ql/math/interpolations/multicubicspline.hpp:337:45: warning: reference 'v2_' cannot be declared 'mutable' [-fpermissive]
make[2]: *** [BermudanSwaption.o] Error 1
After compiling with -fpermissive I could get it compiled but the warnings are still there whenever the compiler encounters
the mutable variables.
Thanks for Quantlib
----------------------------------------------------------------------
Comment By: Fahad Khan (fak98)
Date: 2011-06-21 18:07
Message:
I don't get any such issues on Fedora 15. Both on QuantLib-1.1 and trunk
$ gcc --version
gcc (GCC) 4.6.0 20110509 (Red Hat 4.6.0-7)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112740&aid=3307791&group_id=12740
------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev
_______________________________________________
QuantLib-dev mailing list
Qua...@li...
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
|
|
From: SourceForge.net <no...@so...> - 2011-06-22 09:08:29
|
Bugs item #3307791, was opened at 2011-05-26 10:07 Message generated for change (Comment added) made by hyu9910 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112740&aid=3307791&group_id=12740 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: charas (benyam) Assigned to: Nobody/Anonymous (nobody) Summary: g++ complains about mutable variables Initial Comment: While building a package for quantlib on archlinux i got the following warning and error reference 'y2_' cannot be declared 'mutable' [-fpermissive] ../ql/math/interpolations/multicubicspline.hpp:277:34: warning: reference 'v_' cannot be declared 'mutable' [-fpermissive] ../ql/math/interpolations/multicubicspline.hpp:336:33: warning: reference 'y2_' cannot be declared 'mutable' [-fpermissive] ../ql/math/interpolations/multicubicspline.hpp:337:34: warning: reference 'v_' cannot be declared 'mutable' [-fpermissive] ../ql/math/interpolations/multicubicspline.hpp:337:39: warning: reference 'v1_' cannot be declared 'mutable' [-fpermissive] ../ql/math/interpolations/multicubicspline.hpp:337:45: warning: reference 'v2_' cannot be declared 'mutable' [-fpermissive] make[2]: *** [BermudanSwaption.o] Error 1 After compiling with -fpermissive I could get it compiled but the warnings are still there whenever the compiler encounters the mutable variables. Thanks for Quantlib ---------------------------------------------------------------------- Comment By: Hong Yu (hyu9910) Date: 2011-06-22 17:08 Message: I will be interested to help; however, I currently do not have sufficient computer space to install Fedora. So if you have Fedora and can let me access via SSH/SFTP etc., I will be happy to help tracing. My contact is: <hy...@ho...>, or, SourceForge account 'hyu9910'. ---------------------------------------------------------------------- Comment By: Fahad Khan (fak98) Date: 2011-06-22 01:07 Message: I don't get any such issues on Fedora 15. Both on QuantLib-1.1 and trunk $ gcc --version gcc (GCC) 4.6.0 20110509 (Red Hat 4.6.0-7) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112740&aid=3307791&group_id=12740 |
|
From: SourceForge.net <no...@so...> - 2011-06-21 17:07:46
|
Bugs item #3307791, was opened at 2011-05-26 03:07 Message generated for change (Comment added) made by fak98 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112740&aid=3307791&group_id=12740 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: charas (benyam) Assigned to: Nobody/Anonymous (nobody) Summary: g++ complains about mutable variables Initial Comment: While building a package for quantlib on archlinux i got the following warning and error reference 'y2_' cannot be declared 'mutable' [-fpermissive] ../ql/math/interpolations/multicubicspline.hpp:277:34: warning: reference 'v_' cannot be declared 'mutable' [-fpermissive] ../ql/math/interpolations/multicubicspline.hpp:336:33: warning: reference 'y2_' cannot be declared 'mutable' [-fpermissive] ../ql/math/interpolations/multicubicspline.hpp:337:34: warning: reference 'v_' cannot be declared 'mutable' [-fpermissive] ../ql/math/interpolations/multicubicspline.hpp:337:39: warning: reference 'v1_' cannot be declared 'mutable' [-fpermissive] ../ql/math/interpolations/multicubicspline.hpp:337:45: warning: reference 'v2_' cannot be declared 'mutable' [-fpermissive] make[2]: *** [BermudanSwaption.o] Error 1 After compiling with -fpermissive I could get it compiled but the warnings are still there whenever the compiler encounters the mutable variables. Thanks for Quantlib ---------------------------------------------------------------------- Comment By: Fahad Khan (fak98) Date: 2011-06-21 18:07 Message: I don't get any such issues on Fedora 15. Both on QuantLib-1.1 and trunk $ gcc --version gcc (GCC) 4.6.0 20110509 (Red Hat 4.6.0-7) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112740&aid=3307791&group_id=12740 |
|
From: Luca B. <luc...@gm...> - 2011-06-18 13:44:55
|
Hi all,
I just found that when building a term structure from a USD Libor Swap
Index and then re-evaluating the same Swap Index, the original quote
is not always recovered.
This happens only on particular evaluation dates and it seems to be
caused by a misalignment of the fixing calendars in the underlying
swaps generated by the classes "SwapIndex" and "SwapRateHelper".
More precisely, the underlying swap in "SwapRateHelper" inherits the
fixing calendar from the underlying "IborIndex" not from the
"SwapIndex". In the case of USD, "IborIndex" and "SwapIndex" calendars
are different.
Here's a code sample that illustrates the issue.
Changing eDate to a different value makes the issue disappear.
Date eDate(29, Dec, 2011);
Settings::instance().evaluationDate() = eDate;
double swaprate = 0.0500;
Period term = 2*Years;
boost::shared_ptr<RateHelper> s2y(new SwapRateHelper(swaprate,
boost::shared_ptr<SwapIndex>(
new
UsdLiborSwapIsdaFixAm(term))));
std::vector<boost::shared_ptr<RateHelper> > instruments;
instruments.push_back(s2y);
boost::shared_ptr<YieldTermStructure> curve(
new PiecewiseYieldCurve<Discount,LogLinear>(
0,
NullCalendar(),
instruments,
ActualActual(ActualActual::ISDA)));
std::cout << UsdLiborSwapIsdaFixAm(term,
Handle<YieldTermStructure>(curve)).fixing(eDate) << std::endl;
|
|
From: Luigi B. <lui...@gm...> - 2011-06-17 14:48:01
|
On Thu, 2011-06-09 at 12:50 -0500, Kakhkhor Abdijalilov wrote: > Is there any difference between "paid" Visual C++ 2010 solutions and > express version solutions? > > Looks like solution files for older versions don't convert well into > Visual C++ 2010 solution. Did anyone tried to write a makefile for MS > nmake? No, I don't think there's any difference in the solutions. The reason the 64-bit configuration is missing might just be that the conversion was done on a 32-bit machine. Luigi -- Ninety percent of everything is crap. --- Theodore Sturgeon |
|
From: Hong Y. <hy...@ho...> - 2011-06-16 05:02:14
|
Some friends are doing portfolio analysis recently, and they are considering using Matlab-like tools. May I ask, can QuantLib be used in portfolio analysis, and how in general? Thanks! Regards, Hong Yu |
|
From: Hong Y. <hy...@ho...> - 2011-06-14 12:04:39
|
I can build QuantLib (v1.1 code and trunk code) in VC-2010-express IDE these days, and the release version also passes all 400 more tests. So not so sure of your suggestion on modifying for MS nmake. But I do remember quite a few warnings during the building process; did you refer to the warnings? Thanks. Regards, Hong Yu -----Original Message----- Looks like solution files for older versions don't convert well into Visual C++ 2010 solution. Did anyone tried to write a makefile for MS nmake? Regards, Kakhkhor Abdijalilov. ------------------------------------------------------------------------------ EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev _______________________________________________ QuantLib-dev mailing list Qua...@li... https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
|
From: Hong Y. <hy...@ho...> - 2011-06-12 13:03:22
|
Thanks! Next I have a question about building QuantLib source in VC10-express. I specified boost path in 'include dir' and 'lib dir' of 'VC++ Directories' of 'project dependencies'. And then the building process resulted in a 'lib\QuantLib-vc100-mt-gd.lib' file, and some error messages like the following: "ql\qldefines.hpp(29): fatal error C1083: Cannot open include file: 'boost/config.hpp': No such file or directory". Look forward to any suggestions. Regards, Hong Yu -----Original Message----- From: Luigi Ballabio Sent: Friday, June 10, 2011 9:10 PM To: Hong Yu Cc: Kakhkhor Abdijalilov ; qua...@li... Subject: Re: [Quantlib-dev] Visual Studio 2010 Win64 configuration On Fri, 2011-06-10 at 19:05 +0800, Hong Yu wrote: > May I ask about installing libboost on windows? Do we only need the > following components for quantlib (http://quantlib.org/install/vc9.shtml)? > > - Boost header files > - start menu shortcuts > - source & doc > - tools (source and binary) > - Boost Test (unit test framework for VC9.0 and VC10.0) Yes. I usually don't install start menu shortcuts, source & doc, and tools. The headers and the test libraries are enough. Luigi |
|
From: Luigi B. <lui...@gm...> - 2011-06-10 13:10:41
|
On Fri, 2011-06-10 at 19:05 +0800, Hong Yu wrote: > May I ask about installing libboost on windows? Do we only need the > following components for quantlib (http://quantlib.org/install/vc9.shtml)? > > - Boost header files > - start menu shortcuts > - source & doc > - tools (source and binary) > - Boost Test (unit test framework for VC9.0 and VC10.0) Yes. I usually don't install start menu shortcuts, source & doc, and tools. The headers and the test libraries are enough. Luigi -- Harrison's Postulate: For every action, there is an equal and opposite criticism. |
|
From: Hong Y. <hy...@ho...> - 2011-06-10 11:05:46
|
May I ask about installing libboost on windows? Do we only need the following components for quantlib (http://quantlib.org/install/vc9.shtml)? - Boost header files - start menu shortcuts - source & doc - tools (source and binary) - Boost Test (unit test framework for VC9.0 and VC10.0) Regards & Thanks a lot Hong Yu -----Original Message----- From: Kakhkhor Abdijalilov Sent: Friday, June 10, 2011 1:50 AM To: qua...@li... Subject: Re: [Quantlib-dev] Visual Studio 2010 Win64 configuration Is there any difference between "paid" Visual C++ 2010 solutions and express version solutions? Looks like solution files for older versions don't convert well into Visual C++ 2010 solution. Did anyone tried to write a makefile for MS nmake? Regards, Kakhkhor Abdijalilov. ------------------------------------------------------------------------------ EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev _______________________________________________ QuantLib-dev mailing list Qua...@li... https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
|
From: Kakhkhor A. <kab...@gm...> - 2011-06-09 17:50:30
|
Is there any difference between "paid" Visual C++ 2010 solutions and express version solutions? Looks like solution files for older versions don't convert well into Visual C++ 2010 solution. Did anyone tried to write a makefile for MS nmake? Regards, Kakhkhor Abdijalilov. |
|
From: Hong Y. <hy...@ho...> - 2011-06-09 13:50:55
|
By the way, if the project wish for people to work on Windows and Mac, I am also interested to try as I have VC-10-express on windows-7. Just not so sure how to get Mac for free and to install. Regards, Hong Yu -----Original Message----- From: Hong Yu Sent: Thursday, June 09, 2011 4:07 PM To: lui...@gm... Cc: qua...@li... ; Yu Hong Subject: Re: [Quantlib-dev] Visual Studio 2010 Win64 configuration Thanks for the information! Yesterday I updated the source and compiled OK. So Linux-compiling is not a problem now. Also, I mean I am interested in joining quantlib development. So I am following the mailing lists to learn the code for sometime first. Thanks. Regards, Hong Yu |
|
From: Ferdinando A. <na...@am...> - 2011-06-09 12:45:13
|
> Ferdinando works on Windows, but I don't know > which version of Visual C++ he's using these days. VC9 (aka 2008) I plan to switch to VC10 (2010) soon, but will keep maintaining VC9 ciao -- Nando |