aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--stratified_sampling.hpp10
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};
}
-
-
-
-