Permalink
Browse files

Fixed minor casting bug in renadom stream and renamed them to camel case

  • Loading branch information...
1 parent d86ed6a commit 9a71ce2666614ed4761d92812cc01435ce57fd31 @miscco committed Sep 26, 2016
Showing with 10 additions and 10 deletions.
  1. +7 −7 Random_Stream.h
  2. +2 −2 Thalamic_Column.cpp
  3. +1 −1 Thalamic_Column.h
View
@@ -29,11 +29,11 @@
#pragma once
#include <random>
-class random_stream_normal {
+class randomStreamNormal {
public:
- explicit random_stream_normal(double mean, double stddev)
+ explicit randomStreamNormal(double mean, double stddev)
: mt(rand()), norm_dist(mean, stddev) {}
- explicit random_stream_normal(double mean, double stddev, double seed)
+ explicit randomStreamNormal(double mean, double stddev, double seed)
: mt(seed), norm_dist(mean, stddev) {}
double operator ()(void) { return norm_dist(mt); }
@@ -42,14 +42,14 @@ class random_stream_normal {
std::normal_distribution<double> norm_dist;
};
-class random_stream_uniform_int {
+class randomStreamUniformInt {
public:
- explicit random_stream_uniform_int(int lower_bound, int upper_bound)
+ explicit randomStreamUniformInt(int lower_bound, int upper_bound)
: mt(rand()), uniform_dist(lower_bound, upper_bound) {}
- explicit random_stream_uniform_int(int lower_bound, int upper_bound, double seed)
+ explicit randomStreamUniformInt(int lower_bound, int upper_bound, double seed)
: mt(seed), uniform_dist(lower_bound, upper_bound) {}
- double operator ()(void) { return uniform_dist(mt); }
+ int operator ()(void) { return uniform_dist(mt); }
private:
std::mt19937_64 mt;
std::uniform_int_distribution<> uniform_dist;
View
@@ -44,10 +44,10 @@ void Thalamic_Column::set_RNG(void) {
Rand_vars.reserve(2*numRandomVariables);
for (unsigned i=0; i < numRandomVariables; ++i){
/* Add the RNG for I_{l}*/
- MTRands.push_back(random_stream_normal(0.0, dphi*dt));
+ MTRands.push_back(randomStreamNormal(0.0, dphi*dt));
/* Add the RNG for I_{l,0} */
- MTRands.push_back(random_stream_normal(0.0, dt));
+ MTRands.push_back(randomStreamNormal(0.0, dt));
/* Get the random number for the first iteration */
Rand_vars.push_back(MTRands[2*i]());
View
@@ -191,7 +191,7 @@ class Thalamic_Column {
const std::vector<double> B = {0.75, 0.75, 0.0, 0.0};
/* Random number generators */
- std::vector<random_stream_normal> MTRands;
+ std::vector<randomStreamNormal> MTRands;
/* Container for noise */
std::vector<double> Rand_vars;

0 comments on commit 9a71ce2

Please sign in to comment.