From 55431ec82f1db436938125d9d6169aab79cbd3d3 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 4 May 2012 18:44:53 +0000 Subject: Two basic random number generators, Cmwc is supposed to be a pretty good one. I need to get the base class and singleton interface in place. --- src/experimental/randomcmwc.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/experimental/randomcmwc.h (limited to 'src/experimental/randomcmwc.h') diff --git a/src/experimental/randomcmwc.h b/src/experimental/randomcmwc.h new file mode 100644 index 0000000..3a05383 --- /dev/null +++ b/src/experimental/randomcmwc.h @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2007-2012 Xagasoft, All rights reserved. + * + * This file is part of the libbu++ library and is released under the + * terms of the license contained in the file LICENSE. + */ +#ifndef BU_RANDOM_CMWC_H +#define BU_RANDOM_CMWC_H + +#include + +namespace Bu +{ + class RandomCmwc + { + public: + RandomCmwc(); + virtual ~RandomCmwc(); + + void seed( int32_t iSeed ); + + int32_t rand(); + + private: + uint32_t *q, c; + }; +}; + +#endif -- cgit v1.2.3