random.tcc: Define static const data members.

2009-09-29  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/random.tcc: Define static const data members.
	* include/tr1/random.tcc: Likewise.
	* testsuite/26_numerics/random/subtract_with_carry_engine/
	requirements/constants.cc: New.
	* testsuite/26_numerics/random/mersenne_twister_engine/
	requirements/constants.cc: Likewise.
	* testsuite/26_numerics/random/linear_congruential_engine/
	requirements/constants.cc: Likewise.
	* testsuite/26_numerics/random/shuffle_order_engine/requirements/
	constants.cc: Likewise.
	* testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/
	requirements/constants.cc: Likewise.
	* testsuite/tr1/5_numerical_facilities/random/
	subtract_with_carry_01/requirements/constants.cc: Likewise.
	* testsuite/tr1/5_numerical_facilities/random/discard_block/
	requirements/constants.cc: Likewise.
	* testsuite/tr1/5_numerical_facilities/random/linear_congruential/
	requirements/constants.cc: Likewise.
	* testsuite/tr1/5_numerical_facilities/random/mersenne_twister/
	requirements/constants.cc: Likewise.
	* testsuite/tr1/5_numerical_facilities/random/xor_combine/
	requirements/constants.cc: Likewise.

From-SVN: r152317
This commit is contained in:
Paolo Carlini 2009-09-30 00:50:24 +00:00
parent 0b70519f01
commit 300ea2831b
13 changed files with 732 additions and 5 deletions

View File

@ -1,4 +1,29 @@
2009-09-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2009-09-29 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/random.tcc: Define static const data members.
* include/tr1/random.tcc: Likewise.
* testsuite/26_numerics/random/subtract_with_carry_engine/
requirements/constants.cc: New.
* testsuite/26_numerics/random/mersenne_twister_engine/
requirements/constants.cc: Likewise.
* testsuite/26_numerics/random/linear_congruential_engine/
requirements/constants.cc: Likewise.
* testsuite/26_numerics/random/shuffle_order_engine/requirements/
constants.cc: Likewise.
* testsuite/tr1/5_numerical_facilities/random/subtract_with_carry/
requirements/constants.cc: Likewise.
* testsuite/tr1/5_numerical_facilities/random/
subtract_with_carry_01/requirements/constants.cc: Likewise.
* testsuite/tr1/5_numerical_facilities/random/discard_block/
requirements/constants.cc: Likewise.
* testsuite/tr1/5_numerical_facilities/random/linear_congruential/
requirements/constants.cc: Likewise.
* testsuite/tr1/5_numerical_facilities/random/mersenne_twister/
requirements/constants.cc: Likewise.
* testsuite/tr1/5_numerical_facilities/random/xor_combine/
requirements/constants.cc: Likewise.
2009-09-29 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
PR libstdc++/38923
* acinclude.m4 (GLIBCXX_CHECK_LINKER_FEATURES): Avoid 'head',
@ -8,10 +33,10 @@
2009-09-28 Benjamin Kosnik <bkoz@redhat.com>
* libsupc++/eh_terminate.cc: Fixes for -fno-exceptions.
* libsupc++/vec.cc: Same.
* libsupc++/vterminate.cc: Same.
* libsupc++/new_opnt.cc: Same.
* libsupc++/eh_terminate.cc: Fixes for -fno-exceptions.
* libsupc++/vec.cc: Same.
* libsupc++/vterminate.cc: Same.
* libsupc++/new_opnt.cc: Same.
2009-09-28 Johannes Singler <singler@ira.uka.de>

View File

@ -89,6 +89,23 @@ namespace std
};
} // namespace __detail
template<typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
const _UIntType
linear_congruential_engine<_UIntType, __a, __c, __m>::multiplier;
template<typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
const _UIntType
linear_congruential_engine<_UIntType, __a, __c, __m>::increment;
template<typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
const _UIntType
linear_congruential_engine<_UIntType, __a, __c, __m>::modulus;
template<typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
const _UIntType
linear_congruential_engine<_UIntType, __a, __c, __m>::default_seed;
/**
* Seeds the LCR with integral value @p __s, adjusted so that the
* ring identity is never a member of the convergence set.
@ -169,6 +186,133 @@ namespace std
}
template<typename _UIntType,
size_t __w, size_t __n, size_t __m, size_t __r,
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
_UIntType __b, size_t __t, _UIntType __c, size_t __l,
_UIntType __f>
const size_t
mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d,
__s, __b, __t, __c, __l, __f>::word_size;
template<typename _UIntType,
size_t __w, size_t __n, size_t __m, size_t __r,
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
_UIntType __b, size_t __t, _UIntType __c, size_t __l,
_UIntType __f>
const size_t
mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d,
__s, __b, __t, __c, __l, __f>::state_size;
template<typename _UIntType,
size_t __w, size_t __n, size_t __m, size_t __r,
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
_UIntType __b, size_t __t, _UIntType __c, size_t __l,
_UIntType __f>
const size_t
mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d,
__s, __b, __t, __c, __l, __f>::shift_size;
template<typename _UIntType,
size_t __w, size_t __n, size_t __m, size_t __r,
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
_UIntType __b, size_t __t, _UIntType __c, size_t __l,
_UIntType __f>
const size_t
mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d,
__s, __b, __t, __c, __l, __f>::mask_bits;
template<typename _UIntType,
size_t __w, size_t __n, size_t __m, size_t __r,
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
_UIntType __b, size_t __t, _UIntType __c, size_t __l,
_UIntType __f>
const _UIntType
mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d,
__s, __b, __t, __c, __l, __f>::xor_mask;
template<typename _UIntType,
size_t __w, size_t __n, size_t __m, size_t __r,
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
_UIntType __b, size_t __t, _UIntType __c, size_t __l,
_UIntType __f>
const size_t
mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d,
__s, __b, __t, __c, __l, __f>::tempering_u;
template<typename _UIntType,
size_t __w, size_t __n, size_t __m, size_t __r,
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
_UIntType __b, size_t __t, _UIntType __c, size_t __l,
_UIntType __f>
const _UIntType
mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d,
__s, __b, __t, __c, __l, __f>::tempering_d;
template<typename _UIntType,
size_t __w, size_t __n, size_t __m, size_t __r,
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
_UIntType __b, size_t __t, _UIntType __c, size_t __l,
_UIntType __f>
const size_t
mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d,
__s, __b, __t, __c, __l, __f>::tempering_s;
template<typename _UIntType,
size_t __w, size_t __n, size_t __m, size_t __r,
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
_UIntType __b, size_t __t, _UIntType __c, size_t __l,
_UIntType __f>
const _UIntType
mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d,
__s, __b, __t, __c, __l, __f>::tempering_b;
template<typename _UIntType,
size_t __w, size_t __n, size_t __m, size_t __r,
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
_UIntType __b, size_t __t, _UIntType __c, size_t __l,
_UIntType __f>
const size_t
mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d,
__s, __b, __t, __c, __l, __f>::tempering_t;
template<typename _UIntType,
size_t __w, size_t __n, size_t __m, size_t __r,
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
_UIntType __b, size_t __t, _UIntType __c, size_t __l,
_UIntType __f>
const _UIntType
mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d,
__s, __b, __t, __c, __l, __f>::tempering_c;
template<typename _UIntType,
size_t __w, size_t __n, size_t __m, size_t __r,
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
_UIntType __b, size_t __t, _UIntType __c, size_t __l,
_UIntType __f>
const size_t
mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d,
__s, __b, __t, __c, __l, __f>::tempering_l;
template<typename _UIntType,
size_t __w, size_t __n, size_t __m, size_t __r,
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
_UIntType __b, size_t __t, _UIntType __c, size_t __l,
_UIntType __f>
const _UIntType
mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d,
__s, __b, __t, __c, __l, __f>::
initialization_multiplier;
template<typename _UIntType,
size_t __w, size_t __n, size_t __m, size_t __r,
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
_UIntType __b, size_t __t, _UIntType __c, size_t __l,
_UIntType __f>
const _UIntType
mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d,
__s, __b, __t, __c, __l, __f>::default_seed;
template<typename _UIntType,
size_t __w, size_t __n, size_t __m, size_t __r,
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
@ -340,6 +484,22 @@ namespace std
}
template<typename _UIntType, size_t __w, size_t __s, size_t __r>
const size_t
subtract_with_carry_engine<_UIntType, __w, __s, __r>::word_size;
template<typename _UIntType, size_t __w, size_t __s, size_t __r>
const size_t
subtract_with_carry_engine<_UIntType, __w, __s, __r>::short_lag;
template<typename _UIntType, size_t __w, size_t __s, size_t __r>
const size_t
subtract_with_carry_engine<_UIntType, __w, __s, __r>::long_lag;
template<typename _UIntType, size_t __w, size_t __s, size_t __r>
const _UIntType
subtract_with_carry_engine<_UIntType, __w, __s, __r>::default_seed;
template<typename _UIntType, size_t __w, size_t __s, size_t __r>
void
subtract_with_carry_engine<_UIntType, __w, __s, __r>::
@ -474,6 +634,14 @@ namespace std
}
template<typename _RandomNumberEngine, size_t __p, size_t __r>
const size_t
discard_block_engine<_RandomNumberEngine, __p, __r>::block_size;
template<typename _RandomNumberEngine, size_t __p, size_t __r>
const size_t
discard_block_engine<_RandomNumberEngine, __p, __r>::used_block;
template<typename _RandomNumberEngine, size_t __p, size_t __r>
typename discard_block_engine<_RandomNumberEngine,
__p, __r>::result_type
@ -576,6 +744,10 @@ namespace std
}
template<typename _RandomNumberEngine, size_t __k>
const size_t
shuffle_order_engine<_RandomNumberEngine, __k>::table_size;
template<typename _RandomNumberEngine, size_t __k>
typename shuffle_order_engine<_RandomNumberEngine, __k>::result_type
shuffle_order_engine<_RandomNumberEngine, __k>::

View File

@ -89,6 +89,19 @@ namespace tr1
};
} // namespace __detail
template<class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
const _UIntType
linear_congruential<_UIntType, __a, __c, __m>::multiplier;
template<class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
const _UIntType
linear_congruential<_UIntType, __a, __c, __m>::increment;
template<class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
const _UIntType
linear_congruential<_UIntType, __a, __c, __m>::modulus;
/**
* Seeds the LCR with integral value @p __x0, adjusted so that the
* ring identity is never a member of the convergence set.
@ -174,6 +187,83 @@ namespace tr1
}
template<class _UIntType, int __w, int __n, int __m, int __r,
_UIntType __a, int __u, int __s,
_UIntType __b, int __t, _UIntType __c, int __l>
const int
mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s,
__b, __t, __c, __l>::word_size;
template<class _UIntType, int __w, int __n, int __m, int __r,
_UIntType __a, int __u, int __s,
_UIntType __b, int __t, _UIntType __c, int __l>
const int
mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s,
__b, __t, __c, __l>::state_size;
template<class _UIntType, int __w, int __n, int __m, int __r,
_UIntType __a, int __u, int __s,
_UIntType __b, int __t, _UIntType __c, int __l>
const int
mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s,
__b, __t, __c, __l>::shift_size;
template<class _UIntType, int __w, int __n, int __m, int __r,
_UIntType __a, int __u, int __s,
_UIntType __b, int __t, _UIntType __c, int __l>
const int
mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s,
__b, __t, __c, __l>::mask_bits;
template<class _UIntType, int __w, int __n, int __m, int __r,
_UIntType __a, int __u, int __s,
_UIntType __b, int __t, _UIntType __c, int __l>
const _UIntType
mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s,
__b, __t, __c, __l>::parameter_a;
template<class _UIntType, int __w, int __n, int __m, int __r,
_UIntType __a, int __u, int __s,
_UIntType __b, int __t, _UIntType __c, int __l>
const int
mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s,
__b, __t, __c, __l>::output_u;
template<class _UIntType, int __w, int __n, int __m, int __r,
_UIntType __a, int __u, int __s,
_UIntType __b, int __t, _UIntType __c, int __l>
const int
mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s,
__b, __t, __c, __l>::output_s;
template<class _UIntType, int __w, int __n, int __m, int __r,
_UIntType __a, int __u, int __s,
_UIntType __b, int __t, _UIntType __c, int __l>
const _UIntType
mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s,
__b, __t, __c, __l>::output_b;
template<class _UIntType, int __w, int __n, int __m, int __r,
_UIntType __a, int __u, int __s,
_UIntType __b, int __t, _UIntType __c, int __l>
const int
mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s,
__b, __t, __c, __l>::output_t;
template<class _UIntType, int __w, int __n, int __m, int __r,
_UIntType __a, int __u, int __s,
_UIntType __b, int __t, _UIntType __c, int __l>
const _UIntType
mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s,
__b, __t, __c, __l>::output_c;
template<class _UIntType, int __w, int __n, int __m, int __r,
_UIntType __a, int __u, int __s,
_UIntType __b, int __t, _UIntType __c, int __l>
const int
mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s,
__b, __t, __c, __l>::output_l;
template<class _UIntType, int __w, int __n, int __m, int __r,
_UIntType __a, int __u, int __s,
_UIntType __b, int __t, _UIntType __c, int __l>
@ -311,6 +401,18 @@ namespace tr1
}
template<typename _IntType, _IntType __m, int __s, int __r>
const _IntType
subtract_with_carry<_IntType, __m, __s, __r>::modulus;
template<typename _IntType, _IntType __m, int __s, int __r>
const int
subtract_with_carry<_IntType, __m, __s, __r>::long_lag;
template<typename _IntType, _IntType __m, int __s, int __r>
const int
subtract_with_carry<_IntType, __m, __s, __r>::short_lag;
template<typename _IntType, _IntType __m, int __s, int __r>
void
subtract_with_carry<_IntType, __m, __s, __r>::
@ -431,6 +533,18 @@ namespace tr1
}
template<typename _RealType, int __w, int __s, int __r>
const int
subtract_with_carry_01<_RealType, __w, __s, __r>::word_size;
template<typename _RealType, int __w, int __s, int __r>
const int
subtract_with_carry_01<_RealType, __w, __s, __r>::long_lag;
template<typename _RealType, int __w, int __s, int __r>
const int
subtract_with_carry_01<_RealType, __w, __s, __r>::short_lag;
template<typename _RealType, int __w, int __s, int __r>
void
subtract_with_carry_01<_RealType, __w, __s, __r>::
@ -576,6 +690,13 @@ namespace tr1
return __is;
}
template<class _UniformRandomNumberGenerator, int __p, int __r>
const int
discard_block<_UniformRandomNumberGenerator, __p, __r>::block_size;
template<class _UniformRandomNumberGenerator, int __p, int __r>
const int
discard_block<_UniformRandomNumberGenerator, __p, __r>::used_block;
template<class _UniformRandomNumberGenerator, int __p, int __r>
typename discard_block<_UniformRandomNumberGenerator,
@ -639,6 +760,18 @@ namespace tr1
}
template<class _UniformRandomNumberGenerator1, int __s1,
class _UniformRandomNumberGenerator2, int __s2>
const int
xor_combine<_UniformRandomNumberGenerator1, __s1,
_UniformRandomNumberGenerator2, __s2>::shift1;
template<class _UniformRandomNumberGenerator1, int __s1,
class _UniformRandomNumberGenerator2, int __s2>
const int
xor_combine<_UniformRandomNumberGenerator1, __s1,
_UniformRandomNumberGenerator2, __s2>::shift2;
template<class _UniformRandomNumberGenerator1, int __s1,
class _UniformRandomNumberGenerator2, int __s2>
void

View File

@ -0,0 +1,40 @@
// { dg-do link }
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2009-09-29 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2009 Free Software Foundation, Inc.
//
// 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <random>
void test01()
{
std::minstd_rand0 lc;
const void* p = &lc.multiplier;
p = &lc.increment;
p = &lc.modulus;
p = &lc.default_seed;
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,50 @@
// { dg-do link }
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2009-09-29 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2009 Free Software Foundation, Inc.
//
// 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <random>
void test01()
{
std::mt19937 mt;
const void* p = &mt.word_size;
p = &mt.state_size;
p = &mt.shift_size;
p = &mt.mask_bits;
p = &mt.xor_mask;
p = &mt.tempering_u;
p = &mt.tempering_d;
p = &mt.tempering_s;
p = &mt.tempering_b;
p = &mt.tempering_t;
p = &mt.tempering_c;
p = &mt.tempering_l;
p = &mt.initialization_multiplier;
p = &mt.default_seed;
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,38 @@
// { dg-do link }
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2009-09-29 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2009 Free Software Foundation, Inc.
//
// 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <random>
void test01()
{
std::knuth_b so;
const void* p = &so.table_size;
p = &so.table_size;
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,40 @@
// { dg-do link }
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2009-09-29 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2009 Free Software Foundation, Inc.
//
// 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <random>
void test01()
{
std::ranlux24_base swc;
const void* p = &swc.word_size;
p = &swc.short_lag;
p = &swc.long_lag;
p = &swc.default_seed;
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,36 @@
// { dg-do link }
//
// 2009-09-29 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2009 Free Software Foundation, Inc.
//
// 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <tr1/random>
void test01()
{
std::tr1::ranlux3 db;
const void* p = &db.block_size;
p = &db.used_block;
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,37 @@
// { dg-do link }
//
// 2009-09-29 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2009 Free Software Foundation, Inc.
//
// 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <tr1/random>
void test01()
{
std::tr1::minstd_rand0 lc;
const void* p = &lc.multiplier;
p = &lc.increment;
p = &lc.modulus;
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,45 @@
// { dg-do link }
//
// 2009-09-29 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2009 Free Software Foundation, Inc.
//
// 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <tr1/random>
void test01()
{
std::tr1::mt19937 mt;
const void* p = &mt.word_size;
p = &mt.state_size;
p = &mt.shift_size;
p = &mt.mask_bits;
p = &mt.parameter_a;
p = &mt.output_u;
p = &mt.output_s;
p = &mt.output_b;
p = &mt.output_t;
p = &mt.output_c;
p = &mt.output_l;
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,37 @@
// { dg-do link }
//
// 2009-09-29 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2009 Free Software Foundation, Inc.
//
// 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <tr1/random>
void test01()
{
std::tr1::subtract_with_carry<unsigned long, (1UL << 24), 10, 24> swc;
const void* p = &swc.modulus;
p = &swc.long_lag;
p = &swc.short_lag;
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,37 @@
// { dg-do link }
//
// 2009-09-29 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2009 Free Software Foundation, Inc.
//
// 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <tr1/random>
void test01()
{
std::tr1::ranlux_base_01 swc_01;
const void* p = &swc_01.word_size;
p = &swc_01.long_lag;
p = &swc_01.short_lag;
}
int main()
{
test01();
return 0;
}

View File

@ -0,0 +1,37 @@
// { dg-do link }
//
// 2009-09-29 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2009 Free Software Foundation, Inc.
//
// 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <tr1/random>
void test01()
{
std::tr1::xor_combine<std::tr1::minstd_rand, 1, std::tr1::mt19937, 2>
xor_c;
const void* p = &xor_c.shift1;
p = &xor_c.shift2;
}
int main()
{
test01();
return 0;
}