Count Engine Adaptor#
count_engine_adaptor is a random number engine adaptor that counts how many times
random 32 bits were taken from the engine during the generate call.
Description#
This adaptor allows users to query the number of random numbers generated by
an engine during the generate call. Especially it’s especially useful for
distributions based on acceptance-rejection algorithms, such as beta, gamma.
API#
Syntax#
namespace oneapi::mkl::rng::device {
template <typename Engine>
class count_engine_adaptor {
public:
static constexpr std::int32_t vec_size = Engine::vec_size;
// ctors
explicit count_engine_adaptor(const Engine& engine);
explicit count_engine_adaptor(Engine&& engine);
template <typename... Params>
count_engine_adaptor(Params... params);
// getters
std::int64_t get_count() const;
const Engine& base() const;
};
}
Include Files#
oneapi/mkl/rng/device.hpp
Template Parameters#
|
Type of the provided random engine |
Constructors Input Parameters#
Name |
Type |
Description |
|---|---|---|
engine |
|
Constructs the adaptor over |
params |
|
Constructs the adaptor generating an engine inside. |
Getters#
std::size_t get_count() const
This method returns the count of random numbers generated by generate.
const Engine& base() const
Returns the underlying random engine.