// Code written by Andy Huchala based on a joint program written with Jonathan Lee. // Computes the list of dimensions for which there exist several non-isomorphic irreducible representations of G2. #include #include #include #include #include // Requires this file in the same directory to print, available at https://github.com/sercantutar/infint/blob/master/InfInt.h #include "InfInt.h" class Pair { public: long double log; long long coordinates; Pair(long long coordinates, long double log) { this->coordinates = coordinates; this->log = log; } }; bool operator<(const Pair & p1, const Pair & p2) { return p1.log > p2.log; } int main() { const long UPPER_BOUND_FACTOR = 900000; const long shift_const = (1LL << 32L) - 1L; long double* cachedLogs = (long double*) malloc(sizeof (long double) * UPPER_BOUND_FACTOR); // long double cachedLogs [UPPER_BOUND_FACTOR]; int cums[2] = {0, 32}; const int denom = 120; for (long i = 1; i < UPPER_BOUND_FACTOR; i++) { cachedLogs[i] = std::log ( i); } long long x = 0LL; std::priority_queue fringe; std::unordered_set seen; // const long long numToCompute = 10; const long long numToCompute = 20000; long numComputed = 0; int numSeen = 1; long double irrep = 4.7874917427820; fringe.push(Pair(x, irrep)); long double lastLog = 0.0; long long lastCoord = -1LL; long x0;long x1; long long newCoord; long double newIrrep; std::cout<< "Initialization complete\n"; std::ofstream myfile ("g2_rep.txt"); if (myfile.is_open()) { while (numSeen < numToCompute + 1) { numComputed++; Pair cur = fringe.top(); fringe.pop(); seen.erase(cur.coordinates); if (std::abs(lastLog-cur.log) < 1e-12) { x0 = (long) (cur.coordinates & shift_const) + 1L; x1 = (long) ((cur.coordinates >> 32LL) & shift_const) + 1L; InfInt dim1 = "1"; dim1 *= (x0); dim1 *= (x1); dim1 *= (x0+x1); dim1 *= (x0+2*x1); dim1 *= (x0+3*x1); dim1 *= (2*x0+3*x1); dim1 /= denom; x0 = (long) (lastCoord & shift_const) + 1L; x1 = (long) ((lastCoord >> 32LL) & shift_const) + 1L; InfInt dim2 = "1"; dim2 *= (x0); dim2 *= (x1); dim2 *= (x0+x1); dim2 *= (x0+2*x1); dim2 *= (x0+3*x1); dim2 *= (2*x0+3*x1); dim2 /= denom; if (dim1 == dim2) { myfile <> 32LL) & shift_const) + 1L; // std::cout<< std::to_string(x0)+ " " +std::to_string(x1)+"\n"; newIrrep = 0; newIrrep += cachedLogs[x0]; newIrrep += cachedLogs[x1]; newIrrep += cachedLogs[x0+x1]; newIrrep += cachedLogs[x0+2*x1]; newIrrep += cachedLogs[x0+3*x1]; newIrrep += cachedLogs[2*x0+3*x1]; fringe.push(Pair(newCoord, newIrrep)); seen.insert(newCoord); } } } myfile.close(); free(cachedLogs); return 0; }