diff --git a/Makefile b/Makefile index c63d9cd3..59744a49 100644 --- a/Makefile +++ b/Makefile @@ -84,7 +84,7 @@ ifeq (${TOOLCHAIN},clang) CXXFLAGS_EARLY += -march=native -fPIC CXXFLAGS_EARLY += -W -Wall -Wextra -Werror -pedantic CXXFLAGS_EARLY += -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-maybe-uninitialized -Wno-unknown-warning-option - CXXFLAGS_EARLY += -Wno-invalid-offsetof -Wno-overloaded-virtual + CXXFLAGS_EARLY += -Wno-invalid-offsetof endif ifeq (${TOOLCHAIN},gcc) diff --git a/arbitrile.cpp b/arbitrile.cpp index 8d434d09..9604883a 100644 --- a/arbitrile.cpp +++ b/arbitrile.cpp @@ -807,7 +807,7 @@ struct hrmap_arbi : hrmap { return h1; } - transmatrix relative_matrix(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { + transmatrix relative_matrixh(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { return relative_matrix_recursive(h2, h1); } diff --git a/archimedean.cpp b/archimedean.cpp index 0ca7bf27..4f9fc3ce 100644 --- a/archimedean.cpp +++ b/archimedean.cpp @@ -706,7 +706,7 @@ struct hrmap_archimedean : hrmap { return calc_relative_matrix(c->cmove(dir), c, C0); } - transmatrix relative_matrix(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { + transmatrix relative_matrixh(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { if(use_gmatrix && gmatrix0.count(h2->c7) && gmatrix0.count(h1->c7)) return inverse_shift(gmatrix0[h1->c7], gmatrix0[h2->c7]); transmatrix gm = Id, where = Id; diff --git a/asonov.cpp b/asonov.cpp index 3ecd0787..0e864e78 100644 --- a/asonov.cpp +++ b/asonov.cpp @@ -197,7 +197,7 @@ struct hrmap_asonov : hrmap { transmatrix adj(heptagon *h, int i) override { return adjmatrix(i); } - virtual transmatrix relative_matrix(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { + transmatrix relative_matrixh(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { for(int a=0; amove(a)) return adjmatrix(a); return coord_to_matrix(coords[h2], coords[h1]); } diff --git a/binary-tiling.cpp b/binary-tiling.cpp index 17107ccd..bccfe8a7 100644 --- a/binary-tiling.cpp +++ b/binary-tiling.cpp @@ -453,7 +453,7 @@ EX namespace bt { else throw hr_exception("wrong dir"); } - transmatrix relative_matrix(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { + transmatrix relative_matrixh(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { if(gmatrix0.count(h2->c7) && gmatrix0.count(h1->c7)) return inverse_shift(gmatrix0[h1->c7], gmatrix0[h2->c7]); transmatrix gm = Id, where = Id; diff --git a/cell.cpp b/cell.cpp index 1c2cd0e1..d6ff8e33 100644 --- a/cell.cpp +++ b/cell.cpp @@ -30,16 +30,21 @@ struct hrmap { printf("create_step called unexpectedly\n"); exit(1); return NULL; } - virtual struct transmatrix relative_matrix(heptagon *h2, heptagon *h1, const hyperpoint& hint) { - printf("relative_matrix called unexpectedly\n"); +private: + virtual transmatrix relative_matrixh(heptagon *h2, heptagon *h1, const hyperpoint& hint) { + printf("relative_matrixh called unexpectedly\n"); return Id; } - virtual struct transmatrix relative_matrix(cell *c2, cell *c1, const hyperpoint& hint) { - return relative_matrix(c2->master, c1->master, hint); + virtual transmatrix relative_matrixc(cell *c2, cell *c1, const hyperpoint& hint) { + return relative_matrixh(c2->master, c1->master, hint); } - virtual struct transmatrix adj(cell *c, int i) { return adj(c->master, i); } - virtual struct transmatrix adj(heptagon *h, int i); - struct transmatrix iadj(cell *c, int i) { cell *c1 = c->cmove(i); return adj(c1, c->c.spin(i)); } +public: + transmatrix relative_matrix(heptagon *h2, heptagon *h1, const hyperpoint& hint) { return relative_matrixh(h2, h1, hint); } + transmatrix relative_matrix(cell *h2, cell *h1, const hyperpoint& hint) { return relative_matrixc(h2, h1, hint); } + + virtual transmatrix adj(cell *c, int i) { return adj(c->master, i); } + virtual transmatrix adj(heptagon *h, int i); + transmatrix iadj(cell *c, int i) { cell *c1 = c->cmove(i); return adj(c1, c->c.spin(i)); } transmatrix iadj(heptagon *h, int d) { heptagon *h1 = h->cmove(d); return adj(h1, h->c.spin(d)); } @@ -94,8 +99,8 @@ struct hrmap { **/ struct hrmap_standard : hrmap { void draw_at(cell *at, const shiftmatrix& where) override; - transmatrix relative_matrix(heptagon *h2, heptagon *h1, const hyperpoint& hint) override; - transmatrix relative_matrix(cell *c2, cell *c1, const hyperpoint& hint) override; + transmatrix relative_matrixh(heptagon *h2, heptagon *h1, const hyperpoint& hint) override; + transmatrix relative_matrixc(cell *c2, cell *c1, const hyperpoint& hint) override; heptagon *create_step(heptagon *h, int direction) override; transmatrix adj(cell *c, int d) override; transmatrix adj(heptagon *h, int d) override; diff --git a/crystal.cpp b/crystal.cpp index d0d3c01e..ba3caa2b 100644 --- a/crystal.cpp +++ b/crystal.cpp @@ -673,7 +673,7 @@ struct hrmap_crystal : hrmap_standard { else hrmap::draw_at(at, where); } - virtual transmatrix relative_matrix(cell *h2, cell *h1, const hyperpoint& hint) override { + transmatrix relative_matrixc(cell *h2, cell *h1, const hyperpoint& hint) override { if(!crystal3()) return hrmap_standard::relative_matrix(h2, h1, hint); if(h2 == h1) return Id; for(int i=0; imove(i)) return adj(h1->master, i); @@ -683,7 +683,7 @@ struct hrmap_crystal : hrmap_standard { return xpush(999); } - virtual transmatrix relative_matrix(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { + transmatrix relative_matrixh(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { if(!crystal3()) return hrmap::relative_matrix(h2, h1, hint); return relative_matrix(h2->c7, h1->c7, hint); } diff --git a/euclid.cpp b/euclid.cpp index 8f147396..ec779512 100644 --- a/euclid.cpp +++ b/euclid.cpp @@ -260,7 +260,7 @@ EX namespace euc { } } - transmatrix relative_matrix(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { + transmatrix relative_matrixh(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { if(eu.twisted) { if(h1 == h2) return Id; for(int s=0; smove(s)) return adj(h1, s); diff --git a/fake.cpp b/fake.cpp index 253797e9..c3cbbe19 100644 --- a/fake.cpp +++ b/fake.cpp @@ -179,7 +179,7 @@ EX namespace fake { } } - transmatrix relative_matrix(cell *h2, cell *h1, const hyperpoint& hint) override { + transmatrix relative_matrixc(cell *h2, cell *h1, const hyperpoint& hint) override { if(arcm::in()) return underlying_map->relative_matrix(h2, h1, hint); if(h1 == h2) return Id; @@ -189,7 +189,7 @@ EX namespace fake { return Id; } - transmatrix relative_matrix(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { + transmatrix relative_matrixh(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { if(arcm::in()) return underlying_map->relative_matrix(h2, h1, hint); return relative_matrix(h2->c7, h1->c7, hint); } diff --git a/geometry2.cpp b/geometry2.cpp index 49b3f4e0..36c1006e 100644 --- a/geometry2.cpp +++ b/geometry2.cpp @@ -120,11 +120,11 @@ EX transmatrix relative_matrix_via_masters(cell *c2, cell *c1, const hyperpoint& return gm * U * where; } -transmatrix hrmap_standard::relative_matrix(cell *c2, cell *c1, const hyperpoint& hint) { +transmatrix hrmap_standard::relative_matrixc(cell *c2, cell *c1, const hyperpoint& hint) { return relative_matrix_via_masters(c2, c1, hint); } -transmatrix hrmap_standard::relative_matrix(heptagon *h2, heptagon *h1, const hyperpoint& hint) { +transmatrix hrmap_standard::relative_matrixh(heptagon *h2, heptagon *h1, const hyperpoint& hint) { transmatrix gm = Id, where = Id; // always add to last! diff --git a/goldberg.cpp b/goldberg.cpp index 315b383f..5a2a28b7 100644 --- a/goldberg.cpp +++ b/goldberg.cpp @@ -1131,11 +1131,11 @@ EX namespace gp { return c; } - transmatrix relative_matrix(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { + transmatrix relative_matrixh(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { return in_underlying([&] { return currentmap->relative_matrix(h2, h1, hint); }); } - transmatrix relative_matrix(cell *c2, cell *c1, const hyperpoint& hint) override { + transmatrix relative_matrixc(cell *c2, cell *c1, const hyperpoint& hint) override { c1 = mapping[c1]; c2 = mapping[c2]; return in_underlying([&] { return currentmap->relative_matrix(c2, c1, hint); }); diff --git a/kite.cpp b/kite.cpp index 14d1531c..3bb9f305 100644 --- a/kite.cpp +++ b/kite.cpp @@ -326,7 +326,7 @@ struct hrmap_kite : hrmap { } } - transmatrix relative_matrix(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { + transmatrix relative_matrixh(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { if(gmatrix0.count(h2->c7) && gmatrix0.count(h1->c7)) return inverse_shift(gmatrix0[h1->c7], gmatrix0[h2->c7]); transmatrix gm = Id, where = Id; diff --git a/nonisotropic.cpp b/nonisotropic.cpp index a31d7548..8645fdfa 100644 --- a/nonisotropic.cpp +++ b/nonisotropic.cpp @@ -425,7 +425,7 @@ EX namespace sn { h->cmove(d); return adjmatrix(d, h->c.spin(d)); } - virtual transmatrix relative_matrix(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { + transmatrix relative_matrixh(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { for(int i=0; itype; i++) if(h1->move(i) == h2) return adjmatrix(i, h1->c.spin(i)); if(gmatrix0.count(h2->c7) && gmatrix0.count(h1->c7)) return inverse_shift(gmatrix0[h1->c7], gmatrix0[h2->c7]); @@ -943,7 +943,7 @@ EX namespace nilv { transmatrix adj(heptagon *h, int i) override { return adjmatrix(i); } - virtual transmatrix relative_matrix(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { + transmatrix relative_matrixh(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { for(int a=0; amove(a)) return adjmatrix(a); auto p = coords[h1].inverse() * coords[h2]; for(int a=0; a<3; a++) p[a] = szgmod(p[a], nilperiod[a]); @@ -1518,7 +1518,7 @@ EX namespace product { int z0; struct hrmap_product : hybrid::hrmap_hybrid { - transmatrix relative_matrix(cell *c2, cell *c1, const hyperpoint& hint) override { + transmatrix relative_matrixc(cell *c2, cell *c1, const hyperpoint& hint) override { return in_underlying([&] { return calc_relative_matrix(where[c2].first, where[c1].first, hint); }) * mscale(Id, cgi.plevel * szgmod(where[c2].second - where[c1].second, hybrid::csteps)); } @@ -2079,7 +2079,7 @@ EX namespace rots { return M = lift_matrix(PIU(currentmap->adj(cw, i))); } - virtual transmatrix relative_matrix(cell *c2, cell *c1, const hyperpoint& hint) override { + transmatrix relative_matrixc(cell *c2, cell *c1, const hyperpoint& hint) override { if(c1 == c2) return Id; if(gmatrix0.count(c2) && gmatrix0.count(c1)) return inverse_shift(gmatrix0[c1], gmatrix0[c2]); @@ -2087,7 +2087,7 @@ EX namespace rots { return Id; // not implemented yet } - virtual transmatrix ray_iadj(cell *c1, int i) override { + transmatrix ray_iadj(cell *c1, int i) override { if(i == c1->type-1) return uzpush(-cgi.plevel) * spin(-2*cgi.plevel); if(i == c1->type-2) return uzpush(+cgi.plevel) * spin(+2*cgi.plevel); cell *c2 = c1->cmove(i); diff --git a/reg3.cpp b/reg3.cpp index 46e49f95..3778bf6c 100644 --- a/reg3.cpp +++ b/reg3.cpp @@ -689,7 +689,7 @@ EX namespace reg3 { heptagon *getOrigin() override { return allh[0]; } - transmatrix relative_matrix(cell *h2, cell *h1, const hyperpoint& hint) override; + transmatrix relative_matrixc(cell *h2, cell *h1, const hyperpoint& hint) override; void initialize(int cell_count); vector& allcells() override { return acells; } @@ -950,7 +950,7 @@ EX namespace reg3 { if(failures && !testing_subconnections) throw hr_exception("hrmap_closed3 failures"); } - transmatrix hrmap_closed3::relative_matrix(cell *c2, cell *c1, const hyperpoint& hint) { + transmatrix hrmap_closed3::relative_matrixc(cell *c2, cell *c1, const hyperpoint& hint) { if(c1 == c2) return Id; int d = hr::celldistance(c2, c1); @@ -1505,7 +1505,7 @@ EX namespace reg3 { return relative_matrix(h->cmove(d), h, C0); } - transmatrix relative_matrix(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { + transmatrix relative_matrixh(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { auto p1 = reg_gmatrix[h1]; auto p2 = reg_gmatrix[h2]; transmatrix T = Id; @@ -1613,7 +1613,7 @@ EX namespace reg3 { clearfrom(allh[0]); } - struct transmatrix relative_matrix(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { + transmatrix relative_matrixh(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { return iso_inverse(locations[h1->fieldval]) * locations[h2->fieldval]; } @@ -1927,11 +1927,11 @@ EX namespace reg3 { return quotient_map->adj(h, d); } - transmatrix relative_matrix(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { + transmatrix relative_matrixh(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { return relative_matrix_recursive(h2, h1); } - transmatrix relative_matrix(cell *c2, cell *c1, const hyperpoint& hint) override { + transmatrix relative_matrixc(cell *c2, cell *c1, const hyperpoint& hint) override { if(PURE) return relative_matrix(c2->master, c1->master, hint); return relative_matrix_via_masters(c2, c1, hint); } diff --git a/rogueviz/grigorchuk.cpp b/rogueviz/grigorchuk.cpp index 0b520007..38878370 100644 --- a/rogueviz/grigorchuk.cpp +++ b/rogueviz/grigorchuk.cpp @@ -421,13 +421,13 @@ struct hrmap_grigorchuk : hrmap_standard { } } - transmatrix relative_matrix(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { + transmatrix relative_matrixh(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { if(gmatrix0.count(h2->c7) && gmatrix0.count(h1->c7)) return inverse_shift(gmatrix0[h1->c7], gmatrix0[h2->c7]); return Id; } - transmatrix relative_matrix(cell *c2, cell *c1, const struct hyperpoint& hint) override { + transmatrix relative_matrixc(cell *c2, cell *c1, const struct hyperpoint& hint) override { if(gmatrix0.count(c2) && gmatrix0.count(c1)) return inverse_shift(gmatrix0[c1], gmatrix0[c2]); return Id; diff --git a/rogueviz/notknot.cpp b/rogueviz/notknot.cpp index c5fe91b3..ad4d7bf9 100644 --- a/rogueviz/notknot.cpp +++ b/rogueviz/notknot.cpp @@ -1103,7 +1103,7 @@ struct hrmap_notknot : hrmap { ray::volumetric::enable(); } - transmatrix relative_matrix(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { + transmatrix relative_matrixh(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { return Id; } diff --git a/sphere.cpp b/sphere.cpp index 7ed5a9c1..88062a47 100644 --- a/sphere.cpp +++ b/sphere.cpp @@ -172,7 +172,7 @@ struct hrmap_spherical : hrmap_standard { return Id; } - transmatrix relative_matrix(cell *c2, cell *c1, const hyperpoint& hint) override { + transmatrix relative_matrixc(cell *c2, cell *c1, const hyperpoint& hint) override { transmatrix T = iso_inverse(get_where(c1)) * get_where(c2); if(elliptic) fixelliptic(T); return T;