* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114730
138bc75d-0d04-0410-961f-
82ee72b054a4
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.
*/
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
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
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());
}
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());
}
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());
}
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());
}
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());
}
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());
}
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());
}
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());
}
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());
}