inc/boxClump.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  boxIn
struct  boxClump

Functions

void boxClumpFree (struct boxClump **pClump)
void boxClumpFreeList (struct boxClump **pList)
int boxClumpCmpCount (const void *va, const void *vb)
boxClumpboxFindClumps (struct boxIn **pBoxList)


Function Documentation

int boxClumpCmpCount ( const void *  va,
const void *  vb 
)

Definition at line 39 of file boxClump.c.

References boxClump::boxCount.

00041 {
00042 const struct boxClump *a = *((struct boxClump **)va);
00043 const struct boxClump *b = *((struct boxClump **)vb);
00044 return b->boxCount - a->boxCount;
00045 }

void boxClumpFree ( struct boxClump **  pClump  ) 

Some simple utility function on globally declared data structures.

Definition at line 15 of file boxClump.c.

References boxClump::boxList, freez(), and slFreeList().

Referenced by boxClumpFreeList().

00017 {
00018 struct boxClump *clump = *pClump;
00019 if (clump != NULL)
00020     {
00021     slFreeList(&clump->boxList);
00022     freez(pClump);
00023     }
00024 }

Here is the call graph for this function:

Here is the caller graph for this function:

void boxClumpFreeList ( struct boxClump **  pList  ) 

Definition at line 26 of file boxClump.c.

References boxClumpFree(), and boxClump::next.

Referenced by boxLump().

00028 {
00029 struct boxClump *el, *next;
00030 
00031 for (el = *pList; el != NULL; el = next)
00032     {
00033     next = el->next;
00034     boxClumpFree(&el);
00035     }
00036 *pList = NULL;
00037 }

Here is the call graph for this function:

Here is the caller graph for this function:

struct boxClump* boxFindClumps ( struct boxIn **  pBoxList  )  [read]

Definition at line 234 of file boxClump.c.

References AllocVar, BIGNUM, cluster::boxList, box::cluster, dlAddTail(), dlEnd, dlListInit(), dlList::head, box::in, lm, lmAllocVar, lmInit(), boxIn::next, dlNode::next, box::next, cluster::node, boxIn::qEnd, boxIn::qStart, rBoxJoin(), slAddHead, boxIn::tEnd, boxIn::tStart, and dlNode::val.

00239 {
00240 struct boxIn *in;
00241 struct boxClump *clumpList = NULL, *clump;
00242 struct boxRef *refList = NULL, *ref;
00243 struct box *box;
00244 struct cluster *cluster;
00245 struct dlNode *node;
00246 struct dlList clusterList;
00247 int qStart = BIGNUM, qEnd = -BIGNUM;
00248 int tStart = BIGNUM, tEnd = -BIGNUM;
00249 
00250 
00251 dlListInit(&clusterList);
00252 lm = lmInit(0);
00253 
00254 /* Make local box structure, cluster, and reference
00255  * for each input box.  Calculate overall bounds. */
00256 for (in = *pBoxList; in != NULL; in = in->next)
00257     {
00258     lmAllocVar(lm, box);
00259     box->in = in;
00260     if (in->qStart < qStart) qStart = in->qStart;
00261     if (in->qEnd > qEnd) qEnd = in->qEnd;
00262     if (in->tStart < tStart) tStart = in->tStart;
00263     if (in->tEnd > tEnd) tEnd = in->tEnd;
00264     lmAllocVar(lm,cluster);
00265     lmAllocVar(lm, cluster->node);
00266     cluster->node->val = cluster;
00267     dlAddTail(&clusterList, cluster->node);
00268     cluster->boxList = box;
00269     box->cluster = cluster;
00270     lmAllocVar(lm, ref);
00271     ref->box = box;
00272     slAddHead(&refList, ref);
00273     }
00274 
00275 /* Call to recursive joiner. */
00276 rBoxJoin(refList, qStart, qEnd, tStart, tEnd);
00277 
00278 /* Copy from local memory and local data structures
00279  * to global memory and global data structures. */
00280 for (node = clusterList.head; !dlEnd(node); node = node->next)
00281     {
00282     int boxCount = 0;
00283     int qStart = BIGNUM, qEnd = -BIGNUM;
00284     int tStart = BIGNUM, tEnd = -BIGNUM;
00285     struct boxIn *boxList = NULL;
00286     cluster = node->val;
00287     for (box = cluster->boxList; box != NULL; box = box->next)
00288         {
00289         in = box->in;
00290         slAddHead(&boxList, in);
00291         if (in->qStart < qStart) qStart = in->qStart;
00292         if (in->qEnd > qEnd) qEnd = in->qEnd;
00293         if (in->tStart < tStart) tStart = in->tStart;
00294         if (in->tEnd > tEnd) tEnd = in->tEnd;
00295         ++boxCount;
00296         }
00297     if (boxCount > 0)
00298         {
00299         AllocVar(clump);
00300         slAddHead(&clumpList, clump);
00301         clump->boxList = boxList;
00302         clump->boxCount = boxCount;
00303         clump->qStart = qStart;
00304         clump->qEnd = qEnd;
00305         clump->tStart = tStart;
00306         clump->tEnd = tEnd;
00307         }
00308     }
00309 *pBoxList = NULL;
00310 lmCleanup(&lm);
00311 return clumpList;
00312 }

Here is the call graph for this function:


Generated on Tue Dec 25 18:43:08 2007 for blat by  doxygen 1.5.2