Commit 46d893d5 authored by Michael Kuron's avatar Michael Kuron 🔬

Remove boost random, math::special_functions

Also remove some unneeded boost includes
parent fb43f673
Pipeline #7053 failed with stage
in 293 minutes and 3 seconds
......@@ -34,7 +34,7 @@
#include "mesh/distance_octree/DistanceOctree.h"
#include "mesh/MeshIO.h"
#include <boost/random.hpp>
#include <random>
#include <algorithm>
#include <vector>
......@@ -64,7 +64,7 @@ void runBenchmark( const std::string & meshFile, const uint_t numPoints, const u
timer.end();
WALBERLA_LOG_INFO( "Mesh preparation took " << timer.last() << "s" );
boost::random::mt19937 rng;
std::mt19937 rng;
std::vector< typename MeshType::Point > points( numPoints );
for(auto it = points.begin(); it != points.end(); ++it)
......
......@@ -831,7 +831,7 @@ int main( int argc, char **argv )
else if( int(Galileo) == 250 )
{
// add random perturbance for chaotic regime
walberla::math::seedRandomGenerator( boost::mt19937::result_type(std::time(0)) );
walberla::math::seedRandomGenerator( std::mt19937::result_type(std::time(0)) );
xParticle = real_c( xlength ) * real_t(0.5) + walberla::math::realRandom( real_t(-0.5), real_t(0.5) );
yParticle = real_c( ylength ) * real_t(0.5) + walberla::math::realRandom( real_t(-0.5), real_t(0.5) );
......
......@@ -28,7 +28,6 @@
#include "core/math/Utility.h"
#include "core/VectorTrait.h"
//#include <boost/math/special_functions/next.hpp>
#include <boost/type_traits/is_arithmetic.hpp>
#include <boost/type_traits/is_floating_point.hpp>
#include <boost/type_traits/has_left_shift.hpp>
......
......@@ -26,7 +26,6 @@
#include <boost/algorithm/string/replace.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/math/special_functions/pow.hpp>
......@@ -64,7 +63,10 @@ void DistributedSample::mpiAllGather()
variance_ = real_t(0);
for( auto it = data_.begin(); it != data_.end(); ++it )
variance_ += boost::math::pow<2>( *it - mean_ );
{
real_t val = *it - mean_;
variance_ += val*val;
}
WALBERLA_MPI_SECTION()
{
......@@ -120,7 +122,10 @@ void DistributedSample::mpiGather( int rank )
variance_ = real_t(0);
for( auto it = data_.begin(); it != data_.end(); ++it )
variance_ += boost::math::pow<2>( *it - mean_ );
{
real_t val = *it - mean_;
variance_ += val*val;
}
WALBERLA_MPI_SECTION()
{
......
......@@ -22,7 +22,7 @@
#pragma once
#include <boost/math/special_functions/fpclassify.hpp>
#include <cmath>
namespace walberla {
......@@ -39,7 +39,7 @@ namespace math {
template<typename T>
inline bool isnan(T x)
{
return (boost::math::isnan)(x);
return (std::isnan)(x);
}
......@@ -53,7 +53,7 @@ inline bool isnan(T x)
template<typename T>
inline bool isinf(T x)
{
return (boost::math::isinf)(x);
return (std::isinf)(x);
}
......@@ -67,7 +67,7 @@ inline bool isinf(T x)
template<typename T>
bool finite(T x)
{
return (boost::math::isfinite)(x);
return (std::isfinite)(x);
}
......
......@@ -30,7 +30,7 @@
#include <boost/array.hpp>
#include <boost/type_traits/is_floating_point.hpp>
#include <boost/random/uniform_real_distribution.hpp>
#include <random>
namespace walberla {
......
......@@ -1717,7 +1717,7 @@ void GenericAABB< T >::intersect( const GenericAABB & other )
* The point is in ( [ xMin(), xMax() ), [ yMin(), yMax() ), [ zMin(), zMax() ) )
*
* \pre !empty()
* \param engine An Uniform Random Number Generator (e.g. boost::random::mt19937)
* \param engine An Uniform Random Number Generator (e.g. std::mt19937)
* \returns Random point within *this
*/
template< typename T >
......@@ -1725,9 +1725,9 @@ template< typename Engine >
typename GenericAABB< T >::vector_type GenericAABB< T >::randomPoint( Engine & engine ) const
{
WALBERLA_ASSERT( !empty() );
boost::random::uniform_real_distribution< T > randX( xMin(), xMax() );
boost::random::uniform_real_distribution< T > randY( yMin(), yMax() );
boost::random::uniform_real_distribution< T > randZ( zMin(), zMax() );
std::uniform_real_distribution< T > randX( xMin(), xMax() );
std::uniform_real_distribution< T > randY( yMin(), yMax() );
std::uniform_real_distribution< T > randZ( zMin(), zMax() );
return vector_type( randX( engine ), randY( engine ), randZ( engine ) );
}
......
......@@ -29,9 +29,9 @@ namespace math {
namespace internal {
static boost::mt19937 generator; // static boost::random::mt19937_64 generator;
static std::mt19937 generator; // static std::mt19937_64 generator;
boost::mt19937 & getGenerator() // boost::random::mt19937_64
std::mt19937 & getGenerator() // std::mt19937_64
{
return generator;
}
......@@ -40,7 +40,7 @@ boost::mt19937 & getGenerator() // boost::random::mt19937_64
void seedRandomGenerator( const boost::mt19937::result_type & seed )
void seedRandomGenerator( const std::mt19937::result_type & seed )
{
#ifdef _OPENMP
#pragma omp critical (random)
......
......@@ -24,9 +24,7 @@
#include "core/DataTypes.h"
#include "core/debug/Debug.h"
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int.hpp> // #include <boost/random/uniform_int_distribution.hpp>
#include <boost/random/uniform_real.hpp> // #include <boost/random/uniform_real_distribution.hpp>
#include <random>
#include <limits>
......@@ -36,12 +34,12 @@ namespace math {
namespace internal {
boost::mt19937 & getGenerator(); // boost::random::mt19937_64
std::mt19937 & getGenerator(); // std::mt19937_64
}
void seedRandomGenerator( const boost::mt19937::result_type & seed ); // boost::random::mt19937_64
void seedRandomGenerator( const std::mt19937::result_type & seed ); // std::mt19937_64
......@@ -52,12 +50,13 @@ void seedRandomGenerator( const boost::mt19937::result_type & seed ); // boost::
//**********************************************************************************************************************
template< typename INT >
INT intRandom( const INT min = std::numeric_limits<INT>::min(), const INT max = std::numeric_limits<INT>::max(),
boost::mt19937 & generator = internal::getGenerator() )
std::mt19937 & generator = internal::getGenerator() )
{
static_assert_int_t< INT >();
static_assert(sizeof(INT) > sizeof(char), "cannot use char");
WALBERLA_ASSERT_LESS_EQUAL( min, max );
boost::uniform_int< INT > distribution( min, max ); // boost::random::uniform_int_distribution< INT > distribution;
std::uniform_int_distribution< INT > distribution( min, max );
INT value;
#ifdef _OPENMP
......@@ -68,19 +67,70 @@ INT intRandom( const INT min = std::numeric_limits<INT>::min(), const INT max =
return value;
}
template<>
inline char intRandom<char>( const char min, const char max, std::mt19937 & generator )
{
static_assert_int_t< char >();
WALBERLA_ASSERT_LESS_EQUAL( min, max );
std::uniform_int_distribution< int16_t > distribution( min, max );
char value;
#ifdef _OPENMP
#pragma omp critical (random)
#endif
{ value = static_cast<char>( distribution( generator ) ); }
return value;
}
template<>
inline unsigned char intRandom<unsigned char>( const unsigned char min, const unsigned char max, std::mt19937 & generator )
{
static_assert_int_t< unsigned char >();
WALBERLA_ASSERT_LESS_EQUAL( min, max );
std::uniform_int_distribution< int16_t > distribution( min, max );
unsigned char value;
#ifdef _OPENMP
#pragma omp critical (random)
#endif
{ value = static_cast<unsigned char>( distribution( generator ) ); }
return value;
}
template<>
inline signed char intRandom<signed char>( const signed char min, const signed char max, std::mt19937 & generator )
{
static_assert_int_t< signed char >();
WALBERLA_ASSERT_LESS_EQUAL( min, max );
std::uniform_int_distribution< int16_t > distribution( min, max );
signed char value;
#ifdef _OPENMP
#pragma omp critical (random)
#endif
{ value = static_cast<signed char>( distribution( generator ) ); }
return value;
}
template< typename INT >
class IntRandom
{
public:
IntRandom( const boost::mt19937::result_type & seed = boost::mt19937::result_type() ) { generator_.seed( seed ); }
IntRandom( const std::mt19937::result_type & seed = std::mt19937::result_type() ) { generator_.seed( seed ); }
INT operator()( const INT min = std::numeric_limits<INT>::min(), const INT max = std::numeric_limits<INT>::max() )
{
return intRandom( min, max, generator_ );
}
private:
boost::mt19937 generator_;
std::mt19937 generator_;
};
......@@ -91,12 +141,12 @@ private:
*/
//**********************************************************************************************************************
template< typename REAL >
REAL realRandom( const REAL min = REAL(0), const REAL max = REAL(1), boost::mt19937 & generator = internal::getGenerator() )
REAL realRandom( const REAL min = REAL(0), const REAL max = REAL(1), std::mt19937 & generator = internal::getGenerator() )
{
static_assert( std::numeric_limits<REAL>::is_specialized && !std::numeric_limits<REAL>::is_integer, "Floating point type required/expected!" );
WALBERLA_ASSERT_LESS( min, max );
boost::uniform_real< REAL > distribution( min, max ); // boost::uniform_real_distribution< REAL > distribution( min, max );
std::uniform_real_distribution< REAL > distribution( min, max );
REAL value;
#ifdef _OPENMP
......@@ -113,13 +163,13 @@ template< typename REAL >
class RealRandom
{
public:
RealRandom( const boost::mt19937::result_type & seed = boost::mt19937::result_type() ) { generator_.seed( seed ); }
RealRandom( const std::mt19937::result_type & seed = std::mt19937::result_type() ) { generator_.seed( seed ); }
REAL operator()( const REAL min = REAL(0), const REAL max = REAL(1) )
{
return realRandom( min, max, generator_ );
}
private:
boost::mt19937 generator_;
std::mt19937 generator_;
};
......@@ -133,10 +183,10 @@ inline bool boolRandom() { ///< Randomly returns 'true' or 'false'
class BoolRandom
{
public:
BoolRandom( const boost::mt19937::result_type & seed = boost::mt19937::result_type() ) { generator_.seed( seed ); }
BoolRandom( const std::mt19937::result_type & seed = std::mt19937::result_type() ) { generator_.seed( seed ); }
bool operator()() { return boolRandom(); }
private:
boost::mt19937 generator_;
std::mt19937 generator_;
};
......
......@@ -26,7 +26,6 @@
#include <boost/algorithm/string/replace.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/math/special_functions/pow.hpp>
#include <functional>
#include <iterator>
......@@ -128,7 +127,10 @@ real_t Sample::variance( real_t theMean ) const
KahanAccumulator< real_t > acc;
for(auto it = begin(); it != end(); ++it)
acc += boost::math::pow<2>(*it - theMean);
{
real_t val = *it - theMean;
acc += val*val;
}
return acc.get() / real_c(size());
}
......
......@@ -23,7 +23,8 @@
#include "Operator.h"
#include "Variable.h"
#include <boost/math/special_functions/fpclassify.hpp>
#include <cmath>
#include <algorithm>
namespace walberla {
......@@ -128,10 +129,10 @@ namespace math {
double left = root_->left_->compute();
double right = root_->right_->compute();
if ( boost::math::isnan(left) && boost::math::isnan(right) ){
if ( std::isnan(left) && std::isnan(right) ){
//WALBERLA_LOG_WARNING( "WARNING: Both values are NAN -> return true" );
return true;
} else if ( boost::math::isinf(left) && boost::math::isinf(right) ){
} else if ( std::isinf(left) && std::isinf(right) ){
//WALBERLA_LOG_WARNING( "WARNING: Both values are INF -> return true" );
return true;
}
......
......@@ -21,7 +21,7 @@
#include "Variable.h"
#include <boost/math/special_functions/fpclassify.hpp>
#include <cmath>
#include <sstream>
......@@ -36,7 +36,7 @@ namespace math {
void Var::setValue( const double value ){
value_ = value;
valid_ = !boost::math::isnan( value );
valid_ = !std::isnan( value );
}
bool Var::operator==( const Var& var) const {
......
......@@ -30,7 +30,6 @@
#include "core/math/AABB.h"
#include "core/uid/SUID.h"
#include <boost/cast.hpp>
#include <typeinfo>
#include <vector>
......
......@@ -20,7 +20,6 @@
//
//======================================================================================================================
#include "boost/lambda/bind.hpp"
#include "core/debug/Debug.h"
#include "core/logging/Logging.h"
#include "core/math/Parser.h"
......
......@@ -91,7 +91,7 @@ int main( int argc, char* argv[] )
auto dataHandling = make_shared< field::DefaultBlockDataHandling< FieldType > >( sbf, uint_t(3), 0.0, field::zyxf );
auto originalFieldId = sbf->addBlockData( dataHandling, "OriginalField", None, Empty );
math::seedRandomGenerator( numeric_cast<boost::mt19937::result_type>( MPIManager::instance()->rank() ) );
math::seedRandomGenerator( numeric_cast<std::mt19937::result_type>( MPIManager::instance()->rank() ) );
for( auto it = sbf->begin( None, Empty ); it != sbf->end(); ++it )
{
......
......@@ -25,7 +25,7 @@
#include "core/debug/TestSubsystem.h"
#include "core/mpi/Environment.h"
#include <boost/random/mersenne_twister.hpp>
#include <random>
namespace walberla {
namespace blockforest {
......@@ -418,7 +418,7 @@ static void test() {
bb = *( block->getData< CellInterval >( bid ) );
WALBERLA_CHECK_EQUAL( bb, CellInterval(Cell(150,180,210),Cell(199,239,279)) );
boost::random::mt19937 eng( 23 );
std::mt19937 eng( 23 );
for( int i = 0; i < 23; ++i )
{
const Vector3<real_t> globalPoint = forest.getDomain().getScaled( real_t(1.25) ).randomPoint( eng );
......
......@@ -23,19 +23,20 @@
#include "core/cell/CellInterval.h"
#include "core/debug/TestSubsystem.h"
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int.hpp>
#include <random>
#include <iostream>
#include <iterator>
using namespace walberla;
typedef std::mersenne_twister_engine< walberla::uint32_t, 32, 351, 175, 19, 0xccab8ee7, 11, 0xffffffff, 7, 0x31b6ab00, 15, 0xffe50000, 17, 0xa37d3c92 > mt11213b;
CellInterval makeRandomInterval(uint_t maxSize)
{
static boost::mt11213b rng;
boost::uniform_int<cell_idx_t> dist( std::numeric_limits<cell_idx_t>::min(), std::numeric_limits<cell_idx_t>::max() - cell_idx_c( maxSize ) );
boost::uniform_int<uint_t> dist2( uint_t(0), maxSize );
static mt11213b rng;
std::uniform_int_distribution<cell_idx_t> dist( std::numeric_limits<cell_idx_t>::min(), std::numeric_limits<cell_idx_t>::max() - cell_idx_c( maxSize ) );
std::uniform_int_distribution<uint_t> dist2( uint_t(0), maxSize );
cell_idx_t xMin = dist(rng);
cell_idx_t yMin = dist(rng);
......@@ -50,10 +51,10 @@ CellInterval makeRandomInterval(uint_t maxSize)
CellInterval makeRandomEmptyInterval(uint_t maxSize)
{
static boost::mt11213b rng;
boost::uniform_int<cell_idx_t> dist( std::numeric_limits<cell_idx_t>::min() + cell_idx_c( maxSize ), std::numeric_limits<cell_idx_t>::max() - cell_idx_c( maxSize ) );
boost::uniform_int<uint_t> dist2( uint_t(1), maxSize );
boost::uniform_int<uint_t> dist3( uint_t(0), uint_t(1) );
static mt11213b rng;
std::uniform_int_distribution<cell_idx_t> dist( std::numeric_limits<cell_idx_t>::min() + cell_idx_c( maxSize ), std::numeric_limits<cell_idx_t>::max() - cell_idx_c( maxSize ) );
std::uniform_int_distribution<uint_t> dist2( uint_t(1), maxSize );
std::uniform_int_distribution<uint_t> dist3( uint_t(0), uint_t(1) );
cell_idx_t xMin = dist(rng);
cell_idx_t yMin = dist(rng);
......@@ -81,8 +82,8 @@ CellInterval makeRandomEmptyInterval(uint_t maxSize)
Cell makeRandomCell()
{
static boost::mt11213b rng;
boost::uniform_int<cell_idx_t> dist( std::numeric_limits<cell_idx_t>::min(), std::numeric_limits<cell_idx_t>::max() );
static mt11213b rng;
std::uniform_int_distribution<cell_idx_t> dist( std::numeric_limits<cell_idx_t>::min(), std::numeric_limits<cell_idx_t>::max() );
return Cell( dist(rng), dist(rng), dist(rng) );
}
......
......@@ -23,8 +23,7 @@
#include "core/cell/Cell.h"
#include "core/debug/TestSubsystem.h"
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int.hpp>
#include <random>
using namespace walberla;
......@@ -135,8 +134,9 @@ int main( int /*argc*/, char** /*argv*/ ) {
debug::enterTestMode();
boost::mt11213b rng;
boost::uniform_int<cell_idx_t> dist( std::numeric_limits<cell_idx_t>::min(), std::numeric_limits<cell_idx_t>::max() );
typedef std::mersenne_twister_engine< walberla::uint32_t, 32, 351, 175, 19, 0xccab8ee7, 11, 0xffffffff, 7, 0x31b6ab00, 15, 0xffe50000, 17, 0xa37d3c92 > mt11213b;
mt11213b rng;
std::uniform_int_distribution<cell_idx_t> dist( std::numeric_limits<cell_idx_t>::min(), std::numeric_limits<cell_idx_t>::max() );
for(int i = 0; i < 100000; ++i)
{
......
......@@ -40,7 +40,6 @@
#include "vtk/BlockCellDataWriter.h"
#include <boost/lexical_cast.hpp>
#include <boost/random.hpp>
int main( int argc, char * argv[] )
{
......
......@@ -42,7 +42,6 @@
#include "vtk/BlockCellDataWriter.h"
#include <boost/lexical_cast.hpp>
#include <boost/random.hpp>
int main( int argc, char * argv[] )
{
......
......@@ -27,8 +27,7 @@
#include "stencil/D3CornerStencil.h"
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_real.hpp>
#include <random>
using namespace walberla;
......@@ -112,7 +111,7 @@ void testNonEmptyAABB( const GenericAABB< T > & aabb )
WALBERLA_CHECK_FLOAT_EQUAL( tmpAABB.volume(), T(0) );
WALBERLA_CHECK_IDENTICAL( tmpAABB.volume(), aabb.intersectionVolume( intersectingBox ) );
boost::random::mt19937 urng;
std::mt19937 urng;
for( int i = 0; i < 100; ++i )
{
auto p = aabb.randomPoint( urng );
......@@ -530,9 +529,10 @@ void testConstructors( const T x0, const T y0, const T z0, const T x1, const T y
template< typename T >
void randomTest()
{
boost::mt11213b rng;
typedef std::mersenne_twister_engine< walberla::uint32_t, 32, 351, 175, 19, 0xccab8ee7, 11, 0xffffffff, 7, 0x31b6ab00, 15, 0xffe50000, 17, 0xa37d3c92 > mt11213b;
mt11213b rng;
boost::uniform_real<T> dist( -T(10), T(10) );
std::uniform_real_distribution<T> dist( -T(10), T(10) );
for( int i = 0; i < 1000; ++i )
{
......@@ -600,7 +600,7 @@ void testAABBDistancesRandom( const GenericAABB< T > & baseAABB )
{
static const uint_t NUM_BOXES = 100;
static const uint_t NUM_POINTS = 1000;
boost::random::mt19937 rng;
std::mt19937 rng;
for( uint_t i = 0; i < NUM_BOXES; ++i )
{
......
......@@ -25,9 +25,7 @@
#include "core/math/Vector3.h"
#include "core/mpi/Environment.h"
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/normal_distribution.hpp>
#include <boost/random/variate_generator.hpp>
#include <random>
#include <cmath>
#include <vector>
......@@ -39,9 +37,9 @@ template < typename scalar_t >
struct RandomPointGenerator
{
typedef walberla::Vector3<scalar_t> vector_t;
typedef boost::mt11213b RandomNumberEngine;
typedef boost::normal_distribution<scalar_t> NormalDistribution;
typedef boost::variate_generator< RandomNumberEngine, NormalDistribution > Generator;
typedef std::mersenne_twister_engine< walberla::uint32_t, 32, 351, 175, 19, 0xccab8ee7, 11, 0xffffffff, 7, 0x31b6ab00, 15, 0xffe50000, 17, 0xa37d3c92 > mt11213b;
typedef mt11213b RandomNumberEngine;
typedef std::normal_distribution<scalar_t> NormalDistribution;
RandomPointGenerator( const vector_t & mu, const vector_t & sigma )
{
......@@ -49,17 +47,19 @@ struct RandomPointGenerator
{
RandomNumberEngine rne;
rne.seed( numeric_cast< RandomNumberEngine::result_type >( i * 642573 ) );
normalDistributions.push_back( Generator( rne, NormalDistribution( mu[i], sigma[i] ) ) );
engines.push_back( rne );
normalDistributions.push_back( NormalDistribution( mu[i], sigma[i] ) );
}
}
vector_t operator()()
{
return vector_t( normalDistributions[0](), normalDistributions[1](), normalDistributions[2]() );
return vector_t( normalDistributions[0](engines[0]), normalDistributions[1](engines[1]), normalDistributions[2](engines[2]) );
}
private:
std::vector< Generator > normalDistributions;
std::vector< RandomNumberEngine > engines;
std::vector< NormalDistribution > normalDistributions;
};
void testIOStream( const Plane & p )
......
......@@ -27,8 +27,7 @@
#include "core/math/Primes.h"
#include "core/mpi/MPIManager.h"
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int.hpp>
#include <random>
#include <algorithm>
#include <numeric>
......@@ -85,8 +84,9 @@ int main(int argc, char * argv[])
runTests( n );
}
boost::mt11213b rng;
boost::uniform_int<uint_t> dist( 100, 10000 );
typedef std::mersenne_twister_engine< walberla::uint32_t, 32, 351, 175, 19, 0xccab8ee7, 11, 0xffffffff, 7, 0x31b6ab00, 15, 0xffe50000, 17, 0xa37d3c92 > mt11213b;
mt11213b rng;
std::uniform_int_distribution<uint_t> dist( 100, 10000 );
for(int i = 0; i < 100; ++i)
{
const uint_t n = dist(rng);
......
......@@ -26,9 +26,7 @@
#include "core/mpi/BufferSystem.h"
#include "core/mpi/Environment.h"
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int.hpp>
#include <boost/random/variate_generator.hpp>
#include <random>
#include <cmath>
#include <iostream>
......@@ -43,7 +41,7 @@ using namespace std::literals::chrono_literals;
typedef boost::mt19937 base_generator_type;
typedef std::mt19937 base_generator_type;
/**
* Utility function for sleeping a random time
......@@ -60,10 +58,9 @@ void randomSleep( int maxTimeInMs = 20 )
unsigned int seed = static_cast<unsigned int>(std::time(0)) + static_cast<unsigned int>(rank*1000) + counter;
generator.seed(seed);
boost::uniform_int<> uni_dist(0,maxTimeInMs);
boost::variate_generator<base_generator_type&, boost::uniform_int<> > uni(generator, uni_dist);
std::uniform_int_distribution<> uni_dist(0,maxTimeInMs);
int sleepTime = uni();
int sleepTime = uni_dist(generator);
std::this_thread::sleep_for( sleepTime * 1ms );
}
......
......@@ -36,8 +36,7 @@
#include "core/mpi/RecvBuffer.h"
#include "core/mpi/SendBuffer.h"
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int.hpp> // #include <boost/random/uniform_int_distribution.hpp>
#include <random>
#include <cstring>
#include <iostream>
......@@ -48,9 +47,9 @@ using namespace mpi;
template<typename T>
void initIntegerContainer( T & container )
{
static boost::mt19937 rng;
boost::uniform_int<typename T::value_type> dist;
boost::uniform_int<size_t> size_dist(10,1000);
static std::mt19937 rng;
std::uniform_int_distribution<typename T::value_type> dist;
std::uniform_int_distribution<size_t> size_dist(10,1000);
size_t size = size_dist(rng);
container.clear();
......@@ -61,9 +60,9 @@ void initIntegerContainer( T & container )
template<typename T>
void initIntegerAssocContainer( T & container )
{
static boost::mt19937 rng;
boost::uniform_int<typename T::value_type> dist;
boost::uniform_int<size_t> size_dist(10,1000);
static std::mt19937 rng;
std::uniform_int_distribution<typename T::value_type> dist;
std::uniform_int_distribution<size_t> size_dist(10,1000);
size_t size = size_dist(rng);
container.clear();
......@@ -74,9 +73,9 @@ void initIntegerAssocContainer( T & container )
void initVecBool( std::vector<bool> & vecBool )
{
static boost::mt19937 rng;
boost::uniform_int<walberla::uint32_t> dist;
boost::uniform_int<size_t> size_dist(10,1000);
static std::mt19937 rng;
std::uniform_int_distribution<walberla::uint32_t> dist;
std::uniform_int_distribution<size_t> size_dist(10,1000);
size_t size = size_dist(rng);
vecBool.clear();
......@@ -88,10 +87,10 @@ void initVecBool( std::vector<bool> & vecBool )