.TH "std::normal_distribution< _RealType >" 3cxx "Thu Aug 2 2012" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::normal_distribution< _RealType > \- .SH SYNOPSIS .br .PP .SS "Public Types" .in +1c .ti -1c .RI "typedef _RealType \fBinput_type\fP" .br .ti -1c .RI "typedef _RealType \fBresult_type\fP" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "_RealType \fBmean\fP () const " .br .ti -1c .RI "\fBnormal_distribution\fP (const result_type &__mean=result_type(0), const result_type &__sigma=result_type(1))" .br .ti -1c .RI "template result_type \fBoperator()\fP (_UniformRandomNumberGenerator &__urng)" .br .ti -1c .RI "void \fBreset\fP ()" .br .ti -1c .RI "_RealType \fBsigma\fP () const " .br .in -1c .SS "Friends" .in +1c .ti -1c .RI "template \fBstd::basic_ostream\fP< _CharT, .br _Traits > & \fBoperator<<\fP (\fBstd::basic_ostream\fP< _CharT, _Traits > &__os, const \fBnormal_distribution\fP< _RealType1 > &__x)" .br .ti -1c .RI "template \fBstd::basic_istream\fP< _CharT, .br _Traits > & \fBoperator>>\fP (\fBstd::basic_istream\fP< _CharT, _Traits > &__is, \fBnormal_distribution\fP< _RealType1 > &__x)" .br .in -1c .SH "Detailed Description" .PP .SS "templateclass std::normal_distribution< _RealType >" A normal continuous distribution for random numbers\&. The formula for the normal probability mass function is $ p(x) = \frac{1}{\sigma \sqrt{2 \pi}} e^{- \frac{{x - mean}^ {2}}{2 \sigma ^ {2}} } $\&. .PP Definition at line 2231 of file tr1_impl/random\&. .SH "Constructor & Destructor Documentation" .PP .SS "template \fBstd::normal_distribution\fP< _RealType >::\fBnormal_distribution\fP (const result_type &__mean = \fCresult_type(0)\fP, const result_type &__sigma = \fCresult_type(1)\fP)\fC [inline]\fP, \fC [explicit]\fP" Constructs a normal distribution with parameters $ mean $ and $ \sigma $\&. .PP Definition at line 2244 of file tr1_impl/random\&. .SH "Member Function Documentation" .PP .SS "template _RealType \fBstd::normal_distribution\fP< _RealType >::mean () const\fC [inline]\fP" Gets the mean of the distribution\&. .PP Definition at line 2255 of file tr1_impl/random\&. .SS "template template \fBnormal_distribution\fP< _RealType >::result_type \fBstd::normal_distribution\fP< _RealType >::operator() (_UniformRandomNumberGenerator &__urng)" Polar method due to Marsaglia\&. .PP Devroye, L\&. 'Non-Uniform Random Variates Generation\&.' Springer-Verlag, New York, 1986, Ch\&. V, Sect\&. 4\&.4\&. .PP Definition at line 1390 of file random\&.tcc\&. .PP References std::log(), and std::sqrt()\&. .SS "template void \fBstd::normal_distribution\fP< _RealType >::reset ()\fC [inline]\fP" Resets the distribution\&. .PP Definition at line 2269 of file tr1_impl/random\&. .SS "template _RealType \fBstd::normal_distribution\fP< _RealType >::sigma () const\fC [inline]\fP" Gets the $ \sigma $ of the distribution\&. .PP Definition at line 2262 of file tr1_impl/random\&. .SH "Friends And Related Function Documentation" .PP .SS "template template \fBstd::basic_ostream\fP<_CharT, _Traits>& operator<< (\fBstd::basic_ostream\fP< _CharT, _Traits > &__os, const \fBnormal_distribution\fP< _RealType1 > &__x)\fC [friend]\fP" Inserts a normal_distribution random number distribution \fC__x\fP into the output stream \fC__os\fP\&. .PP \fBParameters:\fP .RS 4 \fI__os\fP An output stream\&. .br \fI__x\fP A normal_distribution random number distribution\&. .RE .PP \fBReturns:\fP .RS 4 The output stream with the state of \fC__x\fP inserted or in an error state\&. .RE .PP .SS "template template \fBstd::basic_istream\fP<_CharT, _Traits>& operator>> (\fBstd::basic_istream\fP< _CharT, _Traits > &__is, \fBnormal_distribution\fP< _RealType1 > &__x)\fC [friend]\fP" Extracts a normal_distribution random number distribution \fC__x\fP from the input stream \fC__is\fP\&. .PP \fBParameters:\fP .RS 4 \fI__is\fP An input stream\&. .br \fI__x\fP A normal_distribution random number generator engine\&. .RE .PP \fBReturns:\fP .RS 4 The input stream with \fC__x\fP extracted or in an error state\&. .RE .PP .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.