From fc58c91b6a87c93ccb0a5fba025cf223716d0f5b Mon Sep 17 00:00:00 2001 From: Guillaume Horel Date: Wed, 10 Feb 2016 11:11:31 -0500 Subject: Fix error reported by -Wall - initialize the member variables in the order they are declared --- stratified_sampling.hpp | 10 +++------- 1 file 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 estimator() const; private: vector p; + vector X; vector M; vector cumM; vector mean; vector sigma2; - vector X; const int I; }; @@ -107,7 +107,7 @@ void stratified_sampling::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 @@ -164,7 +164,3 @@ pair stratified_sampling::estimator() const { } return {est_mean, est_std}; } - - - - -- cgit v1.2.3-70-g09d2