From 4e5104a0186bd705b5ed1f57f73375ace60587f6 Mon Sep 17 00:00:00 2001 From: Guillaume Horel Date: Tue, 12 Apr 2016 12:23:13 -0400 Subject: Rename f_mu as exponential_tilt and template it instead of having it depend on asian_option --- src/projet.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/projet.cpp') diff --git a/src/projet.cpp b/src/projet.cpp index b4fa5f9..c4bd6d8 100644 --- a/src/projet.cpp +++ b/src/projet.cpp @@ -6,6 +6,7 @@ #include #include #include "opti.hpp" +#include "option.hpp" using namespace std; @@ -49,8 +50,9 @@ void exemple1_stratified() { vector q = quantile_norm(100, 1); vector p(100, 0.01); asian_option A(0.05, 1.0, 50, 0.1, d, 45); - f_mu G(mu,A); - std::vector > X; + exponential_tilt G(mu, A); + typedef compose_t, multi_gaussian_truncated> tilted_option; + std::vector X; X.push_back(compose(G, multi_gaussian_truncated(GSL_NEGINF,q[0], u))); for(int i=1; i<100; i++) { X.push_back(compose(G, multi_gaussian_truncated(q[i-1],q[i], u))); @@ -58,7 +60,7 @@ void exemple1_stratified() { for(int i=0; i<100; i=i+10){ std::cout< > S(p, X); + stratified_sampling S(p, X); S.draw(1000); cout<<"l'estimateur de la moyenne est :"<