size_t Set_InsDelFind::s_nFeldmanSet_ArrayBits = 4;
size_t Set_InsDelFind::s_nLoadFactor = 2;
+ Set_InsDelFind::actions Set_InsDelFind::s_arrShuffle[Set_InsDelFind::c_nShuffleSize];
void Set_InsDelFind::SetUpTestCase()
{
s_nFeldmanSet_ArrayBits = cfg.get_size_t( "FeldmanMapArrayBits", s_nFeldmanSet_ArrayBits );
if ( s_nFeldmanSet_ArrayBits == 0 )
s_nFeldmanSet_ArrayBits = 2;
+
+ actions * pFirst = s_arrShuffle;
+ actions * pLast = s_arrShuffle + s_nInsertPercentage;
+ std::fill( pFirst, pLast, do_insert );
+ pFirst = pLast;
+ pLast += s_nDeletePercentage;
+ std::fill( pFirst, pLast, do_delete );
+ pFirst = pLast;
+ pLast = s_arrShuffle + sizeof( s_arrShuffle ) / sizeof( s_arrShuffle[0] );
+ if ( pFirst < pLast )
+ std::fill( pFirst, pLast, do_find );
+ shuffle( s_arrShuffle, pLast );
}
std::vector<size_t> Set_InsDelFind_LF::get_load_factors()
do_delete
};
static const unsigned int c_nShuffleSize = 100;
- actions m_arrShuffle[c_nShuffleSize];
+ static actions s_arrShuffle[c_nShuffleSize];
protected:
typedef size_t key_type;
Set& rSet = m_Set;
Set_InsDelFind& fixture = pool().template fixture<Set_InsDelFind>();
- actions * pAct = fixture.m_arrShuffle;
unsigned int i = 0;
size_t const nNormalize = size_t(-1) / ( fixture.s_nSetSize * 2);
while ( !time_elapsed()) {
nRand = cds::bitop::RandXorShift(nRand);
size_t n = nRand / nNormalize;
- switch ( pAct[i] ) {
+ switch ( s_arrShuffle[i] ) {
case do_find:
if ( rSet.contains( n ))
++m_nFindSuccess;