+ // A bit brutal but fast to code
+ static std::vector<size_t>* indices = NULL;
+
+ //Ensure the Nth bit will be selected only once among the different LshTables
+ //to avoid having two different tables with signatures sharing many dimensions/many bits
+ if( indices == NULL )
+ {
+ indices = new std::vector<size_t>( feature_size * CHAR_BIT );
+ }
+ else if( indices->size() < key_size_ )
+ {
+ indices->resize( feature_size * CHAR_BIT );
+ for (size_t i = 0; i < feature_size * CHAR_BIT; ++i) {
+ (*indices)[i] = i;
+ }
+ std::random_shuffle(indices->begin(), indices->end());
+ }
+