Changeset 24034 for trunk/psModules/src/astrom/pmAstrometryObjects.c
- Timestamp:
- May 1, 2009, 5:11:04 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/astrom/pmAstrometryObjects.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/astrom/pmAstrometryObjects.c
r24022 r24034 83 83 { 84 84 psArray *matches = psArrayAllocEmpty(x1->n); 85 psVector *found1 = psVectorAlloc(x1->n, PS_TYPE_S8); 86 psVector *found2 = psVectorAlloc(x2->n, PS_TYPE_S8); 85 87 86 88 const double RADIUS_SQR = PS_SQR(RADIUS); 87 89 double dX, dY, dR; 90 91 psVectorInit (found1, 0); 92 psVectorInit (found2, 0); 88 93 89 94 int jStart; … … 100 105 } 101 106 107 if (found1->data.S8[i]) { 108 i++; 109 continue; 110 } 111 if (found2->data.S8[j]) { 112 j++; 113 continue; 114 } 115 102 116 jStart = j; 103 while ( fabs(dX) < RADIUS && j < x2->n) {117 while ((fabs(dX) < RADIUS) && (j < x2->n)) { 104 118 105 119 dX = x1->data.F64[i] - x2->data.F64[j]; … … 111 125 continue; 112 126 } 127 if (found2->data.S8[j]) { 128 j++; 129 continue; 130 } 113 131 114 132 // got a match; add to output list … … 117 135 psFree (match); 118 136 137 found1->data.S8[i] = 1; 138 found2->data.S8[j] = 1; 139 119 140 j++; 120 141 } … … 122 143 i++; 123 144 } 145 psFree (found1); 146 psFree (found2); 147 124 148 return (matches); 125 149 }
Note:
See TracChangeset
for help on using the changeset viewer.
