Changeset 3615 in Sophya for trunk/SophyaLib/NTools/perandom.h
- Timestamp:
- May 1, 2009, 1:34:31 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/NTools/perandom.h
r3608 r3615 12 12 #include "tvector.h" 13 13 #include "histos.h" 14 #include "srandgen.h"15 14 #include "classfunc.h" 16 #include <complex>17 15 18 16 namespace SOPHYA { … … 54 52 }; 55 53 56 57 /*!58 \ingroup NTools59 \brief Returns a random complex number such that real and imaginary parts are gaussians with variance sig^260 */61 inline complex< r_8 > ComplexGaussRan(void)62 {return complex< r_8 >(NorRand(),NorRand());}63 inline complex< r_8 > ComplexGaussRan(double sig)64 {return complex< r_8 >(GauRnd(0.,sig),GauRnd(0.,sig));}65 66 /*!67 \ingroup NTools68 \brief Returns the module of a random complex number generated by ComplexGaussRan69 */70 inline double ModComplexGaussRan(double sig=1.)71 {double r=-log(1.-drand01()); return sig*sqrt(2.*r);}72 73 54 } // namespace SOPHYA 74 55
Note:
See TracChangeset
for help on using the changeset viewer.