From c66858d0b5876bfb8fb9b00143936e4439160daa Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 3 Mar 2019 00:36:20 +0100 Subject: [PATCH] 3d:: binary:: itmatrix for extra speed --- binary-tiling.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/binary-tiling.cpp b/binary-tiling.cpp index 2f665b0b..e575f34c 100644 --- a/binary-tiling.cpp +++ b/binary-tiling.cpp @@ -214,11 +214,22 @@ namespace binary { } const transmatrix& tmatrix(heptagon *h, int dir) { - if(dir == 8) + if(dir == 8) { + h->cmove(8); return inverse_tmatrix[h->c.spin(8)]; + } else return direct_tmatrix[dir]; } + + const transmatrix& itmatrix(heptagon *h, int dir) { + if(dir == 8) { + h->cmove(8); + return h->cmove(8), direct_tmatrix[h->c.spin(8)]; + } + else + return inverse_tmatrix[dir]; + } #if MAXMDIM == 4 @@ -317,7 +328,7 @@ namespace binary { while(h1 != h2) { if(h1->distance <= h2->distance) { if(DIM == 3) - where = inverse(tmatrix(h2, 8)) * where, h2 = hr::createStep(h2, 8); + where = itmatrix(h2, 8) * where, h2 = hr::createStep(h2, 8); else { if(type_of(h2) == 6) h2 = hr::createStep(h2, bd_down), where = xpush(-log(2)) * where;