diff --git a/fieldpattern.cpp b/fieldpattern.cpp index bd7312f8..b57f4ccf 100644 --- a/fieldpattern.cpp +++ b/fieldpattern.cpp @@ -142,14 +142,23 @@ struct fpattern { } int sqr(int x) { return mul(x,x); } - + + int err; + matrix mmul(const matrix& A, const matrix& B) { matrix res; for(int i=0; i 0) tp += val; + else tn += val; + } + tp %= Prime; tn %= Prime; + if(tp && tn) err++; + t = tp + tn; #else for(int j=0; j fpattern::generate_isometries() { @@ -497,6 +507,7 @@ unsigned fpattern::compute_hash() { bool fpattern::generate_all3() { reg3::generate_fulls(); + err = 0; matrices.clear(); matcode.clear(); @@ -505,19 +516,23 @@ bool fpattern::generate_all3() { for(int i=0; i= limitv) { println(hlog, "limitv exceeded"); return false; } } hashv = compute_hash(); DEBB(DF_FIELD, ("all = ", isize(matrices), "/", local_group, " = ", isize(matrices) / local_group, " hash = ", hashv, " count = ", ++hash_found[hashv])); if(use_quotient_fp) - generate_quotientgroup(); + generate_quotientgroup(); return true; } @@ -588,7 +603,8 @@ void fpattern::generate_quotientgroup() { EX purehookset hooks_solve3; int fpattern::solve3() { - reg3::construct_relations(); + + reg3::generate_fulls(); DEBB(DF_FIELD, ("generating isometries for ", Field)); @@ -597,10 +613,6 @@ int fpattern::solve3() { int cmb = 0; - int N = isize(cgi.rels); - - vector fails(N); - vector possible_P, possible_X, possible_R; for(auto& M: iso3) { @@ -616,20 +628,18 @@ int fpattern::solve3() { DEBB(DF_FIELD, ("field = ", Field, " #P = ", isize(possible_P), " #X = ", isize(possible_X), " #R = ", isize(possible_R), " r_order = ", cgi.r_order, " xp_order = ", cgi.xp_order)); for(auto& xX: possible_X) - for(auto& xP: possible_P) if(check_order(mmul(xP, xX), cgi.xp_order)) - for(auto& xR: possible_R) if(check_order(mmul(xR, xX), cgi.rx_order)) { // if(xR[0][0] == 1 && xR[0][1] == 0) - #if CAP_THREAD && MAXMDIM >+ 4 + for(auto& xP: possible_P) if(check_order(mmul(xP, xX), cgi.xp_order)) + for(auto& xR: possible_R) if(check_order(mmul(xR, xX), cgi.rx_order)) { + + err = 0; + if(mmul(xX, xP) != mmul(xR, mmul(mmul(xP, xX), xR))) continue; + if(err) continue; + + #if CAP_THREAD && MAXMDIM >= 4 if(dis) dis->check_suspend(); if(dis && dis->stop_it) return 0; #endif - auto by = [&] (char ch) -> matrix& { return ch == 'X' ? xX : ch == 'R' ? xR : xP; }; - for(int i=0; ifaces; - hyperpoint v = faces[0][0]; - auto add = [&] (transmatrix T) { - for(int i=0; i 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