fake:: works with coxeter

This commit is contained in:
Zeno Rogue 2021-07-13 02:34:24 +02:00
parent 3560bcc3db
commit 81ea3d75f5
3 changed files with 31 additions and 9 deletions

View File

@ -85,6 +85,11 @@ struct hrmap {
/** \brief in 3D honeycombs, returns a vector<bool> v, where v[j] iff faces i and j are adjacent */ /** \brief in 3D honeycombs, returns a vector<bool> v, where v[j] iff faces i and j are adjacent */
const vector<char>& dirdist(cellwalker cw) { return get_cellshape(cw.at).dirdist[cw.spin]; } const vector<char>& dirdist(cellwalker cw) { return get_cellshape(cw.at).dirdist[cw.spin]; }
/** \brief the sequence of heptagon movement direction to get from c->master to c->move(i)->master; implemented only for reg3 */
virtual const vector<int>& get_move_seq(cell *c, int i) {
throw hr_exception("get_move_seq not implemented for this map class");
}
}; };
/** hrmaps which are based on regular non-Euclidean 2D tilings, possibly quotient /** hrmaps which are based on regular non-Euclidean 2D tilings, possibly quotient

View File

@ -34,7 +34,7 @@ EX namespace fake {
if(arcm::in() && PURE) return true; if(arcm::in() && PURE) return true;
if(WDIM == 2) return false; if(WDIM == 2) return false;
if(among(geometry, gBitrunc3)) return false; if(among(geometry, gBitrunc3)) return false;
if(reg3::in() && !among(variation, eVariation::pure, eVariation::subcubes)) return false; if(reg3::in() && !among(variation, eVariation::pure, eVariation::subcubes, eVariation::coxeter)) return false;
return euc::in() || reg3::in(); return euc::in() || reg3::in();
} }
@ -87,18 +87,25 @@ EX namespace fake {
transmatrix adj(cell *c, int d) override { transmatrix adj(cell *c, int d) override {
transmatrix S1, S2; transmatrix S1, S2;
ld dist; ld dist;
if(variation == eVariation::subcubes && c->master == c->cmove(d)->master) { bool impure = reg3::in() && !PURE;
auto& s1 = get_cellshape(c); vector<int> mseq;
auto& s2 = get_cellshape(c->move(d)); if(impure) {
return s1.from_cellcenter * s2.to_cellcenter; mseq = FPIU ( currentmap->get_move_seq(c, d) );
if(mseq.empty()) {
auto& s1 = get_cellshape(c);
auto& s2 = get_cellshape(c->move(d));
return s1.from_cellcenter * s2.to_cellcenter;
}
if(isize(mseq) > 1)
throw hr_exception("fake adj not implemented for isize(mseq) > 1");
} }
in_underlying([c, d, &S1, &S2, &dist] { in_underlying([c, d, &S1, &S2, &dist, &impure, &mseq] {
#if CAP_ARCM #if CAP_ARCM
dynamicval<bool> u(arcm::use_gmatrix, false); dynamicval<bool> u(arcm::use_gmatrix, false);
#endif #endif
transmatrix T; transmatrix T;
if(variation == eVariation::subcubes) { if(impure) {
T = currentmap->adj(c->master, d); T = currentmap->adj(c->master, mseq[0]);
} }
else { else {
T = currentmap->adj(c, d); T = currentmap->adj(c, d);
@ -109,7 +116,7 @@ EX namespace fake {
S2 = xpush(-dist) * T1; S2 = xpush(-dist) * T1;
}); });
if(variation == eVariation::subcubes) { if(impure) {
auto& s1 = get_cellshape(c); auto& s1 = get_cellshape(c);
auto& s2 = get_cellshape(c->move(d)); auto& s2 = get_cellshape(c->move(d));
S1 = s1.from_cellcenter * S1; S1 = s1.from_cellcenter * S1;

View File

@ -717,6 +717,11 @@ EX namespace reg3 {
int id = local_id.at(cw.at).first; int id = local_id.at(cw.at).first;
return cellwalker(cw.at->cmove(j), strafe_data[id][j][cw.spin]); return cellwalker(cw.at->cmove(j), strafe_data[id][j][cw.spin]);
} }
const vector<int>& get_move_seq(cell *c, int i) override {
int id = local_id.at(c).first;
return move_sequences[id][i];
}
}; };
struct hrmap_quotient3 : hrmap_closed3 { }; struct hrmap_quotient3 : hrmap_closed3 { };
@ -2022,6 +2027,11 @@ EX namespace reg3 {
if(PURE && res1 != res2) println(hlog, "h3: ", res1, " vs ", res2); if(PURE && res1 != res2) println(hlog, "h3: ", res1, " vs ", res2);
return res2; return res2;
} }
const vector<int>& get_move_seq(cell *c, int i) override {
int aid = cell_id.at(c);
return quotient_map->get_move_seq(quotient_map->acells[aid], i);
}
}; };
struct hrmap_h3_rule_alt : hrmap { struct hrmap_h3_rule_alt : hrmap {