mirror of
https://gitlab.com/fbb-git/cppannotations
synced 2024-11-18 10:06:54 +01:00
8881341e24
git-svn-id: https://cppannotations.svn.sourceforge.net/svnroot/cppannotations/trunk@492 f6dd340e-d3f9-0310-b409-bdd246841980
36 lines
1.3 KiB
Text
36 lines
1.3 KiB
Text
The ti(binomial_distribution<IntType = int>) is used to determine the
|
|
probability of the number of successes in a sequence of tt(n) independent
|
|
success/failure experiments, each of which yields success with probability
|
|
tt(p).
|
|
|
|
The template type parameter tt(IntType) defines the type of the generated
|
|
random value, which must be an integral type.
|
|
|
|
Defined types:
|
|
verb(
|
|
typedef IntType result_type;
|
|
struct param_type
|
|
{
|
|
explicit param_type(IntType trials, double prob = 0.5);
|
|
IntType t() const; // returns trials
|
|
double p() const; // returns prob
|
|
};
|
|
)
|
|
|
|
Constructors and members and example:
|
|
itemization(
|
|
itt(binomial_distribution<>(IntType trials = 1, double prob = 0.5))
|
|
constructs a binomial distribution for tt(trials) experiments, each
|
|
having probability tt(prob) of success.
|
|
itt(binomial_distribution<>(param_type const ¶m))
|
|
constructs a binomial distribution according to the values stored in
|
|
the tt(param) struct.
|
|
itt(IntType t() const)nl()
|
|
returns tt(trials);
|
|
itt(double p() const)nl()
|
|
returns tt(prob);
|
|
itt(result_type min() const) nl()
|
|
returns 0;
|
|
itt(result_type max() const)nl()
|
|
returns tt(trials);
|
|
)
|