21 #ifndef __lfeat_sieve_h
22 #define __lfeat_sieve_h
29 template <
typename _Key>
36 template <
typename _Key,
typename _Compare = std::less<_Key> >
41 Sieve(
int iWidth,
int iHeight,
int iLength);
42 void insert(_Key& iElem,
int iWidth,
int iHeight);
48 std::vector<lfeat::bounded_set< _Key, _Compare > >
_buckets;
54 template <
typename _Key,
typename _Compare>
56 _buckets(std::vector<
bounded_set< _Key, _Compare > >(iWidth* iHeight)),
57 _width(iWidth), _height(iHeight)
59 typename std::vector<bounded_set< _Key, _Compare > >::iterator aVB, aVE;
62 for (; aVB != aVE; ++aVB)
64 aVB->setMaxSize(iLength);
68 template <
typename _Key,
typename _Compare>
71 _buckets[iWidth * _height + iHeight].insert(iElem);
74 template <
typename _Key,
typename _Compare>
77 typename std::vector<bounded_set< _Key, _Compare > >::iterator aVB, aVE;
78 aVB = _buckets.begin();
80 for (; aVB != aVE; ++aVB)
82 typename std::set<_Key, _Compare>::iterator aSB, aSE;
83 std::set<_Key, _Compare>& aS = aVB->getSet();
86 for (; aSB != aSE; ++aSB)
95 #endif // __lfeat_sieve_h
Sieve(int iWidth, int iHeight, int iLength)
std::vector< lfeat::bounded_set< _Key, _Compare > > _buckets
void extract(SieveExtractor< _Key > &iEx)
void insert(_Key &iElem, int iWidth, int iHeight)