random (uniform_real<>::uniform_real(_RealType, _RealType)): Implement.
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. From-SVN: r114730
This commit is contained in:
parent
e4d154a179
commit
0934c5effc
@ -1,3 +1,13 @@
|
||||
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):
|
||||
|
@ -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
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -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());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user