From 3a8f7fcc3cc4a1df2f268e820a7a6d25680d62f9 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Tue, 18 Jun 2024 10:21:58 +0200 Subject: [PATCH] twist:: display an error when it fails to solve the twist values, like it does in 14,6,4 --- nonisotropic.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nonisotropic.cpp b/nonisotropic.cpp index c93b184d..3b312c51 100644 --- a/nonisotropic.cpp +++ b/nonisotropic.cpp @@ -1354,10 +1354,14 @@ EX namespace hybrid { } if(candidates.size() == 2 && candidates[0] != candidates[1]) { + if(!quotient) println(hlog, "two candidates in shift : ", candidates); int val = candidates[0] - candidates[1]; + int old_disc_quotient = disc_quotient; if(disc_quotient == 0) disc_quotient = val; disc_quotient = gcd(val, disc_quotient); if(disc_quotient < 0) disc_quotient = -disc_quotient; + if(old_disc_quotient != disc_quotient && !in_underlying([] { return quotient; })) + addMessage(XLAT("ERROR: failed to solve the twist values, the map will be incorrect", its(disc_quotient))); } int val = 0;