Changeset 452 for trunk/src/MathUtils.cc


Ignore:
Timestamp:
02/16/05 12:26:03 (19 years ago)
Author:
mar637
Message:
  • Added extendLastArrayAxis
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/MathUtils.cc

    r382 r452  
    7878
    7979
    80 void mathutil::scanBoundaries (Vector<uInt>& startInt,
    81                                Vector<uInt>& endInt,
    82                                const Vector<Int>& scanIDs)
    83 //
    84 // FInd integrations start and end for each Scan
    85 //
     80void mathutil::scanBoundaries(Vector<uInt>& startInt,
     81                              Vector<uInt>& endInt,
     82                              const Vector<Int>& scanIDs)
     83  // Find integrations start and end for each Scan
    8684{
    87    uInt nInt = scanIDs.nelements();
    88    startInt.resize(nInt);
    89    endInt.resize(nInt);
    90 //
    91    startInt(0) = 0;
    92    uInt j = 0;
    93    Int currScanID = scanIDs(0);
    94    for (uInt i=0; i<nInt; i++) {
    95       if (scanIDs(i) != currScanID) { 
    96          endInt(j) = i-1;
    97          currScanID = scanIDs(i);
    98 //
    99          j += 1;
    100          startInt(j) = i;
    101          if (i==nInt-1) {
    102             endInt(j) = i;
    103          }   
    104       } else {
    105          if (i==nInt-1) endInt(j) = i;
    106       }
    107    }
    108    startInt.resize(j+1,True);
    109    endInt.resize(j+1,True);
     85  uInt nInt = scanIDs.nelements();
     86  startInt.resize(nInt);
     87  endInt.resize(nInt);
     88
     89  startInt(0) = 0;
     90  uInt j = 0;
     91  Int currScanID = scanIDs(0);
     92  for (uInt i=0; i<nInt; i++) {
     93    if (scanIDs(i) != currScanID) { 
     94      endInt(j) = i-1;
     95      currScanID = scanIDs(i);
     96
     97      j += 1;
     98      startInt(j) = i;
     99      if (i==nInt-1) {
     100        endInt(j) = i;
     101      }   
     102    } else {
     103      if (i==nInt-1) endInt(j) = i;
     104    }
     105  }
     106  startInt.resize(j+1,True);
     107  endInt.resize(j+1,True);
    110108}
Note: See TracChangeset for help on using the changeset viewer.