#include <RandStudentT.h>
- Author
Definition at line 41 of file RandStudentT.h.
◆ RandStudentT() [1/2]
CLHEP::RandStudentT::RandStudentT |
( |
HepRandomEngine & |
anEngine, |
|
|
double |
a = 1.0 |
|
) |
| |
|
inline |
◆ RandStudentT() [2/2]
CLHEP::RandStudentT::RandStudentT |
( |
HepRandomEngine * |
anEngine, |
|
|
double |
a = 1.0 |
|
) |
| |
|
inline |
◆ ~RandStudentT()
CLHEP::RandStudentT::~RandStudentT |
( |
| ) |
|
|
virtual |
◆ distributionName()
static std::string CLHEP::RandStudentT::distributionName |
( |
| ) |
|
|
inlinestatic |
◆ engine()
◆ fire() [1/2]
double CLHEP::RandStudentT::fire |
( |
| ) |
|
|
inline |
◆ fire() [2/2]
double CLHEP::RandStudentT::fire |
( |
double |
a | ) |
|
Definition at line 101 of file RandStudentT.cc.
101 {
102
103 double u,v,w;
104
105 do
106 {
107 u = 2.0 * localEngine->flat() - 1.0;
108 v = 2.0 * localEngine->flat() - 1.0;
109 }
110 while ((w = u * u + v * v) > 1.0);
111
112 return(u * std::sqrt( a * ( std::exp(- 2.0 / a * std::log(w)) - 1.0) / w));
113}
◆ fireArray() [1/2]
void CLHEP::RandStudentT::fireArray |
( |
const int |
size, |
|
|
double * |
vect |
|
) |
| |
Definition at line 115 of file RandStudentT.cc.
116{
117 for( double* v = vect; v != vect + size; ++v )
119}
◆ fireArray() [2/2]
void CLHEP::RandStudentT::fireArray |
( |
const int |
size, |
|
|
double * |
vect, |
|
|
double |
a |
|
) |
| |
Definition at line 121 of file RandStudentT.cc.
123{
124 for( double* v = vect; v != vect + size; ++v )
126}
◆ get()
std::istream & CLHEP::RandStudentT::get |
( |
std::istream & |
is | ) |
|
|
virtual |
Reimplemented from CLHEP::HepRandom.
Definition at line 153 of file RandStudentT.cc.
153 {
154 std::string inName;
155 is >> inName;
156 if (inName !=
name()) {
157 is.clear(std::ios::badbit | is.rdstate());
158 std::cerr << "Mismatch when expecting to read state of a "
159 <<
name() <<
" distribution\n"
160 << "Name found was " << inName
161 << "\nistream is left in the badbit state\n";
162 return is;
163 }
165 std::vector<unsigned long> t(2);
167 return is;
168 }
169
170 return is;
171}
static double longs2double(const std::vector< unsigned long > &v)
bool possibleKeywordInput(IS &is, const std::string &key, T &t)
◆ name()
std::string CLHEP::RandStudentT::name |
( |
| ) |
const |
|
virtual |
◆ operator()() [1/2]
double CLHEP::RandStudentT::operator() |
( |
| ) |
|
|
virtual |
◆ operator()() [2/2]
double CLHEP::RandStudentT::operator() |
( |
double |
a | ) |
|
◆ put()
std::ostream & CLHEP::RandStudentT::put |
( |
std::ostream & |
os | ) |
const |
|
virtual |
Reimplemented from CLHEP::HepRandom.
Definition at line 142 of file RandStudentT.cc.
142 {
143 int pr=os.precision(20);
144 std::vector<unsigned long> t(2);
145 os <<
" " <<
name() <<
"\n";
146 os << "Uvec" << "\n";
148 os << defaultA << " " << t[0] << " " << t[1] << "\n";
149 os.precision(pr);
150 return os;
151}
static std::vector< unsigned long > dto2longs(double d)
◆ shoot() [1/4]
static double CLHEP::RandStudentT::shoot |
( |
| ) |
|
|
inlinestatic |
◆ shoot() [2/4]
double CLHEP::RandStudentT::shoot |
( |
double |
a | ) |
|
|
static |
Definition at line 45 of file RandStudentT.cc.
45 {
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70 double u,v,w;
71
72
73
75
76 do
77 {
80 }
81 while ((w = u * u + v * v) > 1.0);
82
83 return(u * std::sqrt( a * ( std::exp(- 2.0 / a * std::log(w)) - 1.0) / w));
84}
static HepRandomEngine * getTheEngine()
◆ shoot() [3/4]
◆ shoot() [4/4]
Definition at line 128 of file RandStudentT.cc.
128 {
129
130 double u,v,w;
131
132 do
133 {
134 u = 2.0 * anEngine->flat() - 1.0;
135 v = 2.0 * anEngine->flat() - 1.0;
136 }
137 while ((w = u * u + v * v) > 1.0);
138
139 return(u * std::sqrt( a * ( std::exp(- 2.0 / a * std::log(w)) - 1.0) / w));
140}
◆ shootArray() [1/2]
void CLHEP::RandStudentT::shootArray |
( |
const int |
size, |
|
|
double * |
vect, |
|
|
double |
a = 1.0 |
|
) |
| |
|
static |
Definition at line 86 of file RandStudentT.cc.
88{
89 for( double* v = vect; v != vect + size; ++v )
91}
◆ shootArray() [2/2]
void CLHEP::RandStudentT::shootArray |
( |
HepRandomEngine * |
anEngine, |
|
|
const int |
size, |
|
|
double * |
vect, |
|
|
double |
a = 1.0 |
|
) |
| |
|
static |
Definition at line 93 of file RandStudentT.cc.
96{
97 for( double* v = vect; v != vect + size; ++v )
98 *v =
shoot(anEngine,a);
99}
The documentation for this class was generated from the following files: