fix rational: for clang

This commit is contained in:
bolero-MURAKAMI 2013-08-09 22:14:43 +09:00
parent c22735b212
commit 071217f1d4
13 changed files with 66 additions and 86 deletions

View file

@ -36,7 +36,7 @@ namespace sprout {
return base1_type::modulus - 1;
}
public:
struct private_constructor_tag {};
struct private_construct_t {};
private:
base1_type mlcg1_;
base2_type mlcg2_;
@ -44,7 +44,7 @@ namespace sprout {
SPROUT_CONSTEXPR additive_combine_engine(
base1_type const& mlcg1,
base2_type const& mlcg2,
private_constructor_tag
private_construct_t
)
: mlcg1_(mlcg1)
, mlcg2_(mlcg2)
@ -59,7 +59,7 @@ namespace sprout {
additive_combine_engine(
rnd1.engine(),
rnd2.engine(),
private_constructor_tag()
private_construct_t()
)
);
}

View file

@ -28,7 +28,7 @@ namespace sprout {
public:
typedef IntType result_type;
private:
struct private_constructor_tag {};
struct private_construct_t {};
public:
SPROUT_STATIC_CONSTEXPR IntType multiplier = a;
SPROUT_STATIC_CONSTEXPR IntType increment = b;
@ -56,14 +56,14 @@ namespace sprout {
private:
IntType x_;
private:
SPROUT_CONSTEXPR inversive_congruential_engine(IntType const& x, private_constructor_tag)
SPROUT_CONSTEXPR inversive_congruential_engine(IntType const& x, private_construct_t)
: x_(x)
{}
SPROUT_CONSTEXPR sprout::random::random_result<inversive_congruential_engine>
generate(result_type result) const {
return sprout::random::random_result<inversive_congruential_engine>(
result,
inversive_congruential_engine(result, private_constructor_tag())
inversive_congruential_engine(result, private_construct_t())
);
}
public:

View file

@ -31,7 +31,7 @@ namespace sprout {
public:
typedef UIntType result_type;
private:
struct private_constructor_tag {};
struct private_construct_t {};
public:
SPROUT_STATIC_CONSTEXPR UIntType multiplier = a;
SPROUT_STATIC_CONSTEXPR UIntType increment = c;
@ -60,13 +60,13 @@ namespace sprout {
private:
UIntType x_;
private:
SPROUT_CONSTEXPR linear_congruential_engine(UIntType const& x, private_constructor_tag)
SPROUT_CONSTEXPR linear_congruential_engine(UIntType const& x, private_construct_t)
: x_(x)
{}
SPROUT_CONSTEXPR sprout::random::random_result<linear_congruential_engine> generate(result_type result) const {
return sprout::random::random_result<linear_congruential_engine>(
result,
linear_congruential_engine(result, private_constructor_tag())
linear_congruential_engine(result, private_construct_t())
);
}
public:
@ -141,7 +141,7 @@ namespace sprout {
public:
typedef std::uint32_t result_type;
private:
struct private_constructor_tag {};
struct private_construct_t {};
typedef sprout::random::linear_congruential_engine<
std::uint64_t,
std::uint64_t(0xDEECE66DUL) | (std::uint64_t(0x5) << 32),
@ -161,7 +161,7 @@ namespace sprout {
private:
lcf_type lcf_;
private:
SPROUT_CONSTEXPR rand48(lcf_type const& lcf, private_constructor_tag)
SPROUT_CONSTEXPR rand48(lcf_type const& lcf, private_construct_t)
: lcf_(lcf)
{}
SPROUT_CONSTEXPR sprout::random::random_result<rand48> generate(
@ -170,7 +170,7 @@ namespace sprout {
{
return sprout::random::random_result<rand48>(
lcf_result.result() >> 17,
rand48(lcf_result.engine(), private_constructor_tag())
rand48(lcf_result.engine(), private_construct_t())
);
}
public:

View file

@ -23,7 +23,7 @@ namespace sprout {
public:
typedef UIntType result_type;
private:
struct private_constructor_tag {};
struct private_construct_t {};
public:
SPROUT_STATIC_CONSTEXPR int word_size = w;
SPROUT_STATIC_CONSTEXPR int exponent1 = k;
@ -56,13 +56,13 @@ namespace sprout {
private:
UIntType x_;
private:
SPROUT_CONSTEXPR linear_feedback_shift_engine(UIntType const& x, private_constructor_tag)
SPROUT_CONSTEXPR linear_feedback_shift_engine(UIntType const& x, private_construct_t)
: x_(x)
{}
SPROUT_CONSTEXPR sprout::random::random_result<linear_feedback_shift_engine> generate(result_type result) const {
return sprout::random::random_result<linear_feedback_shift_engine>(
result,
linear_feedback_shift_engine(result, private_constructor_tag())
linear_feedback_shift_engine(result, private_construct_t())
);
}
public:

View file

@ -31,7 +31,7 @@ namespace sprout {
public:
typedef UIntType result_type;
private:
struct private_constructor_tag {};
struct private_construct_t {};
public:
SPROUT_STATIC_CONSTEXPR std::size_t word_size = w;
SPROUT_STATIC_CONSTEXPR std::size_t state_size = n;
@ -86,7 +86,7 @@ namespace sprout {
sprout::array<UIntType, n> x_;
std::size_t i_;
private:
SPROUT_CONSTEXPR mersenne_twister_engine(sprout::array<UIntType, n> const& x, std::size_t i, private_constructor_tag)
SPROUT_CONSTEXPR mersenne_twister_engine(sprout::array<UIntType, n> const& x, std::size_t i, private_construct_t)
: x_(x)
, i_(i)
{}
@ -290,7 +290,7 @@ namespace sprout {
mersenne_twister_engine(
x_,
i_ + 1,
private_constructor_tag()
private_construct_t()
)
);
}
@ -301,7 +301,7 @@ namespace sprout {
args..., x_[m - 1] ^ ((x_[n - 1] & upper_mask) | (x_[0] & lower_mask) >> 1) ^ ((x_[0] & 1) * a)
}},
0,
private_constructor_tag()
private_construct_t()
);
}
template<typename... Args>

View file

@ -32,7 +32,7 @@ namespace sprout {
typedef RealType input_type;
typedef RealType result_type;
private:
struct private_constructor_tag {};
struct private_construct_t {};
public:
//
// param_type
@ -105,7 +105,7 @@ namespace sprout {
SPROUT_CONSTEXPR normal_distribution(
RealType mean, RealType sigma, RealType r1, RealType r2,
RealType cached_rho, bool valid,
private_constructor_tag
private_construct_t
)
: mean_(mean)
, sigma_(sigma)
@ -132,7 +132,7 @@ namespace sprout {
r2,
cached_rho,
valid,
private_constructor_tag()
private_construct_t()
)
);
}

View file

@ -55,7 +55,7 @@ namespace sprout {
typedef UniformRandomNumberGenerator base_type;
typedef typename base_type::result_type result_type;
private:
struct private_constructor_tag {};
struct private_construct_t {};
public:
SPROUT_STATIC_CONSTEXPR std::size_t buffer_size = k;
SPROUT_STATIC_CONSTEXPR std::size_t table_size = k;
@ -97,7 +97,7 @@ namespace sprout {
base_type const& rng,
sprout::array<result_type, k> const& v,
result_type const& y,
private_constructor_tag
private_construct_t
)
: member_type{rng, v, y}
{}
@ -110,7 +110,7 @@ namespace sprout {
rnd.engine(),
sprout::fixed::set(v_, j, rnd.result()),
v_[j],
private_constructor_tag()
private_construct_t()
)
);
}