STD::PIECEWISE_CONSTANT_DISTRIBUTION(3cxx)

πŸ’– NAME πŸ’–

Okay bestie, this is the 3cxx manual page for std::piecewise_constant_distribution< _RealType > πŸ’… and it is literally a piecewise_constant_distribution random number distribution. That's the whole vibe.

  • std::piecewise_constant_distribution< _RealType > β€” A piecewise_constant_distribution random number distribution. Periodt.

✨ SYNOPSIS ✨

Include this first, no cap:

#include <random>

πŸŽ€ Classes

  • struct param_type

🌸 Public Types

  • typedef _RealType result_type

πŸ¦‹ Public Member Functions

Here's the full function lineup, copied exactly because we do not play with signatures:

       template<typename _InputIteratorB , typename _InputIteratorW >
           piecewise_constant_distribution (_InputIteratorB __bfirst,
           _InputIteratorB __bend, _InputIteratorW __wbegin)
       piecewise_constant_distribution (const param_type &__p)
       template<typename _Func > piecewise_constant_distribution
           (initializer_list< _RealType > __bl, _Func __fw)
       template<typename _Func > piecewise_constant_distribution (size_t __nw,
           _RealType __xmin, _RealType __xmax, _Func __fw)
       template<typename _ForwardIterator , typename
           _UniformRandomNumberGenerator > void __generate (_ForwardIterator
           __f, _ForwardIterator __t, _UniformRandomNumberGenerator &__urng)
       template<typename _ForwardIterator , typename
           _UniformRandomNumberGenerator > void __generate (_ForwardIterator
           __f, _ForwardIterator __t, _UniformRandomNumberGenerator &__urng,
           const param_type &__p)
       template<typename _UniformRandomNumberGenerator > void __generate
           (result_type *__f, result_type *__t, _UniformRandomNumberGenerator
           &__urng, const param_type &__p)
       std::vector< double > densities () const
       std::vector< _RealType > intervals () const
       result_type max () const
       result_type min () const
       template<typename _UniformRandomNumberGenerator > result_type operator()
           (_UniformRandomNumberGenerator &__urng)
       template<typename _UniformRandomNumberGenerator > result_type operator()
           (_UniformRandomNumberGenerator &__urng, const param_type &__p)
       param_type param () const
       void param (const param_type &__param)
       void reset ()

Vibe check on the ones with blurbs:

  • densities () const β€” returns a vector of the probability densities.
  • intervals () const β€” returns a vector of the intervals.
  • max () const β€” gives you the least upper bound value of the distribution.
  • min () const β€” gives you the greatest lower bound value of the distribution.
  • operator() (_UniformRandomNumberGenerator &__urng) β€” generating functions.
  • param () const β€” returns the parameter set of the distribution.
  • param (const param_type &__param) β€” sets the parameter set of the distribution.
  • reset () β€” resets the distribution state.

🫢 Friends

The friend lineup, again exactly as written:

       template<typename _RealType1 , typename _CharT , typename _Traits >
           std::basic_ostream< _CharT, _Traits > & operator<<
           (std::basic_ostream< _CharT, _Traits > &__os, const
           std::piecewise_constant_distribution< _RealType1 > &__x)
       bool operator== (const piecewise_constant_distribution &__d1, const
           piecewise_constant_distribution &__d2)
       template<typename _RealType1 , typename _CharT , typename _Traits >
           std::basic_istream< _CharT, _Traits > & operator>>
           (std::basic_istream< _CharT, _Traits > &__is,
           std::piecewise_constant_distribution< _RealType1 > &__x)
  • operator<< β€” inserts a piecewise_constant_distribution random number distribution __x into the output stream __os.
  • operator== β€” returns true if two piecewise constant distributions have the same parameters.
  • operator>> β€” extracts a piecewise_constant_distribution random number distribution __x from the input stream __is.

πŸ¦‹ Detailed Description πŸ¦‹

The class template situation is:

   template<typename _RealType = double>
       class std::piecewise_constant_distribution< _RealType >"A
       piecewise_constant_distribution random number distribution.

       This distribution produces random numbers $ x, b_0  x < b_n $, uniformly
       distributed over each subinterval ho_{n-1})_{i+1}) $ according to the
       probability mass fuho_{i+1},].for $ b_i  x < b_{i+1} $.
         p(x ho_i0, ...,+b_n,
           =
Bestie, the formula in the source is genuinely garbled in the original page. I'm keeping it exactly as-is so no details disappear. πŸ’€

Since: C++11

πŸŽ€ Member Typedef Documentation πŸŽ€

   template<typename _RealType  = double> typedef _RealType
       std::piecewise_constant_distribution< _RealType >::result_type

The type of the range of the distribution. Iconic.

🌈 Member Function Documentation 🌈

πŸ’– densities

   template<typename _RealType  = double> std::vector< double >
       std::piecewise_constant_distribution< _RealType >::densities () const
       [inline]

Returns a vector of the probability densities.

References std::vector< _Tp, _Alloc >::empty().

πŸ¦‹ intervals

   template<typename _RealType  = double> std::vector< _RealType >
       std::piecewise_constant_distribution< _RealType >::intervals () const
       [inline]

Returns a vector of the intervals.

References std::vector< _Tp, _Alloc >::empty().

⭐ max

   template<typename _RealType  = double> result_type
       std::piecewise_constant_distribution< _RealType >::max () const [inline]

Returns the least upper bound value of the distribution.

References std::vector< _Tp, _Alloc >::back(), and std::vector< _Tp, _Alloc >::empty().

🌸 min

   template<typename _RealType  = double> result_type
       std::piecewise_constant_distribution< _RealType >::min () const [inline]

Returns the greatest lower bound value of the distribution.

References std::vector< _Tp, _Alloc >::empty(), and std::vector< _Tp, _Alloc >::front().

πŸ”₯ operator()

   template<typename _RealType  = double> template<typename
       _UniformRandomNumberGenerator > result_type
       std::piecewise_constant_distribution< _RealType >::operator()
       (_UniformRandomNumberGenerator & __urng) [inline]

Generating functions.

References std::piecewise_constant_distribution< _RealType >::operator()().

Referenced by std::piecewise_constant_distribution< _RealType >::operator()().

πŸŽ€ param (getter)

   template<typename _RealType  = double> param_type
       std::piecewise_constant_distribution< _RealType >::param () const
       [inline]

Returns the parameter set of the distribution.

πŸ’… param (setter)

   template<typename _RealType  = double> void
       std::piecewise_constant_distribution< _RealType >::param (const
       param_type & __param) [inline]

Sets the parameter set of the distribution.

Parameters:

  • __param β€” the new parameter set of the distribution.

🫢 reset

   template<typename _RealType  = double> void
       std::piecewise_constant_distribution< _RealType >::reset () [inline]

Resets the distribution state.

πŸ’œ operator<<

   template<typename _RealType  = double> template<typename _RealType1 ,
       typename _CharT , typename _Traits > std::basic_ostream< _CharT, _Traits
       > & operator<< (std::basic_ostream< _CharT, _Traits > & __os, const
       std::piecewise_constant_distribution< _RealType1 > & __x) [friend]

Inserts a piecewise_constant_distribution random number distribution __x into the output stream __os.

Parameters:

  • __os β€” an output stream.
  • __x β€” a piecewise_constant_distribution random number distribution.

Returns: the output stream with the state of __x inserted or in an error state.

🧚 operator==

   template<typename _RealType  = double> bool operator== (const
       piecewise_constant_distribution< _RealType > & __d1, const
       piecewise_constant_distribution< _RealType > & __d2) [friend]

Return true if two piecewise constant distributions have the same parameters. No cap, that's the whole check.

🌈 operator>>

   template<typename _RealType  = double> template<typename _RealType1 ,
       typename _CharT , typename _Traits > std::basic_istream< _CharT, _Traits
       > & operator>> (std::basic_istream< _CharT, _Traits > & __is,
       std::piecewise_constant_distribution< _RealType1 > & __x) [friend]

Extracts a piecewise_constant_distribution random number distribution __x from the input stream __is.

Parameters:

  • __is β€” an input stream.
  • __x β€” a piecewise_constant_distribution random number generator engine.

Returns: the input stream with __x extracted or in an error state.

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for libstdc++ from the source code.


Cute sign-off β€” source/version: libstdc++ (the footer's libstd energy) and date: not present in the original footer, bestie, so I'm not inventing one πŸ’œ The footer page-tag is the std::piecewise...on< _RealType >(3cxx) situation. 🫢

πŸ“¦ where this page comes from