File: bernoulli.yo

package info (click to toggle)
c%2B%2B-annotations 13.02.02-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,576 kB
  • sloc: cpp: 25,297; makefile: 1,523; ansic: 165; sh: 126; perl: 90; fortran: 27
file content (26 lines) | stat: -rw-r--r-- 855 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
The ti(bernoulli_distribution) is used to generate logical truth (boolean)
values with a certain probability tt(p). It is equal to a binomial
distribution for one experiment (cf ref(BINOMIAL)).

The bernoulli distribution is em(not) defined as a class template.

Defined types:
            verb(    using result_type = bool;
    struct param_type
    {
      explicit param_type(double prob = 0.5);
      double p() const;                     // returns prob
    };)

Constructor and members:
    itemization(
    itt(bernoulli_distribution(double prob = 0.5))nl()
        constructs a bernoulli distribution with probability tt(prob) of
        returning tt(true);
    itt(double p() const)nl()
        returns tt(prob);
    itt(result_type min() const)nl()
        returns tt(false);
    itt(result_type max() const)nl()
        returns tt(true);
    )