#include #include #include "rbmp.hpp" int main(int argc, char* argv[]) { unsigned n = 100; unsigned m = 100; Real T0 = 1; Real T1 = 10; Real ΔT = 1; int opt; while ((opt = getopt(argc, argv, "n:m:0:1:d:")) != -1) { switch (opt) { case 'n': n = atoi(optarg); break; case 'm': m = (unsigned)atof(optarg); break; case '0': T0 = atof(optarg); break; case '1': T1 = atof(optarg); break; case 'd': ΔT = atof(optarg); break; default: exit(1); } } Rng r; AztecDiamond a(n); for (Real T = T0; T <= T1; T += ΔT) { Real avgFreeEnergy = 0; for (unsigned i = 0; i < m; i++) { a.setWeights(r); a.computeWeights(T); avgFreeEnergy += a.computeProbabilities(); } std::cout << std::setprecision(20) << T << " " << - T * avgFreeEnergy / m / a.vertices.size() << std::endl; } return 0; }