From 69d81d75339bc16725346b452ca6e0dc5da89554 Mon Sep 17 00:00:00 2001 From: Bertrand Date: Sun, 14 Feb 2016 17:59:49 +0000 Subject: début exemple sur options asiatiques MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 3 +++ option.cpp | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 option.cpp diff --git a/Makefile b/Makefile index bb7cdc6..3e093eb 100644 --- a/Makefile +++ b/Makefile @@ -17,5 +17,8 @@ test: test.o mt19937.o rqmc: rqmc.o mt19937.o $(CXX) $^ -o $@ $(GSL_FLAGS) +option: option.o mt19937.o + $(CXX) $^ -o $@ $(GSL_FLAGS) + clean: -$(RM) -f *.o test stratified_sampling main diff --git a/option.cpp b/option.cpp new file mode 100644 index 0000000..5caf23f --- /dev/null +++ b/option.cpp @@ -0,0 +1,61 @@ +#include +#include +#include "var_alea.hpp" +#include +#include + +double r; +double T; +double S0; +double V; +int d; + +std::vector path_gen(std::vector X){ + d=X.size(); + std::vector S(d); + S[0]= S0; + for(int i=1;i S(d); + std::vector X(d); + for(int i=1; i