2
3
4
5
6
7
8
9
10
11
12
13
14
15
27 std::cout <<
"Usage: " << filename
28 <<
" <start temperature> <end temperature> <points> "
29 "<lattice size> <cycles> <burn-in-time> <output file>\n\n"
30 <<
"\t[ -h | --help ]\n";
35int main(
int argc,
char **argv)
38 struct option long_options[] = {{
"help", 0, 0, 0}, {NULL, 0, NULL, 0}};
40 int option_index = -1;
44 c = getopt_long(argc, argv,
"h", long_options, &option_index);
51 switch (option_index) {
72 double start = atof(argv[1]), end = atof(argv[2]);
73 int points = atoi(argv[3]), cycles = atoi(argv[5]), L = atoi(argv[4]),
74 burn_in_time = atoi(argv[6]), N = L * L;
75 std::string outfile = argv[7];
82 std::cout <<
"Time: " << t1 - t0 <<
" seconds\n";
int main(int argc, char **argv)
The main function.
void usage(std::string filename)
A function that displays how to use the program and quits.
void phase_transition(int L, double start_T, double end_T, int points_T, int cycles, std::function< data_t(int, double, int, int)> monte_carlo, std::string outfile, int burn_in_time=BURN_IN_TIME)
Perform the MCMC algorithm using a range of temperatures.
data_t mcmc_parallel(int L, double T, int cycles, int burn_in_time=BURN_IN_TIME)
Execute the Metropolis algorithm for a certain amount of Monte Carlo cycles in parallel.