Changes

From Genome Analysis Wiki
Jump to navigationJump to search
no edit summary
Line 2: Line 2:  
bool MaqIndex::LookupWord(String & sequence, int offset, unsigned int & firstOccurrence, unsigned int & lastOccurrence)
 
bool MaqIndex::LookupWord(String & sequence, int offset, unsigned int & firstOccurrence, unsigned int & lastOccurrence)
 
{
 
{
firstOccurrence = 0;
+
  firstOccurrence = 0;
lastOccurrence = sortedPositions.Length() - 1;
+
  lastOccurrence = sortedPositions.Length() - 1;
   −
if (lastOccurrence < 0)
+
  if (lastOccurrence < 0)
return false;
+
return false;
    
   unsigned int firstMax = lastOccurrence;
 
   unsigned int firstMax = lastOccurrence;
Line 15: Line 15:     
   if (boundaryCheck > 0)
 
   if (boundaryCheck > 0)
  while (firstMax >= firstOccurrence)
+
      while (firstMax >= firstOccurrence)
  {
+
  {
  int probe = (firstMax + firstOccurrence) / 2;  
+
  int probe = (firstMax + firstOccurrence) / 2;  
 
           int test = CompareToIndex(sequence, offset, probe);
 
           int test = CompareToIndex(sequence, offset, probe);
  

Navigation menu