ETL  0.04.19
Public Types | Public Member Functions | Private Attributes | List of all members
random< T, POOL_SIZE > Class Template Reference

#include <_random.h>

Public Types

typedef T value_type
typedef int seed_type

Public Member Functions

 random ()
void seed (const seed_type &x __attribute__((unused)))
void set_range (const value_type &floor, const value_type &ceil)
void set_range (const value_type &ceil)
void add_entropy (value_type entropy)
void add_entropy (const char *entropy)
value_type operator() (void)

Private Attributes

value_type entropy_pool [POOL_SIZE]
int pool_index
value_type mod
value_type offset

Detailed Description

template<class T, int POOL_SIZE = 256>
class random< T, POOL_SIZE >

======================================================================== 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.


Definition at line 82 of file _random.h.

Member Typedef Documentation

template<class T , int POOL_SIZE = 256>
typedef T random< T, POOL_SIZE >::value_type

Definition at line 85 of file _random.h.

template<class T , int POOL_SIZE = 256>
typedef int random< T, POOL_SIZE >::seed_type

Definition at line 86 of file _random.h.

Constructor & Destructor Documentation

template<class T , int POOL_SIZE = 256>
random< T, POOL_SIZE >::random ( )
inline

Member Function Documentation

template<class T , int POOL_SIZE = 256>
void random< T, POOL_SIZE >::seed ( const seed_type &x   __attribute__(unused))
inline

Definition at line 101 of file _random.h.

References random< T, POOL_SIZE >::pool_index.

Referenced by random< T, POOL_SIZE >::random().

template<class T , int POOL_SIZE = 256>
void random< T, POOL_SIZE >::set_range ( const value_type floor,
const value_type ceil 
)
inline

Definition at line 104 of file _random.h.

References floor(), random< T, POOL_SIZE >::mod, and random< T, POOL_SIZE >::offset.

template<class T , int POOL_SIZE = 256>
void random< T, POOL_SIZE >::set_range ( const value_type ceil)
inline

Definition at line 107 of file _random.h.

References ceil(), and random< T, POOL_SIZE >::mod.

template<class T , int POOL_SIZE = 256>
void random< T, POOL_SIZE >::add_entropy ( value_type  entropy)
inline

Definition at line 110 of file _random.h.

References random< T, POOL_SIZE >::entropy_pool.

template<class T , int POOL_SIZE = 256>
void random< T, POOL_SIZE >::add_entropy ( const char *  entropy)
inline

Definition at line 117 of file _random.h.

template<class T , int POOL_SIZE = 256>
value_type random< T, POOL_SIZE >::operator() ( void  )
inline

Member Data Documentation

template<class T , int POOL_SIZE = 256>
value_type random< T, POOL_SIZE >::entropy_pool[POOL_SIZE]
private
template<class T , int POOL_SIZE = 256>
int random< T, POOL_SIZE >::pool_index
private

Definition at line 90 of file _random.h.

Referenced by random< T, POOL_SIZE >::operator()(), and random< T, POOL_SIZE >::seed().

template<class T , int POOL_SIZE = 256>
value_type random< T, POOL_SIZE >::mod
private
template<class T , int POOL_SIZE = 256>
value_type random< T, POOL_SIZE >::offset
private

The documentation for this class was generated from the following file: