[Date Time] time duration Debug assertion VSC++ 8
Hi All, This little program works with Visual Studio 2003 but fails with an assertion failure in VS 2005 sp1. #include "boost/date_time/posix_time/posix_time.hpp" int main() { using namespace boost::posix_time; time_duration timeinterval(24,0,0,0); return 0; } The assertion is from strftime.c line 659 ((timeptr->tm_hour>=0)&&(timeptr->tm_hour<=23)) Is there a fix? I am using boost 1.34.0 thanks in advance michael ____________________________________________________________________________________ Luggage? GPS? Comic books? Check out fitting gifts for grads at Yahoo! Search http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz
Howdy fellow Boosters! i've been using the BGL for quite some time now (as for implementing my own version of a critical path estimator on DAGs with weighted nodes). While i was searching for general software on "interval arithmetic" out there, i luckily found out (although i feel much more confident in C) that Boost has its own interval library supporting integers (which is what i'm mostly interested in). My question is if it is meaningful (it is for the analysis in mind:) to implement a SELECT operator that works on intervals. The SELECT operation would be: -> src1, if cond!=0 dst <= | | -> src2, if cond=0 In C trigraph notation this would be dst = (cond?src1:src2); To my understanding, the equivalent in interval arithmetic would be either transfer the interval associated with src1 variable to the dst, or the one associated with src2, depending on the cond (probably a degenerate interval of the form [C,C]. In my problem, the SELECT operator expresses data dependencies (actually it is the result of converting from control to data dependence). Is it possible, to check interval propagation not only on polynomials but on sequences featuring such SELECT interval operators? Or better, is it already there, build in the "interval" numeric sublibrary? Thanks in advance Nikolaos Kavvadias
Le mercredi 20 juin 2007 à 15:14 +0300, Nikolaos Kavvadias a écrit :
My question is if it is meaningful (it is for the analysis in mind:) to
It usually is.
implement a SELECT operator that works on intervals. The SELECT operation would be:
-> src1, if cond!=0 dst <= | | -> src2, if cond=0
Generally, you have to add a third branch when you can't decide whether cond == 0 or cond != 0 (in case cond is not degenerate yet it contains zero). This third branch will store hull(src1, src2) into dst.
Or better, is it already there, build in the "interval" numeric sublibrary?
No, there is no such operator. But it is not difficult to implement. The code would look like if (cerne(cond, 0)) dst = src1; else if (cereq(cond, 0)) dst = src2; else dst = hull(src1, src2); ("cer" means "certainly", available in compare/explicit.hpp) Best regards, Guillaume
Guillaume Melquiond wrote:
The SELECT operation would be:
-> src1, if cond!=0 dst <= | | -> src2, if cond=0
Generally, you have to add a third branch when you can't decide whether cond == 0 or cond != 0 (in case cond is not degenerate yet it contains zero). This third branch will store hull(src1, src2) into dst.
Dear Guillaume thank you for your answer, you have also covered a couple of questions that would eventually come up. In some cases, the "gating" variable (cond in the expression above) would be generated as a result of other computations (and not read as input to the entire graph/sequence), so it is not right for me to think that it would be described by a degenerate interval in all cases. The third branch in your expression is thus necessary. Kind regards Nikolaos Kavvadias PS: Nice documentation and examples, comparable to the ones in the BGL that had me going there. Thanks again.
participants (3)
-
Guillaume Melquiond
-
michael mathews
-
Nikolaos Kavvadias