fieldpattern:: load found solutions from shstreams
This commit is contained in:
parent
9f947c70a7
commit
b58138cd94
|
@ -307,7 +307,8 @@ struct fpattern {
|
||||||
vector<matrix> generate_isometries3();
|
vector<matrix> generate_isometries3();
|
||||||
int solve3();
|
int solve3();
|
||||||
bool generate_all3();
|
bool generate_all3();
|
||||||
|
|
||||||
|
void set_field(int p, int sq);
|
||||||
// transmatrix full_R, full_P, full_X;
|
// transmatrix full_R, full_P, full_X;
|
||||||
|
|
||||||
#if CAP_THREAD
|
#if CAP_THREAD
|
||||||
|
@ -468,6 +469,9 @@ unsigned fpattern::compute_hash() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool fpattern::generate_all3() {
|
bool fpattern::generate_all3() {
|
||||||
|
|
||||||
|
reg3::generate_fulls();
|
||||||
|
|
||||||
matrices.clear();
|
matrices.clear();
|
||||||
matcode.clear();
|
matcode.clear();
|
||||||
add1(Id);
|
add1(Id);
|
||||||
|
@ -489,7 +493,6 @@ bool fpattern::generate_all3() {
|
||||||
}
|
}
|
||||||
|
|
||||||
int fpattern::solve3() {
|
int fpattern::solve3() {
|
||||||
reg3::generate_cellrotations();
|
|
||||||
reg3::construct_relations();
|
reg3::construct_relations();
|
||||||
|
|
||||||
DEBB(DF_FIELD, ("generating isometries for ", Field));
|
DEBB(DF_FIELD, ("generating isometries for ", Field));
|
||||||
|
@ -551,6 +554,13 @@ int fpattern::solve3() {
|
||||||
return cmb;
|
return cmb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void fpattern::set_field(int p, int sq) {
|
||||||
|
Prime = p;
|
||||||
|
Field = sq ? Prime*Prime : Prime;
|
||||||
|
wsquare = sq;
|
||||||
|
for(int a=0; a<MWDIM; a++) for(int b=0; b<MWDIM; b++) Id[a][b] = a==b?1:0;
|
||||||
|
}
|
||||||
|
|
||||||
int fpattern::solve() {
|
int fpattern::solve() {
|
||||||
|
|
||||||
for(int a=0; a<MWDIM; a++) for(int b=0; b<MWDIM; b++) Id[a][b] = a==b?1:0;
|
for(int a=0; a<MWDIM; a++) for(int b=0; b<MWDIM; b++) Id[a][b] = a==b?1:0;
|
||||||
|
@ -1063,6 +1073,9 @@ EX fpattern current_quotient_field = fpattern(0);
|
||||||
EX fpattern fp_invalid = fpattern(0);
|
EX fpattern fp_invalid = fpattern(0);
|
||||||
EX bool quotient_field_changed;
|
EX bool quotient_field_changed;
|
||||||
|
|
||||||
|
// these strings contain \x00
|
||||||
|
#define STR(x) string(x, sizeof(x))
|
||||||
|
|
||||||
EX struct fpattern& getcurrfp() {
|
EX struct fpattern& getcurrfp() {
|
||||||
if(geometry == gFieldQuotient && quotient_field_changed)
|
if(geometry == gFieldQuotient && quotient_field_changed)
|
||||||
return current_quotient_field;
|
return current_quotient_field;
|
||||||
|
@ -1075,17 +1088,21 @@ EX struct fpattern& getcurrfp() {
|
||||||
// 260 cells, hash = 72414D0C (not 0C62E214)
|
// 260 cells, hash = 72414D0C (not 0C62E214)
|
||||||
static fpattern fp(0);
|
static fpattern fp(0);
|
||||||
if(fp.Prime) return fp;
|
if(fp.Prime) return fp;
|
||||||
fp.Prime = 5; fp.force_hash = 0x72414D0C; fp.solve();
|
// fp.Prime = 5; fp.force_hash = 0x72414D0C; fp.solve();
|
||||||
// fp.Prime = 11; fp.force_hash = 0x5FC4CFF0; fp.solve();
|
// fp.Prime = 11; fp.force_hash = 0x5FC4CFF0; fp.solve();
|
||||||
|
shstream ins(STR("\x05\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\xfc\xff\xff\xff\x01\x00\x00\x00\x04\x00\x00\x00\xfc\xff\xff\xff\x04\x00\x00\x00\xfe\xff\xff\xff\x00\x00\x00\x00\x01\x00\x00\x00\xfe\xff\xff\xff\x04\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\xfc\xff\xff\xff\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\xfc\xff\xff\xff\x02\x00\x00\x00\x00\x00\x00\x00\xfc\xff\xff\xff\x01\x00\x00\x00\xfd\xff\xff\xff\x00\x00\x00\x00\x02\x00\x00\x00\xfd\xff\xff\xff\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00"));
|
||||||
|
hread_fpattern(ins, fp);
|
||||||
return fp;
|
return fp;
|
||||||
}
|
}
|
||||||
if(geometry == gSpace435) {
|
if(geometry == gSpace435) {
|
||||||
// 650 cells, hash = EB201050
|
// 650 cells, hash = EB201050
|
||||||
static fpattern fp(0);
|
static fpattern fp(0);
|
||||||
if(fp.Prime) return fp;
|
if(fp.Prime) return fp;
|
||||||
fp.Prime = 5; fp.force_hash = 0x72414D0C; fp.solve();
|
// fp.Prime = 5; fp.force_hash = 0xEB201050; fp.solve();
|
||||||
|
// what is 0x72414D0C??
|
||||||
// fp.Prime = 11; fp.force_hash = 0x65CE0C00; fp.solve();
|
// fp.Prime = 11; fp.force_hash = 0x65CE0C00; fp.solve();
|
||||||
|
shstream ins(STR("\x05\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\xfc\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff\xfc\xff\xff\xff\x04\x00\x00\x00\x02\x00\x00\x00\x04\x00\x00\x00\xff\xff\xff\xff\x02\x00\x00\x00\x03\x00\x00\x00\x03\x00\x00\x00\xfd\xff\xff\xff\x01\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\xfc\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\xfd\xff\xff\xff\xfd\xff\xff\xff\x00\x00\x00\x00\xfd\xff\xff\xff\x02\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\xfd\xff\xff\xff\x03\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00"));
|
||||||
|
hread_fpattern(ins, fp);
|
||||||
return fp;
|
return fp;
|
||||||
}
|
}
|
||||||
if(geometry == gSpace336) {
|
if(geometry == gSpace336) {
|
||||||
|
@ -1094,7 +1111,9 @@ EX struct fpattern& getcurrfp() {
|
||||||
// 9408 cells in C4089F34
|
// 9408 cells in C4089F34
|
||||||
static fpattern fp(0);
|
static fpattern fp(0);
|
||||||
if(fp.Prime) return fp;
|
if(fp.Prime) return fp;
|
||||||
fp.Prime = 7; fp.force_hash = 0xE3F6B7BCu; fp.solve();
|
// fp.Prime = 7; fp.force_hash = 0xE3F6B7BCu; fp.solve();
|
||||||
|
shstream ins(STR("\x07\x00\x00\x00\x03\x00\x00\x00\xfa\xff\xff\xff\x02\x00\x00\x00\x03\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\xfe\xff\xff\xff\xfb\xff\xff\xff\xfc\xff\xff\xff\x03\x00\x00\x00\xfb\xff\xff\xff\xfd\xff\xff\xff\xfb\xff\xff\xff\x01\x00\x00\x00\xfd\xff\xff\xff\xfe\xff\xff\xff\xfd\xff\xff\xff\x03\x00\x00\x00\x00\x00\x00\x00\xfd\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfc\xff\xff\xff\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\xfa\xff\xff\xff\xfb\xff\xff\xff\x00\x00\x00\x00\xfa\xff\xff\xff\x02\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x00\xfb\xff\xff\xff\x06\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00"));
|
||||||
|
hread_fpattern(ins, fp);
|
||||||
return fp;
|
return fp;
|
||||||
}
|
}
|
||||||
if(geometry == gSpace344) {
|
if(geometry == gSpace344) {
|
||||||
|
@ -1145,6 +1164,8 @@ EX struct fpattern& getcurrfp() {
|
||||||
return fp_invalid;
|
return fp_invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef STR
|
||||||
|
|
||||||
// todo undefined behavior
|
// todo undefined behavior
|
||||||
EX int subpathid = currfp.matcode[currfp.strtomatrix("RRRPRRRRRPRRRP")];
|
EX int subpathid = currfp.matcode[currfp.strtomatrix("RRRPRRRRRPRRRP")];
|
||||||
EX int subpathorder = currfp.order(currfp.matrices[subpathid]);
|
EX int subpathorder = currfp.order(currfp.matrices[subpathid]);
|
||||||
|
@ -1289,5 +1310,23 @@ EX int currfp_get_R() { return currfp.matcode[currfp.R]; }
|
||||||
EX int currfp_get_P() { return currfp.matcode[currfp.P]; }
|
EX int currfp_get_P() { return currfp.matcode[currfp.P]; }
|
||||||
EX int currfp_get_X() { return currfp.matcode[currfp.X]; }
|
EX int currfp_get_X() { return currfp.matcode[currfp.X]; }
|
||||||
|
|
||||||
|
EX void hread_fpattern(hstream& hs, fieldpattern::fpattern& fp) {
|
||||||
|
hread(hs, fp.Prime);
|
||||||
|
hread(hs, fp.wsquare);
|
||||||
|
hread(hs, fp.P);
|
||||||
|
hread(hs, fp.R);
|
||||||
|
hread(hs, fp.X);
|
||||||
|
fp.set_field(fp.Prime, fp.wsquare);
|
||||||
|
fp.generate_all3();
|
||||||
|
}
|
||||||
|
|
||||||
|
EX void hwrite_fpattern(hstream& hs, fieldpattern::fpattern& fp) {
|
||||||
|
hwrite(hs, fp.Prime);
|
||||||
|
hwrite(hs, fp.wsquare);
|
||||||
|
hwrite(hs, fp.P);
|
||||||
|
hwrite(hs, fp.R);
|
||||||
|
hwrite(hs, fp.X);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -988,6 +988,13 @@ int read_geom_args() {
|
||||||
fieldpattern::subpathid = currfp.matcode[M];
|
fieldpattern::subpathid = currfp.matcode[M];
|
||||||
fieldpattern::subpathorder = currfp.order(M);
|
fieldpattern::subpathorder = currfp.order(M);
|
||||||
}
|
}
|
||||||
|
else if(argis("-fwrite")) {
|
||||||
|
shstream hs;
|
||||||
|
hwrite_fpattern(hs, currfp);
|
||||||
|
string s;
|
||||||
|
for(char c: hs.s) s += format("\\x%02x", (unsigned char) c);
|
||||||
|
println(hlog, "current fieldpattern: ", s);
|
||||||
|
}
|
||||||
else if(argis("-csp")) {
|
else if(argis("-csp")) {
|
||||||
cheat();
|
cheat();
|
||||||
currfp.findsubpath();
|
currfp.findsubpath();
|
||||||
|
|
40
reg3.cpp
40
reg3.cpp
|
@ -1084,6 +1084,27 @@ EX int matrix_order(const transmatrix A) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EX void generate_fulls() {
|
||||||
|
reg3::generate();
|
||||||
|
reg3::generate_cellrotations();
|
||||||
|
|
||||||
|
auto cons = [&] (int i0, int i1, int i2) {
|
||||||
|
using reg3::adjmoves;
|
||||||
|
transmatrix T = build_matrix(adjmoves[ 0]*C0, adjmoves[ 1]*C0, adjmoves[ 2]*C0, C0);
|
||||||
|
transmatrix U = build_matrix(adjmoves[i0]*C0, adjmoves[i1]*C0, adjmoves[i2]*C0, C0);
|
||||||
|
return U * inverse(T);
|
||||||
|
};
|
||||||
|
|
||||||
|
full_P = reg3::adjmoves[0];
|
||||||
|
full_R = S7 == 8 ? cons(1, 7, 0) : cons(1, 2, 0);
|
||||||
|
full_X = S7 == 8 ? cons(1, 0, 6) : S7 == 6 ? cons(1, 0, 5) : cons(1, 0, reg3::face);
|
||||||
|
|
||||||
|
xp_order = matrix_order(full_X * full_P);
|
||||||
|
r_order = matrix_order(full_R);
|
||||||
|
rx_order = matrix_order(full_R * full_X);
|
||||||
|
println(hlog, "orders = ", tie(rx_order, r_order, xp_order));
|
||||||
|
}
|
||||||
|
|
||||||
EX void construct_relations() {
|
EX void construct_relations() {
|
||||||
if(for_cgi == &cgi) return;
|
if(for_cgi == &cgi) return;
|
||||||
for_cgi = &cgi;
|
for_cgi = &cgi;
|
||||||
|
@ -1091,6 +1112,7 @@ EX void construct_relations() {
|
||||||
|
|
||||||
reg3::generate();
|
reg3::generate();
|
||||||
reg3::generate_cellrotations();
|
reg3::generate_cellrotations();
|
||||||
|
reg3::generate_fulls();
|
||||||
vector<transmatrix> all;
|
vector<transmatrix> all;
|
||||||
|
|
||||||
vector<string> formulas;
|
vector<string> formulas;
|
||||||
|
@ -1106,17 +1128,6 @@ EX void construct_relations() {
|
||||||
return S;
|
return S;
|
||||||
};
|
};
|
||||||
|
|
||||||
auto cons = [&] (int i0, int i1, int i2) {
|
|
||||||
using reg3::adjmoves;
|
|
||||||
transmatrix T = build_matrix(adjmoves[ 0]*C0, adjmoves[ 1]*C0, adjmoves[ 2]*C0, C0);
|
|
||||||
transmatrix U = build_matrix(adjmoves[i0]*C0, adjmoves[i1]*C0, adjmoves[i2]*C0, C0);
|
|
||||||
return U * inverse(T);
|
|
||||||
};
|
|
||||||
|
|
||||||
full_P = reg3::adjmoves[0];
|
|
||||||
full_R = S7 == 8 ? cons(1, 7, 0) : cons(1, 2, 0);
|
|
||||||
full_X = S7 == 8 ? cons(1, 0, 6) : S7 == 6 ? cons(1, 0, 5) : cons(1, 0, reg3::face);
|
|
||||||
|
|
||||||
println(hlog, reg3::cellshape);
|
println(hlog, reg3::cellshape);
|
||||||
|
|
||||||
println(hlog, "cellshape = ", isize(reg3::cellshape));
|
println(hlog, "cellshape = ", isize(reg3::cellshape));
|
||||||
|
@ -1153,12 +1164,7 @@ EX void construct_relations() {
|
||||||
work(T * full_R, i, 'R');
|
work(T * full_R, i, 'R');
|
||||||
work(T * full_X, i, 'X');
|
work(T * full_X, i, 'X');
|
||||||
work(T * full_P, i, 'P');
|
work(T * full_P, i, 'P');
|
||||||
}
|
}
|
||||||
|
|
||||||
xp_order = matrix_order(full_X * full_P);
|
|
||||||
r_order = matrix_order(full_R);
|
|
||||||
rx_order = matrix_order(full_R * full_X);
|
|
||||||
println(hlog, "orders = ", tie(rx_order, r_order, xp_order));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EX }
|
EX }
|
||||||
|
|
Loading…
Reference in New Issue