From a676e66742c256fe29f48b66b9d473360a1b7e4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Gy=C3=B6ngy=C3=B6si?= Date: Tue, 31 Oct 2017 22:53:40 +0100 Subject: [PATCH] Fixed BM1DProcess:Run() multiple call problem --- src/BM1DProcess.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/BM1DProcess.cc b/src/BM1DProcess.cc index f316fb2..2e5e9ca 100644 --- a/src/BM1DProcess.cc +++ b/src/BM1DProcess.cc @@ -15,6 +15,9 @@ BM1DProcess::~BM1DProcess() void BM1DProcess::Run(int nRuns, int nSteps, double p0, double p1) { + t.clear(); + x.clear(); + for(int i = 0; i < nRuns; i++) //multiple runs { t.push_back(0.0); //let's start at t=0, x=0, you can change it if you vant, please use Set methods @@ -50,6 +53,9 @@ void BM1DProcess::Run(int nRuns, int nSteps, double p0, double p1) void BM1DProcess::Run(int nRuns, int nSteps, double p0, double mu, double sigma) { + t.clear(); + x.clear(); + for(int i = 0; i < nRuns; i++) //multiple runs { t.push_back(0.0); //let's start at t=0, x=0, you can change it if you vant, please use Set methods @@ -77,6 +83,9 @@ void BM1DProcess::Run(int nRuns, int nSteps, double p0, double mu, double sigma) void BM1DProcess::Run(int nRuns, int nSteps, double p0, double x1, double x2, double mu1, double sigma1, double mu2, double sigma2) { + t.clear(); + x.clear(); + for(int i = 0; i < nRuns; i++) //multiple runs { t.push_back(0.0); //let's start at t=0, x=0, you can change it if you vant, please use Set methods