
2 Jun
2006
2 Jun
'06
10:03 p.m.
Dear list, I am using dynamic_bitset to store a sequence of random 0/1. The program generates repeatedly 32bit random numbers and assign the result to a dynamic_bitset. for(UINT i=0; i < m_N; ++i) { if(bit == block) // generate a block { ri = rng().randInt(m_max); bit = 0; } if((ri >> bit) & 0x1) succ.set(i); bit++; } When I profile this program, I surprisingly find out that succ.set(i) uses >50% of the execution time. Is there anyway I can assign block by block to dynamic_bitset, or assign sequentially so the position of i does not have to be calculated each time? Many thanks in advance. Bo