Changeset 4409

Show
Ignore:
Timestamp:
03/20/12 18:57:33 (7 years ago)
Author:
vdebuen
Message:

Fixes #1488

Location:
tolp/trunk/tol/btol/timeset_type
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • tolp/trunk/tol/btol/timeset_type/tms.cpp

    r4347 r4409  
    279279      if(!S) 
    280280      { 
    281       //Std(BText("\nTRACE GetHashBetween type=")+typeid(*this).name()+"\n"); 
    282         if(typeid(*this).name()=="class BTmsRangeSuc") 
    283           printf(""); 
    284281        NCThis->CalcHashBetween(hash, first, last); 
    285282        NCThis->PutCache(hash, bc, ec); 
  • tolp/trunk/tol/btol/timeset_type/tmsgrav.cpp

    r4347 r4409  
    695695  int iter, n, N = (int)MaxIter().Value(), M = (int)OutOfRange().Value(); 
    696696  BDate curLimit = CurrentCalcLastDate(); 
    697   if(curLimit.IsTheEnd() || !curLimit.HasValue())  
    698   { curLimit = BDate::DefaultLast(); } 
     697  if(!curLimit.HasValue()) { curLimit = BDate::DefaultLast(); } 
    699698  double defaultRange =  BDate::DefaultLast() -  BDate::DefaultFirst(); 
    700699  BDate cutLimit = curLimit+((1+defaultRange)*cutRangeFactor_.Value()); 
     
    702701  { 
    703702    dte = EnsureNotAbortedSuccessor(dte); 
    704     EnsureLimitsSuccessor(dte); 
     703    if(dte.IsUnknown()||dte.IsTheEnd()) { return(dte); } 
     704    if(dte>=Sup()) { return(BDate::End()); } 
     705 
    705706    if(curLimit<dte)  
    706707    {  
     
    746747  int iter, n, N = (int)MaxIter().Value(), M = (int)OutOfRange().Value(); 
    747748  BDate curLimit = CurrentCalcFirstDate(); 
    748   if(curLimit.IsTheBegin() || !curLimit.HasValue())  
    749   { curLimit = BDate::DefaultFirst(); } 
     749  if(curLimit==BDate::Begin()) { curLimit = BDate::DefaultFirst(); } 
    750750  double defaultRange =  BDate::DefaultLast() -  BDate::DefaultFirst(); 
    751751  BDate cutLimit = curLimit-((1+defaultRange)*cutRangeFactor_.Value()); 
    752   BDate old = dte; 
    753752  for(n=iter=0; iter<N; iter++) 
    754753  { 
    755754    dte = EnsureNotAbortedPredecessor(dte); 
    756     EnsureLimitsPredecessor(dte); 
     755    if(dte.IsUnknown()||dte.IsTheBegin()) { return(dte); } 
     756    if(dte<=Inf()) { return(BDate::Begin()); } 
    757757    if(curLimit>dte)  
    758758    {  
     
    778778    else if( ac &&  bc)    { BDate d = Maximum(aPred,bPred); AbortSaveInfo(dte_, d, -1); return(d); }  
    779779    else                   { dte =  Minimum(aPred,bPred);  } 
    780     if(dte==old) 
    781     { 
    782       return(BDate::Begin()); 
    783     } 
    784     old = dte; 
    785780  } 
    786781  AbortMessageMaxIter("BTmsIntersection::Predecessor",dte_,dte,-1); 
     
    852847  int iter, n, N = (int)MaxIter().Value(), M = (int)OutOfRange().Value(); 
    853848  BDate curLimit = CurrentCalcLastDate(); 
    854   if(curLimit.IsTheEnd() || !curLimit.HasValue())  
    855   { curLimit = BDate::DefaultLast(); } 
     849  if(!curLimit.HasValue()) { curLimit = BDate::DefaultLast(); } 
    856850  double defaultRange =  BDate::DefaultLast() -  BDate::DefaultFirst(); 
    857851  BDate cutLimit = curLimit+((1+defaultRange)*cutRangeFactor_.Value()); 
     
    861855    { 
    862856      dte = EnsureNotAbortedSuccessor(dte); 
    863       EnsureLimitsSuccessor(dte); 
     857      if(dte.IsUnknown()||dte.IsTheEnd()) { return(dte); } 
     858      if(dte>=Sup()) { return(BDate::End()); } 
    864859      if(curLimit<dte)  
    865860      {  
     
    906901  int iter, n, N = (int)MaxIter().Value(), M = (int)OutOfRange().Value(); 
    907902  BDate curLimit = CurrentCalcFirstDate(); 
    908   if(curLimit.IsTheBegin() || !curLimit.HasValue())  
    909   { curLimit = BDate::DefaultFirst(); } 
     903  if(curLimit==BDate::Begin()) { curLimit = BDate::DefaultFirst(); } 
    910904  double defaultRange =  BDate::DefaultLast() -  BDate::DefaultFirst(); 
    911905  BDate cutLimit = curLimit-((1+defaultRange)*cutRangeFactor_.Value()); 
     
    915909    { 
    916910      dte = EnsureNotAbortedPredecessor(dte); 
    917       EnsureLimitsPredecessor(dte); 
     911      if(dte.IsUnknown()||dte.IsTheBegin()) { return(dte); } 
     912      if(dte<=Inf()) { return(BDate::Begin()); } 
    918913      if(curLimit>dte)  
    919914      {  
     
    971966{ 
    972967  BDate d, inf; 
    973   for(BInt n=1; (!inf.IsTheBegin()) && (n<=NumArgs()); n++) 
     968  for(BInt n=1; (inf!=BDate::Begin()) && (n<=NumArgs()); n++) 
    974969  { 
    975970    d = Tms(Arg(n))->Inf(); 
     
    984979{ 
    985980  BDate d, sup; 
    986   for(BInt n=1; (!sup.IsTheEnd()) && (n<=NumArgs()); n++) 
     981  for(BInt n=1; (sup!=BDate::End()) && (n<=NumArgs()); n++) 
    987982  { 
    988983    d = Tms(Arg(n))->Sup(); 
     
    11951190  BArray<BDate> D(NumArgs()); 
    11961191  BDate curLimit = CurrentCalcLastDate(); 
    1197   if(curLimit.IsTheEnd() || !curLimit.HasValue())  
    1198   { curLimit = BDate::DefaultLast(); } 
     1192  if(!curLimit.HasValue()) { curLimit = BDate::DefaultLast(); } 
    11991193  double defaultRange =  BDate::DefaultLast() -  BDate::DefaultFirst(); 
    12001194  BDate cutLimit = curLimit+((1+defaultRange)*cutRangeFactor_.Value()); 
     
    12021196  { 
    12031197    dte = EnsureNotAbortedSuccessor(dte); 
    1204     EnsureLimitsSuccessor(dte); 
     1198    if(dte.IsUnknown()||dte.IsTheEnd()) { return(dte); } 
     1199    if(dte>=Sup()) { return(BDate::End()); } 
    12051200    if(curLimit<dte)  
    12061201    {  
     
    12601255  BArray<BDate> D(NumArgs()); 
    12611256  BDate curLimit = CurrentCalcFirstDate(); 
    1262   if(curLimit.IsTheBegin() || !curLimit.HasValue())  
    1263   { curLimit = BDate::DefaultFirst(); } 
     1257  if(curLimit==BDate::Begin()) { curLimit = BDate::DefaultFirst(); } 
    12641258  double defaultRange =  BDate::DefaultLast() -  BDate::DefaultFirst(); 
    12651259  BDate cutLimit = curLimit+((1+defaultRange)*cutRangeFactor_.Value()); 
     
    12671261  { 
    12681262    dte = EnsureNotAbortedPredecessor(dte); 
    1269     EnsureLimitsPredecessor(dte); 
     1263    if(dte.IsUnknown()||dte.IsTheBegin()) { return(dte); } 
     1264    if(dte<=Inf()) { return(BDate::Begin()); } 
    12701265    if(curLimit>dte)  
    12711266    {  
     
    21062101  BDate d, inf, cInf = center_->Inf(), uInf = units_->Inf(); 
    21072102  if(cInf.IsTheBegin()) { return(uInf); } 
    2108   for(int k = from_; (!inf.IsTheBegin()) && (k<=until_); k++) 
     2103  for(int k = from_; (inf!=BDate::Begin()) && (k<=until_); k++) 
    21092104  { 
    21102105    if(!k) { d = icu_->Inf(); } 
     
    21252120  BDate d, sup, cSup = center_->Sup(), uSup = units_->Sup(); 
    21262121  if(cSup.IsTheEnd()) { return(uSup); } 
    2127   for(int k = from_; (!sup.IsTheEnd()) && (k<=until_); k++) 
     2122  for(int k = from_; (sup!=BDate::End()) && (k<=until_); k++) 
    21282123  { 
    21292124    if(!k) { d = icu_->Sup(); } 
     
    25122507  int iter, n, N = (int)MaxIter().Value(), M = (int)OutOfRange().Value(); 
    25132508  BDate curLimit = CurrentCalcLastDate(); 
    2514   if(curLimit.IsTheEnd() || !curLimit.HasValue())  
    2515   { curLimit = BDate::DefaultLast(); } 
     2509  if(!curLimit.HasValue()) { curLimit = BDate::DefaultLast(); } 
    25162510//Std(Out()+"\nBTmsOfSerie::Successor of "+ser->Identify()+" "+dte); 
    25172511  for(n=iter=0; iter<N; iter++) 
    25182512  { 
    25192513    dte = EnsureNotAbortedSuccessor(dte); 
    2520     EnsureLimitsSuccessor(dte); 
     2514    if(dte.IsUnknown()||dte.IsTheEnd()) { return(dte); } 
     2515    if(dte>=Sup()) { return(BDate::End()); } 
     2516 
    25212517    if(curLimit<dte)  
    25222518    {  
     
    25532549  int iter, n, N = (int)MaxIter().Value(), M = (int)OutOfRange().Value(); 
    25542550  BDate curLimit = CurrentCalcFirstDate(); 
    2555   if(curLimit.IsTheBegin() || !curLimit.HasValue())  
    2556   { curLimit = BDate::DefaultFirst(); } 
     2551  if(curLimit==BDate::Begin()) { curLimit = BDate::DefaultFirst(); } 
    25572552  for(n=iter=0; iter<N; iter++) 
    25582553  { 
    25592554    dte = EnsureNotAbortedPredecessor(dte); 
    2560     EnsureLimitsPredecessor(dte); 
     2555    if(dte.IsUnknown()||dte.IsTheBegin()) { return(dte); } 
     2556    if(dte<=Inf()) { return(BDate::Begin()); } 
    25612557    if(curLimit>dte)  
    25622558    {