#include "sonLib.h" #include "checkEdges.h" #include "shared.h" #include "cactusMatchingAlgorithms.h" static stHash *rebaseNodes(stSortedSet *nodes) { /* * Renumber the nodes from 0 contiguously. */ stHash *nodesToRebasedNodes = stHash_construct3( (uint32_t(*)(const void *)) stIntTuple_hashKey, (int(*)(const void *, const void *)) stIntTuple_equalsFn, NULL, (void(*)(void *)) stIntTuple_destruct); int32_t i=0; stSortedSetIterator *it = stSortedSet_getIterator(nodes); stIntTuple *node; while((node = stSortedSet_getNext(it)) != NULL) { stHash_insert(nodesToRebasedNodes, node, stIntTuple_construct(1, i++)); } stSortedSet_destructIterator(it); return nodesToRebasedNodes; } static stList *translateEdges(stList *edges, stHash *nodesToRebasedNodes) { /* * Translate the edges. */ stList *rebasedEdges = stList_construct3(0, (void (*)(void *))stIntTuple_destruct); for(int32_t i=0; i