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

MakeGroupIndex.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_Table_MakeGroupIndex_h
00002 #define Impala_Core_Table_MakeGroupIndex_h
00003 
00004 #include "Core/Table/GroupIndex.h"
00005 
00006 namespace Impala
00007 {
00008 namespace Core
00009 {
00010 namespace Table
00011 {
00012 
00013 
00014 template <class C>
00015 inline void
00016 MakeGroupIndex(GroupIndex* table, C* column, int start, int end)
00017 {
00018     table->SetEmpty();
00019     typename C::ColElemType elem = column->Get(start);
00020     int first = start;
00021     int nr = 1;
00022     for (int i=start+1 ; i<end ; i++)
00023     {
00024         if (column->Get(i) != elem)
00025         {
00026             table->Add(first, nr);
00027             elem = column->Get(i);
00028             first = i;
00029             nr = 1;
00030         }
00031         else
00032         {
00033             nr++;
00034         }
00035     }
00036     table->Add(first, nr);
00037 }
00038 
00039 } // namespace Table
00040 } // namespace Core
00041 } // namespace Impala
00042 
00043 #endif

Generated on Fri Mar 19 09:31:20 2010 for ImpalaSrc by  doxygen 1.5.1