1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-27 14:37:16 +00:00

cellrotations are now structs, and include inverses

This commit is contained in:
Zeno Rogue 2020-01-28 15:15:35 +01:00
parent 7fd199dd49
commit 100b8f3534
3 changed files with 15 additions and 4 deletions

View File

@ -633,7 +633,7 @@ struct hrmap_crystal : hrmap_standard {
for(auto& cr: cgi.cellrotations) { for(auto& cr: cgi.cellrotations) {
transmatrix U = T * cr.first; transmatrix U = T * cr.M;
ld go = hdist0(U * tC0(reg3::adjmoves[h->c.spin(d)])); ld go = hdist0(U * tC0(reg3::adjmoves[h->c.spin(d)]));
if(go > 1e-2) continue; if(go > 1e-2) continue;

View File

@ -294,7 +294,13 @@ hpcshape
vector<array<int, 3>> symmetriesAt; vector<array<int, 3>> symmetriesAt;
vector<pair<transmatrix, vector<int> > > cellrotations; struct cellrotation_t {
transmatrix M;
vector<int> mapping;
int inverse_id;
};
vector<cellrotation_t> cellrotations;
#ifndef SCALETUNER #ifndef SCALETUNER
static constexpr static constexpr

View File

@ -1267,9 +1267,14 @@ EX void generate_cellrotations() {
for(int x=0; x<S7; x++) if(perm[x] == -1) bad = true; for(int x=0; x<S7; x++) if(perm[x] == -1) bad = true;
if(bad) continue; if(bad) continue;
cr.emplace_back(S, perm); cr.emplace_back(geometry_information::cellrotation_t{S, perm, 0});
} }
int rots = isize(cr);
for(int i=0; i<rots; i++)
for(int j=0; j<rots; j++)
if(cr[i].mapping[cr[j].mapping[0]] == 0 && cr[i].mapping[cr[j].mapping[1]] == 1 && cr[i].mapping[cr[j].mapping[2]] == 2)
cr[i].inverse_id = j;
} }
#endif #endif