From 4909d262ba578dc71b7431bd3f3c2ef9b3132384 Mon Sep 17 00:00:00 2001 From: Bertrand Date: Fri, 26 Feb 2016 14:48:54 +0000 Subject: debbugage de main --- src/main.cpp | 15 +++++++++------ src/opti.cpp | 3 --- src/stratified_sampling.hpp | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index 561b8c2..88f3737 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -45,17 +45,20 @@ x = 1.64*S.estimator().second; void exemple2 (){ - std::vector mu(16); - mu = argmax(0.05, 1.0, 50, 0.1, 45, 16); + int d= 16; + std::vector mu(d); + mu = argmax(0.05, 1.0, 50, 0.1, 45, d); double norm_mu = 0; - std::vector u(16); - for(int i=0; i<16; i++) { + std::vector u(d); + for(int i=0; i q = quantile_norm(100, 1); vector p(100, 0.01); - asian_option A(0.05, 1.0, 50, 0.1, 45, 16); + asian_option A(0.05, 1.0, 50, 0.1, d, 45); f_mu G(mu,A); multi_gaussian_truncated MG(q[50],q[51], u); for(int i=0; i<10; i++){ diff --git a/src/opti.cpp b/src/opti.cpp index 23ddff3..6b05ecd 100644 --- a/src/opti.cpp +++ b/src/opti.cpp @@ -39,9 +39,6 @@ std::vector argmax(double r, double T, double S0, double V, double K, in std::vector x(d,0); std::vector g(0); - - std::cout<<"valeur au début : "< stratified_sampling::estimator() const { struct f_mu : public std::unary_function, double> { f_mu(std::vector mu, asian_option A) : mu(mu), A(A){ - double norm_mu = 0; - for(int i=0; i<16; i++) { + norm_mu = 0; + for(unsigned int i=0; i