Re: Gregorian Bad Year exception error: please help!
Posted by
Luigi Ballabio on
Jul 28, 2017; 1:36pm
URL: http://quantlib.414.s1.nabble.com/Gregorian-Bad-Year-exception-error-please-help-tp18451p18458.html
That's weird. May you try debugging the program and see what is happening when the exception is thrown?
Luigi
Hi Luigi,
I checked the dates on both axes. They are all valid and go on to 2037. For some reason, std::vector::insert is not working properly on them.
We shouldn’t have any problem on the sort method since Date class is already endowed with a < comparison operator.
Thanks for the advise.
Apologies if I'm asking the obvious, but did you check the dates in your axes? Are they all valid dates between years 1400 and 10000?
Luigi
Hi Community,
I am writing a small interface for a simulation time axis for exposures using QL. To keep the question short, I show below the function where error is reported:
inline SimulationTimeAxis& SimulationTimeAxis::MergeWithOtherTimeAxis(const SimulationTimeAxis& other_axis)
{
exposure_dates_.insert(exposure_dates_.end(), (other_axis.exposure_dates()).begin(),
(other_axis.exposure_dates()).end());
std::sort(exposure_dates_.begin(),exposure_dates_.end());
std::unique(exposure_dates_.begin(), exposure_dates_.end());
return(*this);
}
I get the following exception error message when testing the method:
exception of type boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::gregorian::bad_year> >: Year is out of valid range: 1400..10000
And I was wondering whether anyone had already come across such error in the past. Your help is much appreciated.
Thanks,
Amine
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org!
http://sdm.link/slashdot_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users