Class template bernoulli_distribution
boost::compute::bernoulli_distribution — Produces random boolean values according to the following discrete probability function with parameter p : P(true/p) = p and P(false/p) = (1 - p)
Synopsis
Description
Следующий пример показывает, как настроить распределение бернулли для получения случайных булевых значений с параметром p = 0,25.
bernoulli_distribution
public
construct/copy/destruct
- <
bernoulli_distribution(RealTypep=0.5f);
>Создает новое распределение бернулли.
- <
~bernoulli_distribution();
>Уничтожение объекта<bernoulli_distribution
>.
bernoulli_distribution
public member functions
- <
RealTypep()const;
>Возвращает значение параметра p.
- <
template<typenameOutputIterator,typenameGenerator>
voidgenerate(OutputIteratorfirst,OutputIteratorlast,
Generator&generator,command_queue&queue);
>Генерирует бернулли, распределяет булевы и хранит их в ассортименте [<first
>,<last
>.
bernoulli_distribution
private member functions
- <
BOOST_STATIC_ASSERT_MSG(boost::is_floating_point<RealType>::value,
"Template argument must be a floating point type");
>