int a[nLimit];
for (int i = 0; i < nLimit; ++i)
a[i]=i;
- std::random_shuffle( a, a + nLimit );
+ shuffle( a, a + nLimit );
for (int i = 0; i < nLimit; ++i) {
arrItem[i].nKey = a[i];
int a[nLimit];
for (int i = 0; i < nLimit; ++i)
a[i]=i;
- std::random_shuffle( a, a + nLimit );
+ shuffle( a, a + nLimit );
for (int i = 0; i < nLimit; ++i) {
arrItem[i].nKey = a[i];
int a[nLimit];
for (int i = 0; i < nLimit; ++i)
a[i]=i;
- std::random_shuffle( a, a + nLimit );
+ shuffle( a, a + nLimit );
for (int i = 0; i < nLimit; ++i) {
arrItem[i].nKey = a[i];
int a[nLimit];
for (int i = 0; i < nLimit; ++i)
a[i]=i;
- std::random_shuffle( a, a + nLimit );
+ shuffle( a, a + nLimit );
for (int i = 0; i < nLimit; ++i) {
arrItem[i].nKey = a[i];
int arr[nLimit];
for ( int i = 0; i < nLimit; i++ )
arr[i] = i;
- std::random_shuffle( arr, arr + nLimit );
+ shuffle( arr, arr + nLimit );
// extract/get
for ( int i = 0; i < nLimit; ++i )
int a[nLimit];
for (int i = 0; i < nLimit; ++i)
a[i]=i;
- std::random_shuffle( a, a + nLimit );
+ shuffle( a, a + nLimit );
// extract/get
for ( int i = 0; i < nLimit; ++i )
int arr[nLimit];
for ( int i = 0; i < nLimit; i++ )
arr[i] = i;
- std::random_shuffle( arr, arr + nLimit );
+ shuffle( arr, arr + nLimit );
// extract/get
for ( int i = 0; i < nLimit; ++i )
int a[nLimit];
for (int i = 0; i < nLimit; ++i)
a[i]=i;
- std::random_shuffle( a, a + nLimit );
+ shuffle( a, a + nLimit );
// extract/get
for ( int i = 0; i < nLimit; ++i )
int arr[nLimit];
for ( int i = 0; i < nLimit; i++ )
arr[i] = i;
- std::random_shuffle( arr, arr + nLimit );
+ shuffle( arr, arr + nLimit );
// extract/get
for ( int i = 0; i < nLimit; ++i )
int a[nLimit];
for (int i = 0; i < nLimit; ++i)
a[i]=i;
- std::random_shuffle( a, a + nLimit );
+ shuffle( a, a + nLimit );
// extract/get
for ( int i = 0; i < nLimit; ++i )
int arr[nLimit];
for ( int i = 0; i < nLimit; i++ )
arr[i] = i;
- std::random_shuffle( arr, arr + nLimit );
+ shuffle( arr, arr + nLimit );
// extract/get
for ( int i = 0; i < nLimit; ++i )
int a[nLimit];
for (int i = 0; i < nLimit; ++i)
a[i]=i;
- std::random_shuffle( a, a + nLimit );
+ shuffle( a, a + nLimit );
// extract/get
for ( int i = 0; i < nLimit; ++i )
#include <cds/os/timer.h>
#include <cds/opt/hash.h>
#include <functional> // ref
-#include <algorithm> // random_shuffle
namespace cds { namespace container {}}
#include <cds/os/timer.h>
#include <cds/opt/hash.h>
#include <functional> // ref
-#include <algorithm> // random_shuffle
namespace cds { namespace container {}}
int arrRandom[nLimit];
for ( int i = 0; i < nLimit; ++i )
arrRandom[i] = i;
- std::random_shuffle( arrRandom, arrRandom + nLimit );
+ shuffle( arrRandom, arrRandom + nLimit );
for ( int i = 0; i < nLimit; ++i )
CPPUNIT_ASSERT( m.insert( arrRandom[i], arrRandom[i] ));
int arr[nLimit];
for ( size_t i = 0; i < nLimit; ++i )
arr[i] = (int) i;
- std::random_shuffle( arr, arr + nLimit );
+ shuffle( arr, arr + nLimit );
for ( size_t i = 0; i < nLimit; ++i )
CPPUNIT_ASSERT( m.insert( arr[i], arr[i] ));
for ( int i = 0; i < nLimit; ++i ) {
nRand[i] = i;
}
- std::random_shuffle( nRand, nRand + nLimit );
+ shuffle( nRand, nRand + nLimit );
for ( int i = 0; i < nLimit; ++i ) {
CPPUNIT_ASSERT( m.insert( nRand[i], nRand[i]) );
int arrItem[nLimit];
for ( int i = 0; i < nLimit; ++i )
arrItem[i] = i;
- std::random_shuffle( arrItem, arrItem + nLimit );
+ shuffle( arrItem, arrItem + nLimit );
typedef base_class::less less;
for ( int i = 0; i < nLimit; ++i ) {
nRand[i] = i;
}
- std::random_shuffle( nRand, nRand + nLimit );
+ shuffle( nRand, nRand + nLimit );
for ( int i = 0; i < nLimit; ++i ) {
CPPUNIT_ASSERT( m.insert(i, i) );
int arrItem[nLimit];
for ( int i = 0; i < nLimit; ++i )
arrItem[i] = i;
- std::random_shuffle( arrItem, arrItem + nLimit );
+ shuffle( arrItem, arrItem + nLimit );
typedef typename Map::value_type value_type;
typename Map::exempt_ptr ep;
#include <cds/os/timer.h>
#include <cds/opt/hash.h>
#include <functional> // ref
-#include <algorithm> // random_shuffle
namespace cds { namespace container {}}
for ( T * p = pFirst; p != pLast; ++p, ++i )
*p = i;
- std::random_shuffle( pFirst, pLast );
+ shuffle( pFirst, pLast );
}
~data_array()
for ( T * p = pFirst; p != pLast; ++p, ++i )
p->k = p->v = i;
- std::random_shuffle( pFirst, pLast );
+ shuffle( pFirst, pLast );
}
~data_array()
#include <cds/opt/hash.h>
#include <cds/os/timer.h>
#include <functional> // ref
-#include <algorithm> // random_shuffle
// forward namespace declaration
namespace cds {
#include <cds/opt/hash.h>
#include <functional> // ref
-#include <algorithm> // random_shuffle
// forward declaration
namespace cds { namespace intrusive {} }
int arr[nLimit];
for ( size_t i = 0; i < nLimit; ++i )
arr[i] = (int) i;
- std::random_shuffle( arr, arr + nLimit );
+ shuffle( arr, arr + nLimit );
for ( size_t i = 0; i < nLimit; ++i ) {
arrItems[i].nKey = arr[i];
int arr[nLimit];
for ( size_t i = 0; i < nLimit; ++i )
arr[i] = (int) i;
- std::random_shuffle( arr, arr + nLimit );
+ shuffle( arr, arr + nLimit );
for ( size_t i = 0; i < nLimit; ++i ) {
arrItems[i].nKey = arr[i];
for ( int i = 0; i < (int) c_nArrSize; ++i ) {
nRand[i] = i;
}
- std::random_shuffle( nRand, nRand + c_nArrSize );
+ shuffle( nRand, nRand + c_nArrSize );
for ( int i = 0; i < (int) c_nArrSize; ++i ) {
pArr[i].nKey = nRand[i];
for ( int i = 0; i < (int) c_nArrSize; ++i ) {
nRand[i] = i;
}
- std::random_shuffle( nRand, nRand + c_nArrSize );
+ shuffle( nRand, nRand + c_nArrSize );
for ( int i = 0; i < (int) c_nArrSize; ++i ) {
pArr[i].nKey = nRand[i];
#include <cds/opt/hash.h>
#include <cds/os/timer.h>
#include <functional> // ref
-#include <algorithm> // random_shuffle
// forward namespace declaration
namespace cds {
int arrRandom[nLimit];
for ( int i = 0; i < nLimit; ++i )
arrRandom[i] = i;
- std::random_shuffle( arrRandom, arrRandom + nLimit );
+ shuffle( arrRandom, arrRandom + nLimit );
for ( int i = 0; i < nLimit; ++i )
CPPUNIT_ASSERT( s.insert( arrRandom[i] ));
int arr[nLimit];
for ( size_t i = 0; i < nLimit; ++i )
arr[i] = (int) i;
- std::random_shuffle( arr, arr + nLimit );
+ shuffle( arr, arr + nLimit );
for ( size_t i = 0; i < nLimit; ++i )
CPPUNIT_ASSERT( s.insert( arr[i] ));
int arrRandom[nLimit];
for ( int i = 0; i < nLimit; ++i )
arrRandom[i] = i;
- std::random_shuffle( arrRandom, arrRandom + nLimit );
+ shuffle( arrRandom, arrRandom + nLimit );
// Test iterator - ascending order
int arrRandom[nLimit];
for ( int i = 0; i < nLimit; ++i )
arrRandom[i] = i;
- std::random_shuffle( arrRandom, arrRandom + nLimit );
+ shuffle( arrRandom, arrRandom + nLimit );
// Test iterator - ascending order
s.clear();
#include <cds/opt/hash.h>
#include <cds/os/timer.h>
#include <functional> // ref
-#include <algorithm> // random_shuffle
// forward namespace declaration
namespace cds {
int keys[1000];
for ( key_type i = 0; i < static_cast<key_type>(sizeof(keys) / sizeof(keys[0])); ++i )
keys[i] = i;
- std::random_shuffle( keys, keys + sizeof(keys) / sizeof(keys[0]));
+ shuffle( keys, keys + sizeof(keys) / sizeof(keys[0]));
size_t nCount = 1;
int nPrev;
for ( int * p = pFirst; p != pLast; ++p, ++i )
*p = i;
- std::random_shuffle( pFirst, pLast );
+ shuffle( pFirst, pLast );
}
~data_array()
for ( int * p = pFirst; p != pLast; ++p, ++i )
*p = i;
- std::random_shuffle( pFirst, pLast );
+ shuffle( pFirst, pLast );
}
~data_array()
p->nValue = i * 2;
}
- std::random_shuffle( pFirst, pLast );
+ shuffle( pFirst, pLast );
}
~data_array()
if ( m_Arr[i].bExists )
++m_nRealMapSize;
}
- std::random_shuffle( m_Arr.begin(), m_Arr.end() );
+ shuffle( m_Arr.begin(), m_Arr.end() );
}
void Map_find_int::initTestSequence()
#include "cppunit/thread.h"
#include <vector>
-#include <algorithm> // random_shuffle
// find int test in map<int> in mutithreaded mode
namespace map2 {
#include <cds/sync/spinlock.h>
#include <vector>
-#include <algorithm> // random_shuffle
namespace map2 {
m_arrValues.reserve( c_nMapSize );
for ( size_t i = 0; i < c_nMapSize; ++i )
m_arrValues.push_back( i );
- std::random_shuffle( m_arrValues.begin(), m_arrValues.end() );
+ shuffle( m_arrValues.begin(), m_arrValues.end() );
CppUnitMini::ThreadPool pool( *this );
pool.add( new InserterThread( pool, testMap ), c_nInsertThreadCount );
m_arrValues.reserve( c_nMapSize );
for ( size_t i = 0; i < c_nMapSize; ++i )
m_arrValues.push_back( i );
- std::random_shuffle( m_arrValues.begin(), m_arrValues.end() );
+ shuffle( m_arrValues.begin(), m_arrValues.end() );
CppUnitMini::ThreadPool pool( *this );
pool.add( new InserterThread( pool, testMap ), c_nInsertThreadCount );
#include "cppunit/thread.h"
#include <vector>
-#include <algorithm> // random_shuffle
namespace map2 {
v.reserve( c_nMapSize );
for ( size_t i = 0; i < c_nMapSize; ++i )
v.push_back( i );
- std::random_shuffle( v.begin(), v.end() );
+ shuffle( v.begin(), v.end() );
for ( size_t i = 0; i < v.size(); ++i ) {
CPPUNIT_ASSERT( testMap.insert( v[i], v[i] ));
}
pFirst = pLast;
pLast = m_arrShuffle + sizeof(m_arrShuffle)/sizeof(m_arrShuffle[0]);
std::fill( pFirst, pLast, do_find );
- std::random_shuffle( m_arrShuffle, pLast );
+ shuffle( m_arrShuffle, pLast );
}
void Map_InsDelFind::myRun(const char *in_name, bool invert /*= false*/)
#include "map2/map_type.h"
#include "cppunit/thread.h"
-#include <algorithm> // random_shuffle
#include <vector>
namespace map2 {
arr.reserve( c_nInitialMapSize );
for ( size_t i = 0; i < c_nInitialMapSize; ++i )
arr.push_back( i * 2 + 1);
- std::random_shuffle( arr.begin(), arr.end() );
+ shuffle( arr.begin(), arr.end() );
for ( size_t i = 0; i < c_nInitialMapSize; ++i )
testMap.insert( arr[i], arr[i] );
}
#include <cds/os/topology.h>
#include <vector>
-#include <algorithm> // random_shuffle
namespace map2 {
size_t nItem = m_nThreadNo;
for ( size_t i = 0; i < nSize; nItem += c_nThreadCount, ++i )
m_arrVal[i] = nItem;
- std::random_shuffle( m_arrVal.begin(), m_arrVal.end() );
+ shuffle( m_arrVal.begin(), m_arrVal.end() );
}
public:
size_t m_nInsertSuccess;
#include "pqueue/pqueue_type.h"
#include <vector>
-#include <algorithm> // random_shuffle
#include <memory>
namespace pqueue {
m_arr.reserve( nEnd - nStart );
for ( size_t i = nStart; i < nEnd; ++i )
m_arr.push_back( i );
- std::random_shuffle( m_arr.begin(), m_arr.end() );
+ shuffle( m_arr.begin(), m_arr.end() );
}
};
#include "pqueue/pqueue_type.h"
#include <vector>
-#include <algorithm> // random_shuffle
#include <memory>
namespace pqueue {
m_arr.reserve( nEnd - nStart );
for ( size_t i = nStart; i < nEnd; ++i )
m_arr.push_back( i );
- std::random_shuffle( m_arr.begin(), m_arr.end() );
+ shuffle( m_arr.begin(), m_arr.end() );
}
};
#include "pqueue/pqueue_type.h"
#include <vector>
-#include <algorithm> // random_shuffle
#include <memory>
namespace pqueue {
m_arr.reserve( nEnd - nStart );
for ( size_t i = nStart; i < nEnd; ++i )
m_arr.push_back( i );
- std::random_shuffle( m_arr.begin(), m_arr.end() );
+ shuffle( m_arr.begin(), m_arr.end() );
}
};
m_arrData.resize( c_nSetSize );
for ( size_t i = 0; i < c_nSetSize; ++i )
m_arrData[i] = i;
- std::random_shuffle( m_arrData.begin(), m_arrData.end() );
+ shuffle( m_arrData.begin(), m_arrData.end() );
}
void Set_DelOdd::myRun(const char *in_name, bool invert /*= false*/)
#include "cppunit/thread.h"
#include "set2/set_type.h"
-#include <algorithm> // random_shuffle
namespace set2 {
m_pKeyLast = m_pKeyFirst + c_nMapSize;
for ( size_t i = 0; i < c_nMapSize; ++i )
m_pKeyArr[i] = i;
- std::random_shuffle( m_pKeyFirst, m_pKeyLast );
+ shuffle( m_pKeyFirst, m_pKeyLast );
cds::OS::Timer timer;
pFirst = pLast;
pLast = m_arrShuffle + sizeof(m_arrShuffle)/sizeof(m_arrShuffle[0]);
std::fill( pFirst, pLast, do_find );
- std::random_shuffle( m_arrShuffle, pLast );
+ shuffle( m_arrShuffle, pLast );
}
void Set_InsDelFind::myRun(const char *in_name, bool invert /*= false*/)
#include "set2/set_type.h"
#include "cppunit/thread.h"
-#include <algorithm> // random_shuffle
namespace set2 {
size_t * pEnd = pInitArr + c_nInitialMapSize;
for ( size_t i = 0; i < c_nInitialMapSize; ++i )
pInitArr[i] = i * 2 + 1;
- std::random_shuffle( pInitArr, pEnd );
+ shuffle( pInitArr, pEnd );
for ( size_t * p = pInitArr; p < pEnd; ++p )
testSet.insert( typename Set::value_type( *p, *p ) );
delete [] pInitArr;