From da8ce36d27e960abfb0da23d04f5bc01cead7ffa Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sun, 6 Oct 2002 22:25:38 +0000 Subject: [PATCH] integrate simple compute() function in-class [SVN r15753] --- include/boost/random/subtract_with_carry.hpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/include/boost/random/subtract_with_carry.hpp b/include/boost/random/subtract_with_carry.hpp index 3cce4d2..4e3ede3 100644 --- a/include/boost/random/subtract_with_carry.hpp +++ b/include/boost/random/subtract_with_carry.hpp @@ -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 const unsigned int subtract_with_carry::short_lag; #endif -template -IntType subtract_with_carry::compute(unsigned int index) const -{ - return x[(k+index) % long_lag]; -} - // use a floating-point representation to produce values in [0..1) template