From 833fe23df203623c0cf9c540cd9a085792c04869 Mon Sep 17 00:00:00 2001 From: Bertrand Date: Sat, 13 Feb 2016 22:35:00 +0000 Subject: maj Makefile et calcul de moyenne de normales avec méthode qmc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 2 +- rqmc.cpp | 40 +++++++++++++++++++++++++++++++++------- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 6b87c38..bb7cdc6 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ main.o: stratified_sampling.o test: test.o mt19937.o $(CXX) $^ -o $@ -rqmc: rqmc.o +rqmc: rqmc.o mt19937.o $(CXX) $^ -o $@ $(GSL_FLAGS) clean: diff --git a/rqmc.cpp b/rqmc.cpp index 40fd8ad..e8b98fc 100644 --- a/rqmc.cpp +++ b/rqmc.cpp @@ -1,14 +1,40 @@ #include "low_discrepancy.hpp" #include +#include +#include "var_alea.hpp" + + +double frac_part(double x){ + return x - floor(x); +} + +double mean_rqmc(int N, double X) { + sobol s(1); + double sum = 0; + for(int i=0; i q; - std::vector a; - q = s(); - a = s(); - for(int i=0; i<3; i++){ - std::cout<