#include <RandStudentT.h>
- Author
Definition at line 43 of file RandStudentT.h.
◆ RandStudentT() [1/2]
◆ RandStudentT() [2/2]
◆ ~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]
Definition at line 103 of file RandStudentT.cc.
103 {
104
105 double u,v,w;
106
107 do
108 {
109 u = 2.0 * localEngine->flat() - 1.0;
110 v = 2.0 * localEngine->flat() - 1.0;
111 }
112 while ((w = u * u + v * v) > 1.0);
113
114 return(u * std::sqrt( a * ( std::exp(- 2.0 / a * std::log(w)) - 1.0) / w));
115}
◆ fireArray() [1/2]
void CLHEP::RandStudentT::fireArray |
( |
const int |
size, |
|
|
double * |
vect |
|
) |
| |
Definition at line 117 of file RandStudentT.cc.
118{
119 for( double* v = vect; v != vect + size; ++v )
121}
◆ fireArray() [2/2]
void CLHEP::RandStudentT::fireArray |
( |
const int |
size, |
|
|
double * |
vect, |
|
|
double |
a |
|
) |
| |
Definition at line 123 of file RandStudentT.cc.
125{
126 for( double* v = vect; v != vect + size; ++v )
128}
◆ get()
std::istream & CLHEP::RandStudentT::get |
( |
std::istream & |
is | ) |
|
|
virtual |
Reimplemented from CLHEP::HepRandom.
Definition at line 162 of file RandStudentT.cc.
162 {
163 std::string inName;
164 is >> inName;
165 if (inName !=
name()) {
166 is.clear(std::ios::badbit | is.rdstate());
167 std::cerr << "Mismatch when expecting to read state of a "
168 <<
name() <<
" distribution\n"
169 << "Name found was " << inName
170 << "\nistream is left in the badbit state\n";
171 return is;
172 }
174 std::vector<unsigned long> t(2);
176 return is;
177 }
178
179 return is;
180}
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]
◆ put()
std::ostream & CLHEP::RandStudentT::put |
( |
std::ostream & |
os | ) |
const |
|
virtual |
Reimplemented from CLHEP::HepRandom.
Definition at line 144 of file RandStudentT.cc.
144 {
145 long pr=os.precision(20);
146 std::vector<unsigned long> t(2);
147 os <<
" " <<
name() <<
"\n";
148 os << "Uvec" << "\n";
150 os << defaultA << " " << t[0] << " " << t[1] << "\n";
151 os.precision(pr);
152 return os;
153#ifdef REMOVED
154 long pr=os.precision(20);
155 os <<
" " <<
name() <<
"\n";
156 os << defaultA << "\n";
157 os.precision(pr);
158 return os;
159#endif
160}
static std::vector< unsigned long > dto2longs(double d)
◆ shoot() [1/4]
static double CLHEP::RandStudentT::shoot |
( |
| ) |
|
|
inlinestatic |
◆ shoot() [2/4]
Definition at line 47 of file RandStudentT.cc.
47 {
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72 double u,v,w;
73
74
75
76 if( a < 0.0) return (DBL_MAX);
77
78 do
79 {
82 }
83 while ((w = u * u + v * v) > 1.0);
84
85 return(u * std::sqrt( a * ( std::exp(- 2.0 / a * std::log(w)) - 1.0) / w));
86}
static HepRandomEngine * getTheEngine()
◆ shoot() [3/4]
◆ shoot() [4/4]
Definition at line 130 of file RandStudentT.cc.
130 {
131
132 double u,v,w;
133
134 do
135 {
136 u = 2.0 * anEngine->flat() - 1.0;
137 v = 2.0 * anEngine->flat() - 1.0;
138 }
139 while ((w = u * u + v * v) > 1.0);
140
141 return(u * std::sqrt( a * ( std::exp(- 2.0 / a * std::log(w)) - 1.0) / w));
142}
◆ shootArray() [1/2]
void CLHEP::RandStudentT::shootArray |
( |
const int |
size, |
|
|
double * |
vect, |
|
|
double |
a = 1.0 |
|
) |
| |
|
static |
Definition at line 88 of file RandStudentT.cc.
90{
91 for( double* v = vect; v != vect + size; ++v )
93}
◆ shootArray() [2/2]
Definition at line 95 of file RandStudentT.cc.
98{
99 for( double* v = vect; v != vect + size; ++v )
100 *v =
shoot(anEngine,a);
101}
The documentation for this class was generated from the following files: