|
@@ -185,14 +185,21 @@ namespace Lemma {
|
185
|
185
|
// Method: SampleNoise
|
186
|
186
|
//--------------------------------------------------------------------------------------
|
187
|
187
|
VectorXr TEMReceiver::SampleNoise ( ) {
|
188
|
|
- // Consider making these static?
|
|
188
|
+
|
|
189
|
+ /* we have C++-11 now! No Boost!
|
189
|
190
|
boost::mt19937 rng(time(0));
|
190
|
191
|
boost::normal_distribution<> nd(0.0, 1.0);
|
191
|
192
|
boost::variate_generator<boost::mt19937&, boost::normal_distribution<> > var_nor(rng, nd);
|
|
193
|
+ */
|
|
194
|
+
|
|
195
|
+ std::random_device rd;
|
|
196
|
+ std::mt19937 gen(rd());
|
|
197
|
+ std::normal_distribution<> d(0.0, 1.00);
|
192
|
198
|
|
193
|
199
|
VectorXr noise = VectorXr::Zero( windowCentres.size() );
|
194
|
200
|
for (int ii=0; ii<windowCentres.size(); ++ii) {
|
195
|
|
- noise(ii) = var_nor();
|
|
201
|
+ //noise(ii) = var_nor(); // old boost way
|
|
202
|
+ noise(ii) = d(gen);
|
196
|
203
|
}
|
197
|
204
|
return noise.array() * noiseSTD.array();
|
198
|
205
|
} // ----- end of method TEMReceiver::SampleNoise -----
|