diff options
| author | Guillaume Horel <guillaume.horel@serenitascapital.com> | 2016-02-10 11:11:31 -0500 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@serenitascapital.com> | 2016-02-10 11:11:31 -0500 |
| commit | fc58c91b6a87c93ccb0a5fba025cf223716d0f5b (patch) | |
| tree | 50a0b1b2fab18f9a8d1da5fb7d384e4baf316aac | |
| parent | 285fb5cdc5f88d9591c5173c8952931b1d97edeb (diff) | |
| download | projet_C++-fc58c91b6a87c93ccb0a5fba025cf223716d0f5b.tar.gz | |
Fix error reported by -Wall
- initialize the member variables in the order they are declared
| -rw-r--r-- | stratified_sampling.hpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/stratified_sampling.hpp b/stratified_sampling.hpp index 76fafbf..e7b3978 100644 --- a/stratified_sampling.hpp +++ b/stratified_sampling.hpp @@ -40,8 +40,8 @@ struct gaussian_truncated : public var_alea_real ~gaussian_truncated() { gsl_rng_free(gen); } private: + double a, b, mean, sigma2; int seed; - double mean, sigma2, a, b; gsl_rng *gen; }; @@ -58,11 +58,11 @@ struct stratified_sampling { pair<double,double> estimator() const; private: vector<double> p; + vector<L> X; vector<int> M; vector<int> cumM; vector<double> mean; vector<double> sigma2; - vector<L> X; const int I; }; @@ -107,7 +107,7 @@ void stratified_sampling<L>::update(int Nk) { M[i] += floor(current+m[i]) - floor(current); current += m[i]; } - M[I-1]+=Nk-I-floor(current); + M[I-1]+=Nk-I-floor(current); } template <typename L> @@ -164,7 +164,3 @@ pair<double,double> stratified_sampling<L>::estimator() const { } return {est_mean, est_std}; } - - - - |
