3d:: binary:: itmatrix for extra speed

This commit is contained in:
Zeno Rogue 2019-03-03 00:36:20 +01:00
parent 03083a4520
commit c66858d0b5
1 changed files with 13 additions and 2 deletions

View File

@ -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;