From 48069693a9b9f07f95663bb493d78f8bedd3406b Mon Sep 17 00:00:00 2001
From: Elias Pipping <elias.pipping@fu-berlin.de>
Date: Wed, 7 Sep 2011 18:35:21 +0200
Subject: [PATCH] Only run debugging code if NDEBUG is unset

---
 src/bisection-example-flexible.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/bisection-example-flexible.cc b/src/bisection-example-flexible.cc
index 75847a33..62d3d7df 100644
--- a/src/bisection-example-flexible.cc
+++ b/src/bisection-example-flexible.cc
@@ -72,7 +72,7 @@ class SampleFunctional {
     }
     Dune::dverb << "Interval now [" << l << "," << r << "]" << std::endl;
 
-    // Debugging
+#ifndef NDEBUG
     {
       SmallVector tmpl = x;
       tmpl.axpy(l, descDir);
@@ -81,6 +81,7 @@ class SampleFunctional {
       assert(directionalDerivative(tmpl, descDir) < 0);
       assert(directionalDerivative(tmpr, descDir) > 0);
     }
+#endif
 
     double m = l / 2 + r / 2;
     SmallVector middle = SmallVector(0.0);
-- 
GitLab