From c9655a29a5749f59e41157678489563a17fa1030 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Wed, 29 May 2019 20:21:19 +0200 Subject: [PATCH] diagnostic functions raise_error and invalid_matrix --- hyper.h | 3 +++ hypgraph.cpp | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/hyper.h b/hyper.h index 014504c0..6d10d136 100644 --- a/hyper.h +++ b/hyper.h @@ -5489,4 +5489,7 @@ namespace dual { inline reaction_t mayboth(reaction_t what) { return [=] { may_split_or_do(what); }; } } +void raise_error(); +bool invalid_matrix(const transmatrix T); + } \ No newline at end of file diff --git a/hypgraph.cpp b/hypgraph.cpp index 2e32f8a5..426d1991 100644 --- a/hypgraph.cpp +++ b/hypgraph.cpp @@ -782,6 +782,18 @@ bool invis_point(const hyperpoint h) { return h[2] < 0; } +void raise_error() { + println(hlog, "something wrong"); + } + +bool invalid_matrix(const transmatrix T) { + for(int i=0; i 1e8 || T[i][j] < -1e8 || std::isinf(T[i][j])) + return true; + for(int i=0; i .5 || T[i][j] < -.5) return false; + return true; + } + bool invalid_point(const hyperpoint h) { return std::isnan(h[DIM]) || h[DIM] > 1e8 || std::isinf(h[DIM]); }