Not sure if it is a bug in schedule.cpp

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Not sure if it is a bug in schedule.cpp

Schmidt
Hi dear QuantLib developers

          I'm curious about line#415 code in schedule.cpp. When I use DateGeneration::ThirdWednesday

to generate a schedule when:
 
effectiveDate = 2016/01/15
terminationDate = 2016/7/18
tenor = 1*Months
calendar = Taiwan()
businessdayConvention = Following
terminationDateConvention = Following
endOfMonth = false

before the execution of code starts from line#414

the member vector dates_ and isRegular_ of my schedule are:
dates_:{42384 42417 42445 42480 42508 42536 42571 42569}
isRegular_:{true true true true true true false}

since dates_[dates_.size()-2] >= dates_.back() is true (in my case dates_.size() = 8)
code line#415&416 will assign "false" to isRegular_[6]
and it is weired that this "false" value should be assigned to isRegular_[5] or more specifically
isRegular_[isRegular.size()-2]
the final dates_ will be {42384 42417 42445 42480 42508 42536 42569}
and 42569 is not an regular date, so the isRegular_ vector should be: {true true true true true false}however now my QuantLib 1.7 will generate a isRegular_ vector with all true in it. is it a little bug? or I'm somwhere wrong or misunderstanding?
Reply | Threaded
Open this post in threaded view
|

Re: Not sure if it is a bug in schedule.cpp

Luigi Ballabio
Hello,
    yes, it looks like a bug. I'm looking into it.

Luigi


On Thu, Jun 2, 2016 at 10:24 AM Schmidt <[hidden email]> wrote:
Hi dear QuantLib developers

          I'm curious about line#415 code in schedule.cpp. When I use
DateGeneration::ThirdWednesday

to generate a schedule when:

effectiveDate = 2016/01/15
terminationDate = 2016/7/18
tenor = 1*Months
calendar = Taiwan()
businessdayConvention = Following
terminationDateConvention = Following
endOfMonth = false

before the execution of code starts from line#414

the member vector dates_ and isRegular_ of my schedule are:
dates_:{42384 42417 42445 42480 42508 42536 42571 42569}
isRegular_:{true true true true true true false}

since dates_[dates_.size()-2] >= dates_.back() is true (in my case
dates_.size() = 8)
code line#415&416 will assign "false" to isRegular_[6]
and it is weired that this "false" value should be assigned to isRegular_[5]
or more specifically
isRegular_[isRegular.size()-2]
the final dates_ will be {42384 42417 42445 42480 42508 42536 42569}
and 42569 is not an regular date, so the isRegular_ vector should be: {true
true true true true false}however now my QuantLib 1.7 will generate a
isRegular_ vector with all true in it. is it a little bug? or I'm somwhere
wrong or misunderstanding?



--
View this message in context: http://quantlib.10058.n7.nabble.com/Not-sure-if-it-is-a-bug-in-schedule-cpp-tp17498.html
Sent from the quantlib-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Not sure if it is a bug in schedule.cpp

Luigi Ballabio
Hello,
    yes, it was a bug. I've fixed it in the git repository.

Thanks for the heads-up,
    Luigi


On Fri, Jun 10, 2016 at 5:10 PM Luigi Ballabio <[hidden email]> wrote:
Hello,
    yes, it looks like a bug. I'm looking into it.

Luigi


On Thu, Jun 2, 2016 at 10:24 AM Schmidt <[hidden email]> wrote:
Hi dear QuantLib developers

          I'm curious about line#415 code in schedule.cpp. When I use
DateGeneration::ThirdWednesday

to generate a schedule when:

effectiveDate = 2016/01/15
terminationDate = 2016/7/18
tenor = 1*Months
calendar = Taiwan()
businessdayConvention = Following
terminationDateConvention = Following
endOfMonth = false

before the execution of code starts from line#414

the member vector dates_ and isRegular_ of my schedule are:
dates_:{42384 42417 42445 42480 42508 42536 42571 42569}
isRegular_:{true true true true true true false}

since dates_[dates_.size()-2] >= dates_.back() is true (in my case
dates_.size() = 8)
code line#415&416 will assign "false" to isRegular_[6]
and it is weired that this "false" value should be assigned to isRegular_[5]
or more specifically
isRegular_[isRegular.size()-2]
the final dates_ will be {42384 42417 42445 42480 42508 42536 42569}
and 42569 is not an regular date, so the isRegular_ vector should be: {true
true true true true false}however now my QuantLib 1.7 will generate a
isRegular_ vector with all true in it. is it a little bug? or I'm somwhere
wrong or misunderstanding?



--
View this message in context: http://quantlib.10058.n7.nabble.com/Not-sure-if-it-is-a-bug-in-schedule-cpp-tp17498.html
Sent from the quantlib-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users