Fix burn-in time bug
This commit is contained in:
parent
370d72176f
commit
54e4d9243d
@ -124,7 +124,7 @@ data_t mcmc_serial(int L, double T, int cycles, int burn_in_time)
|
|||||||
data_t data;
|
data_t data;
|
||||||
IsingModel model(L, T);
|
IsingModel model(L, T);
|
||||||
|
|
||||||
for (size_t i = 0; i < BURN_IN_TIME; i++) {
|
for (size_t i = 0; i < burn_in_time; i++) {
|
||||||
model.Metropolis();
|
model.Metropolis();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -148,7 +148,7 @@ data_t mcmc_parallel(int L, double T, int cycles, int burn_in_time)
|
|||||||
|
|
||||||
// Each thread runs the Metropolis algorithm before starting to collect
|
// Each thread runs the Metropolis algorithm before starting to collect
|
||||||
// samples
|
// samples
|
||||||
for (size_t i = 0; i < BURN_IN_TIME; i++) {
|
for (size_t i = 0; i < burn_in_time; i++) {
|
||||||
model.Metropolis();
|
model.Metropolis();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -24,8 +24,8 @@
|
|||||||
void usage(std::string filename)
|
void usage(std::string filename)
|
||||||
{
|
{
|
||||||
std::cout << "Usage: " << filename
|
std::cout << "Usage: " << filename
|
||||||
<< " <start temperature> <end temperature> <lattice size> "
|
<< " <start temperature> <end temperature> <points> "
|
||||||
"<points> <cycles> <burn-in-time> <output file>\n\n"
|
"<lattice size> <cycles> <burn-in-time> <output file>\n\n"
|
||||||
<< "\t[ -h | --help ]\n";
|
<< "\t[ -h | --help ]\n";
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
@ -76,7 +76,7 @@ int main(int argc, char **argv)
|
|||||||
std::string outfile = argv[7];
|
std::string outfile = argv[7];
|
||||||
|
|
||||||
montecarlo::phase_transition(L, start, end, points, cycles,
|
montecarlo::phase_transition(L, start, end, points, cycles,
|
||||||
montecarlo::mcmc_parallel, outfile);
|
montecarlo::mcmc_parallel, outfile, burn_in_time);
|
||||||
|
|
||||||
t1 = omp_get_wtime();
|
t1 = omp_get_wtime();
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user