std::piecew...distribution(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’– NAME πŸ’–

okay so bestie, welcome to std::piecew...distribution(3) from the C++ Standard Libary β€” yes, that’s the manual name folded in near the top instead of copying the header line πŸ’…. The actual NAME section is literally:

std::piecewise_linear_distribution::piecewise_linear_distribution β€” std::piecewise_linear_distribution::piecewise_linear_distribution

No cap, that’s the whole name, and it’s giving β€œsay it twice because it’s iconic” ✨


✨ Synopsis ✨

Here’s the constructor lineup, all (since C++11) β€” main character energy only 🫢

piecewise_linear_distribution();

(1) (since C++11)

template< class InputIt1, class InputIt2 >
piecewise_linear_distribution( InputIt1 first_i, InputIt1 last_i,
                               InputIt2 first_w );

(2) (since C++11)

template< class UnaryOperation >
piecewise_linear_distribution( std::initializer_list<RealType> ilist,
                               UnaryOperation fw );

(3) (since C++11)

template< class UnaryOperation >
piecewise_linear_distribution( std::size_t nw,
                               RealType xmin, RealType xmax,
                               UnaryOperation fw );

(4) (since C++11)

explicit piecewise_linear_distribution( const param_type& parm );

(5) (since C++11)


Constructs new piecewise linear distribution object. πŸŽ€ That’s the description, and here’s the numbered tea, fr fr:

  1. Constructs a distribution object with n = 1, ρ0 = 1, b0 = 0, and b1 = 1.
  2. Constructs a distribution object from iterators over the interval sequence [first_i, last_i) and a matching weight sequence starting at first_w.
  3. Constructs a distribution object where the intervals are taken from the initializer list ilist and the weights generated by the function fw.
  4. Constructs a distribution object with the fw intervals distributed uniformly over [xmin, xmax].
  5. Constructs a distribution object initialized with the parameters param.

🌸 Parameters 🌸

  • first_i β€” iterator initialized to the start of the interval sequence
  • last_i β€” iterator initialized to one-past-the-end of the interval sequence
  • first_w β€” iterator initialized to the start of the density (weight) sequence
  • ilist β€” initializer_list yielding the interval sequence
  • fw β€” double(double) function yielding the densities
  • nw β€” the number of densities
  • xmin β€” the lower bound of the interval sequence
  • xmax β€” the upper bound of the interval sequence
  • parm β€” the distribution parameter set

bestie, that’s the whole vibe check πŸ’– source/version and date at the very end: http://cppreference.com, 2024.06.10, and the manual name std::piecew...distribution(3). periodt 🌈✨

πŸ“¦ where this page comes from