From f738a61dbc8b2e11ce3b46161920d10227231f6c Mon Sep 17 00:00:00 2001
From: Elias Pipping <elias.pipping@fu-berlin.de>
Date: Thu, 23 Feb 2012 18:05:12 +0100
Subject: [PATCH] Make LambertW compile

---
 src/LambertW.cc | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/LambertW.cc b/src/LambertW.cc
index 0c0ae500..ff5e933a 100644
--- a/src/LambertW.cc
+++ b/src/LambertW.cc
@@ -324,15 +324,17 @@ template <double IterationStep(const double x, const double w)>
 struct Iterator {
 
   static double Do(const int n, const double x, const double w) {
+    double tmpw = w;
     for (int i = 0; i < n; ++i)
-      w = IterationStep(x, w);
-    return w;
+      tmpw = IterationStep(x, tmpw);
+    return tmpw;
   }
 
   template <int n> static double Do(const double x, const double w) {
+    double tmpw = w;
     for (int i = 0; i < n; ++i)
-      w = IterationStep(x, w);
-    return w;
+      tmpw = IterationStep(x, tmpw);
+    return tmpw;
   }
 
   template <int n, class = void> struct Depth {
-- 
GitLab