2
3
4
5
6
7
8
9
10
11
21
24 std::string outfile =
"data/timing/lattice_sizes.txt";
27 int lattice_sizes[] = {20, 40, 60, 80, 100};
32 for (
int L : lattice_sizes) {
44
47 std::string outfile =
"data/timing/sample_sizes.txt";
50 int sample_sizes[] = {1000, 10000, 100000};
55 for (
int samples : sample_sizes) {
69 std::cout <<
"Usage: " << filename <<
" OPTION ...\n"
70 <<
"At least one option should be used.\n\n"
71 <<
"\t[ -h | --help ]\n"
73 <<
"\t[ --time-lattice-sizes ]\n"
74 <<
"\t[ --time-sample-sizes ]\n";
79int main(
int argc,
char **argv)
81 struct option long_options[] = {{
"all", 0, 0, 0},
82 {
"time-lattice-sizes", 0, 0, 0},
83 {
"time-sample-sizes", 0, 0, 0},
87 int option_index = -1;
91 c = getopt_long(argc, argv,
"h", long_options, &option_index);
98 switch (option_index) {
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.
void time_lattice_sizes()
Time phase transition using different lattice sizes.
void time_sample_sizes()
Time phase transition using different sample sizes.
bool mkpath(std::string path, int mode=0777)
Make path given.
std::string scientific_format(double d, int width=20, int prec=10)
Turns a double into a string written in scientific format.
std::string dirname(const std::string &path)
Get the directory name of the path.