1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-09-04 11:37:55 +00:00

reg3/field:: incorrect field computations generate errors; fixed a bug in suspending discovery; more elegant fieldpattern search not based on cgi.rels

This commit is contained in:
Zeno Rogue
2022-08-25 01:10:07 +02:00
parent 3f32112937
commit 14a9961f92
2 changed files with 32 additions and 88 deletions

View File

@@ -2766,70 +2766,6 @@ EX void generate_fulls() {
println(hlog, "orders = ", tie(cgi.rx_order, cgi.r_order, cgi.xp_order));
}
EX void construct_relations() {
auto& rels = cgi.rels;
if(!rels.empty()) return;
rels.clear();
reg3::generate_cellrotations();
reg3::generate_fulls();
vector<transmatrix> all;
vector<string> formulas;
formulas.push_back("");
all.push_back(Id);
auto& faces = cgi.heptshape->faces;
hyperpoint v = faces[0][0];
auto add = [&] (transmatrix T) {
for(int i=0; i<isize(all); i++) if(eqmatrix(all[i], T)) return i;
int S = isize(all);
all.push_back(T);
return S;
};
println(hlog, faces);
println(hlog, "cellshape = ", isize(faces));
bool ok = true;
int last_i = -1;
for(auto& v: faces) for(hyperpoint h: v) {
int i = 0, j = 0;
for(auto& uv: faces) for(hyperpoint u: uv) {
if(hdist(h, cgi.full_X*u) < 5e-2) i++;
if(hdist(h, cgi.full_R*u) < 5e-2) j++;
}
if(last_i == -1) last_i = i;
if(i != j || i != last_i) ok = false;
}
if(!ok) { println(hlog, "something wrong"); exit(1); }
add(Id);
auto work = [&] (transmatrix T, int p, char c) {
if(hdist0(tC0(T)) > 5) return;
for(auto& hv: faces) for(hyperpoint h: hv) if(hdist(T * h, v) < 1e-4) goto ok;
return;
ok:
int id = add(T);
// println(hlog, p, " x ", (s0+c), " = ", id);
if(id >= isize(formulas)) formulas.push_back(formulas[p] + c);
else if(id == 0) println(hlog, "reached identity: ", formulas[p]+c);
else if(formulas[p][0] != formulas[id][0])
rels.emplace_back(formulas[p] + c, formulas[id]);
};
for(int i=0; i<isize(all); i++) {
transmatrix T = all[i];
work(T * cgi.full_R, i, 'R');
work(T * cgi.full_X, i, 'X');
work(T * cgi.full_P, i, 'P');
}
}
eVariation target_variation;
flagtype target_coxeter;
int target_subcube_count;