Exemplo n.º 1
0
void GenomeNeighbourhood::processSide(int mode){

	#ifdef ASSERT
	assert(mode==FETCH_CHILDREN || mode==FETCH_PARENTS);
	#endif

	if(!m_startedSide){

		#ifdef ASSERT
		assert(m_contigIndex < (int)m_contigs->size());
		#endif

		int contigLength=m_contigs->at(m_contigIndex).size();

		#ifdef ASSERT
		assert(contigLength>=1);
		#endif

		Kmer kmer;

		if(mode==FETCH_CHILDREN){
			m_contigs->at(m_contigIndex).at(contigLength-1,&kmer);

		}else if(mode==FETCH_PARENTS){

			m_contigs->at(m_contigIndex).at(0,&kmer);
		}

		createStacks(kmer);

		resetKmerStates();

		m_visited.clear();
		m_foundContigs.clear();

/* the maximum depth
 * values are 1024, 2048 or 4096 */
		m_maximumDepth=1024;

		m_startedSide=true;

		#ifdef DEBUG_SIDE
		if(mode==FETCH_PARENTS){
			cout<<"Starting mode FETCH_PARENTS"<<endl;
		}else if(mode==FETCH_CHILDREN){
			cout<<"Starting mode FETCH_CHILDREN"<<endl;
		}
		#endif

	}else if(!m_stackOfVertices.empty()){
		
		processLinks(mode);

	}else{
		m_doneSide=true;
	}

}
Exemplo n.º 2
0
/* Driver program to test twStacks class */
int main()
{
  struct TwoStack * twoStacks = createStacks(5);
  push1(twoStacks, 5);
  push2(twoStacks, 10);
  push2(twoStacks, 15);
  push1(twoStacks, 11);
  push2(twoStacks, 7);
  printf("Popped element from stack1 is %d", pop1(twoStacks));
  push2(twoStacks, 40);
  printf("\nPopped element from stack2 is %d", pop2(twoStacks));
  return 0;
}