STD::CHI_SQUARED_DISTRIBUTION(3)
β¨ std::chi_squared_distribution< _RealType > β¨
okay so bestie, this is a section-3 library manual page straight out of libstdc++, and we're talking about the iconic std::chi_squared_distribution< _RealType > β a whole random number distribution π
. Grab a strawberry drink, we're going in.
π NAME π
std::chi_squared_distribution< _RealType > β a chi_squared_distribution random number distribution. that's it, that's the name, she's serving exactly what it says on the tin π«Ά
πΈ SYNOPSIS πΈ
#include <random>
π¦ Classes π¦
struct param_type
β Public Types β
typedef _RealType result_type
π Public Member Functions π
chi_squared_distribution (_RealType __n)β constructor, takes the__nparameter πchi_squared_distribution (const param_type &__p)β constructor that takes aparam_typeinsteadtemplate<typename _ForwardIterator, typename _UniformRandomNumberGenerator> void __generate (_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator &__urng)β the internal generation hook, iterator-flavoredtemplate<typename _ForwardIterator, typename _UniformRandomNumberGenerator> void __generate (_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator &__urng, const param_type &__p)β same iterator-flavored hook but you also hand it aparam_typetemplate<typename _UniformRandomNumberGenerator> void __generate (result_type *__f, result_type *__t, _UniformRandomNumberGenerator &__urng)β pointer-flavored version of the hooktemplate<typename _UniformRandomNumberGenerator> void __generate (result_type *__f, result_type *__t, _UniformRandomNumberGenerator &__urng, const param_type &__p)β pointer-flavored hook plus aparam_typeresult_type max () constβ returns the least upper bound value of the distributionresult_type min () constβ returns the greatest lower bound value of the distribution_RealType n () constβ hands you back thenπ«template<typename _UniformRandomNumberGenerator> result_type operator() (_UniformRandomNumberGenerator &__urng)β generating functions β¨template<typename _UniformRandomNumberGenerator> result_type operator() (_UniformRandomNumberGenerator &__urng, const param_type &__p)β generating, but with your ownparam_typeparam_type param () constβ returns the parameter set of the distributionvoid param (const param_type &__param)β sets the parameter set of the distributionvoid reset ()β resets the distribution state
π Friends π
template<typename _RealType1, typename _CharT, typename _Traits> std::basic_ostream< _CharT, _Traits > & operator<< (std::basic_ostream< _CharT, _Traits > &__os, const std::chi_squared_distribution< _RealType1 > &__x)β inserts a chi_squared_distribution random number distribution__xinto the output stream__osbool operator== (const chi_squared_distribution &__d1, const chi_squared_distribution &__d2)β returntrueif two Chi-squared distributions have the same parameters and the sequences that would be generated are equaltemplate<typename _RealType1, typename _CharT, typename _Traits> std::basic_istream< _CharT, _Traits > & operator>> (std::basic_istream< _CharT, _Traits > &__is, std::chi_squared_distribution< _RealType1 > &__x)β extracts a chi_squared_distribution random number distribution__xfrom the input stream__is
π Detailed Description π
template<typename _RealType = double>
class std::chi_squared_distribution< _RealType >"A
chi_squared_distribution random number distribution.
(yes the stray "A up there is literally in the page, we don't ask questions, we just respect her π)
The formula for the normal probability mass function is
$p(x|n) = ac{x^{(n/2) - 1}e^{-x/2}}{Gamma(n/2) 2^{n/2}}$
Since
C++11 β she's been around, she's a classic, no cap π
π§ Member Typedef Documentation π§
template<typename _RealType = double> typedef _RealType
std::chi_squared_distribution< _RealType >::result_type
The type of the range of the distribution. that's the vibe, that's the whole job π
πΈ Member Function Documentation πΈ
template<typename _RealType = double> result_type
std::chi_squared_distribution< _RealType >::max () const [inline]
Returns the least upper bound value of the distribution. the ceiling, the limit, the "that's the most you're getting" π₯
template<typename _RealType = double> result_type
std::chi_squared_distribution< _RealType >::min () const [inline]
Returns the greatest lower bound value of the distribution. the floor, the baseline, the starting line β
template<typename _RealType = double> template<typename
_UniformRandomNumberGenerator> result_type
std::chi_squared_distribution< _RealType >::operator()
(_UniformRandomNumberGenerator & __urng) [inline]
Generating functions. this is the one you actually call, bestie π
template<typename _RealType = double> param_type
std::chi_squared_distribution< _RealType >::param () const [inline]
Returns the parameter set of the distribution. all the little settings, in a neat lil bundle π
template<typename _RealType = double> void std::chi_squared_distribution<
_RealType >::param (const param_type & __param) [inline]
Sets the parameter set of the distribution.
Parameters
__paramβ the new parameter set of the distribution.
template<typename _RealType = double> void std::chi_squared_distribution<
_RealType >::reset () [inline]
Resets the distribution state. fresh start, clean slate, main character reinvention energy π
π« Friends And Related Symbol Documentation π«
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::chi_squared_distribution< _RealType1 > & __x) [friend]
Inserts a chi_squared_distribution random number distribution __x into the output stream __os.
Parameters
__osβ an output stream.__xβ a chi_squared_distribution random number distribution.
Returns
The output stream with the state of __x inserted or in an error state.
lowkey important: if things go sideways you don't get a value, you get the stream sitting in an error state. so check it, bestie π
template<typename _RealType = double> bool operator== (const
chi_squared_distribution< _RealType > & __d1, const
chi_squared_distribution< _RealType > & __d2) [friend]
Return true if two Chi-squared distributions have the same parameters and the sequences that would be generated are equal. twin flames fr fr π«Ά
template<typename _RealType = double> template<typename _RealType1, typename
_CharT, typename _Traits> std::basic_istream< _CharT, _Traits > &
operator>> (std::basic_istream< _CharT, _Traits > & __is,
std::chi_squared_distribution< _RealType1 > & __x) [friend]
Extracts a chi_squared_distribution random number distribution __x from the input stream __is.
Parameters
__isβ an input stream.__xβ a chi_squared_distribution random number generator engine.
Returns
The input stream with __x extracted or in an error state.
same deal as the output side: error state is always a possibility. it's giving "read the stream state, don't assume" π
π Author π
Generated automatically by Doxygen for libstdc++ from the source code. not a human, not a poet, just Doxygen doing her thing π
and that's the whole page, periodt β¨ this one came to you courtesy of libstdc++ (that's the footer, she's the source/version, and she's iconic), auto-generated from the source code by Doxygen for the std::chi_s...RealType >(3) page β mwah, take care of her, she's your bestie now ππ
π¦ where this page comes from
- arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 Β· GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
- fedora 44: libstdc++-docs 16.0.1-0.10.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- fedora 44: libstdc++-docs 16.2.1-2.fc44
- fedora 44: libstdc++-docs 16.2.1-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms