- Timestamp:
- May 7, 2013, 8:44:53 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130419/pswarp/src/pswarpOverlaps.c
r35512 r35525 166 166 bool pswarpFindOverlap (pmFPA *input, pmFPA *output, pswarpBounds *src, pswarpBounds *tgt) { 167 167 168 bool status = false; 169 168 170 // we have the source and target bounds. loop over all output elements and check if any of the source 169 171 // elements overlap it. … … 204 206 psArrayAdd (inputChips, 1, input->chips->data[i]); 205 207 } 206 chip->process = hasOverlap;208 chip->process |= hasOverlap; 207 209 if (hasOverlap) { 210 pmChipSelectCells (chip); 208 211 // get the complete list of input cells for this set of input chips 209 212 // pmConceptsAverageCells needs a psList (not a psArray) 210 ps List *inputCells = psListAlloc(NULL);213 psArray *inputCells = psArrayAllocEmpty(8); 211 214 for (int nChip = 0; nChip < inputChips->n; nChip++) { 212 215 pmChip *inputChip = inputChips->data[nChip]; 213 216 for (int nCell = 0; nCell < inputChip->cells->n; nCell++) { 214 217 fprintf (stderr, "input %d, %d : output %d\n", nChip, nCell, j); 215 ps ListAdd (inputCells, PS_LIST_TAIL, inputChip->cells->data[nCell]);218 psArrayAdd (inputCells, 8, inputChip->cells->data[nCell]); 216 219 } 217 220 } … … 220 223 for (int nCell = 0; nCell < chip->cells->n; nCell++) { 221 224 pmCell *outputCell = chip->cells->data[nCell]; 222 psMetadataAddPtr(outputCell->analysis, PS_LIST_TAIL, "INPUT.CELLS", PS_DATA_LIST , "input cells touching this output cell", inputCells); 225 psList *outList = psMetadataLookupPtr(&status, outputCell->analysis, "INPUT.CELLS"); 226 if (!outList) { 227 outList = psListAlloc(NULL); 228 psMetadataAddPtr(outputCell->analysis, PS_LIST_TAIL, "INPUT.CELLS", PS_DATA_LIST , "input cells touching this output cell", outList); 229 psFree (outList); 230 } 231 for (int nCell = 0; nCell < inputCells->n; nCell ++) { 232 psListAdd (outList, PS_LIST_TAIL, inputCells->data[nCell]); 233 } 223 234 } 224 235 psFree (inputCells);
Note:
See TracChangeset
for help on using the changeset viewer.
