diff --git a/fieldpattern.cpp b/fieldpattern.cpp index fc28606c..92cdd6d7 100644 --- a/fieldpattern.cpp +++ b/fieldpattern.cpp @@ -1148,7 +1148,7 @@ void fpattern::findsubpath() { } } -fpattern fp43(43); +fpattern *fp43; EX void info() { fpattern fp(0); @@ -1303,16 +1303,18 @@ EX struct fpattern& getcurrfp() { return fp; } if(sphere || euclid) return fp_invalid; - if(S7 == 7 && S3 == 3 && !bt::in()) - return fp43; + if(S7 == 7 && S3 == 3 && !bt::in()) { + if(!fp43) fp43 = new fpattern(43); + return *fp43; + } return fp_invalid; } #undef STR // todo undefined behavior -EX int subpathid = currfp.matcode[currfp.strtomatrix("RRRPRRRRRPRRRP")]; -EX int subpathorder = currfp.order(currfp.matrices[subpathid]); +EX int subpathid = -1; +EX int subpathorder = -1; // extra information for field quotient extra configuration diff --git a/pattern2.cpp b/pattern2.cpp index eb33881f..07060f7e 100644 --- a/pattern2.cpp +++ b/pattern2.cpp @@ -467,6 +467,12 @@ EX int fieldval_uniq_rand(cell *c, int randval) { } pair subval(cell *c, int _subpathid = subpathid, int _subpathorder = subpathorder) { + + if(_subpathid == -1) + _subpathid = currfp.matcode[currfp.strtomatrix("RRRPRRRRRPRRRP")]; + if(_subpathorder == -1) + _subpathorder = currfp.order(currfp.matrices[subpathid]); + if(!ctof(c)) { auto m = subval(createMov(c, 0)); for(int u=2; u