From 9bf6bc8933de87c41c8245b553f777a8bbdcab7f Mon Sep 17 00:00:00 2001 From: cvs2svn Date: Sat, 27 May 2000 02:25:29 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'gcc-vendor-gcc_2_95_cvs_20000526'. --- contrib/libg++/libstdc++/stl/random.cc | 60 ---------------------------------- 1 file changed, 60 deletions(-) delete mode 100644 contrib/libg++/libstdc++/stl/random.cc (limited to 'contrib/libg++/libstdc++/stl/random.cc') diff --git a/contrib/libg++/libstdc++/stl/random.cc b/contrib/libg++/libstdc++/stl/random.cc deleted file mode 100644 index e79872ca49b17..0000000000000 --- a/contrib/libg++/libstdc++/stl/random.cc +++ /dev/null @@ -1,60 +0,0 @@ -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - */ - -#include - -#define __SEED 161803398 - -class __random_generator { -protected: - unsigned long table[55]; - size_t index1; - size_t index2; -public: - unsigned long operator()(unsigned long limit) { - index1 = (index1 + 1) % 55; - index2 = (index2 + 1) % 55; - table[index1] = table[index1] - table[index2]; - return table[index1] % limit; - } - void seed(unsigned long j); - __random_generator(unsigned long j) { seed(j); } -}; - -void __random_generator::seed(unsigned long j) { - unsigned long k = 1; - table[54] = j; - for (size_t i = 0; i < 54; i++) { - size_t ii = 21 * i % 55; - table[ii] = k; - k = j - k; - j = table[ii]; - } - for (int loop = 0; loop < 4; loop++) { - for (size_t i = 0; i < 55; i++) - table[i] = table[i] - table[(1 + i + 30) % 55]; - } - index1 = 0; - index2 = 31; -} - -static __random_generator rd(__SEED); - -unsigned long __long_random(unsigned long limit) { - return rd(limit); -} - - - -- cgit v1.2.3