File: binomial.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 (34 lines) | stat: -rw-r--r-- 1,294 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
27
28
29
30
31
32
33
34
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(    using result_type =  IntType;
    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 &param))
        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);
    )