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__xinto the output stream__os.operator==β returnstrueif two piecewise constant distributions have the same parameters.operator>>β extracts a piecewise_constant_distribution random number distribution__xfrom 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.
π Friends And Related Symbol Documentation π
π 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
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms