From a3033fc82713a5dab236a21a326dda084c0303d6 Mon Sep 17 00:00:00 2001
From: Stephan Hilb <stephan@ecshi.net>
Date: Fri, 25 Feb 2022 19:51:21 +0100
Subject: [PATCH] simplify

---
 scripts/run_experiments.jl       |  3 ++-
 scripts/symbolic_calculations.jl | 20 ++++++++------------
 2 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/scripts/run_experiments.jl b/scripts/run_experiments.jl
index da08a90..69b5bb1 100644
--- a/scripts/run_experiments.jl
+++ b/scripts/run_experiments.jl
@@ -1366,7 +1366,8 @@ function experiment_optflow_middlebury_all(ctx)
             "RubberWhale", "Urban2", "Urban3", "Venus"]
         ctx(experiment_optflow_middlebury, example;
             alpha1 = 10., alpha2 = 0., lambda = 1., beta = 1e-5,
-            gamma1 = 1e-3, gamma2 = 1e-3)
+            gamma1 = 1e-4, gamma2 = 1e-4)
+        return
     end
 end
 
diff --git a/scripts/symbolic_calculations.jl b/scripts/symbolic_calculations.jl
index a4cc08f..3237b14 100644
--- a/scripts/symbolic_calculations.jl
+++ b/scripts/symbolic_calculations.jl
@@ -3,19 +3,15 @@ using Reduce
 # explicitly calculate l1 integral over reference triangle with first order
 # lagrange discretization
 function l1triangle()
-    integrand_2 = :(abs(u0 * (1-x1-x2) + u1 * x1 + u2 * x2))
-
-    integral_2 = Reduce.Algebra.int(integrand_2, :x2)
-    integrand_1 = Reduce.Algebra.:-(
-        Reduce.Algebra.sub(:x2 => :(1 - x1), integral_2),
-        Reduce.Algebra.sub(:x2 => 0, integral_2))
-
-    integral_1 = Reduce.Algebra.int(integrand_1, :x1)
-    result = Reduce.Algebra.:-(
-        Reduce.Algebra.sub(:x1 => 1, integral_1),
-        Reduce.Algebra.sub(:x1 => 0, integral_1))
+    int3 = :(abs(u0 * (1-x1-x2) + u1 * x1 + u2 * x2))
+    int2 = Reduce.Algebra.int(int3, :x2, 0, :(1 - x1))
+    int1 = Reduce.Algebra.int(int2, :x1, 0, 1)
+    return int1
+end
 
-    return result
+function l1interval()
+    integrand = :(abs(u0 * (1-x) + u1 * x))
+    return Reduce.Algebra.int(integrand, :x, 0, 1)
 end
 
 function norm_grad()
-- 
GitLab