Exemplo n.º 1
0
static Event *allocateEvent()
{
	if (eventMemory == NULL)
		eventMemory = newRecycleBin(sizeof(Event), BLOCK_SIZE);

	return allocatePointer(eventMemory);
}
Exemplo n.º 2
0
static Mask *allocateMask(SequencesWriter *seqWriteInfo)
{
	if (seqWriteInfo->m_maskMemory == NULL)
		seqWriteInfo->m_maskMemory = newRecycleBin(sizeof(Mask), 10000);

	return (Mask *) allocatePointer(seqWriteInfo->m_maskMemory);
}
Exemplo n.º 3
0
static Mask *allocateMask()
{
	if (maskMemory == NULL)
		maskMemory = newRecycleBin(sizeof(Mask), 10000);

	return (Mask *) allocatePointer(maskMemory);
}
Exemplo n.º 4
0
static Connection *allocateConnection()
{
	if (connectionMemory == NULL)
		connectionMemory =
		    newRecycleBin(sizeof(Connection), BLOCK_SIZE);

	return allocatePointer(connectionMemory);
}
Exemplo n.º 5
0
Transcript *allocateTranscript()
{
	if (transcriptMemory == NULL)
		transcriptMemory =
		    newRecycleBin(sizeof(Transcript), BLOCK_SIZE);

	return (Transcript*)allocatePointer(transcriptMemory);
}
Exemplo n.º 6
0
static SmallNodeList *allocateSmallNodeList()
{
	if (smallNodeListMemory == NULL)
		smallNodeListMemory =
		    newRecycleBin(sizeof(SmallNodeList), BLOCKSIZE);

	return allocatePointer(smallNodeListMemory);
}
Exemplo n.º 7
0
static NodeList *allocateNodeList()
{
	if (nodeListMemory == NULL)
		nodeListMemory =
		    newRecycleBin(sizeof(NodeList), BLOCK_SIZE);

	return (NodeList*)allocatePointer(nodeListMemory);
}
Exemplo n.º 8
0
static RBConnection *allocateRBConnection()
{
	if (nodeListMemory == NULL)
		nodeListMemory =
		    newRecycleBin(sizeof(RBConnection), BLOCKSIZE);

	return allocatePointer(nodeListMemory);
}
Exemplo n.º 9
0
void readCoherentGraph(Graph * inGraph, boolean(*isUnique) (Node * node),
		       double coverage, ReadSet * reads)
{
	IDnum nodeIndex;
	Node *node;
	IDnum previousNodeCount = 0;

	graph = inGraph;
	listMemory = newRecycleBin(sizeof(PassageMarkerList), 100000);
	expected_coverage = coverage;
	sequences = reads->tSequences;

	velvetLog("Read coherency...\n");
	resetNodeStatus(graph);
	identifyUniqueNodes(isUnique);
	trimLongReadTips();

	previousNodeCount = 0;
	while (previousNodeCount != nodeCount(graph)) {

		previousNodeCount = nodeCount(graph);

		for (nodeIndex = 1; nodeIndex <= nodeCount(graph);
		     nodeIndex++) {

			node = getNodeInGraph(graph, nodeIndex);

			if (node == NULL || !getUniqueness(node))
				continue;

			while (uniqueNodesConnect(node))
				node = bypass();

			node = getTwinNode(node);

			while (uniqueNodesConnect(node))
				node = bypass();

		}

		renumberNodes(graph);
	}

	destroyRecycleBin(listMemory);
	destroyRecycleBin(nodeListMemory);

	velvetLog("Confronted to %li multiple hits and %li null over %li\n",
	       (long) multCounter, (long) nullCounter, (long) dbgCounter);

	velvetLog("Read coherency over!\n");
}
Exemplo n.º 10
0
Arquivo: dfib.c Projeto: Debian/velvet
/*
 * Public Heap Functions
 */
DFibHeap *dfh_makekeyheap()
{
	DFibHeap *n;

	if ((n = (DFibHeap*)malloc(sizeof *n)) == NULL)
		return NULL;

	n->nodeMemory = newRecycleBin(sizeof(DFibHeapNode), BLOCKSIZE);
	n->dfh_n = 0;
	n->dfh_Dl = -1;
	n->dfh_cons = NULL;
	n->dfh_min = NULL;
	n->dfh_root = NULL;

	return n;
}
Exemplo n.º 11
0
static SplayNode *allocateSplayNode()
{
#ifdef OPENMP
#ifdef DEBUG
	if (treeMemory == NULL)
	{
		velvetLog("The memory for splay trees seems uninitialised, "
			  "this is probably a bug, aborting.\n");
		abort();
	}
#endif
	return allocatePointer(getRecycleBinInArray(treeMemory,
						    omp_get_thread_num()));
#else
	if (treeMemory == NULL)
		treeMemory = newRecycleBin(sizeof(SplayNode), CHUNKSIZE);

	return allocatePointer(treeMemory);
#endif
}
Exemplo n.º 12
0
static SmallNodeList *allocateSmallNodeList()
{
#ifdef OPENMP
#ifdef DEBUG
	if (smallNodeListMemory == NULL)
	{
		velvetLog("The memory for small nodes seems uninitialised, "
				"this is probably a bug, aborting.\n");
		abort();
	}
#endif
	return allocatePointer(getRecycleBinInArray(smallNodeListMemory,
				omp_get_thread_num()));
#else
	if (smallNodeListMemory == NULL)
		smallNodeListMemory = newRecycleBin(sizeof(SmallNodeList), BLOCKSIZE);

	return allocatePointer(smallNodeListMemory);
#endif
}