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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user