A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.com/reference/random/fisher_f_distribution/fisher_f_distribution/ below:

public member function

<random>

std::fisher_f_distribution::(constructor) (1)
explicit fisher_f_distribution ( result_type m = 1.0, result_type n = 1.0 );
(2)
explicit fisher_f_distribution ( const param_type& parm );

Construct Fisher F-distribution

Constructs a fisher_f_distribution object, adopting the distribution parameters specified either by m and n or by object parm.

Parameters
m
Distribution parameter m, which specifies the numerator's degrees of freedomn.
This shall be a positive value (m>0).
result_type is a member type that represents the type of the random numbers generated on each call to operator(). It is defined as an alias of the first class template parameter (RealType).
n
Distribution parameter n, which specifies the denominator's degrees of freedom.
This shall be a positive value (n>0).
result_type is a member type that represents the type of the random numbers generated on each call to operator(). It is defined as an alias of the first class template parameter (RealType).
parm
An object representing the distribution's parameters, obtained by a call to member function param.
param_type is a member type.

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// fisher_f_distribution example
#include <iostream>
#include <chrono>
#include <random>

int main()
{
  // construct a trivial random generator engine from a time-based seed:
  unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
  std::default_random_engine generator (seed);

  std::fisher_f_distribution<double> distribution (2.0,2.0);

  std::cout << "some F-distributed(2.0,2.0) results:" << std::endl;
  for (int i=0; i<5; ++i)
    std::cout << distribution(generator) << std::endl;

  return 0;
}

Possible output:
some F-distributed(2.0,2.0) results:
0.226118
0.208781
0.0283665
2.15256
0.37961


Complexity Constant.

See also
fisher_f_distribution::reset
Reset distribution (public member function)
fisher_f_distribution::param
Distribution parameters (public member function)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4