From a70bf950d14902f91ae0c0e4027537a7e23d3bc5 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Mon, 25 Nov 2013 14:39:34 +0100 Subject: [PATCH 1/1] ... --- sim-1mr-.hpp | 3 +-- sim-r-.hpp | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sim-1mr-.hpp b/sim-1mr-.hpp index 00e15be..75c41d9 100644 --- a/sim-1mr-.hpp +++ b/sim-1mr-.hpp @@ -45,6 +45,7 @@ void sim::updatePhi (const int& x) { const double theta = gsl_rng_uniform(rangsl) * 2*M_PI; complex V=0; + const double oldarg = arg(conf[x].phi); for (int nu=0; nu<4; nu++) V += conf[ (*nb)[x*4+nu] ].phi; @@ -53,8 +54,6 @@ void sim::updatePhi (const int& x) - 1./M * norm(V) + 2 * real( conf[x].phi * conj(V) ) ); - double oldarg = arg(conf[x].phi); - conf[x].phi = sqrt(std::log( 1./(1-r) )) / sqrt(M) * polar(1.0, oldarg) + V / M; diff --git a/sim-r-.hpp b/sim-r-.hpp index 24f7ca4..f16d97e 100644 --- a/sim-r-.hpp +++ b/sim-r-.hpp @@ -45,13 +45,12 @@ void sim::updatePhi (const int& x) { const double r = gsl_rng_uniform(rangsl); const double theta = gsl_rng_uniform(rangsl) * 2*M_PI; + const double oldarg = arg(conf[x].phi); complex V=0; for (int nu=0; nu<4; nu++) V += conf[ (*nb)[x*4+nu] ].phi; - double oldarg = arg(conf[x].phi); - conf[x].phi = sqrt(std::log( 1./(1-r) )) / sqrt(M) * polar(1.0, oldarg) + V / M; -- 2.39.5