Changeset 2559 for branches


Ignore:
Timestamp:
06/11/12 18:42:43 (12 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: No

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No?

Module(s): Module Names change impacts.

Description: Describe your changes here...

Minor speed-up of STMath::almacal


File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/hpc33/src/STMath.cpp

    r2557 r2559  
    39643964    Vector<Double> interval = out->integrCol_.getColumn() ;
    39653965    interval /= 86400.0 ;
    3966     Block<uInt> gaplist( 100 ) ;
    3967     uInt glidx = 0 ;
    3968     uInt glsize = gaplist.size() ;
     3966    uInt *newscan = new uInt[nrow] ;
     3967    Vector<uInt> newscanno( IPosition(1,nrow), newscan, TAKE_OVER ) ;
     3968    uInt *p = newscan ;
     3969    uInt newid = 0 ;
    39693970    for ( uInt i = 0 ; i < nrow - 1 ; i++ ) {
     3971      *p = newid ;
    39703972      double gap = 2.0 * timeSep[i+1] / ( interval[i] + interval[i+1] ) ;
    39713973      //cout << "gap[" << i << "]=" << setw(5) << gap << endl ;
    39723974      if ( gap > 1.1 ) {
    39733975//         cout << "detected gap between " << i << " and " << i+1 << endl ;
    3974         gaplist[glidx] = i ;
    3975         glidx++ ;
    3976       }
    3977       if ( glidx >= glsize ) {
    3978 //         cout << "resize gaplist" << endl ;
    3979         glsize += 100 ;
    3980         gaplist.resize( glsize ) ;
    3981       }
    3982     }
    3983     gaplist[glidx] = nrow - 1 ;
    3984     glidx++ ;
    3985 //     cout << "gaplist = " << Vector<uInt>(IPosition(1,glidx),gaplist.storage()) << endl ;
    3986     uInt newid = 0 ;
    3987     Vector<uInt> newscanno( nrow, 0 ) ;
    3988     uInt *p = newscanno.data() ;
    3989     IPosition pos( 1 ) ;
    3990     for ( uInt i = 1 ; i < glidx  ; i++ ) {
    3991       pos[0] = gaplist[i] - gaplist[i-1] ;
    3992       Vector<uInt> scnslice( pos, p+gaplist[i-1]+1, SHARE ) ;
    3993       scnslice = i ;
    3994     }
     3976        newid++ ;
     3977      }
     3978      p++ ;
     3979    }
     3980    *p = newid ;
    39953981    out->scanCol_.putColumn( newscanno ) ;
    39963982//     double t2 = mathutil::gettimeofday_sec() ;
Note: See TracChangeset for help on using the changeset viewer.