thrust
|
A discard_block_engine
adapts an existing base random number engine and produces random values by discarding some of the values returned by its base engine. Each cycle of the compound engine begins by returning r
values successively produced by the base engine and ends by discarding p-r
such values. The engine's state is the state of its base engine followed by the number of calls to operator()
that have occurred since the beginning of the current cycle.
More...
#include <thrust/random/discard_block_engine.h>
Public Types | |
typedef Engine | base_type |
The type of the adapted base random number engine. | |
typedef base_type::result_type | result_type |
The type of the unsigned integer produced by this linear_congruential_engine . | |
Public Member Functions | |
__host__ __device__ | discard_block_engine () |
__host__ __device__ | discard_block_engine (const base_type &urng) |
__host__ __device__ | discard_block_engine (result_type s) |
__host__ __device__ void | seed (void) |
__host__ __device__ void | seed (result_type s) |
__host__ __device__ result_type | operator() (void) |
__host__ __device__ void | discard (unsigned long long z) |
__host__ __device__ const base_type & | base (void) const |
Static Public Attributes | |
static const size_t | block_size = p |
static const size_t | used_block = r |
static const result_type | min = base_type::min |
static const result_type | max = base_type::max |
A discard_block_engine
adapts an existing base random number engine and produces random values by discarding some of the values returned by its base engine. Each cycle of the compound engine begins by returning r
values successively produced by the base engine and ends by discarding p-r
such values. The engine's state is the state of its base engine followed by the number of calls to operator()
that have occurred since the beginning of the current cycle.
Engine | The type of the base random number engine to adapt. |
p | The discard cycle length. |
r | The number of values to return of the base engine. Because p-r will be discarded, r <= p . |
The following code snippet shows an example of using a discard_block_engine
instance: