X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=ETL%2Ftags%2FETL_0_04_09%2FETL%2F_random.h;fp=ETL%2Ftags%2FETL_0_04_09%2FETL%2F_random.h;h=0000000000000000000000000000000000000000;hb=3a6643238c67c043fc3592837a05d6d2861967f1;hp=73efa08c04ad803e60b2b70d27628d84559e88c9;hpb=47fce282611fbba1044921d22ca887f9b53ad91a;p=synfig.git diff --git a/ETL/tags/ETL_0_04_09/ETL/_random.h b/ETL/tags/ETL_0_04_09/ETL/_random.h deleted file mode 100644 index 73efa08..0000000 --- a/ETL/tags/ETL_0_04_09/ETL/_random.h +++ /dev/null @@ -1,138 +0,0 @@ -/*! ======================================================================== -** Extended Template and Library -** Random Number Generator Class Implementation -** $Id$ -** -** Copyright (c) 2002 Robert B. Quattlebaum Jr. -** -** This package is free software; you can redistribute it and/or -** modify it under the terms of the GNU General Public License as -** published by the Free Software Foundation; either version 2 of -** the License, or (at your option) any later version. -** -** This package is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** === N O T E S =========================================================== -** -** This is an internal header file, included by other ETL headers. -** You should not attempt to use it directly. -** -** ========================================================================= */ - -/* === S T A R T =========================================================== */ - -#ifndef __ETL__RANDOM_H -#define __ETL__RANDOM_H - -/* === H E A D E R S ======================================================= */ - -/* === M A C R O S ========================================================= */ - -/* === C L A S S E S & S T R U C T S ======================================= */ - -_ETL_BEGIN_NAMESPACE - -/* -class rand_source_xor -{ -public: - typedef int seed_type; - typedef short value_type; - -private: - short entropy_pool[256]; - int pool_index; - -public: - random() - { - seed(0); - mod=offset=0; - } - - void seed(const seed_type &x) - { pool_index=0; } - - void add_entropy(value_type entropy) - { - int i; - for(i=0;iPOOL_SIZE) - pool_index=0; - if(mod) - return entropy_pool[pool_index++]%mod+offset; - return entropy_pool[pool_index++]; - } -}; -*/ - -template -class random -{ -public: - typedef T value_type; - typedef int seed_type; - -private: - value_type entropy_pool[POOL_SIZE]; - int pool_index; - - value_type mod,offset; - -public: - random() - { - seed(0); - mod=offset=0; - } - - void seed(const seed_type &x) - { pool_index=0; } - - void set_range(const value_type &floor,const value_type &ceil) - { mod=ceil-floor; offset=floor; } - - void set_range(const value_type &ceil) - { mod=ceil; } - - void add_entropy(value_type entropy) - { - int i; - for(i=0;iPOOL_SIZE) - pool_index=0; - if(mod) - return entropy_pool[pool_index++]%mod+offset; - return entropy_pool[pool_index++]; - } -}; - -/* === T Y P E D E F S ===================================================== */ - -_ETL_END_NAMESPACE - -/* === E N D =============================================================== */ - -#endif -