diff --git a/classes.cpp b/classes.cpp index 096346b2..646c73e9 100644 --- a/classes.cpp +++ b/classes.cpp @@ -1740,6 +1740,7 @@ static const flagtype qsZEBRA = qANYQ | qSMALL | qBOUNDED | qZEBRA; static const flagtype qsFIELD = qANYQ | qFIELD | qBOUNDED; static const flagtype qsDOCKS = qANYQ | qSMALL | qBOUNDED | qDOCKS; static const flagtype qsSMALLB = qSMALL | qBOUNDED; +static const flagtype qsSMALLBF = qsSMALLB | qsFIELD; static const flagtype qsSMALLBE = qsSMALLB | qELLIPTIC; vector ginf = { @@ -1790,6 +1791,8 @@ vector ginf = { {"bin{3,6}", "none", "{3,6} on horospheres", "bin36", 8, 3, qBINARY, gcHyperbolic, 0x40000, {{7, 3}}, eVariation::pure}, {"bin-rect", "none", "rectangles on horospheres", "bin44/2", 7, 3, qBINARY, gcHyperbolic, 0x40200, {{7, 3}}, eVariation::pure}, {"bin{6,3}", "none", "{6,3} on horospheres", "bin63", 14, 3, qBINARY, gcHyperbolic, 0x40400, {{7, 3}}, eVariation::pure}, + {"{4,3,5}","field", "{4,3,5} field quotient space", "f435", 6, 5, qsSMALLBF, gcHyperbolic, 0x40600, {{SEE_ALL, SEE_ALL}}, eVariation::pure}, + {"{5,3,4}","field", "{5,3,4} field quotient space", "f435", 12, 4, qsSMALLBF, gcHyperbolic, 0x40800, {{SEE_ALL, SEE_ALL}}, eVariation::pure}, }; // bits: 9, 10, 15, 16, (reserved for later) 17, 18 diff --git a/classes.h b/classes.h index 023e8412..9a9cf283 100644 --- a/classes.h +++ b/classes.h @@ -223,6 +223,7 @@ enum eGeometry { gCell24, gECell24, gCell600, gECell600, gHoroTris, gHoroRec, gHoroHex, + gField435, gField534, gGUARD}; enum eGeometryClass { gcHyperbolic, gcEuclid, gcSphere }; diff --git a/geom-exp.cpp b/geom-exp.cpp index d94b0423..f287066f 100644 --- a/geom-exp.cpp +++ b/geom-exp.cpp @@ -383,8 +383,9 @@ vector quotientlist = { }; vector list3d = { - gBinary3, gHoroTris, + gBinary3, gHoroTris, gHoroRec, gHoroHex, gSpace534, gSpace435, + gField534, gField435, gCubeTiling, gRhombic3, gBitrunc3, gCell120, gECell120, gCell600, gECell600, @@ -718,7 +719,7 @@ void showEuclideanMenu() { #if CAP_CRYSTAL geometry == gCrystal ? "∞^" + its(ts/2) : #endif - DIM == 3 && sphere ? its(isize(currentmap->allcells())) : + DIM == 3 && bounded ? its(isize(currentmap->allcells())) : DIM == 3 && euclid ? "∞" : worldsize < 0 ? (nom%denom ? its(nom)+"/"+its(denom) : its(-worldsize)) + " exp(∞)": (euwrap && !fulltorus) ? "∞" : diff --git a/hyper.h b/hyper.h index a96ee1df..a85e6235 100644 --- a/hyper.h +++ b/hyper.h @@ -4903,10 +4903,13 @@ inline void delayed_geo_reset() { need_reset_geometry = true; } extern unordered_map params; namespace dq { - extern set visited; extern queue> drawqueue; + extern set visited; void enqueue(heptagon *h, const transmatrix& T); + + extern set visited_by_matrix; + void enqueue_by_matrix(heptagon *h, const transmatrix& T); } typedef pair named_functionality; diff --git a/hypgraph.cpp b/hypgraph.cpp index b2164f93..50d5a2b4 100644 --- a/hypgraph.cpp +++ b/hypgraph.cpp @@ -1528,15 +1528,23 @@ void fix_the_band(transmatrix& T) { } namespace dq { - set visited; queue> drawqueue; + set visited; void enqueue(heptagon *h, const transmatrix& T) { if(!h || visited.count(h)) { return; } visited.insert(h); drawqueue.emplace(h, T, band_shift); } + set visited_by_matrix; + void enqueue_by_matrix(heptagon *h, const transmatrix& T) { + if(!h) return; + int b = reg3::bucketer(tC0(T)); + if(visited_by_matrix.count(b)) { return; } + visited_by_matrix.insert(b); + drawqueue.emplace(h, T, band_shift); + } } bool do_draw(cell *c) { diff --git a/pattern2.cpp b/pattern2.cpp index 539ba07d..8d8ebd45 100644 --- a/pattern2.cpp +++ b/pattern2.cpp @@ -1296,7 +1296,8 @@ bool pseudohept(cell *c) { #endif #if MAXMDIM == 4 if(DIM == 3) { - if(euclid) return euclid3::pseudohept(c); + if(quotient) return false; + else if(euclid) return euclid3::pseudohept(c); else return reg3::pseudohept(c); } #endif diff --git a/reg3.cpp b/reg3.cpp index d4c37f81..142bd266 100644 --- a/reg3.cpp +++ b/reg3.cpp @@ -176,6 +176,247 @@ namespace reg3 { void test(); + struct hrmap_field3 : hrmap { + vector allh; + vector acells; + + vector> tmatrices; + + int mgmul(std::initializer_list v) { + int a = 0; + for(int b: v) a = a ? currfp_gmul(a, b) : b; + return a; + } + + vector fullmatrices; + + int P, R, X; + transmatrix full_P, full_R, full_X; + + vector field_adjmoves; + vector cyclers; + int perm_group; + + vector wsrcode; + vector srcode; + + void seek(set& seen_matrices, set& seen_codes, const transmatrix& at, int ccode, const hyperpoint checker) { + if(hdist0(tC0(at)) > 4) return; + int b = reg3::bucketer(tC0(at)); + if(seen_matrices.count(b)) return; + seen_matrices.insert(b); + for(int a=0; a known(perm_group, false); + known[0] = true; + for(int a=0; a .1 && hdist(h, corner3) > .1 && abs(hdist(h, corner0)-hdist(corner0, corner1)) < .1) + cornerx = h; + println(hlog, "corner0 = ", corner0); + println(hlog, "corner1 = ", corner1); + println(hlog, "corner3 = ", corner3); + println(hlog, "cornerx = ", cornerx); + + transmatrix adj = Id, iadj = Id; + + geometry = g; + reg3::generate(); + + cyclers.clear(); + println(hlog, "S7 = ", S7); + if(S7 == 12) { + + transmatrix resmatrix; + set_column(resmatrix, 0, corner0); + set_column(resmatrix, 1, corner1); + set_column(resmatrix, 2, corner3); + set_column(resmatrix, 3, cornerx); + + transmatrix transformer; + set_column(transformer, 0, C0); + set_column(transformer, 1, tC0(reg3::adjmoves[0])); + set_column(transformer, 2, tC0(reg3::adjmoves[1])); + set_column(transformer, 3, tC0(reg3::adjmoves[2])); + + transmatrix cav = resmatrix * inverse(transformer); + println(hlog, "cav = ", cav); + println(hlog, "cav * C0 = ", cav * C0); + + set seen_matrices; + set seen_codes; + seek(seen_matrices, seen_codes, Id, 0, corner0); + + for(int x: seen_codes) cyclers.push_back(x); + perm_group = isize(cyclers); + adj = cav; + iadj = inverse(cav); + } + else { + for(int i=0; i (S7); + allh[i]->c7 = newCell(S7, allh[i]); + allh[i]->fieldval = i; + acells.push_back(allh[i]->c7); + } + + println(hlog, "finding tmatrices..."); + tmatrices.resize(cells); + + for(int i=0; imove(d) = allh[srcode[tmul2]]; + tmatrices[i].push_back(reg3::adjmoves[d] * iadj * fullmatrices[s] * adj); + found++; + } + } + if(found != 1) println(hlog, "bad found: ", i, "/", d, "/", found); + println(hlog, "tmatrix(",i,",",d,") = ", tmatrices[i][d]); + } + } + + println(hlog, "setting spin..."); + for(int i=0; imove(d)->move(e) == allh[i]) + allh[i]->c.setspin(d, e, false); + + } + + void draw() override { + sphereflip = Id; + if(!sightranges[geometry]) sightranges[geometry] = 3; + + // for(int i=0; i(p); + transmatrix V = get<1>(p); + dynamicval b(band_shift, get<2>(p)); + bandfixer bf(V); + dq::drawqueue.pop(); + + cell *c = h->c7; + if(!do_draw(c, V)) continue; + drawcell(c, V, 0, false); + + for(int d=0; dmove(d), V * tmatrices[h->fieldval][d]); + } + } + + transmatrix relative_matrix(heptagon *h2, heptagon *h1) override { + if(h1 == h2) return Id; + int d = hr::celldistance(h2->c7, h1->c7); + + for(int a=0; amove(a)->c7, h2->c7) < d) + return tmatrices[h1->fieldval][a] * relative_matrix(h2, h1->move(a)); + + println(hlog, "error in hrmap_field3:::relative_matrix"); + return Id; + } + + heptagon *getOrigin() override { return allh[0]; } + + vector& allcells() override { return acells; } + }; + struct hrmap_reg3 : hrmap { heptagon *origin; @@ -409,6 +650,7 @@ namespace reg3 { }; hrmap* new_map() { + if(quotient) return new hrmap_field3; return new hrmap_reg3; }