add sprout/bitset.hpp

This commit is contained in:
bolero-MURAKAMI 2012-06-17 19:14:38 +09:00
parent 955561e36c
commit a2888b19bb
10 changed files with 1457 additions and 32 deletions

1424
sprout/bitset.hpp Normal file

File diff suppressed because it is too large Load diff

View file

@ -5,5 +5,6 @@
#include <sprout/functional/bit_and.hpp> #include <sprout/functional/bit_and.hpp>
#include <sprout/functional/bit_or.hpp> #include <sprout/functional/bit_or.hpp>
#include <sprout/functional/bit_xor.hpp> #include <sprout/functional/bit_xor.hpp>
#include <sprout/functional/bit_not.hpp>
#endif // #ifndef SPROUT_FUNCTIONAL_BITWISE_HPP #endif // #ifndef SPROUT_FUNCTIONAL_BITWISE_HPP

View file

@ -73,10 +73,10 @@ namespace sprout {
{ {
return lhs << rhs.p_; return lhs << rhs.p_;
} }
SPROUT_CONSTEXPR friend bool operator==(param_type const& lhs, param_type const& rhs) { friend SPROUT_CONSTEXPR bool operator==(param_type const& lhs, param_type const& rhs) {
return lhs.p_ == rhs.p_; return lhs.p_ == rhs.p_;
} }
SPROUT_CONSTEXPR friend bool operator!=(param_type const& lhs, param_type const& rhs) { friend SPROUT_CONSTEXPR bool operator!=(param_type const& lhs, param_type const& rhs) {
return !(lhs == rhs); return !(lhs == rhs);
} }
}; };
@ -146,10 +146,10 @@ namespace sprout {
{ {
return lhs << rhs.param(); return lhs << rhs.param();
} }
SPROUT_CONSTEXPR friend bool operator==(bernoulli_distribution const& lhs, bernoulli_distribution const& rhs) { friend SPROUT_CONSTEXPR bool operator==(bernoulli_distribution const& lhs, bernoulli_distribution const& rhs) {
return lhs.param() == rhs.param(); return lhs.param() == rhs.param();
} }
SPROUT_CONSTEXPR friend bool operator!=(bernoulli_distribution const& lhs, bernoulli_distribution const& rhs) { friend SPROUT_CONSTEXPR bool operator!=(bernoulli_distribution const& lhs, bernoulli_distribution const& rhs) {
return !(lhs == rhs); return !(lhs == rhs);
} }
}; };

View file

@ -131,10 +131,10 @@ namespace sprout {
{ {
return lhs << rhs.t_ << " " << rhs.p_; return lhs << rhs.t_ << " " << rhs.p_;
} }
SPROUT_CONSTEXPR friend bool operator==(param_type const& lhs, param_type const& rhs) { friend SPROUT_CONSTEXPR bool operator==(param_type const& lhs, param_type const& rhs) {
return lhs.t_ == rhs.t_ && lhs.p_ == rhs.p_; return lhs.t_ == rhs.t_ && lhs.p_ == rhs.p_;
} }
SPROUT_CONSTEXPR friend bool operator!=(param_type const& lhs, param_type const& rhs) { friend SPROUT_CONSTEXPR bool operator!=(param_type const& lhs, param_type const& rhs) {
return !(lhs == rhs); return !(lhs == rhs);
} }
}; };
@ -442,10 +442,10 @@ namespace sprout {
{ {
return lhs << rhs.param(); return lhs << rhs.param();
} }
SPROUT_CONSTEXPR friend bool operator==(binomial_distribution const& lhs, binomial_distribution const& rhs) { friend SPROUT_CONSTEXPR bool operator==(binomial_distribution const& lhs, binomial_distribution const& rhs) {
return lhs.param() == rhs.param(); return lhs.param() == rhs.param();
} }
SPROUT_CONSTEXPR friend bool operator!=(binomial_distribution const& lhs, binomial_distribution const& rhs) { friend SPROUT_CONSTEXPR bool operator!=(binomial_distribution const& lhs, binomial_distribution const& rhs) {
return !(lhs == rhs); return !(lhs == rhs);
} }
}; };

View file

@ -77,10 +77,10 @@ namespace sprout {
{ {
return lhs << rhs.p_; return lhs << rhs.p_;
} }
SPROUT_CONSTEXPR friend bool operator==(param_type const& lhs, param_type const& rhs) { friend SPROUT_CONSTEXPR bool operator==(param_type const& lhs, param_type const& rhs) {
return lhs.p_ == rhs.p_; return lhs.p_ == rhs.p_;
} }
SPROUT_CONSTEXPR friend bool operator!=(param_type const& lhs, param_type const& rhs) { friend SPROUT_CONSTEXPR bool operator!=(param_type const& lhs, param_type const& rhs) {
return !(lhs == rhs); return !(lhs == rhs);
} }
}; };
@ -162,10 +162,10 @@ namespace sprout {
{ {
return lhs << rhs.param(); return lhs << rhs.param();
} }
SPROUT_CONSTEXPR friend bool operator==(geometric_distribution const& lhs, geometric_distribution const& rhs) { friend SPROUT_CONSTEXPR bool operator==(geometric_distribution const& lhs, geometric_distribution const& rhs) {
return lhs.param() == rhs.param(); return lhs.param() == rhs.param();
} }
SPROUT_CONSTEXPR friend bool operator!=(geometric_distribution const& lhs, geometric_distribution const& rhs) { friend SPROUT_CONSTEXPR bool operator!=(geometric_distribution const& lhs, geometric_distribution const& rhs) {
return !(lhs == rhs); return !(lhs == rhs);
} }
}; };

View file

@ -91,10 +91,10 @@ namespace sprout {
{ {
return lhs << rhs.mean_ << " " << rhs.sigma_; return lhs << rhs.mean_ << " " << rhs.sigma_;
} }
SPROUT_CONSTEXPR friend bool operator==(param_type const& lhs, param_type const& rhs) { friend SPROUT_CONSTEXPR bool operator==(param_type const& lhs, param_type const& rhs) {
return lhs.mean_ == rhs.mean_ && lhs.sigma_ == rhs.sigma_; return lhs.mean_ == rhs.mean_ && lhs.sigma_ == rhs.sigma_;
} }
SPROUT_CONSTEXPR friend bool operator!=(param_type const& lhs, param_type const& rhs) { friend SPROUT_CONSTEXPR bool operator!=(param_type const& lhs, param_type const& rhs) {
return !(lhs == rhs); return !(lhs == rhs);
} }
}; };
@ -239,10 +239,10 @@ namespace sprout {
{ {
return lhs << rhs.param() << " " << rhs.valid_ << " " << rhs.cached_rho_ << " " << rhs.r1_ << " " << rhs.r2_; return lhs << rhs.param() << " " << rhs.valid_ << " " << rhs.cached_rho_ << " " << rhs.r1_ << " " << rhs.r2_;
} }
SPROUT_CONSTEXPR friend bool operator==(normal_distribution const& lhs, normal_distribution const& rhs) { friend SPROUT_CONSTEXPR bool operator==(normal_distribution const& lhs, normal_distribution const& rhs) {
return lhs.param() == rhs.param() && lhs.valid_ == rhs.valid_ && lhs.cached_rho_ == rhs.cached_rho_ && lhs.r1_ == rhs.r1_ && lhs.r2_ == rhs.r2_; return lhs.param() == rhs.param() && lhs.valid_ == rhs.valid_ && lhs.cached_rho_ == rhs.cached_rho_ && lhs.r1_ == rhs.r1_ && lhs.r2_ == rhs.r2_;
} }
SPROUT_CONSTEXPR friend bool operator!=(normal_distribution const& lhs, normal_distribution const& rhs) { friend SPROUT_CONSTEXPR bool operator!=(normal_distribution const& lhs, normal_distribution const& rhs) {
return !(lhs == rhs); return !(lhs == rhs);
} }
}; };

View file

@ -41,10 +41,10 @@ namespace sprout {
{ {
return lhs; return lhs;
} }
SPROUT_CONSTEXPR friend bool operator==(param_type const& lhs, param_type const& rhs) { friend SPROUT_CONSTEXPR bool operator==(param_type const& lhs, param_type const& rhs) {
return true; return true;
} }
SPROUT_CONSTEXPR friend bool operator!=(param_type const& lhs, param_type const& rhs) { friend SPROUT_CONSTEXPR bool operator!=(param_type const& lhs, param_type const& rhs) {
return !(lhs == rhs); return !(lhs == rhs);
} }
}; };
@ -116,10 +116,10 @@ namespace sprout {
{ {
return lhs; return lhs;
} }
SPROUT_CONSTEXPR friend bool operator==(uniform_01 const& lhs, uniform_01 const& rhs) { friend SPROUT_CONSTEXPR bool operator==(uniform_01 const& lhs, uniform_01 const& rhs) {
return true; return true;
} }
SPROUT_CONSTEXPR friend bool operator!=(uniform_01 const& lhs, uniform_01 const& rhs) { friend SPROUT_CONSTEXPR bool operator!=(uniform_01 const& lhs, uniform_01 const& rhs) {
return !(lhs == rhs); return !(lhs == rhs);
} }
}; };

View file

@ -455,10 +455,10 @@ namespace sprout {
{ {
return lhs << rhs.min_ << " " << rhs.max_; return lhs << rhs.min_ << " " << rhs.max_;
} }
SPROUT_CONSTEXPR friend bool operator==(param_type const& lhs, param_type const& rhs) { friend SPROUT_CONSTEXPR bool operator==(param_type const& lhs, param_type const& rhs) {
return lhs.min_ == rhs.min_ && lhs.max_ == rhs.max_; return lhs.min_ == rhs.min_ && lhs.max_ == rhs.max_;
} }
SPROUT_CONSTEXPR friend bool operator!=(param_type const& lhs, param_type const& rhs) { friend SPROUT_CONSTEXPR bool operator!=(param_type const& lhs, param_type const& rhs) {
return !(lhs == rhs); return !(lhs == rhs);
} }
}; };
@ -530,10 +530,10 @@ namespace sprout {
{ {
return lhs << rhs.param(); return lhs << rhs.param();
} }
SPROUT_CONSTEXPR friend bool operator==(uniform_int_distribution const& lhs, uniform_int_distribution const& rhs) { friend SPROUT_CONSTEXPR bool operator==(uniform_int_distribution const& lhs, uniform_int_distribution const& rhs) {
return lhs.param() == rhs.param(); return lhs.param() == rhs.param();
} }
SPROUT_CONSTEXPR friend bool operator!=(uniform_int_distribution const& lhs, uniform_int_distribution const& rhs) { friend SPROUT_CONSTEXPR bool operator!=(uniform_int_distribution const& lhs, uniform_int_distribution const& rhs) {
return !(lhs == rhs); return !(lhs == rhs);
} }
}; };

View file

@ -247,10 +247,10 @@ namespace sprout {
{ {
return lhs << rhs.min_ << " " << rhs.max_; return lhs << rhs.min_ << " " << rhs.max_;
} }
SPROUT_CONSTEXPR friend bool operator==(param_type const& lhs, param_type const& rhs) { friend SPROUT_CONSTEXPR bool operator==(param_type const& lhs, param_type const& rhs) {
return lhs.min_ == rhs.min_ && lhs.max_ == rhs.max_; return lhs.min_ == rhs.min_ && lhs.max_ == rhs.max_;
} }
SPROUT_CONSTEXPR friend bool operator!=(param_type const& lhs, param_type const& rhs) { friend SPROUT_CONSTEXPR bool operator!=(param_type const& lhs, param_type const& rhs) {
return !(lhs == rhs); return !(lhs == rhs);
} }
}; };
@ -322,10 +322,10 @@ namespace sprout {
{ {
return lhs << rhs.param(); return lhs << rhs.param();
} }
SPROUT_CONSTEXPR friend bool operator==(uniform_real_distribution const& lhs, uniform_real_distribution const& rhs) { friend SPROUT_CONSTEXPR bool operator==(uniform_real_distribution const& lhs, uniform_real_distribution const& rhs) {
return lhs.param() == rhs.param(); return lhs.param() == rhs.param();
} }
SPROUT_CONSTEXPR friend bool operator!=(uniform_real_distribution const& lhs, uniform_real_distribution const& rhs) { friend SPROUT_CONSTEXPR bool operator!=(uniform_real_distribution const& lhs, uniform_real_distribution const& rhs) {
return !(lhs == rhs); return !(lhs == rhs);
} }
}; };

View file

@ -85,10 +85,10 @@ namespace sprout {
{ {
return lhs << rhs.min_ << " " << rhs.max_; return lhs << rhs.min_ << " " << rhs.max_;
} }
SPROUT_CONSTEXPR friend bool operator==(param_type const& lhs, param_type const& rhs) { friend SPROUT_CONSTEXPR bool operator==(param_type const& lhs, param_type const& rhs) {
return lhs.min_ == rhs.min_ && lhs.max_ == rhs.max_; return lhs.min_ == rhs.min_ && lhs.max_ == rhs.max_;
} }
SPROUT_CONSTEXPR friend bool operator!=(param_type const& lhs, param_type const& rhs) { friend SPROUT_CONSTEXPR bool operator!=(param_type const& lhs, param_type const& rhs) {
return !(lhs == rhs); return !(lhs == rhs);
} }
}; };
@ -258,10 +258,10 @@ namespace sprout {
{ {
return lhs << rhs.param(); return lhs << rhs.param();
} }
SPROUT_CONSTEXPR friend bool operator==(uniform_smallint const& lhs, uniform_smallint const& rhs) { friend SPROUT_CONSTEXPR bool operator==(uniform_smallint const& lhs, uniform_smallint const& rhs) {
return lhs.param() == rhs.param(); return lhs.param() == rhs.param();
} }
SPROUT_CONSTEXPR friend bool operator!=(uniform_smallint const& lhs, uniform_smallint const& rhs) { friend SPROUT_CONSTEXPR bool operator!=(uniform_smallint const& lhs, uniform_smallint const& rhs) {
return !(lhs == rhs); return !(lhs == rhs);
} }
}; };