added missing MAXMDIM guards in fieldpattern

This commit is contained in:
Zeno Rogue 2020-04-17 15:36:32 +02:00
parent a246e53d2c
commit 7c9e37031e
2 changed files with 9 additions and 9 deletions

View File

@ -284,7 +284,7 @@ struct fpattern {
fpattern(int p) { fpattern(int p) {
force_hash = 0; force_hash = 0;
#if CAP_THREAD #if CAP_THREAD && MAXMDIM >= 4
dis = nullptr; dis = nullptr;
#endif #endif
if(!p) return; if(!p) return;
@ -317,7 +317,7 @@ struct fpattern {
#endif #endif
}; };
#if CAP_THREAD #if CAP_THREAD && MAXMDIM >= 4
struct discovery { struct discovery {
fpattern experiment; fpattern experiment;
std::shared_ptr<std::thread> discoverer; std::shared_ptr<std::thread> discoverer;
@ -404,7 +404,7 @@ vector<matrix> fpattern::generate_isometries3() {
for(T[3][1]=low; T[3][1]<Prime; T[3][1]++) for(T[3][1]=low; T[3][1]<Prime; T[3][1]++)
if(colprod(1, 1) == 1) if(colprod(1, 1) == 1)
if(colprod(1, 0) == 0) { if(colprod(1, 0) == 0) {
#if CAP_THREAD #if CAP_THREAD && MAXMDIM >= 4
if(dis) dis->check_suspend(); if(dis) dis->check_suspend();
if(dis && dis->stop_it) return res; if(dis && dis->stop_it) return res;
#endif #endif
@ -528,7 +528,7 @@ int fpattern::solve3() {
for(auto& xX: possible_X) for(auto& xX: possible_X)
for(auto& xP: possible_P) if(check_order(mmul(xP, xX), cgi.xp_order)) 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) 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 #if CAP_THREAD && MAXMDIM >+ 4
if(dis) dis->check_suspend(); if(dis) dis->check_suspend();
if(dis && dis->stop_it) return 0; if(dis && dis->stop_it) return 0;
#endif #endif
@ -542,7 +542,7 @@ int fpattern::solve3() {
} }
P = xP; R = xR; X = xX; P = xP; R = xR; X = xX;
if(!generate_all3()) continue; if(!generate_all3()) continue;
#if CAP_THREAD #if CAP_THREAD && MAXMDIM >= 4
if(dis) { dis->discovered(); continue; } if(dis) { dis->discovered(); continue; }
#endif #endif
if(force_hash && compute_hash() != force_hash) continue; if(force_hash && compute_hash() != force_hash) continue;
@ -1254,7 +1254,7 @@ EX void field_from_current() {
fieldpattern::quotient_field_changed = true; fieldpattern::quotient_field_changed = true;
} }
#if CAP_THREAD #if CAP_THREAD && MAXMDIM >= 4
EX map<string, discovery> discoveries; EX map<string, discovery> discoveries;
void discovery::activate() { void discovery::activate() {
@ -1294,7 +1294,7 @@ discovery::~discovery() { schedule_destruction(); if(discoverer) discoverer->joi
#endif #endif
int hk = int hk =
#if CAP_THREAD #if CAP_THREAD && MAXMDIM >= 4
+ addHook(on_geometry_change, 100, [] { for(auto& d:discoveries) if(!d.second.is_suspended) d.second.suspend(); }) + addHook(on_geometry_change, 100, [] { for(auto& d:discoveries) if(!d.second.is_suspended) d.second.suspend(); })
+ addHook(final_cleanup, 100, [] { + addHook(final_cleanup, 100, [] {
for(auto& d:discoveries) { d.second.schedule_destruction(); if(d.second.is_suspended) d.second.activate(); } for(auto& d:discoveries) { d.second.schedule_destruction(); if(d.second.is_suspended) d.second.activate(); }

View File

@ -405,7 +405,7 @@ EX string dim_name() {
return " (" + its(WDIM) + "D)"; return " (" + its(WDIM) + "D)";
} }
#if CAP_THREAD #if CAP_THREAD && MAXMDIM >= 4
EX void showQuotientConfig3() { EX void showQuotientConfig3() {
using namespace fieldpattern; using namespace fieldpattern;
@ -528,7 +528,7 @@ EX void select_quotient_screen() {
println(hlog, "set prime = ", currfp.Prime); println(hlog, "set prime = ", currfp.Prime);
start_game(); start_game();
} }
#if CAP_THREAD #if CAP_THREAD && MAXMDIM >= 4
pushScreen(showQuotientConfig3); pushScreen(showQuotientConfig3);
#endif #endif
} }