Commit 42a73304 by Paolo Carlini

[multiple changes]

2009-04-05  Edward M. Smith-Rowland  <3dw4rd@verizon.net>

	* include/bits/random.h (struct _ShiftMin1): Fix small typo and
	thinko.
	* testsuite/26_numerics/random/mersenne_twister_engine/cons/
	default.cc: Enable.

2009-04-05  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/39629 (partial)
	* testsuite/26_numerics/random/independent_bits_engine/cons/
	base_move.cc: Use uint_fast64_t instead of unsigned long.
	* testsuite/26_numerics/random/independent_bits_engine/cons/
	seed1.cc: Likewise.
	* testsuite/26_numerics/random/independent_bits_engine/cons/
	seed2.cc: Likewise.
	* testsuite/26_numerics/random/independent_bits_engine/cons/
	base_copy.cc: Likewise.
	* testsuite/26_numerics/random/independent_bits_engine/cons/
	default.cc: Likewise.
	* testsuite/26_numerics/random/independent_bits_engine/cons/
	seed_seq.cc: Likewise.
	* testsuite/26_numerics/random/independent_bits_engine/
	requirements/typedefs.cc: Likewise.
	* testsuite/26_numerics/random/independent_bits_engine/
	operators/equal.cc: Likewise.
	* testsuite/26_numerics/random/independent_bits_engine/
	operators/serialize.cc: Likewise.
	* testsuite/26_numerics/random/mt19937_64.cc: Use ull.

From-SVN: r145553
parent cf7d2eb0
2009-04-05 Edward M. Smith-Rowland <3dw4rd@verizon.net>
* include/bits/random.h (struct _ShiftMin1): Fix small typo and
thinko.
* testsuite/26_numerics/random/mersenne_twister_engine/cons/
default.cc: Enable.
2009-04-05 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/39629 (partial)
* testsuite/26_numerics/random/independent_bits_engine/cons/
base_move.cc: Use uint_fast64_t instead of unsigned long.
* testsuite/26_numerics/random/independent_bits_engine/cons/
seed1.cc: Likewise.
* testsuite/26_numerics/random/independent_bits_engine/cons/
seed2.cc: Likewise.
* testsuite/26_numerics/random/independent_bits_engine/cons/
base_copy.cc: Likewise.
* testsuite/26_numerics/random/independent_bits_engine/cons/
default.cc: Likewise.
* testsuite/26_numerics/random/independent_bits_engine/cons/
seed_seq.cc: Likewise.
* testsuite/26_numerics/random/independent_bits_engine/
requirements/typedefs.cc: Likewise.
* testsuite/26_numerics/random/independent_bits_engine/
operators/equal.cc: Likewise.
* testsuite/26_numerics/random/independent_bits_engine/
operators/serialize.cc: Likewise.
* testsuite/26_numerics/random/mt19937_64.cc: Use ull.
2009-04-03 Paolo Carlini <paolo.carlini@oracle.com> 2009-04-03 Paolo Carlini <paolo.carlini@oracle.com>
* include/tr1_impl/random: Remove, empty. * include/tr1_impl/random: Remove, empty.
......
...@@ -78,14 +78,17 @@ namespace std ...@@ -78,14 +78,17 @@ namespace std
bool = __w <static_cast<size_t> bool = __w <static_cast<size_t>
(std::numeric_limits<_UIntType>::digits)> (std::numeric_limits<_UIntType>::digits)>
struct _ShiftMin1 struct _ShiftMin1
{ {
static const _UIntType __value = static const _UIntType __value =
__gnu_cxx::__numeric_traits<_UIntType>::max; __gnu_cxx::__numeric_traits<_UIntType>::__max;
}; };
template<typename _UIntType, size_t __w> template<typename _UIntType, size_t __w>
struct _ShiftMin1<_UIntType, __w, true> struct _ShiftMin1<_UIntType, __w, true>
{ static const _UIntType __value = _UIntType(1) << __w - _UIntType(1); }; {
static const _UIntType __value =
(_UIntType(1) << __w) - _UIntType(1);
};
template<typename _Tp, _Tp __a, _Tp __c, _Tp __m, bool> template<typename _Tp, _Tp __a, _Tp __c, _Tp __m, bool>
struct _Mod; struct _Mod;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// //
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008 Free Software Foundation, Inc. // Copyright (C) 2008, 2009 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -36,7 +36,7 @@ test01() ...@@ -36,7 +36,7 @@ test01()
base_engine b; base_engine b;
std::independent_bits_engine<base_engine, 48, unsigned long> e(b); std::independent_bits_engine<base_engine, 48, uint_fast64_t> e(b);
} }
int main() int main()
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// //
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008 Free Software Foundation, Inc. // Copyright (C) 2008, 2009 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -34,7 +34,7 @@ test01() ...@@ -34,7 +34,7 @@ test01()
typedef std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12> typedef std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>
base_engine; base_engine;
std::independent_bits_engine<base_engine, 48, unsigned long> std::independent_bits_engine<base_engine, 48, uint_fast64_t>
e(std::move(base_engine())); e(std::move(base_engine()));
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// //
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008 Free Software Foundation, Inc. // Copyright (C) 2008, 2009 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -35,7 +35,7 @@ test01() ...@@ -35,7 +35,7 @@ test01()
< <
std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>, std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>,
48, 48,
unsigned long uint_fast64_t
> e; > e;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// //
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008 Free Software Foundation, Inc. // Copyright (C) 2008, 2009 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -37,7 +37,7 @@ test01() ...@@ -37,7 +37,7 @@ test01()
< <
std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>, std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>,
48, 48,
unsigned long uint_fast64_t
> e(seed); > e(seed);
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// //
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008 Free Software Foundation, Inc. // Copyright (C) 2008, 2009 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -37,7 +37,7 @@ test01() ...@@ -37,7 +37,7 @@ test01()
< <
std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>, std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>,
48, 48,
unsigned long uint_fast64_t
> e(seed); > e(seed);
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// //
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008 Free Software Foundation, Inc. // Copyright (C) 2008, 2009 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -37,7 +37,7 @@ test01() ...@@ -37,7 +37,7 @@ test01()
< <
std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>, std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>,
48, 48,
unsigned long uint_fast64_t
> e(seq); > e(seq);
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// //
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008 Free Software Foundation, Inc. // Copyright (C) 2008, 2009 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -33,7 +33,7 @@ test01() ...@@ -33,7 +33,7 @@ test01()
std::independent_bits_engine std::independent_bits_engine
<std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>, <std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>,
48, unsigned long> u, v; 48, uint_fast64_t> u, v;
VERIFY( u == v ); VERIFY( u == v );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// //
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008 Free Software Foundation, Inc. // Copyright (C) 2008, 2009 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -35,7 +35,7 @@ test01() ...@@ -35,7 +35,7 @@ test01()
std::stringstream str; std::stringstream str;
std::independent_bits_engine std::independent_bits_engine
<std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>, <std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>,
48, unsigned long> u, v; 48, uint_fast64_t> u, v;
u(); // advance u(); // advance
str << u; str << u;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// //
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008 Free Software Foundation, Inc. // Copyright (C) 2008, 2009 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -35,7 +35,7 @@ test01() ...@@ -35,7 +35,7 @@ test01()
< <
uint_fast64_t, 48, 5, 12 uint_fast64_t, 48, 5, 12
>, >,
48, unsigned long 48, uint_fast64_t
> test_type; > test_type;
typedef test_type::result_type result_type; typedef test_type::result_type result_type;
......
...@@ -40,7 +40,7 @@ test01() ...@@ -40,7 +40,7 @@ test01()
0xefc60000ul, 18, 1812433253ul> x; 0xefc60000ul, 18, 1812433253ul> x;
VERIFY( x.min() == 0 ); VERIFY( x.min() == 0 );
// XXX VERIFY( x.max() == 4294967295ul); VERIFY( x.max() == 4294967295ul );
VERIFY( x() == 3499211612ul ); VERIFY( x() == 3499211612ul );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// //
// 2008-11-18 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-11-18 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2006, 2008 Free Software Foundation, Inc. // Copyright (C) 2008, 2009 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -34,7 +34,7 @@ test01() ...@@ -34,7 +34,7 @@ test01()
std::mt19937_64 a; std::mt19937_64 a;
a.discard(9999); a.discard(9999);
VERIFY( a() == 9981545732273789042ul ); VERIFY( a() == 9981545732273789042ull );
} }
int main() int main()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment