[Assorted-commits] SF.net SVN: assorted: [615] cpp-commons/trunk/src/commons/rand.h
Brought to you by:
yangzhang
From: <yan...@us...> - 2008-03-07 02:38:20
|
Revision: 615 http://assorted.svn.sourceforge.net/assorted/?rev=615&view=rev Author: yangzhang Date: 2008-03-06 18:38:20 -0800 (Thu, 06 Mar 2008) Log Message: ----------- inlined rand methods Modified Paths: -------------- cpp-commons/trunk/src/commons/rand.h Modified: cpp-commons/trunk/src/commons/rand.h =================================================================== --- cpp-commons/trunk/src/commons/rand.h 2008-03-06 00:41:49 UTC (rev 614) +++ cpp-commons/trunk/src/commons/rand.h 2008-03-07 02:38:20 UTC (rev 615) @@ -10,11 +10,11 @@ private: unsigned long randx; public: - posix_rand(long s = 0) { randx = s; } - void seed(long s) { randx = s; } - long abs(long x) { return x & 0x7fffffff; } - long draw() { return randx = randx * 1103515245 + 12345; } - long operator()() { return abs(draw()); } + inline posix_rand(long s = 0) { randx = s; } + inline void seed(long s) { randx = s; } + inline long abs(long x) { return x & 0x7fffffff; } + inline long draw() { return randx = randx * 1103515245 + 12345; } + inline long operator()() { return abs(draw()); } }; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |