Changeset 452 for trunk/src/MathUtils.cc
- Timestamp:
- 02/16/05 12:26:03 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/MathUtils.cc
r382 r452 78 78 79 79 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 // 80 void mathutil::scanBoundaries(Vector<uInt>& startInt, 81 Vector<uInt>& endInt, 82 const Vector<Int>& scanIDs) 83 // Find integrations start and end for each Scan 86 84 { 87 88 89 90 // 91 92 93 94 95 96 97 98 // 99 100 101 102 103 104 105 106 107 108 109 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); 110 108 }
Note: See TracChangeset
for help on using the changeset viewer.