Пример #1
0
// ordinary call
void SplitHeuristic::call(Level &L)
{
	m_cm->init(L);
	buffer = Array<node>(L.size());

	recCall(L, 0, L.size() - 1);

	buffer = Array<node>(-1);
}
Пример #2
0
// SimDraw call
void SplitHeuristic::call(Level &L, const EdgeArray<unsigned int> *edgeSubGraph)
{
	// only difference to call is the different calculation of the crossingsmatrix
	m_cm->init(L, edgeSubGraph);
	buffer = Array<node>(L.size());

	recCall(L, 0, L.size() - 1);

	buffer = Array<node>(-1);
}
Пример #3
0
void SplitHeuristic::recCall(Level &L, int low, int high)
{
	if (high <= low) return;

	const Hierarchy &H = L.hierarchy();
	CrossingsMatrix &crossings = *m_cm;
	int up = high, down = low;

	// chooses L[low] as pivot
	int i;
	for (i = low+1; i <= high; i++) 
	{
		if (crossings(i,low) < crossings(low,i))
			buffer[down++] = L[i];
	}

	// use two for-loops in order to keep the number of swaps low
	for (i = high; i >= low+1; i--) 
	{
		if (crossings(i,low) >= crossings(low,i))
			buffer[up--] = L[i];
	}

	buffer[down] = L[low];

	for (i = low; i < high; i++) 
	{ 
		int j = H.pos(buffer[i]);
		if (i != j) 
		{
			L.swap(i,j);
			crossings.swap(i,j);
		}
	}

	recCall(L,low,down-1);
	recCall(L,up+1,high);
}
Пример #4
0
void recTLBWR() { recCall(Interp::TLBWR); }
Пример #5
0
void recTLBWI() { recCall(Interp::TLBWI); }
Пример #6
0
void recTLBP() { recCall(Interp::TLBP); }