std::piecew...distribution(3)

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

πŸ’– NAME πŸ’–

std::piecewise_constant_distribution::piecewise_constant_distribution - std::piecewise_constant_distribution::piecewise_constant_distribution β€” okay bestie, yes, it's the same iconic name twice πŸ˜­πŸ‘‘. This is the std::piecew...distribution(3) page from the C++ Standard Libary, and it's literally all about the constructor for std::piecewise_constant_distribution.

✨ Synopsis ✨

Deep breath, bestie β€” here's the whole constructor lineup, every one of them since C++11:

piecewise_constant_distribution();
(1) (since C++11)

template< class InputIt1, class InputIt2 >
piecewise_constant_distribution( InputIt1 first_i, InputIt1 last_i,
                                 InputIt2 first_w );
(2) (since C++11)

template< class UnaryOperation >
piecewise_constant_distribution( std::initializer_list<RealType> ilist_i,
                                 UnaryOperation fw );
(3) (since C++11)

template< class UnaryOperation >
piecewise_constant_distribution( std::size_t nw,
                                 RealType xmin, RealType xmax,
                                 UnaryOperation fw );
(4) (since C++11)

explicit piecewise_constant_distribution( const param_type& param );
(5) (since C++11)

Constructs new piecewise constant distribution object πŸ’…. No cap, that's the whole mood. Here's the vibe check for each one:

  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_i and the weights generated by the function fw 🌸.
  4. Constructs a distribution object with the nw intervals distributed uniformly over [xmin, xmax] and the weights generated by the function fw πŸ”₯.
  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_i β€” 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 πŸ¦‹
  • param β€” the distribution parameter set πŸŽ€

okay bestie, that's the whole page, and it ate πŸ’–. source/version: http://cppreference.com 🌈, date: 2024.06.10 πŸ‘‘. periodt.

πŸ“¦ where this page comes from