diff options
11 files changed, 32 insertions, 15 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index b4217ec..66f3497 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,15 @@ 2006-06-16 Paolo Carlini <pcarlini@suse.de> + * include/tr1/random (uniform_real<>::uniform_real(_RealType, + _RealType)): Implement. + (uniform_real<>::min()): Likewise. + (uniform_real<>::max()): Likewise. + (uniform_real<>::reset()): Likewise. + + * include/tr1/random (class uniform_real<>): Minor cosmetic tweaks. + +2006-06-16 Paolo Carlini <pcarlini@suse.de> + * include/bits/locale_facets.tcc (time_get<>::_M_extract_via_format): Ignore the value of the __err argument. (time_get<>::do_get_weekday): Likewise. diff --git a/libstdc++-v3/include/tr1/random b/libstdc++-v3/include/tr1/random index 4973b16..0f4ab01 100644 --- a/libstdc++-v3/include/tr1/random +++ b/libstdc++-v3/include/tr1/random @@ -1595,20 +1595,27 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1) */ explicit uniform_real(_RealType __min = _RealType(0), - _RealType __max = _RealType(1)); + _RealType __max = _RealType(1)) + : _M_min(__min), _M_max(__max) + { + _GLIBCXX_DEBUG_ASSERT(_M_min <= _M_max); + } result_type - min() const; + min() const + { return _M_min; } result_type - max() const; + max() const + { return _M_max; } - void reset(); + void + reset() { } template<class _UniformRandomNumberGenerator> result_type operator()(_UniformRandomNumberGenerator& __urng) - { return (__urng() * (max() - min())) + min(); } + { return (__urng() * (_M_max - _M_min)) + _M_min; } /** * Inserts a %uniform_real random number distribution @p __x into the @@ -1624,7 +1631,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1) friend std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& __os, const uniform_real& __x) - { return __os << __x.min() << " " << __x.max(); } + { return __os << __x._M_min << " " << __x._M_max; } /** * Extracts a %unform_real random number distribution diff --git a/libstdc++-v3/testsuite/ext/pb_ds/regression/hash_data_map_rand.cc b/libstdc++-v3/testsuite/ext/pb_ds/regression/hash_data_map_rand.cc index 06c51f5..1dc658a 100644 --- a/libstdc++-v3/testsuite/ext/pb_ds/regression/hash_data_map_rand.cc +++ b/libstdc++-v3/testsuite/ext/pb_ds/regression/hash_data_map_rand.cc @@ -54,7 +54,7 @@ main(int argc, char* a_p_argv[]) using namespace pb_ds::test; typedef hash_map_tl_t map_tl_t; - return rand_regression_test(10000, 10000, + return rand_regression_test(1000, 1000, "hash_data_map_rand_regression_test", map_tl_t()); } diff --git a/libstdc++-v3/testsuite/ext/pb_ds/regression/hash_no_data_map_rand.cc b/libstdc++-v3/testsuite/ext/pb_ds/regression/hash_no_data_map_rand.cc index 50bf333..0f9dc31 100644 --- a/libstdc++-v3/testsuite/ext/pb_ds/regression/hash_no_data_map_rand.cc +++ b/libstdc++-v3/testsuite/ext/pb_ds/regression/hash_no_data_map_rand.cc @@ -54,7 +54,7 @@ main(int argc, char* a_p_argv[]) using namespace pb_ds::test; typedef hash_set_tl_t map_tl_t; - return rand_regression_test(10000, 10000, + return rand_regression_test(1000, 1000, "hash_no_data_map_rand_regression_test", map_tl_t()); } diff --git a/libstdc++-v3/testsuite/ext/pb_ds/regression/list_update_data_map_rand.cc b/libstdc++-v3/testsuite/ext/pb_ds/regression/list_update_data_map_rand.cc index d184844..d3a1cb8 100644 --- a/libstdc++-v3/testsuite/ext/pb_ds/regression/list_update_data_map_rand.cc +++ b/libstdc++-v3/testsuite/ext/pb_ds/regression/list_update_data_map_rand.cc @@ -54,7 +54,7 @@ main(int argc, char* a_p_argv[]) using namespace pb_ds::test; typedef lu_map_tl_t map_tl_t; - return rand_regression_test(100, 10, + return rand_regression_test(10, 1, "lu_data_map_rand_regression_test", map_tl_t()); } diff --git a/libstdc++-v3/testsuite/ext/pb_ds/regression/list_update_no_data_map_rand.cc b/libstdc++-v3/testsuite/ext/pb_ds/regression/list_update_no_data_map_rand.cc index ae70c1e..79f1d9d 100644 --- a/libstdc++-v3/testsuite/ext/pb_ds/regression/list_update_no_data_map_rand.cc +++ b/libstdc++-v3/testsuite/ext/pb_ds/regression/list_update_no_data_map_rand.cc @@ -54,7 +54,7 @@ main(int argc, char* a_p_argv[]) using namespace pb_ds::test; typedef lu_set_tl_t map_tl_t; - return rand_regression_test(100, 10, + return rand_regression_test(10, 1, "lu_no_data_map_rand_regression_test", map_tl_t()); } diff --git a/libstdc++-v3/testsuite/ext/pb_ds/regression/priority_queue_rand.cc b/libstdc++-v3/testsuite/ext/pb_ds/regression/priority_queue_rand.cc index 6266e13..8830210 100644 --- a/libstdc++-v3/testsuite/ext/pb_ds/regression/priority_queue_rand.cc +++ b/libstdc++-v3/testsuite/ext/pb_ds/regression/priority_queue_rand.cc @@ -52,7 +52,7 @@ int main(int argc, char* a_p_argv[]) { using namespace pb_ds::test; - return rand_regression_test(10000, 10000, + return rand_regression_test(1000, 1000, "tree_no_data_map_rand_regression_test", pq_tl_t()); } diff --git a/libstdc++-v3/testsuite/ext/pb_ds/regression/tree_data_map_rand.cc b/libstdc++-v3/testsuite/ext/pb_ds/regression/tree_data_map_rand.cc index 4a51fac..21e18e7 100644 --- a/libstdc++-v3/testsuite/ext/pb_ds/regression/tree_data_map_rand.cc +++ b/libstdc++-v3/testsuite/ext/pb_ds/regression/tree_data_map_rand.cc @@ -54,7 +54,7 @@ main(int argc, char* a_p_argv[]) using namespace pb_ds::test; typedef tree_map_tl_t map_tl_t; - return rand_regression_test(10000, 10000, + return rand_regression_test(1000, 1000, "tree_data_map_rand_regression_test", map_tl_t()); } diff --git a/libstdc++-v3/testsuite/ext/pb_ds/regression/tree_no_data_map_rand.cc b/libstdc++-v3/testsuite/ext/pb_ds/regression/tree_no_data_map_rand.cc index 4d3c8ff..d2abc5f 100644 --- a/libstdc++-v3/testsuite/ext/pb_ds/regression/tree_no_data_map_rand.cc +++ b/libstdc++-v3/testsuite/ext/pb_ds/regression/tree_no_data_map_rand.cc @@ -54,7 +54,7 @@ main(int argc, char* a_p_argv[]) using namespace pb_ds::test; typedef tree_set_tl_t map_tl_t; - return rand_regression_test(10000, 10000, + return rand_regression_test(1000, 1000, "tree_no_data_map_rand_regression_test", map_tl_t()); } diff --git a/libstdc++-v3/testsuite/ext/pb_ds/regression/trie_data_map_rand.cc b/libstdc++-v3/testsuite/ext/pb_ds/regression/trie_data_map_rand.cc index e684197..4b350e5 100644 --- a/libstdc++-v3/testsuite/ext/pb_ds/regression/trie_data_map_rand.cc +++ b/libstdc++-v3/testsuite/ext/pb_ds/regression/trie_data_map_rand.cc @@ -54,7 +54,7 @@ main(int argc, char* a_p_argv[]) using namespace pb_ds::test; typedef trie_map_tl_t map_tl_t; - return rand_regression_test(10000, 10000, + return rand_regression_test(1000, 1000, "trie_data_map_rand_regression_test", map_tl_t()); } diff --git a/libstdc++-v3/testsuite/ext/pb_ds/regression/trie_no_data_map_rand.cc b/libstdc++-v3/testsuite/ext/pb_ds/regression/trie_no_data_map_rand.cc index b8af58c..a64511f 100644 --- a/libstdc++-v3/testsuite/ext/pb_ds/regression/trie_no_data_map_rand.cc +++ b/libstdc++-v3/testsuite/ext/pb_ds/regression/trie_no_data_map_rand.cc @@ -54,7 +54,7 @@ main(int argc, char* a_p_argv[]) using namespace pb_ds::test; typedef trie_set_tl_t map_tl_t; - return rand_regression_test(10000, 10000, + return rand_regression_test(1000, 1000, "trie_no_data_map_rand_regression_test", map_tl_t()); } |