Home || Visual Search || Applications || Architecture || Important Messages || OGL || Src

template<class C>
int Impala::Core::Column::FindInAscending ( C *  col,
typename C::ColElemType  elem,
int  start,
int  end 
) [inline]

Definition at line 23 of file FindInAscending.h.

00024 {
00025     if (end == -1)
00026         end = col->Capacity();
00027     int low = start;
00028     int high = end - 1;
00029     while (low <= high)
00030     {
00031         int mid = (low + high) / 2;
00032         typename C::ColElemType colVal = col->Get(mid);
00033         if (colVal > elem)
00034             high = mid - 1;
00035         else if (colVal < elem)
00036             low = mid + 1;
00037         else
00038             return mid; // found
00039     }
00040     return end; // not found
00041 }


Generated on Thu Jan 13 09:18:48 2011 for ImpalaSrc by  doxygen 1.5.1