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

int Impala::Util::IndexOfNth ( bool *  set,
int  size,
int  n 
)

returns the index in the filter of the 'n'th positive element or 'size' if there are less than 'n' positive elements.

So if we use a filter with a table then table->Get1(IndexOfNth(filter, table->Size(), 3)) will return the 3rd selected value. Although of course that fails when the selection has less than 3 elements.

Definition at line 64 of file FilterOperations.h.

Referenced by Impala::Core::Feature::TryRandomSplit().

00065 {
00066     int count=0;
00067     for(int i=0 ; i<size ; ++i)
00068         if(set[i])
00069         {
00070             if(count==n)
00071                 return i;
00072             ++count;
00073         }
00074     return size;
00075 }


Generated on Fri Mar 19 11:39:08 2010 for ImpalaSrc by  doxygen 1.5.1