diff options
| author | Bertrand <bertrand.horel@gmail.com> | 2016-02-26 15:17:01 +0000 |
|---|---|---|
| committer | Bertrand <bertrand.horel@gmail.com> | 2016-02-26 15:17:01 +0000 |
| commit | e21e4882c9755a4b8e8194a79ecf5702fc935248 (patch) | |
| tree | 7d32df6f0ddfda7ccc60f81465cf896a6ae243e5 /src/stratified_sampling.hpp | |
| parent | 4909d262ba578dc71b7431bd3f3c2ef9b3132384 (diff) | |
| download | projet_C++-e21e4882c9755a4b8e8194a79ecf5702fc935248.tar.gz | |
on utilise plus .current et on améliore exemple 2
Diffstat (limited to 'src/stratified_sampling.hpp')
| -rw-r--r-- | src/stratified_sampling.hpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/stratified_sampling.hpp b/src/stratified_sampling.hpp index ed53b6d..c04369e 100644 --- a/src/stratified_sampling.hpp +++ b/src/stratified_sampling.hpp @@ -141,8 +141,9 @@ void stratified_sampling<L>::draw(int N) { m=0; s=0; for(int j=0;j<M[i];j++){ - m=m+X[i](); - s=s+X[i].current()*X[i].current(); + double temp = X[i](); + m=m+temp; + s=s+temp*temp; } oldmean=mean[i]; mean[i]=(mean[i]*cumM[i]+m)/(cumM[i]+M[i]); |
