From 3b5e31156d931f9b2f526d9c7321042420c93de7 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 22 Mar 2020 10:15:57 +0100 Subject: [PATCH] arb:: a bit nicer --- arbitrile.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arbitrile.cpp b/arbitrile.cpp index dd4f0030..93d38125 100644 --- a/arbitrile.cpp +++ b/arbitrile.cpp @@ -404,9 +404,9 @@ struct hrmap_arbi : hrmap { } for(auto& p2: altmap[alt]) if(id_of(p2.first) == xt && hdist(tC0(p2.second), tC0(T)) < 1e-2) { - for(int oth=0; oth < p2.first->type; oth++) - if(hdist(p2.second * xsh.vertices[oth], T * xsh.vertices[e]) < 1e-2) { - ld err = hdist(p2.second * xsh.vertices[oth], T * xsh.vertices[e]); + for(int oth=0; oth < p2.first->type; oth++) { + ld err = hdist(p2.second * xsh.vertices[oth], T * xsh.vertices[e]); + if(err < 1e-2) { static ld max_err = 0; if(err > max_err) { println(hlog, "err = ", err); @@ -415,6 +415,7 @@ struct hrmap_arbi : hrmap { h->c.connect(d, p2.first, oth%p2.first->type, m); return p2.first; } + } } auto h1 = tailored_alloc (current.shapes[xt].size());