2
0
mirror of https://github.com/boostorg/random.git synced 2026-02-02 21:12:16 +00:00

integrate simple compute() function in-class

[SVN r15753]
This commit is contained in:
Jens Maurer
2002-10-06 22:25:38 +00:00
parent 45615b25c4
commit da8ce36d27

View File

@@ -168,7 +168,10 @@ public:
private:
// returns x(i-r+index), where index is in 0..r-1
IntType compute(unsigned int index) const;
IntType compute(unsigned int index) const
{
return x[(k+index) % long_lag];
}
// state representation; next output (state) is x(i)
// x[0] ... x[k] x[k+1] ... x[long_lag-1] represents
@@ -205,12 +208,6 @@ template<class IntType, IntType m, unsigned int s, unsigned int r, IntType val>
const unsigned int subtract_with_carry<IntType, m, s, r, val>::short_lag;
#endif
template<class IntType, IntType m, unsigned int s, unsigned int r, IntType val>
IntType subtract_with_carry<IntType, m, s, r, val>::compute(unsigned int index) const
{
return x[(k+index) % long_lag];
}
// use a floating-point representation to produce values in [0..1)
template<class RealType, int w, unsigned int s, unsigned int r, int val=0>