std::distance

Defined in header <iterator> template< class InputIt > typename std::iterator_traits<InputIt>::difference_type distance( InputIt first, InputIt last ); Returns the number of elements between first and last. The behavior is undefined if last is not reachable from first by (possibly repeatedly) incrementing first. (until C++11) If InputIt is not RandomAccessIterator, the behavior is undefined if last is not reachable from first by (possibly repeatedly) inc

std::disjunction

Defined in header <type_traits> template<class... B> struct disjunction; (1) (since C++17) Forms the logical disjunction of the type traits B... . The BaseCharacteristic of a specialization std::disjunction <B1, ..., BN> is the first Bi for which Bi::value != false, or if every Bi::value == false, the BaseCharacteristic is BN. If sizeof...(B) == 0, the BaseCharacteristic is std::false_type. Disjunction is short-circuiting: if there is a template type argument Bi

std::discrete_distribution::reset

void reset(); (since C++11) Resets the internal state of the distribution object. After a call to this function, the next call to operator() on the distribution object will not be dependent on previous calls to operator(). Parameters (none). Return value (none). Complexity Constant.

std::discrete_distribution::probabilities

std::vector<double> probabilities() const; (since C++11) Obtains a std::vector<double> containing the individual probabilities of each integer that is generated by this distribution. Parameters (none). Return value An object of type std::vector<double> Example #include <iostream> #include <vector> #include <random> int main() { std::discrete_distribution<> d({40, 10, 10, 40}); std::vector<double> p = d.probabilities();

std::discrete_distribution::param

param_type param() const; (1) (since C++11) void param( const param_type& params ); (2) (since C++11) Manages the associated distribution parameter set. 1) Returns the associated parameter set. 2) Sets the associated parameter set to params. Parameters params - new contents of the associated parameter set Return value 1) The associated parameter set. 2) (none). Complexity Constant.

std::discrete_distribution::min

result_type min() const; (since C++11) Returns the minimum value potentially generated by the distribution. Parameters (none). Return value The minimum value potentially generated by the distribution. Complexity Constant. See also max returns the maximum potentially generated value (public member function)

std::discrete_distribution::max

result_type max() const; (since C++11) Returns the maximum value potentially generated by the distribution. Parameters (none). Return value The maximum value potentially generated by the distribution. Complexity Constant. See also min returns the minimum potentially generated value (public member function)

std::discrete_distribution::discrete_distribution

discrete_distribution(); (1) (since C++11) template< class InputIt > discrete_distribution( InputIt first, InputIt last ); (2) (since C++11) discrete_distribution( std::initializer_list<double> weights ); (3) (since C++11) template< class UnaryOperation > discrete_distribution( std::size_t count, double xmin, double xmax, UnaryOperation unary_op ); (4) (since C++11) explicit discrete_distribution( const param_type& params );

std::discrete_distribution

Defined in header <random> template< class IntType = int > class discrete_distribution; (since C++11) std::discrete_distribution produces random integers on the interval [0, n), where the probability of each individual integer i is defined as wi/S, that is the weight of the ith integer divided by the sum of all n weights. std::discrete_distribution satisfies all requirements of RandomNumberDistribution. Template parameters IntType - The result type generated b

std::discard_block_engine::seed

void seed(); (1) (since C++11) void seed( result_type value ); (2) (since C++11) template< class Sseq > void seed( Sseq& seq ); (3) (since C++11) Reinitializes the internal state of the underlying engine using a new seed value. 1) Seeds the underlying engine with the default seed value. Effectively calls e.seed(), where e is the underlying engine. 2) Seeds the underlying engine with the seed value s. Effectively calls e.seed(value), where e is the underlying eng