diff --git a/CMakeLists.txt b/CMakeLists.txt index c5ada42..3c217b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,14 +17,12 @@ target_include_directories(boost_random PUBLIC include) target_link_libraries(boost_random PUBLIC - Boost::array Boost::assert Boost::config Boost::core Boost::dynamic_bitset Boost::integer Boost::io - Boost::range Boost::static_assert Boost::system Boost::throw_exception @@ -51,4 +49,3 @@ if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt") add_subdirectory(test) endif() - diff --git a/build.jam b/build.jam index ad7e37d..0d2def6 100644 --- a/build.jam +++ b/build.jam @@ -6,14 +6,12 @@ require-b2 5.2 ; constant boost_dependencies : - /boost/array//boost_array /boost/assert//boost_assert /boost/config//boost_config /boost/core//boost_core /boost/dynamic_bitset//boost_dynamic_bitset /boost/integer//boost_integer /boost/io//boost_io - /boost/range//boost_range /boost/static_assert//boost_static_assert /boost/system//boost_system /boost/throw_exception//boost_throw_exception @@ -33,4 +31,3 @@ explicit call-if : boost-library random : install boost_random ; - diff --git a/include/boost/random/discrete_distribution.hpp b/include/boost/random/discrete_distribution.hpp index c6c25fe..877cbf2 100644 --- a/include/boost/random/discrete_distribution.hpp +++ b/include/boost/random/discrete_distribution.hpp @@ -29,9 +29,6 @@ #include #endif -#include -#include - #include namespace boost { @@ -268,7 +265,7 @@ public: */ template explicit param_type(const Range& range) - : _probabilities(boost::begin(range), boost::end(range)) + : _probabilities(std::begin(range), std::end(range)) { normalize(); } @@ -308,7 +305,7 @@ public: detail::print_vector(os, parm._probabilities); return os; } - + /** Reads the parameters from a @c std::istream. */ BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR(is, param_type, parm) { @@ -389,7 +386,7 @@ public: template explicit discrete_distribution(const Range& range) { - init(boost::begin(range), boost::end(range)); + init(std::begin(range), std::end(range)); } /** * Constructs a discrete_distribution that approximates a function. @@ -440,7 +437,7 @@ public: return(_impl._alias_table[static_cast(result)].second); } } - + /** * Returns a value distributed according to the parameters * specified by param. @@ -472,7 +469,7 @@ public: return discrete_distribution(parm)(urng); } } - + /** Returns the smallest value that the distribution can produce. */ result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return 0; } /** Returns the largest value that the distribution can produce. */ @@ -520,7 +517,7 @@ public: { init(parm._probabilities.begin(), parm._probabilities.end()); } - + /** * Effects: Subsequent uses of the distribution do not depend * on values produced by any engine prior to invoking reset. @@ -576,7 +573,7 @@ private: std::vector > above_average; below_average.reserve(input_size); above_average.reserve(input_size); - + WeightType weight_average = _impl.init_average(first, last); WeightType normalized_average = _impl.get_weight(0); std::size_t i = 0; diff --git a/include/boost/random/hyperexponential_distribution.hpp b/include/boost/random/hyperexponential_distribution.hpp index 3a71c9e..9512985 100644 --- a/include/boost/random/hyperexponential_distribution.hpp +++ b/include/boost/random/hyperexponential_distribution.hpp @@ -25,9 +25,6 @@ #include #include #include -#include -#include -#include #include #include #include @@ -294,8 +291,8 @@ class hyperexponential_distribution param_type(ProbRangeT const& prob_range, RateRangeT const& rate_range, typename boost::disable_if_c::value || boost::has_pre_increment::value>::type* = 0) - : probs_(boost::begin(prob_range), boost::end(prob_range)), - rates_(boost::begin(rate_range), boost::end(rate_range)) + : probs_(std::begin(prob_range), std::end(prob_range)), + rates_(std::begin(rate_range), std::end(rate_range)) { hyperexp_detail::normalize(probs_); @@ -330,8 +327,8 @@ class hyperexponential_distribution // We SFINAE this out of existance if the argument type is // incrementable as in that case the type is probably an iterator. public: template - param_type(RateIterT rate_first, - RateIterT rate_last, + param_type(RateIterT rate_first, + RateIterT rate_last, typename boost::enable_if_c::value>::type* = 0) : probs_(std::distance(rate_first, rate_last), 1), // will be normalized below rates_(rate_first, rate_last) @@ -355,8 +352,8 @@ class hyperexponential_distribution */ public: template param_type(RateRangeT const& rate_range) - : probs_(boost::size(rate_range), 1), // Will be normalized below - rates_(boost::begin(rate_range), boost::end(rate_range)) + : probs_(std::size(rate_range), 1), // Will be normalized below + rates_(std::begin(rate_range), std::end(rate_range)) { hyperexp_detail::normalize(probs_); @@ -529,7 +526,7 @@ class hyperexponential_distribution return lhs.probs_ == rhs.probs_ && lhs.rates_ == rhs.rates_; } - + /** Returns true if the two sets of parameters are the different. */ public: BOOST_RANDOM_DETAIL_INEQUALITY_OPERATOR(param_type) @@ -608,7 +605,7 @@ class hyperexponential_distribution RateRangeT const& rate_range, typename boost::disable_if_c::value || boost::has_pre_increment::value>::type* = 0) : dd_(prob_range), - rates_(boost::begin(rate_range), boost::end(rate_range)) + rates_(std::begin(rate_range), std::end(rate_range)) { BOOST_ASSERT( hyperexp_detail::check_params(dd_.probabilities(), rates_) ); } @@ -667,8 +664,8 @@ class hyperexponential_distribution */ public: template hyperexponential_distribution(RateRangeT const& rate_range) - : dd_(std::vector(boost::size(rate_range), 1)), - rates_(boost::begin(rate_range), boost::end(rate_range)) + : dd_(std::vector(std::size(rate_range), 1)), + rates_(std::begin(rate_range), std::end(rate_range)) { BOOST_ASSERT( hyperexp_detail::check_params(dd_.probabilities(), rates_) ); } @@ -854,7 +851,7 @@ class hyperexponential_distribution return lhs.dd_ == rhs.dd_ && lhs.rates_ == rhs.rates_; } - + /** * Returns true if the two instances of @c hyperexponential_distribution will * return different sequences of values given equal generators. diff --git a/include/boost/random/piecewise_constant_distribution.hpp b/include/boost/random/piecewise_constant_distribution.hpp index 488f41c..68ef2c6 100644 --- a/include/boost/random/piecewise_constant_distribution.hpp +++ b/include/boost/random/piecewise_constant_distribution.hpp @@ -26,9 +26,6 @@ #include #endif -#include -#include - namespace boost { namespace random { @@ -127,8 +124,8 @@ public: template param_type(const IntervalRange& intervals_arg, const WeightRange& weights_arg) - : _intervals(boost::begin(intervals_arg), boost::end(intervals_arg)), - _weights(boost::begin(weights_arg), boost::end(weights_arg)) + : _intervals(std::begin(intervals_arg), std::end(intervals_arg)), + _weights(std::begin(weights_arg), std::end(weights_arg)) { if(_intervals.size() < 2) { _intervals.clear(); @@ -185,7 +182,7 @@ public: detail::print_vector(os, parm._weights); return os; } - + /** Reads the parameters from a @c std::istream. */ BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR(is, param_type, parm) { @@ -318,7 +315,7 @@ public: piecewise_constant_distribution(const IntervalsRange& intervals_arg, const WeightsRange& weights_arg) : _bins(weights_arg), - _intervals(boost::begin(intervals_arg), boost::end(intervals_arg)) + _intervals(std::begin(intervals_arg), std::end(intervals_arg)) { if(_intervals.size() < 2) { _intervals.clear(); @@ -367,7 +364,7 @@ public: std::size_t i = _bins(urng); return uniform_real(_intervals[i], _intervals[i+1])(urng); } - + /** * Returns a value distributed according to the parameters * specified by param. @@ -377,7 +374,7 @@ public: { return piecewise_constant_distribution(parm)(urng); } - + /** Returns the smallest value that the distribution can produce. */ result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return _intervals.front(); } @@ -414,7 +411,7 @@ public: _bins.param(bins_param); _intervals.swap(new_intervals); } - + /** * Effects: Subsequent uses of the distribution do not depend * on values produced by any engine prior to invoking reset. diff --git a/include/boost/random/piecewise_linear_distribution.hpp b/include/boost/random/piecewise_linear_distribution.hpp index 541c57f..1e36c85 100644 --- a/include/boost/random/piecewise_linear_distribution.hpp +++ b/include/boost/random/piecewise_linear_distribution.hpp @@ -28,9 +28,6 @@ #include #endif -#include -#include - namespace boost { namespace random { @@ -134,8 +131,8 @@ public: template param_type(const IntervalRange& intervals_arg, const WeightRange& weights_arg) - : _intervals(boost::begin(intervals_arg), boost::end(intervals_arg)), - _weights(boost::begin(weights_arg), boost::end(weights_arg)) + : _intervals(std::begin(intervals_arg), std::end(intervals_arg)), + _weights(std::begin(weights_arg), std::end(weights_arg)) { if(_intervals.size() < 2) { _weights.clear(); @@ -200,7 +197,7 @@ public: detail::print_vector(os, parm._weights); return os; } - + /** Reads the parameters from a @c std::istream. */ BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR(is, param_type, parm) { @@ -321,8 +318,8 @@ public: template piecewise_linear_distribution(const IntervalsRange& intervals_arg, const WeightsRange& weights_arg) - : _intervals(boost::begin(intervals_arg), boost::end(intervals_arg)), - _weights(boost::begin(weights_arg), boost::end(weights_arg)) + : _intervals(std::begin(intervals_arg), std::end(intervals_arg)), + _weights(std::begin(weights_arg), std::end(weights_arg)) { if(_intervals.size() < 2) { default_init(); @@ -383,7 +380,7 @@ public: return (std::min)(dist(urng), dist(urng)); } } - + /** * Returns a value distributed according to the parameters * specified by param. @@ -393,7 +390,7 @@ public: { return piecewise_linear_distribution(parm)(urng); } - + /** Returns the smallest value that the distribution can produce. */ result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return _intervals.front(); } @@ -439,7 +436,7 @@ public: _intervals.swap(new_intervals); _weights.swap(new_weights); } - + /** * Effects: Subsequent uses of the distribution do not depend * on values produced by any engine prior to invoking reset. diff --git a/include/boost/random/seed_seq.hpp b/include/boost/random/seed_seq.hpp index b0b1de2..fc7adbb 100644 --- a/include/boost/random/seed_seq.hpp +++ b/include/boost/random/seed_seq.hpp @@ -16,8 +16,6 @@ #include #include -#include -#include #include #include #include @@ -53,7 +51,7 @@ public: /** Initializes the sequence from Boost.Range range. */ template explicit seed_seq(const Range& range) - : v(boost::begin(range), boost::end(range)) {} + : v(std::begin(range), std::end(range)) {} /** * Fills a range with 32-bit values based on the stored sequence.