From 2a863f8f05823406d3dd6548a390112fbcf159a4 Mon Sep 17 00:00:00 2001
From: Stephan Hilb <stephan@ecshi.net>
Date: Tue, 18 Jan 2022 13:02:33 +0100
Subject: [PATCH] add checks

---
 scripts/run_experiments.jl | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scripts/run_experiments.jl b/scripts/run_experiments.jl
index a59d861..80e0e1d 100644
--- a/scripts/run_experiments.jl
+++ b/scripts/run_experiments.jl
@@ -73,6 +73,9 @@ end
 
 function L1L2TVState(mesh, m; T, tdata, S,
 	alpha1, alpha2, beta, lambda, gamma1, gamma2)
+    alpha2 > 0 || beta > 0 ||
+        throw(ArgumentError("operator B is singular with these parameters"))
+
     d = ndims_domain(mesh)
 
     Vest = FeSpace(mesh, DP0(), (1,))
@@ -106,6 +109,9 @@ end
 
 function OptFlowState(mesh;
 	alpha1, alpha2, beta, lambda, gamma1, gamma2)
+    alpha2 > 0 || beta > 0 ||
+        throw(ArgumentError("operator B is singular with these parameters"))
+
     d = ndims_domain(mesh)
     m = 2
 
-- 
GitLab