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];
77 montecarlo::phase_transition(L, start, end, points, cycles,
78 montecarlo::mcmc_parallel, outfile, burn_in_time);
82 std::cout <<
"Time: " << t1 - t0 <<
" seconds\n";
Header for the data_t type.
Functions for Monte Carlo simulations.
void usage(std::string filename)
A function that displays how to use the program and quits.
int main()
The main function.
Function prototypes and macros that are useful.