00001 /* boxClump - put together 2 dimensional boxes that 00002 * overlap with each other into clumps. */ 00003 00004 #ifndef BOXCLUMP_H 00005 #define BOXCLUMP_H 00006 00007 struct boxIn 00008 /* Input to box clumper. */ 00009 { 00010 struct boxIn *next; /* Next in list. */ 00011 void *data; /* Some user-associated data. */ 00012 int qStart, qEnd; /* Range covered in query. */ 00013 int tStart, tEnd; /* Range covered in target. */ 00014 }; 00015 00016 struct boxClump 00017 /* Output of box clumper. */ 00018 { 00019 struct boxClump *next; /* Next in list. */ 00020 struct boxIn *boxList; /* List of boxes in this clump. */ 00021 int boxCount; /* Count of boxes in this clump. */ 00022 int qStart, qEnd; /* Expanse of clump in query. */ 00023 int tStart, tEnd; /* Expanse of clump in target. */ 00024 }; 00025 00026 void boxClumpFree(struct boxClump **pClump); 00027 /* Free boxClump. */ 00028 00029 void boxClumpFreeList(struct boxClump **pList); 00030 /* Free list of boxClumps. */ 00031 00032 int boxClumpCmpCount(const void *va, const void *vb); 00033 /* Compare to sort based on count of boxes. */ 00034 00035 struct boxClump *boxFindClumps(struct boxIn **pBoxList); 00036 /* Convert list of boxes to a list of clumps. Clumps 00037 * are collections of boxes that overlap. Note that 00038 * the original boxList is overwritten as the boxes 00039 * are moved from it to the clumps. */ 00040 00041 #endif /* BOXCLUMP_H */
1.5.2