diff --git a/docs/IsingModel_8cpp.html b/docs/IsingModel_8cpp.html
index 45e898a..3b1eba4 100644
--- a/docs/IsingModel_8cpp.html
+++ b/docs/IsingModel_8cpp.html
@@ -105,8 +105,6 @@ $(document).ready(function(){initNavTree('IsingModel_8cpp.html',''); initResizab
The implementation of the Ising model.
More...
#include "IsingModel.hpp "
-
#include <cmath>
-
#include <random>
Go to the source code of this file.
@@ -115,7 +113,7 @@ $(document).ready(function(){initNavTree('IsingModel_8cpp.html',''); initResizab
Janita Ovidie Sandtrøen Willumsen (janitaws)
Version 0.1
-Bug: No known bugs
+Bug: No known bugs
Definition in file IsingModel.cpp .
diff --git a/docs/IsingModel_8cpp_source.html b/docs/IsingModel_8cpp_source.html
index 84b95ce..786afe0 100644
--- a/docs/IsingModel_8cpp_source.html
+++ b/docs/IsingModel_8cpp_source.html
@@ -101,157 +101,175 @@ $(document).ready(function(){initNavTree('IsingModel_8cpp_source.html',''); init
-
Go to the documentation of this file.
-
+
Go to the documentation of this file.
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
36 this->
lattice .set_size(this->L, this->L);
-
-
-
-
-
-
-
-
-
-
-
47 std::random_device rd{};
-
48 std::mt19937 engine{rd()};
-
-
50 std::uniform_int_distribution<> coin_flip(0, 1);
-
-
52 for (
size_t i = 0; i < this->
lattice .n_elem; i++)
-
53 this->
lattice (i) = 2 * coin_flip(engine) - 1;
-
-
-
-
-
-
-
-
61 for (
int i = 0; i < (int)this->
L ; i++) {
-
62 this->
neighbors (i, UP) = INDEX(i - 1, this->
L );
-
63 this->
neighbors (i, DOWN) = INDEX(i + 1, this->
L );
-
-
-
-
-
-
69 for (
int i = -8; i <= 8; i += 4) {
-
70 this->
energy_diff .insert({i, std::exp(-(
double )i / this->
T )});
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
45 std::random_device rd{};
+
+
+
+
+
+
51 this ->lattice.set_size(
this -> L ,
this -> L );
+
+
53 std::uniform_int_distribution<> coin_flip(0, 1);
+
+
55 for (size_t i = 0; i <
this ->lattice.n_elem; i++)
+
56 this ->lattice(i) = 2 * coin_flip(
this -> engine ) - 1;
+
+
+
+
+
+
62 if (val != 1 && val != -1) {
+
+
+
+
66 this ->lattice.set_size(
this -> L ,
this -> L );
+
67 this ->lattice.fill(val);
+
+
+
+
+
72 this ->neighbors.set_size(
this -> L , 2);
-
-
-
-
77 for (
size_t i = 0; i < this->
lattice .n_elem; i++) {
-
-
-
-
-
-
-
-
-
-
87 for (
size_t j = 0; j < this->
L ; j++) {
-
88 for (
size_t i = 0; i < this->
L ; i++) {
-
-
-
-
+
+
75 for (
int i = 0; i < (
int )
this -> L ; i++) {
+
76 this ->neighbors(i,
UP ) =
INDEX (i - 1,
this -> L );
+
+
+
+
+
+
+
83 for (
int i = -8; i <= 8; i += 4) {
+
+
+
+
+
+
+
+
91 for (size_t i = 0; i <
this ->lattice.n_elem; i++) {
+
92 this -> M +=
this ->lattice(i);
-
+
-
98 std::random_device rd{};
-
99 std::mt19937_64 engine{rd()};
-
-
-
-
-
-
105 std::uniform_int_distribution<> random_index(0, this->
L - 1);
-
-
107 std::uniform_real_distribution<> random_number(0., 1.);
-
-
-
110 for (
size_t i = 0; i < this->
lattice .n_elem; i++) {
-
-
112 ri = random_index(engine);
-
113 rj = random_index(engine);
+
+
+
+
101 for (size_t j = 0; j <
this -> L ; j++) {
+
102 for (size_t i = 0; i <
this -> L ; i++) {
+
103 this -> E -=
this ->lattice(i, j)
+
104 * (
this ->lattice(i,
this ->neighbors(j,
RIGHT ))
+
105 +
this ->lattice(
this ->neighbors(i,
DOWN ), j));
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
123 if (random_number(engine) <= this->
energy_diff [dE]) {
-
-
-
126 this->
M += 2 * this->
lattice (ri, rj);
-
-
-
-
-
131 return data_t ((
double )this->
E , (
double )(this->E * this->E), (
double )this->
M ,
-
132 (
double )(this->M * this->M), std::fabs((
double )this->M));
-
-
-
-
-
-
-
-
-
-
-
-
The definition of the Ising model.
-
int M
The current magnetic strength. unit: Unitless.
-
std::unordered_map< int, double > energy_diff
A hash map containing all possible energy changes.
-
double T
The temperature of the model.
-
int L
Size of the lattice.
-
arma::Mat< int > lattice
matrix where element .
-
void initialize_lattice()
Initialize the lattice with a random distribution of 1s and -1s.
-
data_t Metropolis()
The Metropolis algorithm.
-
void initialize_energy()
Initialize the energy.
-
void initialize_neighbors()
initialize the neighbors matrix.
-
void initialize_magnetization()
Initialize the magnetization.
-
arma::Mat< int > neighbors
matrix with the neighbors of each element .
-
int get_M()
Get the current magnetization.
-
int get_E()
Get the current energy.
-
IsingModel()
Constructor used for testing.
-
int E
The current energy state. unit: .
-
void initialize_energy_diff()
Initialize the hashmap with the correct values.
-
+
+
116 std::uniform_int_distribution<> random_index(0,
this ->L - 1);
+
+
118 std::uniform_real_distribution<> random_number(0., 1.);
+
+
+
121 for (size_t i = 0; i <
this ->lattice.n_elem; i++) {
+
+
123 ri = random_index(
engine );
+
124 rj = random_index(
engine );
+
+
+
127 dE = 2 *
this ->lattice(ri, rj)
+
128 * (
this ->lattice(ri,
this ->neighbors(rj,
LEFT ))
+
129 +
this ->lattice(ri,
this ->neighbors(rj,
RIGHT ))
+
130 +
this ->lattice(
this ->neighbors(ri,
UP ), rj)
+
131 +
this ->lattice(
this ->neighbors(ri,
DOWN ), rj));
+
+
+
+
+
136 this ->lattice(ri, rj) *= -1;
+
137 this -> M += 2 *
this ->lattice(ri, rj);
+
+
+
+
+
+
143 (
double )(
this -> M *
this -> M )
, std::fabs((
double )
this -> M )
) ;
+
+
#define UP
Used for the neighbor matrix in the class.
+
#define INDEX(I, N)
I modulo N.
+
#define DOWN
Used for the neighbor matrix in the class.
+
#define LEFT
Used for the neighbor matrix in the class.
+
#define RIGHT
Used for the neighbor matrix in the class.
+
The Ising model in 2 dimensions.
+
std::mt19937 engine
The RNG that is used for the Metropolis algorithm.
+
int64_t E
The current energy state. unit: .
+
double T
The temperature of the model.
+
int L
Size of the lattice.
+
void initialize_lattice()
Initialize the lattice with a random distribution of 1s and -1s.
+
IsingModel(int L, double T, int val)
Constructor for the Ising model.
+
IsingModel(int L, double T)
Constructor for the Ising model.
+
data_t Metropolis()
The Metropolis algorithm.
+
void initialize_energy()
Initialize the energy of the system.
+
void initialize_neighbors()
initialize the neighbors matrix.
+
double energy_diff[17]
An array containing all possible energy differences.
+
void initialize_magnetization()
Initialize the magnetization of the system.
+
void initialize_engine()
Initialize the RNG.
+
void initialize_lattice(int val)
Initialize the lattice with a specific value.
+
IsingModel()
Constructor used for testing.
+
int64_t M
The current magnetic strength. unit: Unitless.
+
void initialize_energy_diff()
Initialize the energy_diff array with the correct values.
+
Type to use with the IsingModel class and montecarlo module.
+
data_t(double E, double E2, double M, double M2, double M_abs)
Constructor with parameters.
diff --git a/docs/IsingModel_8hpp.html b/docs/IsingModel_8hpp.html
index 06ffc00..fb00296 100644
--- a/docs/IsingModel_8hpp.html
+++ b/docs/IsingModel_8hpp.html
@@ -107,11 +107,10 @@ $(document).ready(function(){initNavTree('IsingModel_8hpp.html',''); initResizab
The definition of the Ising model.
More...
-#include "constants.hpp "
-
#include "data_type.hpp "
-
#include "typedefs.hpp "
+
#include "data_type.hpp "
#include "utils.hpp "
#include <armadillo>
+
#include <cstdint>
#include <random>
#include <unordered_map>
@@ -126,14 +125,19 @@ Classes
#define INDEX (I, N) (I + N) % N
+
I modulo N.
#define UP 0
+
Used for the neighbor matrix in the class.
#define LEFT 0
+
Used for the neighbor matrix in the class.
#define DOWN 1
+
Used for the neighbor matrix in the class.
#define RIGHT 1
+
Used for the neighbor matrix in the class.
@@ -142,7 +146,7 @@ Macros
Janita Ovidie Sandtrøen Willumsen (janitaws)
Version 0.1
-
Bug: No known bugs
+
Bug: No known bugs
Definition in file IsingModel.hpp .
@@ -158,7 +162,9 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
@@ -188,7 +194,9 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
@@ -204,7 +212,9 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
@@ -220,7 +230,9 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
@@ -236,7 +248,9 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
diff --git a/docs/IsingModel_8hpp.js b/docs/IsingModel_8hpp.js
index 616fe52..d0a391a 100644
--- a/docs/IsingModel_8hpp.js
+++ b/docs/IsingModel_8hpp.js
@@ -1,4 +1,9 @@
var IsingModel_8hpp =
[
- [ "IsingModel", "classIsingModel.html", "classIsingModel" ]
+ [ "IsingModel", "classIsingModel.html", "classIsingModel" ],
+ [ "DOWN", "IsingModel_8hpp.html#a4193cd1c8c2e6ebd0e056fa2364a663f", null ],
+ [ "INDEX", "IsingModel_8hpp.html#a3039ac753f46401767c38f867787fae6", null ],
+ [ "LEFT", "IsingModel_8hpp.html#a437ef08681e7210d6678427030446a54", null ],
+ [ "RIGHT", "IsingModel_8hpp.html#a80fb826a684cf3f0d306b22aa100ddac", null ],
+ [ "UP", "IsingModel_8hpp.html#a1965eaca47dbf3f87acdafc2208f04eb", null ]
];
\ No newline at end of file
diff --git a/docs/IsingModel_8hpp_source.html b/docs/IsingModel_8hpp_source.html
index 6282c69..b3123e4 100644
--- a/docs/IsingModel_8hpp_source.html
+++ b/docs/IsingModel_8hpp_source.html
@@ -101,92 +101,168 @@ $(document).ready(function(){initNavTree('IsingModel_8hpp_source.html',''); init
-
Go to the documentation of this file.
-
12 #ifndef __ISING_MODEL__
-
13 #define __ISING_MODEL__
+
Go to the documentation of this file.
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12 # ifndef __ISING_MODEL__
+
13 # define __ISING_MODEL__
-
-
-
-
-
-
-
-
22 #include <unordered_map>
-
-
24 #define INDEX(I, N) (I + N) % N
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Test class for the Ising model.
-
The Ising model in 2 dimensions.
-
int M
The current magnetic strength. unit: Unitless.
-
std::unordered_map< int, double > energy_diff
A hash map containing all possible energy changes.
-
double T
The temperature of the model.
-
int L
Size of the lattice.
-
arma::Mat< int > lattice
matrix where element .
-
void initialize_lattice()
Initialize the lattice with a random distribution of 1s and -1s.
-
data_t Metropolis()
The Metropolis algorithm.
-
void initialize_energy()
Initialize the energy.
-
void initialize_neighbors()
initialize the neighbors matrix.
-
void initialize_magnetization()
Initialize the magnetization.
-
arma::Mat< int > neighbors
matrix with the neighbors of each element .
-
int get_M()
Get the current magnetization.
-
int get_E()
Get the current energy.
-
IsingModel()
Constructor used for testing.
-
int E
The current energy state. unit: .
-
void initialize_energy_diff()
Initialize the hashmap with the correct values.
-
-
-
Header for the data_t type.
-
Useful typedefs for cleaner code.
-
Function prototypes and macros that are useful.
+
+
+
+
+
+
+
21 # include < unordered_map >
+
+
23 # define INDEX ( I , N ) ( I + N ) % N
+
+
+
+
+
+
+
+
+
32
+
33
+
34
+
35
+
+
+
+
39
+
+
+
+
43
+
+
+
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
+
+
+
57
+
+
+
+
61
+
+
+
+
65
+
+
+
+
69
+
+
+
+
73
+
+
+
+
77
+
+
+
+
81
+
+
+
+
85
+
86
+
+
+
+
90
+
+
+
+
94
+
+
+
+
98
+
+
+
+
102
+
+
+
+
106
+
+
+
+
110
+
+
+
+
+
115
+
116
+
117
+
118
+
+
+
+
122
+
123
+
124
+
125
+
126
+
+
+
+
130
+
+
+
+
+
#define UP
Used for the neighbor matrix in the class.
+
#define INDEX(I, N)
I modulo N.
+
#define DOWN
Used for the neighbor matrix in the class.
+
#define LEFT
Used for the neighbor matrix in the class.
+
#define RIGHT
Used for the neighbor matrix in the class.
+
Test class for the Ising model.
+
The Ising model in 2 dimensions.
+
std::mt19937 engine
The RNG that is used for the Metropolis algorithm.
+
int64_t E
The current energy state. unit: .
+
double T
The temperature of the model.
+
int L
Size of the lattice.
+
arma::Mat< int > lattice
matrix where element .
+
void initialize_lattice()
Initialize the lattice with a random distribution of 1s and -1s.
+
IsingModel(int L, double T, int val)
Constructor for the Ising model.
+
IsingModel(int L, double T)
Constructor for the Ising model.
+
data_t Metropolis()
The Metropolis algorithm.
+
void initialize_energy()
Initialize the energy of the system.
+
void initialize_neighbors()
initialize the neighbors matrix.
+
double energy_diff[17]
An array containing all possible energy differences.
+
void initialize_magnetization()
Initialize the magnetization of the system.
+
arma::Mat< int > neighbors
matrix with the neighbors of each element .
+
void initialize_engine()
Initialize the RNG.
+
void initialize_lattice(int val)
Initialize the lattice with a specific value.
+
IsingModel()
Constructor used for testing.
+
int64_t M
The current magnetic strength. unit: Unitless.
+
void initialize_energy_diff()
Initialize the energy_diff array with the correct values.
+
Type to use with the IsingModel class and montecarlo module.
+
data_t(double E, double E2, double M, double M2, double M_abs)
Constructor with parameters.
diff --git a/docs/README_8md.html b/docs/README_8md.html
new file mode 100644
index 0000000..1e5e6d8
--- /dev/null
+++ b/docs/README_8md.html
@@ -0,0 +1,114 @@
+
+
+
+
+
+
+
+2 Dimensional Ising Model: README.md File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2 Dimensional Ising Model
+
+ Simulate the change in energy and magnetization in a ferro magnet
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/annotated.html b/docs/annotated.html
index 751b997..bd0ed41 100644
--- a/docs/annotated.html
+++ b/docs/annotated.html
@@ -103,7 +103,7 @@ $(document).ready(function(){initNavTree('annotated.html',''); initResizable();
Here are the classes, structs, unions and interfaces with brief descriptions:
diff --git a/docs/annotated_dup.js b/docs/annotated_dup.js
index 74285eb..fa4ef24 100644
--- a/docs/annotated_dup.js
+++ b/docs/annotated_dup.js
@@ -1,6 +1,6 @@
var annotated_dup =
[
- [ "data_t", "classdata__t.html", null ],
+ [ "data_t", "classdata__t.html", "classdata__t" ],
[ "IsingModel", "classIsingModel.html", "classIsingModel" ],
[ "IsingModelTest", "classIsingModelTest.html", "classIsingModelTest" ]
];
\ No newline at end of file
diff --git a/docs/bug.html b/docs/bug.html
index e17d575..d6f2015 100644
--- a/docs/bug.html
+++ b/docs/bug.html
@@ -102,34 +102,38 @@ $(document).ready(function(){initNavTree('bug.html',''); initResizable(); });
-File constants.hpp
- No known bugs
File data_type.cpp
- No known bugs
+ No known bugs
File data_type.hpp
No known bugs
File IsingModel.cpp
- No known bugs
-File IsingModel.hpp
No known bugs
-File main.cpp
- No known bugs
-File monte_carlo.cpp
- No known bugs
-File monte_carlo.hpp
+File IsingModel.hpp
No known bugs
+File main.cpp
+ No known bugs
+File mcmc_progression.cpp
+ No known bugs
+File monte_carlo.cpp
+ No known bugs
+File monte_carlo.hpp
+ No known bugs
+File pd_estimate.cpp
+ No known bugs
+File phase_transition.cpp
+ No known bugs
File phase_transition_mpi.cpp
No known bugs
File test_suite.cpp
No known bugs
File testlib.cpp
- No known bugs
-File testlib.hpp
- No known bugs
-File typedefs.hpp
- No known bugs
-File utils.cpp
No known bugs
+File testlib.hpp
+ No known bugs
+File time.cpp
+ No known bugs
+File utils.cpp
+ No known bugs
File utils.hpp
No known bugs
diff --git a/docs/classIsingModel-members.html b/docs/classIsingModel-members.html
index 46d1990..081260e 100644
--- a/docs/classIsingModel-members.html
+++ b/docs/classIsingModel-members.html
@@ -104,25 +104,26 @@ $(document).ready(function(){initNavTree('classIsingModel.html',''); initResizab
This is the complete list of members for IsingModel , including all inherited members.
diff --git a/docs/classIsingModel.html b/docs/classIsingModel.html
index e2a27b6..2cd97d0 100644
--- a/docs/classIsingModel.html
+++ b/docs/classIsingModel.html
@@ -124,29 +124,29 @@ Public Member Functions
data_t Metropolis ()
The Metropolis algorithm.
-
int get_E ()
-
Get the current energy.
-
-
int get_M ()
-
Get the current magnetization.
-
+void initialize_engine ()
+ Initialize the RNG.
+
void initialize_lattice ()
Initialize the lattice with a random distribution of 1s and -1s.
+void initialize_lattice (int val)
+ Initialize the lattice with a specific value.
+
void initialize_neighbors ()
initialize the neighbors matrix.
void initialize_energy_diff ()
- Initialize the hashmap with the correct values.
+ Initialize the energy_diff array with the correct values.
void initialize_magnetization ()
- Initialize the magnetization.
+ Initialize the magnetization of the system.
void initialize_energy ()
- Initialize the energy.
+ Initialize the energy of the system.
IsingModel ()
Constructor used for testing.
@@ -160,32 +160,36 @@ Private Attributes
arma::Mat< int > neighbors
\( L \times 2 \) matrix with the neighbors of each element \( x_i \).
-std::unordered_map< int, double > energy_diff
- A hash map containing all possible energy changes.
-
+double energy_diff [17]
+ An array containing all possible energy differences.
+
double T
The temperature of the model.
int L
Size of the lattice.
-int E
- The current energy state. unit: \( J \).
-
-int M
- The current magnetic strength. unit: Unitless.
-
+int64_t E
+ The current energy state. unit: \( J \).
+
+int64_t M
+ The current magnetic strength. unit: Unitless.
+
+std::mt19937 engine
+ The RNG that is used for the Metropolis algorithm.
+
The Ising model in 2 dimensions.
None of the methods are parallelized, as there is very little benefit in doing so.
-
Definition at line 37 of file IsingModel.hpp .
+
Definition at line 36 of file IsingModel.hpp .
◆ IsingModel() [1/3]
@@ -212,7 +216,7 @@ Friends
Constructor used for testing.
-
Definition at line 17 of file IsingModel.cpp .
+
Definition at line 14 of file IsingModel.cpp .
@@ -251,7 +255,7 @@ Friends
-Definition at line 21 of file IsingModel.cpp .
+Definition at line 19 of file IsingModel.cpp .
@@ -297,55 +301,11 @@ Friends
-Definition at line 32 of file IsingModel.cpp .
+Definition at line 31 of file IsingModel.cpp .
-
-◆ get_E()
-
-
-
-
-
- int IsingModel::get_E
- (
- )
-
-
-
-
-
-
Get the current energy.
-
Returns double
-
-
Definition at line 135 of file IsingModel.cpp .
-
-
-
-
-◆ get_M()
-
-
-
-
-
- int IsingModel::get_M
- (
- )
-
-
-
-
-
-
Get the current magnetization.
-
Returns double
-
-
Definition at line 140 of file IsingModel.cpp .
-
-
-
◆ initialize_energy()
@@ -369,9 +329,9 @@ Friends
@@ -398,14 +358,43 @@ Friends
-
Initialize the hashmap with the correct values.
+
Initialize the energy_diff array with the correct values.
-
Definition at line 67 of file IsingModel.cpp .
+
Definition at line 81 of file IsingModel.cpp .
+
+
+
+
+◆ initialize_engine()
+
+
+
+
+
+
+
+
+ void IsingModel::initialize_engine
+ (
+ )
+
+
+
+
+
+private
+
+
+
-◆ initialize_lattice()
+◆ initialize_lattice() [1/2]
@@ -429,7 +418,37 @@ Friends
Initialize the lattice with a random distribution of 1s and -1s.
-
Definition at line 44 of file IsingModel.cpp .
+
Definition at line 49 of file IsingModel.cpp .
+
+
+
+
+◆ initialize_lattice() [2/2]
+
+
+
+
+
+
+
+
+ void IsingModel::initialize_lattice
+ (
+ int
+ val )
+
+
+
+
+
+private
+
+
+
+
+
Initialize the lattice with a specific value.
+
+
Definition at line 59 of file IsingModel.cpp .
@@ -456,9 +475,9 @@ Friends
-
Initialize the magnetization.
+
Initialize the magnetization of the system.
-
Definition at line 74 of file IsingModel.cpp .
+
Definition at line 88 of file IsingModel.cpp .
@@ -487,7 +506,7 @@ Friends
initialize the neighbors matrix.
-Definition at line 56 of file IsingModel.cpp .
+Definition at line 70 of file IsingModel.cpp .
@@ -508,7 +527,7 @@ Friends
The Metropolis algorithm.
-Definition at line 96 of file IsingModel.cpp .
+Definition at line 110 of file IsingModel.cpp .
@@ -533,13 +552,15 @@ Friends
-
-
+
+
@@ -548,7 +569,7 @@ Friends
- int IsingModel::E
+ int64_t IsingModel::E
@@ -560,12 +581,12 @@ Friends
The current energy state. unit: \( J \).
-
Definition at line 68 of file IsingModel.hpp .
+
Definition at line 70 of file IsingModel.hpp .
-
-◆ energy_diff
+
+◆ energy_diff
@@ -574,7 +595,7 @@ Friends
- std::unordered_map<int, double> IsingModel::energy_diff
+ double IsingModel::energy_diff[17]
@@ -584,9 +605,35 @@ Friends
-
A hash map containing all possible energy changes.
+
An array containing all possible energy differences.
-
Definition at line 56 of file IsingModel.hpp .
+
Definition at line 58 of file IsingModel.hpp .
+
+
+
+
+◆ engine
+
+
+
+
+
+
+
+
+ std::mt19937 IsingModel::engine
+
+
+
+
+private
+
+
+
+
+
The RNG that is used for the Metropolis algorithm.
+
+
Definition at line 78 of file IsingModel.hpp .
@@ -612,7 +659,7 @@ Friends
Size of the lattice.
-Definition at line 64 of file IsingModel.hpp .
+Definition at line 66 of file IsingModel.hpp .
@@ -638,12 +685,12 @@ Friends
\( L \times L \) matrix where element \( x \in {-1, 1}\).
-Definition at line 42 of file IsingModel.hpp .
+Definition at line 44 of file IsingModel.hpp .
-
-
+
+
@@ -652,7 +699,7 @@ Friends
- int IsingModel::M
+ int64_t IsingModel::M
@@ -664,7 +711,7 @@ Friends
The current magnetic strength. unit: Unitless.
-
Definition at line 72 of file IsingModel.hpp .
+
Definition at line 74 of file IsingModel.hpp .
@@ -691,7 +738,7 @@ Friends
\( L \times 2 \) matrix with the neighbors of each element \( x_i \).
The reason why it's \( L \times 2 \) instead of \( L \times 2 \), is that we can see that we can use the same column for the left and upper neighbor, and we can use the same column for the right and lower neighbor.
-Definition at line 52 of file IsingModel.hpp .
+Definition at line 54 of file IsingModel.hpp .
@@ -717,7 +764,7 @@ Friends
The temperature of the model.
-Definition at line 60 of file IsingModel.hpp .
+Definition at line 62 of file IsingModel.hpp .
diff --git a/docs/classIsingModel.js b/docs/classIsingModel.js
index 8a0ca5c..6b41adc 100644
--- a/docs/classIsingModel.js
+++ b/docs/classIsingModel.js
@@ -3,19 +3,21 @@ var classIsingModel =
[ "IsingModel", "classIsingModel.html#acf281f6f5ed02911ca6ab07004449864", null ],
[ "IsingModel", "classIsingModel.html#a4a39ee7fbfbbf566f75bc28900ca9ea5", null ],
[ "IsingModel", "classIsingModel.html#a46c9446e94854452f715d307c77c1c15", null ],
- [ "get_E", "classIsingModel.html#aaa0787d964b004a17869811a5e947ff5", null ],
- [ "get_M", "classIsingModel.html#aa5701496e6483bc4668c486d6d3af625", null ],
[ "initialize_energy", "classIsingModel.html#a59fced38c695e2fa647f53be81b9d2a1", null ],
[ "initialize_energy_diff", "classIsingModel.html#aff9a1201933fd5408845a1447e4895b4", null ],
+ [ "initialize_engine", "classIsingModel.html#aaedc25b7284e04849269f31291590bf5", null ],
[ "initialize_lattice", "classIsingModel.html#a34a4710949b4a70f3e37ca223aefcf8a", null ],
+ [ "initialize_lattice", "classIsingModel.html#acc86effd6889bea199a3d70a9f38dc78", null ],
[ "initialize_magnetization", "classIsingModel.html#a926cf4964d190d2ce23e5a17201787a4", null ],
[ "initialize_neighbors", "classIsingModel.html#a6776109105051597c275670dabd0054a", null ],
[ "Metropolis", "classIsingModel.html#a56559d68dc9aaff1976d84b157f43488", null ],
- [ "E", "classIsingModel.html#ae9f872ca2054992161d53306119979dd", null ],
- [ "energy_diff", "classIsingModel.html#a1a4ceb1bb2593dbd20c51ed04100cbcd", null ],
+ [ "IsingModelTest", "classIsingModel.html#a2b1cf104e0bda1fce78ed366e1ec7287", null ],
+ [ "E", "classIsingModel.html#a1c8a2a4331c7e60c3e1350c0cf8300b9", null ],
+ [ "energy_diff", "classIsingModel.html#a7112dd6433b1bb9512150cbdc1a0b77e", null ],
+ [ "engine", "classIsingModel.html#a1bbe0cb10abee98058e7b45b22b9cd0a", null ],
[ "L", "classIsingModel.html#a2b8ac43baefeb386186266d5aa4de348", null ],
[ "lattice", "classIsingModel.html#a2c3c76c79717c968d7c227c58b46df41", null ],
- [ "M", "classIsingModel.html#a0d373a61baca6b0faa607bb12d82cc47", null ],
+ [ "M", "classIsingModel.html#aef7232b28df08e064ef58eb5ef32f738", null ],
[ "neighbors", "classIsingModel.html#a94093aaf30facca62737f2ac381fdbcd", null ],
[ "T", "classIsingModel.html#a20fc4c0c99d8a119f70a1614784d4e5c", null ]
];
\ No newline at end of file
diff --git a/docs/classIsingModelTest.html b/docs/classIsingModelTest.html
index 055b598..2a5fc3f 100644
--- a/docs/classIsingModelTest.html
+++ b/docs/classIsingModelTest.html
@@ -111,7 +111,7 @@ $(document).ready(function(){initNavTree('classIsingModelTest.html',''); initRes
void test_init_functions ()
- Test That initializing works as intended.
+ Test that initializing works as intended.
int test_2x2_lattice (double tol, int max_cycles)
Test numerical data with analytical data.
@@ -120,7 +120,7 @@ Public Member Functions
Test class for the Ising model.
-
Definition at line 30 of file test_suite.cpp .
+
Definition at line 36 of file test_suite.cpp .
◆ test_2x2_lattice()
@@ -166,7 +166,7 @@ Public Member Functions
return int
-Definition at line 70 of file test_suite.cpp .
+Definition at line 76 of file test_suite.cpp .
@@ -193,9 +193,9 @@ Public Member Functions
-
Test That initializing works as intended.
+
Test that initializing works as intended.
-
Definition at line 34 of file test_suite.cpp .
+
Definition at line 40 of file test_suite.cpp .
diff --git a/docs/classdata__t-members.html b/docs/classdata__t-members.html
index 83e7c4a..adefef9 100644
--- a/docs/classdata__t-members.html
+++ b/docs/classdata__t-members.html
@@ -104,20 +104,19 @@ $(document).ready(function(){initNavTree('classdata__t.html',''); initResizable(
This is the complete list of members for data_t , including all inherited members.
diff --git a/docs/classdata__t.html b/docs/classdata__t.html
index 4c8e8cb..076fd0c 100644
--- a/docs/classdata__t.html
+++ b/docs/classdata__t.html
@@ -105,47 +105,65 @@ $(document).ready(function(){initNavTree('classdata__t.html',''); initResizable(
+
+
Type to use with the IsingModel class and montecarlo module.
+ More...
+
+
#include <data_type.hpp >
- data_t (double E, double E2, double M, double M2, double M_abs)
+ data_t ()
+ constructor with no parameters.
+
+ data_t (double E , double E2 , double M , double M2 , double M_abs )
+ Constructor with parameters.
template<class T >
data_t operator/ (T num)
+ Overload of the division operator.
template<class T >
data_t & operator/= (T num)
+ Overload of the division equals operator.
template<class T >
data_t operator* (T num)
+ Overload of the multiply operator.
template<class T >
data_t & operator*= (T num)
+ Overload of the multiply equals operator.
data_t operator+ (const data_t &b)
+ Overload of the addition operator.
data_t & operator+= (const data_t &b)
+ Overload of the addition equals operator.
-template<class T >
-void operator= (T num)
-
double E
+ Energy.
double M
+ Magnetization.
double E2
+ Energy squared.
double M2
+ Magnetization squared.
double M_abs
+ Absolute Magnetization.
-
-
Definition at line 18 of file data_type.hpp .
+
Type to use with the IsingModel class and montecarlo module.
+
+
Definition at line 19 of file data_type.hpp .
◆ data_t() [1/2]
@@ -170,7 +188,9 @@ Public Attributes
@@ -226,7 +246,19 @@ Public Attributes
-
Definition at line 31 of file data_type.hpp .
+
Constructor with parameters.
+
Parameters
+
+ E Initial energy
+ E2 Initial energy squared
+ M Initial magnetization
+ M2 Initial magnetization squared
+ M_abs Initial absolute magnetization
+
+
+
+
+
Definition at line 45 of file data_type.hpp .
@@ -257,7 +289,16 @@ template<class T >
-
Definition at line 63 of file data_type.hpp .
+
Overload of the multiply operator.
+
Parameters
+
+ num The number to multiply each field by.
+
+
+
+
Returns data_t
+
+
Definition at line 96 of file data_type.hpp .
@@ -287,7 +328,16 @@ template<class T >
-
Definition at line 75 of file data_type.hpp .
+
Overload of the multiply equals operator.
+
Parameters
+
+ num The number to multiply each field by.
+
+
+
+
Returns data_t
+
+
Definition at line 114 of file data_type.hpp .
@@ -315,7 +365,16 @@ template<class T >
@@ -343,7 +402,16 @@ template<class T >
@@ -373,7 +441,16 @@ template<class T >
-
Definition at line 40 of file data_type.hpp .
+
Overload of the division operator.
+
Parameters
+
+ num The number to divide each field by.
+
+
+
+
Returns data_t
+
+
Definition at line 60 of file data_type.hpp .
@@ -403,37 +480,16 @@ template<class T >
-
Definition at line 52 of file data_type.hpp .
+
Overload of the division equals operator.
+
Parameters
+
+ num The number to divide each field by.
+
+
+
+
Returns data_t
-
-
-
-◆ operator=()
-
-
-
-
-template<class T >
-
-
-
-
-
- void data_t::operator=
- (
- T
- num )
-
-
-
-
-
-inline
-
-
-
@@ -450,7 +506,9 @@ template<class T >
@@ -466,7 +524,9 @@ template<class T >
@@ -482,7 +542,9 @@ template<class T >
@@ -498,7 +560,9 @@ template<class T >
@@ -514,7 +578,9 @@ template<class T >
diff --git a/docs/classdata__t.js b/docs/classdata__t.js
new file mode 100644
index 0000000..b18f779
--- /dev/null
+++ b/docs/classdata__t.js
@@ -0,0 +1,16 @@
+var classdata__t =
+[
+ [ "data_t", "classdata__t.html#aa2690d3e5d711b4baf3c8f8b9095faf7", null ],
+ [ "data_t", "classdata__t.html#a3f2d19ab309e696ba91a2000479bcb83", null ],
+ [ "operator*", "classdata__t.html#a7954efc97086ea50e10c33113b203085", null ],
+ [ "operator*=", "classdata__t.html#a6ddf3a7372730ef2393aee8bbcb34992", null ],
+ [ "operator+", "classdata__t.html#a13bc1d73eadeb39c507e89f5872d726f", null ],
+ [ "operator+=", "classdata__t.html#a6cb96b4ff750ab29041038ca53f307cb", null ],
+ [ "operator/", "classdata__t.html#a429a11c53ee7fe08f6a4e75db524521d", null ],
+ [ "operator/=", "classdata__t.html#a88da5be78439fbdecfa473ec007dffd8", null ],
+ [ "E", "classdata__t.html#a6c1a196d96e177b11ca98c61fae35a2e", null ],
+ [ "E2", "classdata__t.html#abb622f9c6cc5ffb9dddb151d2e202f72", null ],
+ [ "M", "classdata__t.html#ad08d2488bf913c626157471cf6e8a46a", null ],
+ [ "M2", "classdata__t.html#a71ae3cd4460f2c66239500c11804e70b", null ],
+ [ "M_abs", "classdata__t.html#a586475e0f71322dffda2e75f228ab24b", null ]
+];
\ No newline at end of file
diff --git a/docs/data__type_8cpp.html b/docs/data__type_8cpp.html
index e40f949..7bf8d17 100644
--- a/docs/data__type_8cpp.html
+++ b/docs/data__type_8cpp.html
@@ -102,18 +102,18 @@ $(document).ready(function(){initNavTree('data__type_8cpp.html',''); initResizab
-
Implementation for the data_t type.
+
Implementation for the data_t type.
More...
Go to the source code of this file.
-
Implementation for the data_t type.
+
Implementation for the data_t type.
Author Cory Alexander Balaton (coryab)
Janita Ovidie Sandtrøen Willumsen (janitaws)
Version 1.0
-
Bug: No known bugs
+
Bug: No known bugs
Definition in file data_type.cpp .
diff --git a/docs/data__type_8cpp_source.html b/docs/data__type_8cpp_source.html
index 087ddc0..d8eb459 100644
--- a/docs/data__type_8cpp_source.html
+++ b/docs/data__type_8cpp_source.html
@@ -101,9 +101,18 @@ $(document).ready(function(){initNavTree('data__type_8cpp_source.html',''); init
diff --git a/docs/data__type_8hpp.html b/docs/data__type_8hpp.html
index 02f1bd4..dd44aac 100644
--- a/docs/data__type_8hpp.html
+++ b/docs/data__type_8hpp.html
@@ -104,7 +104,7 @@ $(document).ready(function(){initNavTree('data__type_8hpp.html',''); initResizab
-
Header for the data_t type.
+
Header for the data_t type.
More...
#include <sys/types.h>
#include <type_traits>
@@ -114,10 +114,11 @@ $(document).ready(function(){initNavTree('data__type_8hpp.html',''); initResizab
class data_t
+
Type to use with the IsingModel class and montecarlo module. More...
-
Header for the data_t type.
+
Header for the data_t type.
Author Cory Alexander Balaton (coryab)
Janita Ovidie Sandtrøen Willumsen (janitaws)
diff --git a/docs/data__type_8hpp.js b/docs/data__type_8hpp.js
index 80d6066..8bdb337 100644
--- a/docs/data__type_8hpp.js
+++ b/docs/data__type_8hpp.js
@@ -1,4 +1,4 @@
var data__type_8hpp =
[
- [ "data_t", "classdata__t.html", null ]
+ [ "data_t", "classdata__t.html", "classdata__t" ]
];
\ No newline at end of file
diff --git a/docs/data__type_8hpp_source.html b/docs/data__type_8hpp_source.html
index 30b1e71..b028bf3 100644
--- a/docs/data__type_8hpp_source.html
+++ b/docs/data__type_8hpp_source.html
@@ -101,116 +101,185 @@ $(document).ready(function(){initNavTree('data__type_8hpp_source.html',''); init
-
Go to the documentation of this file.
-
-
+
Go to the documentation of this file.
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
+
-
-
+
+
-
-
-
20 double E, M, E2, M2, M_abs;
-
-
-
-
-
-
-
-
-
-
-
31 data_t (
double E,
double E2,
double M,
double M2,
double M_abs)
-
-
-
-
-
-
-
-
-
40 template <
class T>
data_t operator/(T num)
-
-
-
43 res.E = this->E / (double)num;
-
44 res.E2 = this->E2 / (double)num;
-
45 res.M = this->M / (double)num;
-
46 res.M2 = this->M2 / (double)num;
-
47 res.M_abs = this->M_abs / (double)num;
-
-
-
-
-
52 template <
class T>
data_t & operator/=(T num)
-
-
54 this->E /= (double)num;
-
55 this->E2 /= (double)num;
-
56 this->M /= (double)num;
-
57 this->M2 /= (double)num;
-
58 this->M_abs /= (double)num;
-
-
-
-
-
63 template <
class T>
data_t operator*(T num)
-
-
-
66 res.E = this->E * (double)num;
-
67 res.E2 = this->E2 * (double)num;
-
68 res.M = this->M * (double)num;
-
69 res.M2 = this->M2 * (double)num;
-
70 res.M_abs = this->M_abs * (double)num;
+
+
+
+
+
+
+
+
+
+
+
28
+
+
+
+
+
+
+
+
+
+
+
39
+
40
+
41
+
42
+
43
+
44
+
45 data_t (
double E,
double E2,
double M,
double M2,
double M_abs)
+
+
+
+
+
+
+
+
+
+
55
+
56
+
57
+
58
+
59
+
+
+
+
63 res
. E =
this -> E / (
double )num;
+
64 res
. E2 =
this -> E2 / (
double )num;
+
65 res
. M =
this -> M / (
double )num;
+
66 res
. M2 =
this -> M2 / (
double )num;
+
+
+
+
-
-
-
-
75 template <
class T>
data_t & operator*=(T num)
-
-
77 this->E *= (double)num;
-
78 this->E2 *= (double)num;
-
79 this->M *= (double)num;
-
80 this->M2 *= (double)num;
-
81 this->M_abs *= (double)num;
-
-
-
-
-
-
-
-
89 res.E = this->E + b.E;
-
90 res.E2 = this->E2 + b.E2;
-
91 res.M = this->M + b.M;
-
92 res.M2 = this->M2 + b.M2;
-
93 res.M_abs = this->M_abs + b.M_abs;
-
-
-
-
-
-
-
-
-
-
-
104 this->M_abs += b.M_abs;
-
-
-
-
-
109 template <
class T>
void operator=(T num)
-
-
111 this->E = (double)num;
-
112 this->E2 = (double)num;
-
113 this->M = (double)num;
-
114 this->M2 = (double)num;
-
115 this->M_abs = (double)num;
-
-
-
-
-
+
+
+
74
+
75
+
76
+
77
+
78
+
+
+
81 this -> E /= (
double )num;
+
82 this -> E2 /= (
double )num;
+
83 this -> M /= (
double )num;
+
84 this -> M2 /= (
double )num;
+
+
+
+
+
+
+
91
+
92
+
93
+
94
+
95
+
+
+
+
99 res
. E =
this -> E * (
double )num;
+
100 res
. E2 =
this -> E2 * (
double )num;
+
101 res
. M =
this -> M * (
double )num;
+
102 res
. M2 =
this -> M2 * (
double )num;
+
+
+
+
+
+
+
109
+
110
+
111
+
112
+
113
+
+
+
116 this -> E *= (
double )num;
+
117 this -> E2 *= (
double )num;
+
118 this -> M *= (
double )num;
+
119 this -> M2 *= (
double )num;
+
+
+
+
+
+
+
+
127
+
128
+
129
+
130
+
131
+
+
+
+
+
+
+
+
+
+
+
+
+
+
145
+
146
+
147
+
148
+
149
+
+
+
+
+
+
+
+
+
+
+
+
+
+
163 # pragma omp declare reduction ( + : data_t : omp_out += omp_in )
+
+
+
Type to use with the IsingModel class and montecarlo module.
+
data_t operator+(const data_t &b)
Overload of the addition operator.
+
data_t(double E, double E2, double M, double M2, double M_abs)
Constructor with parameters.
+
data_t operator/(T num)
Overload of the division operator.
+
double M_abs
Absolute Magnetization.
+
+
data_t & operator+=(const data_t &b)
Overload of the addition equals operator.
+
data_t & operator*=(T num)
Overload of the multiply equals operator.
+
double M2
Magnetization squared.
+
data_t operator*(T num)
Overload of the multiply operator.
+
data_t & operator/=(T num)
Overload of the division equals operator.
+
data_t()
constructor with no parameters.
+
+
diff --git a/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html
index 75f9ece..1fa9679 100644
--- a/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html
+++ b/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html
@@ -102,15 +102,10 @@ $(document).ready(function(){initNavTree('dir_68267d1309a1af8e8297ef4c3efbcdba.h
file data_type.cpp [code]
- Implementation for the data_t type.
+ Implementation for the data_t type.
file IsingModel.cpp [code]
The implementation of the Ising model.
@@ -118,9 +113,18 @@ Files
file main.cpp [code]
The main program.
+file mcmc_progression.cpp [code]
+ Execute the mcmc algorithm and write data to file after each Monte Carlo cycle.
+
file monte_carlo.cpp [code]
Implementation of the monte carlo functions.
+file pd_estimate.cpp [code]
+ execute the mcmc algorithm and write data to file after each Monte Carlo cycles.
+
+file phase_transition.cpp [code]
+ Sweep over different temperatures and generate data.
+
file phase_transition_mpi.cpp [code]
Sweep over different temperatures and generate data.
@@ -130,6 +134,9 @@ Files
file testlib.cpp [code]
Implementation of the testing library.
+file time.cpp [code]
+ Timing various things.
+
file utils.cpp [code]
Implementation of the utils.
diff --git a/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.js b/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.js
index 90dbe2d..284e098 100644
--- a/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.js
+++ b/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.js
@@ -1,12 +1,15 @@
var dir_68267d1309a1af8e8297ef4c3efbcdba =
[
- [ "scripts", "dir_634e799a3947388232110823971192a8.html", "dir_634e799a3947388232110823971192a8" ],
[ "data_type.cpp", "data__type_8cpp.html", null ],
[ "IsingModel.cpp", "IsingModel_8cpp.html", null ],
[ "main.cpp", "main_8cpp.html", "main_8cpp" ],
+ [ "mcmc_progression.cpp", "mcmc__progression_8cpp.html", "mcmc__progression_8cpp" ],
[ "monte_carlo.cpp", "monte__carlo_8cpp.html", "monte__carlo_8cpp" ],
+ [ "pd_estimate.cpp", "pd__estimate_8cpp.html", "pd__estimate_8cpp" ],
+ [ "phase_transition.cpp", "phase__transition_8cpp.html", "phase__transition_8cpp" ],
[ "phase_transition_mpi.cpp", "phase__transition__mpi_8cpp.html", "phase__transition__mpi_8cpp" ],
[ "test_suite.cpp", "test__suite_8cpp.html", "test__suite_8cpp" ],
[ "testlib.cpp", "testlib_8cpp.html", "testlib_8cpp" ],
+ [ "time.cpp", "time_8cpp.html", "time_8cpp" ],
[ "utils.cpp", "utils_8cpp.html", "utils_8cpp" ]
];
\ No newline at end of file
diff --git a/docs/dir_d44c64559bbebec7f509842c48db8b23.html b/docs/dir_d44c64559bbebec7f509842c48db8b23.html
index 9348629..c234ca2 100644
--- a/docs/dir_d44c64559bbebec7f509842c48db8b23.html
+++ b/docs/dir_d44c64559bbebec7f509842c48db8b23.html
@@ -104,24 +104,18 @@ $(document).ready(function(){initNavTree('dir_d44c64559bbebec7f509842c48db8b23.h
-file constants.hpp [code]
- Library of constants.
-
file data_type.hpp [code]
- Header for the data_t type.
+ Header for the data_t type.
file IsingModel.hpp [code]
The definition of the Ising model.
file monte_carlo.hpp [code]
- Functions for monte carlo simulations.
+ Functions for Monte Carlo simulations.
file testlib.hpp [code]
A small test library.
-file typedefs.hpp [code]
- Useful typedefs for cleaner code.
-
file utils.hpp [code]
Function prototypes and macros that are useful.
diff --git a/docs/dir_d44c64559bbebec7f509842c48db8b23.js b/docs/dir_d44c64559bbebec7f509842c48db8b23.js
index aeac9c5..4a229eb 100644
--- a/docs/dir_d44c64559bbebec7f509842c48db8b23.js
+++ b/docs/dir_d44c64559bbebec7f509842c48db8b23.js
@@ -1,10 +1,8 @@
var dir_d44c64559bbebec7f509842c48db8b23 =
[
- [ "constants.hpp", "constants_8hpp.html", "constants_8hpp" ],
[ "data_type.hpp", "data__type_8hpp.html", "data__type_8hpp" ],
[ "IsingModel.hpp", "IsingModel_8hpp.html", "IsingModel_8hpp" ],
[ "monte_carlo.hpp", "monte__carlo_8hpp.html", "monte__carlo_8hpp" ],
[ "testlib.hpp", "testlib_8hpp.html", "testlib_8hpp" ],
- [ "typedefs.hpp", "typedefs_8hpp.html", null ],
[ "utils.hpp", "utils_8hpp.html", "utils_8hpp" ]
];
\ No newline at end of file
diff --git a/docs/files.html b/docs/files.html
index 8e299ae..fa07684 100644
--- a/docs/files.html
+++ b/docs/files.html
@@ -102,28 +102,26 @@ $(document).ready(function(){initNavTree('files.html',''); initResizable(); });
Here is a list of all documented files with brief descriptions:
-
[detail level 1 2 3 ]
+[detail level 1 2 ]
diff --git a/docs/functions.html b/docs/functions.html
index ac97e55..9e98403 100644
--- a/docs/functions.html
+++ b/docs/functions.html
@@ -98,22 +98,63 @@ $(document).ready(function(){initNavTree('functions.html',''); initResizable();
-
Here is a list of all documented class members with links to the class documentation for each member:
-E : IsingModel
-energy_diff : IsingModel
-get_E() : IsingModel
-get_M() : IsingModel
+Here is a list of all documented class members with links to the class documentation for each member:
+
+ - d -
+
+
+ - e -
+
+
+ - i -
+
+
+ - l -
+
+
+ - m -
+
+
+ - n -
+
+
+ - o -
+
+
+ - t -
T : IsingModel
test_2x2_lattice() : IsingModelTest
test_init_functions() : IsingModelTest
diff --git a/docs/functions_func.html b/docs/functions_func.html
index 35e1c22..3713564 100644
--- a/docs/functions_func.html
+++ b/docs/functions_func.html
@@ -99,15 +99,21 @@ $(document).ready(function(){initNavTree('functions_func.html',''); initResizabl
diff --git a/docs/functions_rela.html b/docs/functions_rela.html
new file mode 100644
index 0000000..40aee32
--- /dev/null
+++ b/docs/functions_rela.html
@@ -0,0 +1,113 @@
+
+
+
+
+
+
+
+
2 Dimensional Ising Model: Class Members - Related Functions
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2 Dimensional Ising Model
+
+ Simulate the change in energy and magnetization in a ferro magnet
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/functions_vars.html b/docs/functions_vars.html
index 5332b4c..d37a784 100644
--- a/docs/functions_vars.html
+++ b/docs/functions_vars.html
@@ -99,11 +99,15 @@ $(document).ready(function(){initNavTree('functions_vars.html',''); initResizabl
diff --git a/docs/globals.html b/docs/globals.html
index 5d49ff3..d24b10e 100644
--- a/docs/globals.html
+++ b/docs/globals.html
@@ -98,18 +98,74 @@ $(document).ready(function(){initNavTree('globals.html',''); initResizable(); })
-
Here is a list of all documented file members with links to the documentation:
diff --git a/docs/globals_defs.html b/docs/globals_defs.html
index a96a42a..6bc55d2 100644
--- a/docs/globals_defs.html
+++ b/docs/globals_defs.html
@@ -101,8 +101,16 @@ $(document).ready(function(){initNavTree('globals_defs.html',''); initResizable(
diff --git a/docs/globals_func.html b/docs/globals_func.html
index 08348b6..b21e4cb 100644
--- a/docs/globals_func.html
+++ b/docs/globals_func.html
@@ -99,13 +99,15 @@ $(document).ready(function(){initNavTree('globals_func.html',''); initResizable(
-main() : main.cpp , phase_transition_mpi.cpp , test_suite.cpp
-monte_carlo_parallel() : monte_carlo.hpp , monte_carlo.cpp
-monte_carlo_progression() : monte_carlo.hpp , monte_carlo.cpp
-monte_carlo_serial() : monte_carlo.hpp , monte_carlo.cpp
-pd_estimate() : monte_carlo.hpp , monte_carlo.cpp
-phase_transition() : monte_carlo.hpp , monte_carlo.cpp
-test_2x2_lattice() : monte_carlo.hpp
+create_burn_in_time_data() : main.cpp
+create_pd_estimate_data() : main.cpp
+create_phase_transition_data() : main.cpp
+main() : main.cpp , mcmc_progression.cpp , pd_estimate.cpp , phase_transition.cpp , phase_transition_mpi.cpp , test_suite.cpp , time.cpp
+test_burn_in_time() : main.cpp
+test_parallel_speedup() : main.cpp
+time_lattice_sizes() : time.cpp
+time_sample_sizes() : time.cpp
+usage() : main.cpp , mcmc_progression.cpp , pd_estimate.cpp , phase_transition.cpp , phase_transition_mpi.cpp , time.cpp
diff --git a/docs/index.html b/docs/index.html
index d282042..9f3ba18 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -126,8 +126,6 @@ Operating systems
Tools
Profiling
@@ -149,39 +147,56 @@ Libraries
Compiling
-Compiling is as easy as running this command while being inside the src directory:
+The commands shown here should be run from the root of this project.
+
+Normal binaries
+Compiling regular binaries is as easy as running this command:
-Running programs
+The binaries will then be inside the **./bin** directory.
+Profiling binaries
+If you want to profile the programs (specifically the MPI program), then run this command
+The binaries will then be inside the **./prof** directory.
+
+Debugging binaries
+If you want to debug the code, then use this command:
+The binaries will then be inside the **./debug** directory.
+
+Running programs
+
C++ binaries
-To run main or test_suite , just run this command while being inside src:
-
+To run any of the programs, just use the following command:
+./<bin|prof|debug>/<program-name> <args>
+
If you need help with any of the programs, you can use the -h or –help flag to show you how to use the programs. Here is an example:
+
Python scripts
-
+
Install libraries
Before running the scripts, make sure that all libraries are installed. Using pip, you can install all requirements like this:
pip install -r requirements.txt
This recursively install all the packages that are listed in requirements.txt .
-
+
Running scripts
-For the Python scripts, run them from the src directory like this:
-python scripts/<script-name>
+
For the Python scripts, run them from the root of the project:
+
python python_scripts/<script-name>
If you have any problems running the scripts, you might have to run this instead:
-
python3 scripts/<script-name>
-
+python3 python_scripts/<script-name>
+
Batch system
-For the phase_transition_mpi program, there are scripts in the src/jobs directory that come along with it. This is to be able to run it on a batch system using Slurm if you have access to one. This is the recommended way to use this program as it takes approximately 90 minutes to complete when using 8 processes where each process has 10 threads.
-
If you happen to have such a system available to you, then you should clone this repo on that system, then compile it by running:
-
make phase_transition_mpi
-
You might have to load the Armadillo library using the module system before compiling.
-
After compiling, you can schedule it by running:
-
sbatch jobs/<script-name>
-
+For the phase_transition_mpi program, there are scripts in the **./slurm_scripts** directory that come along with it. This is to be able to run it on a batch system using Slurm if you have access to one. The only program that should be executed by the user is the **./slurm_scripts/execute.script** script. You can see how to use this script by doing:
+
./slurm_scripts/execute.script --help
+
This is the recommended way to use this program as it takes approximately 90 minutes to complete when using 8 processes where each process has 10 threads.
+
If you happen to have such a system available to you, then you should clone this repo on that system, then compile the MPI program like this:
+
make bin/phase_transition_mpi
+
After compiling, you can schedule it by using the **./slurm_scripts/execute.script**:
+
./slurm_scripts/execute.script <parameters>
+
Performance
-
This section aims to give an idea to the time it takes for the program to run so that you know a bit what to expect if you decide to run it for yourself.
-
+This section aims to give an idea to the time it takes for the phase transition program to run so that you know a bit what to expect if you decide to run it for yourself.
+
CPU
The times mentioned here are times achieved on a computer with these specifications:
-
+
Times
-
+Note that all times here are recorded using the OpenMP implementation of the MCMC algorithm.
+
+
+lattice size points samples burn-in time time (seconds)
+
+20 20 100000 0 3.20
+
+20 40 100000 0 6.17
+
+20 80 100000 0 12.11
+
+
+
+lattice size points samples burn-in time time (seconds)
+
+20 20 100000 0 3.20
+
+40 20 100000 0 11.91
+
+80 20 100000 0 47.88
+
+
+
+lattice size points samples burn-in time time (seconds)
+
+20 20 100000 0 3.20
+
+20 20 1000000 0 29.95
+
+20 20 10000000 0 305.849
+
+
+
+lattice size points samples burn-in time time (seconds)
+
+20 20 100000 0 3.20
+
+20 20 100000 5000 4.93
+
+20 20 100000 10000 6.58
+
+
We can see that changing the number of points, samples and burn-in time changes the time in a linear fashion, while changing the size of the lattice changes the time in a square fashion.
+
Credits
The Doxygen theme used here is doxygen-awesome-css .
diff --git a/docs/index.js b/docs/index.js
index 6788a1b..db22cce 100644
--- a/docs/index.js
+++ b/docs/index.js
@@ -5,18 +5,22 @@ var index =
[ "Tools", "index.html#autotoc_md3", null ],
[ "Libraries", "index.html#autotoc_md4", null ]
] ],
- [ "Compiling", "index.html#autotoc_md5", null ],
- [ "Running programs", "index.html#autotoc_md6", [
- [ "C++ binaries", "index.html#autotoc_md7", null ],
- [ "Python scripts", "index.html#autotoc_md8", [
- [ "Install libraries", "index.html#autotoc_md9", null ],
- [ "Running scripts", "index.html#autotoc_md10", null ]
+ [ "Compiling", "index.html#autotoc_md5", [
+ [ "Normal binaries", "index.html#autotoc_md6", null ],
+ [ "Profiling binaries", "index.html#autotoc_md7", null ],
+ [ "Debugging binaries", "index.html#autotoc_md8", null ]
+ ] ],
+ [ "Running programs", "index.html#autotoc_md9", [
+ [ "C++ binaries", "index.html#autotoc_md10", null ],
+ [ "Python scripts", "index.html#autotoc_md11", [
+ [ "Install libraries", "index.html#autotoc_md12", null ],
+ [ "Running scripts", "index.html#autotoc_md13", null ]
] ],
- [ "Batch system", "index.html#autotoc_md11", null ]
+ [ "Batch system", "index.html#autotoc_md14", null ]
] ],
- [ "Performance", "index.html#autotoc_md12", [
- [ "CPU", "index.html#autotoc_md13", null ],
- [ "Times", "index.html#autotoc_md14", null ]
+ [ "Performance", "index.html#autotoc_md15", [
+ [ "CPU", "index.html#autotoc_md16", null ],
+ [ "Times", "index.html#autotoc_md17", null ]
] ],
- [ "Credits", "index.html#autotoc_md15", null ]
+ [ "Credits", "index.html#autotoc_md18", null ]
];
\ No newline at end of file
diff --git a/docs/main_8cpp.html b/docs/main_8cpp.html
index 45bb8b4..a5e86df 100644
--- a/docs/main_8cpp.html
+++ b/docs/main_8cpp.html
@@ -109,23 +109,30 @@ $(document).ready(function(){initNavTree('main_8cpp.html',''); initResizable();
#include "data_type.hpp "
#include "monte_carlo.hpp "
#include "utils.hpp "
-
#include <csignal>
-
#include <cstdlib>
-
#include <iostream>
-
#include <omp.h>
+
#include <getopt.h>
Go to the source code of this file.
void create_burn_in_time_data ()
+ Create the data for the burn-in time for temperatures 1.0 and 2.4 for both unordered and ordered initial states.
void create_pd_estimate_data ()
+ Create the data used to estimate the probability distribution for tempratures 1.0 anbd 2.4.
+void test_burn_in_time ()
+ Create data using the same parameters except one uses burn-in time, while the other doesn't.
+
void test_parallel_speedup ()
+ Test how much Openmp speeds up.
void create_phase_transition_data ()
+ Create data for studying phase transition.
+void usage (std::string filename)
+ A function that displays how to use the program and quits.
+
int main (int argc, char **argv)
The main function.
@@ -136,7 +143,7 @@ Functions
Janita Ovidie Sandtrøen Willumsen (janitaws)
Version 0.1
-Bug: No known bugs
+Bug: No known bugs
Definition in file main.cpp .
@@ -155,6 +162,8 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
+
Create the data for the burn-in time for temperatures 1.0 and 2.4 for both unordered and ordered initial states.
+
Definition at line 21 of file main.cpp .
@@ -174,7 +183,9 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
-
Definition at line 34 of file main.cpp .
+
Create the data used to estimate the probability distribution for tempratures 1.0 anbd 2.4.
+
+
Definition at line 37 of file main.cpp .
@@ -193,7 +204,9 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
-
Definition at line 62 of file main.cpp .
+
Create data for studying phase transition.
+
+
Definition at line 83 of file main.cpp .
@@ -225,7 +238,28 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
The main function.
-Definition at line 84 of file main.cpp .
+Definition at line 125 of file main.cpp .
+
+
+
+
+◆ test_burn_in_time()
+
+
+
+
+
+ void test_burn_in_time
+ (
+ )
+
+
+
+
+
+
Create data using the same parameters except one uses burn-in time, while the other doesn't.
+
+
Definition at line 49 of file main.cpp .
@@ -244,7 +278,31 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
-
Definition at line 41 of file main.cpp .
+
Test how much Openmp speeds up.
+
+
Definition at line 60 of file main.cpp .
+
+
+
+
+
◆ usage()
+
+
+
+
+
+ void usage
+ (
+ std::string
+ filename )
+
+
+
+
+
+
A function that displays how to use the program and quits.
+
+
Definition at line 110 of file main.cpp .
diff --git a/docs/main_8cpp.js b/docs/main_8cpp.js
index 89e321a..07b4fb6 100644
--- a/docs/main_8cpp.js
+++ b/docs/main_8cpp.js
@@ -1,4 +1,10 @@
var main_8cpp =
[
- [ "main", "main_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627", null ]
+ [ "create_burn_in_time_data", "main_8cpp.html#a68406fc2dd8de5849c3984658c171f32", null ],
+ [ "create_pd_estimate_data", "main_8cpp.html#a4f8ea24364d72024915d3753a572cc5b", null ],
+ [ "create_phase_transition_data", "main_8cpp.html#a9d62cf1399596f4c5a39abdd3196d76d", null ],
+ [ "main", "main_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627", null ],
+ [ "test_burn_in_time", "main_8cpp.html#a746d8dc451b2b2536abbb1ff1acaf861", null ],
+ [ "test_parallel_speedup", "main_8cpp.html#a0dfa85080578dffff23b68e372cece95", null ],
+ [ "usage", "main_8cpp.html#ac907e18135856c90366aaa599a9e10b1", null ]
];
\ No newline at end of file
diff --git a/docs/main_8cpp_source.html b/docs/main_8cpp_source.html
index 5a6dd8e..727245f 100644
--- a/docs/main_8cpp_source.html
+++ b/docs/main_8cpp_source.html
@@ -101,118 +101,195 @@ $(document).ready(function(){initNavTree('main_8cpp_source.html',''); initResiza
-
Go to the documentation of this file.
-
-
-
+
Go to the documentation of this file.
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
+
+
-
-
-
-
-
-
21 void create_burn_in_time_data()
+
+
+
+
19
+
20
+
-
-
25 "output/burn_in_time/unordered_1_0.txt" );
-
-
27 "output/burn_in_time/ordered_1_0.txt" );
-
-
29 "output/burn_in_time/unordered_2_4.txt" );
-
-
31 "output/burn_in_time/ordered_2_4.txt" );
+
24 montecarlo::progression(1.0, 20, 20000,
+
25 "../output/burn_in_time/unordered_1_0.txt" );
+
26 montecarlo::progression(1.0, 20, 20000, 1,
+
27 "../output/burn_in_time/ordered_1_0.txt" );
+
28 montecarlo::progression(2.4, 20, 20000,
+
29 "../output/burn_in_time/unordered_2_4.txt" );
+
30 montecarlo::progression(2.4, 20, 20000, 1,
+
31 "../output/burn_in_time/ordered_2_4.txt" );
-
34 void create_pd_estimate_data()
-
-
-
37 pd_estimate (1.0, 20, 1000000,
"output/pd_estimate/estimate_1_0.txt" );
-
38 pd_estimate (2.4, 20, 1000000,
"output/pd_estimate/estimate_2_4.txt" );
-
-
-
41 void test_parallel_speedup()
-
-
-
-
-
-
-
48 for (
size_t i = 0; i < tries; i++)
-
-
-
51 for (
size_t i = 0; i < tries; i++)
-
-
-
-
55 std::cout <<
"Time serial : " << (t1 - t0) / tries <<
" seconds"
-
-
57 std::cout <<
"Time parallel : " << (t2 - t1) / tries <<
" seconds"
-
-
59 std::cout <<
"Speedup parallel: " << (t1 - t0) / (t2 - t1) <<
'\n' ;
-
-
-
62 void create_phase_transition_data()
-
-
-
+
+
35
+
36
+
+
+
+
+
41 "../output/pd_estimate/estimate_1_0.txt" );
+
+
43 "../output/pd_estimate/estimate_2_4.txt" );
+
+
+
+
47
+
48
+
+
+
+
+
53 "../output/test_burn_in_time/burn_in.txt" , 5000);
+
+
+
56 "../output/test_burn_in_time/no_burn_in.txt" , 0);
+
+
+
+
+
+
+
+
+
-
-
-
69 "output/phase_transition/size_20.txt" );
-
-
71 "output/phase_transition/size_40.txt" );
-
-
73 "output/phase_transition/size_60.txt" );
-
-
75 "output/phase_transition/size_80.txt" );
-
-
77 "output/phase_transition/size_100.txt" );
-
-
-
80 std::cout <<
"Time: " << t1 - t0 << std::endl;
-
-
-
84 int main (
int argc,
char **argv)
-
-
-
87 std::cout <<
"Need at least 1 argument, got " << argc - 1
-
88 <<
" arguments." << std::endl;
-
-
-
-
92 int arg = atoi(argv[1]);
-
-
-
-
96 create_burn_in_time_data();
-
-
-
99 create_pd_estimate_data();
-
-
-
102 test_parallel_speedup();
-
-
-
105 create_phase_transition_data();
-
-
-
108 std::cout <<
"Not a valid option!" << std::endl;
-
-
-
-
-
-
-
Header for the data_t type.
-
Functions for monte carlo simulations.
-
void phase_transition(int L, double start_T, double end_T, int points_T, std::function< data_t(int, double, int)> monte_carlo, std::string outfile)
Perform the MCMC algorithm using a range of temperatures.
-
data_t monte_carlo_serial(int L, double T, int cycles)
Execute the Metropolis algorithm for a certain amount of Monte Carlo cycles.
-
void pd_estimate(double T, int L, int cycles, const std::string filename)
Estimate the probability distribution for the energy.
-
void monte_carlo_progression(double T, int L, int cycles, const std::string filename)
Write the expected values for each Monte Carlo cycles to file.
-
data_t monte_carlo_parallel(int L, double T, int cycles)
Execute the Metropolis algorithm for a certain amount of Monte Carlo cycles in parallel.
-
int main()
The main function.
-
Function prototypes and macros that are useful.
+
67 for (size_t i = 0; i < tries; i++)
+
+
+
70 for (size_t i = 0; i < tries; i++)
+
+
+
+
74 std::cout <<
"Time serial : " << (t1 - t0) / tries <<
" seconds"
+
+
76 std::cout <<
"Time parallel : " << (t2 - t1) / tries <<
" seconds"
+
+
78 std::cout <<
"Speedup parallel: " << (t1 - t0) / (t2 - t1) <<
'\n' ;
+
+
+
+
82
+
+
+
+
+
+
+
+
+
91 "../output/phase_transition/size_20.txt" );
+
+
+
94 "../output/phase_transition/size_40.txt" );
+
+
+
97 "../output/phase_transition/size_60.txt" );
+
+
+
100 "../output/phase_transition/size_80.txt" );
+
+
+
103 "../output/phase_transition/size_100.txt" );
+
104 t1 = omp_get_wtime();
+
+
106 std::cout <<
"Time: " << t1 - t0 << std::endl;
+
+
+
+
+
+
112 std::cout <<
"Usage: " << filename <<
" OPTION ...\n"
+
113 <<
"At least one option should be used.\n\n"
+
114 <<
"\t[ -h | --help ]\n"
+
+
116 <<
"\t[ --create-burn-in-data ]\n"
+
117 <<
"\t[ --create-pd-estimate-data ]\n"
+
118 <<
"\t[ --create-phase-transition-data ]\n"
+
119 <<
"\t[ --test-parallel-speedup ]\n"
+
120 <<
"\t[ --test-burn-in-time ]\n" ;
+
+
+
+
+
+
+
127 static struct option long_options[] = {
+
128 {
"all" , no_argument, 0, 0},
+
129 {
"create-burn-in-data" , no_argument, 0, 0},
+
130 {
"create-pd-estimate-data" , no_argument, 0, 0},
+
131 {
"test-parallel-speedup" , no_argument, 0, 0},
+
132 {
"create-phase-transition-data" , no_argument, 0, 0},
+
133 {
"test-burn-in-time" , no_argument, 0, 0},
+
134 {
"help" , no_argument, 0, 0}};
+
+
136 int option_index = -1;
+
+
+
+
140 c = getopt_long(argc, argv,
"h" , long_options, &option_index);
+
+
+
+
+
+
+
147 switch (option_index) {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Type to use with the IsingModel class and montecarlo module.
+
void test_parallel_speedup()
Test how much Openmp speeds up.
+
int main(int argc, char **argv)
The main function.
+
void create_pd_estimate_data()
Create the data used to estimate the probability distribution for tempratures 1.0 anbd 2....
+
void create_burn_in_time_data()
Create the data for the burn-in time for temperatures 1.0 and 2.4 for both unordered and ordered init...
+
void test_burn_in_time()
Create data using the same parameters except one uses burn-in time, while the other doesn't.
+
void create_phase_transition_data()
Create data for studying phase transition.
+
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.
+
data_t mcmc_serial(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.
+
void pd_estimate(double T, int L, int cycles, const std::string filename, int burn_in_time=BURN_IN_TIME)
Estimate the probability distribution for the energy.
diff --git a/docs/mcmc__progression_8cpp.html b/docs/mcmc__progression_8cpp.html
new file mode 100644
index 0000000..af5487d
--- /dev/null
+++ b/docs/mcmc__progression_8cpp.html
@@ -0,0 +1,201 @@
+
+
+
+
+
+
+
+2 Dimensional Ising Model: src/mcmc_progression.cpp File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2 Dimensional Ising Model
+
+ Simulate the change in energy and magnetization in a ferro magnet
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+
+
+
+
+
Execute the mcmc algorithm and write data to file after each Monte Carlo cycle.
+More...
+
#include "data_type.hpp "
+
#include "monte_carlo.hpp "
+
#include "utils.hpp "
+
#include <getopt.h>
+
#include <omp.h>
+
#include <string>
+
+
Go to the source code of this file.
+
+
+void usage (std::string filename)
+ A function that displays how to use the program and quits.
+
+int main (int argc, char **argv)
+ The main function.
+
+
+
+
Execute the mcmc algorithm and write data to file after each Monte Carlo cycle.
+
Author Cory Alexander Balaton (coryab)
+
+Janita Ovidie Sandtrøen Willumsen (janitaws)
+
Version 1.0
+
Bug: No known bugs
+
+
Definition in file mcmc_progression.cpp .
+
+
+
◆ main()
+
+
+
+
+
+ int main
+ (
+ int
+ argc ,
+
+
+
+
+ char **
+ argv
+
+
+
+ )
+
+
+
+
+
+
+
◆ usage()
+
+
+
+
+
+ void usage
+ (
+ std::string
+ filename )
+
+
+
+
+
+
A function that displays how to use the program and quits.
+
+
Definition at line 22 of file mcmc_progression.cpp .
+
+
+
+
+
+
+
+
+
diff --git a/docs/mcmc__progression_8cpp.js b/docs/mcmc__progression_8cpp.js
new file mode 100644
index 0000000..4ebaaf6
--- /dev/null
+++ b/docs/mcmc__progression_8cpp.js
@@ -0,0 +1,5 @@
+var mcmc__progression_8cpp =
+[
+ [ "main", "mcmc__progression_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627", null ],
+ [ "usage", "mcmc__progression_8cpp.html#ac907e18135856c90366aaa599a9e10b1", null ]
+];
\ No newline at end of file
diff --git a/docs/mcmc__progression_8cpp_source.html b/docs/mcmc__progression_8cpp_source.html
new file mode 100644
index 0000000..8ce6821
--- /dev/null
+++ b/docs/mcmc__progression_8cpp_source.html
@@ -0,0 +1,194 @@
+
+
+
+
+
+
+
+2 Dimensional Ising Model: src/mcmc_progression.cpp Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2 Dimensional Ising Model
+
+ Simulate the change in energy and magnetization in a ferro magnet
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
+
+
+
+
+
+
+
+
+
+
+
24 std::cout <<
"Usage: " << filename
+
25 <<
" <temperature> <lattice size> "
+
26 "<cycles> <burn-in-time> <output file>\n\n"
+
27 <<
"\t[ -h | --help ]\n" ;
+
+
+
+
+
32 int main (
int argc,
char **argv)
+
+
+
35 struct option long_options[] = {{
"help" , 0, 0, 0}, {NULL, 0, NULL, 0}};
+
+
37 int option_index = -1;
+
+
+
+
41 c = getopt_long(argc, argv,
"h" , long_options, &option_index);
+
+
+
+
+
+
+
48 switch (option_index) {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
69 double temp = atoi(argv[1]);
+
70 int L = atoi(argv[2]), cycles = atoi(argv[3]), burn_in_time = atoi(argv[4]);
+
71 std::string outfile = argv[5];
+
+
73 montecarlo::progression(temp, L, cycles, outfile, burn_in_time);
+
+
+
+
77 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.
+
+
+
+
+
+
diff --git a/docs/menudata.js b/docs/menudata.js
index 64b7dfd..3eb3787 100644
--- a/docs/menudata.js
+++ b/docs/menudata.js
@@ -29,12 +29,33 @@ var menudata={children:[
{text:"Class List",url:"annotated.html"},
{text:"Class Index",url:"classes.html"},
{text:"Class Members",url:"functions.html",children:[
-{text:"All",url:"functions.html"},
+{text:"All",url:"functions.html",children:[
+{text:"d",url:"functions.html#index_d"},
+{text:"e",url:"functions.html#index_e"},
+{text:"i",url:"functions.html#index_i"},
+{text:"l",url:"functions.html#index_l"},
+{text:"m",url:"functions.html#index_m"},
+{text:"n",url:"functions.html#index_n"},
+{text:"o",url:"functions.html#index_o"},
+{text:"t",url:"functions.html#index_t"}]},
{text:"Functions",url:"functions_func.html"},
-{text:"Variables",url:"functions_vars.html"}]}]},
+{text:"Variables",url:"functions_vars.html"},
+{text:"Related Functions",url:"functions_rela.html"}]}]},
{text:"Files",url:"files.html",children:[
{text:"File List",url:"files.html"},
{text:"File Members",url:"globals.html",children:[
-{text:"All",url:"globals.html"},
+{text:"All",url:"globals.html",children:[
+{text:"_",url:"globals.html#index__5F"},
+{text:"a",url:"globals.html#index_a"},
+{text:"c",url:"globals.html#index_c"},
+{text:"d",url:"globals.html#index_d"},
+{text:"e",url:"globals.html#index_e"},
+{text:"i",url:"globals.html#index_i"},
+{text:"l",url:"globals.html#index_l"},
+{text:"m",url:"globals.html#index_m"},
+{text:"r",url:"globals.html#index_r"},
+{text:"t",url:"globals.html#index_t"},
+{text:"u",url:"globals.html#index_u"},
+{text:"x",url:"globals.html#index_x"}]},
{text:"Functions",url:"globals_func.html"},
{text:"Macros",url:"globals_defs.html"}]}]}]}
diff --git a/docs/monte__carlo_8cpp.html b/docs/monte__carlo_8cpp.html
index f0385af..4676787 100644
--- a/docs/monte__carlo_8cpp.html
+++ b/docs/monte__carlo_8cpp.html
@@ -107,31 +107,29 @@ $(document).ready(function(){initNavTree('monte__carlo_8cpp.html',''); initResiz
Implementation of the monte carlo functions.
More...
#include "monte_carlo.hpp "
-
#include <cmath>
-
#include <cstdint>
Go to the source code of this file.
-void monte_carlo_progression (double T, int L, int cycles, const std::string filename)
- Write the expected values for each Monte Carlo cycles to file.
-
-void monte_carlo_progression (double T, int L, int cycles, int value, const std::string filename)
- Write the expected values for each Monte Carlo cycles to file.
-
-void pd_estimate (double T, int L, int cycles, const std::string filename)
- Estimate the probability distribution for the energy.
-
-data_t monte_carlo_serial (int L, double T, int cycles)
- Execute the Metropolis algorithm for a certain amount of Monte Carlo cycles.
-
-data_t monte_carlo_parallel (int L, double T, int cycles)
- Execute the Metropolis algorithm for a certain amount of Monte Carlo cycles in parallel.
-
-void phase_transition (int L, double start, double end, int points, std::function< data_t (int, double, int)> monte_carlo, std::string outfile)
- Perform the MCMC algorithm using a range of temperatures.
-
+void montecarlo::progression (double T, int L, int cycles, const std::string filename, int burn_in_time=BURN_IN_TIME)
+ Write the expected values for each Monte Carlo cycles to file.
+
+void montecarlo::progression (double T, int L, int cycles, int value, const std::string filename, int burn_in_time=BURN_IN_TIME)
+ Write the expected values for each Monte Carlo cycles to file.
+
+void montecarlo::pd_estimate (double T, int L, int cycles, const std::string filename, int burn_in_time=BURN_IN_TIME)
+ Estimate the probability distribution for the energy.
+
+data_t montecarlo::mcmc_serial (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.
+
+data_t montecarlo::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 montecarlo::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.
+
Implementation of the monte carlo functions.
@@ -139,18 +137,18 @@ Functions
Janita Ovidie Sandtrøen Willumsen (janitaws)
Version 1.0
-
Bug: No known bugs
+
Bug: No known bugs
Definition in file monte_carlo.cpp .
-
-◆ monte_carlo_parallel()
+
+◆ mcmc_parallel()
- data_t monte_carlo_parallel
+ data_t montecarlo::mcmc_parallel
(
int
L ,
@@ -165,7 +163,13 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
int
- cycles
+ cycles ,
+
+
+
+
+ int
+ burn_in_time = BURN_IN_TIME
@@ -180,24 +184,79 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
L The size of the lattice
T The Temperature for the Ising model
- cycles The amount of Monte Carlo cycles to do
+ cycles The amount of Monte Carlo cycles to do
+ burn_in_time The burn-in time to use
-Returns data_t
+Returns data_t
-Definition at line 128 of file monte_carlo.cpp .
+Definition at line 141 of file monte_carlo.cpp .
-
-◆ monte_carlo_progression() [1/2]
+
+◆ mcmc_serial()
- void monte_carlo_progression
+ data_t montecarlo::mcmc_serial
+ (
+ 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.
+
Parameters
+
+ L The size of the lattice
+ T The Temperature for the Ising model
+ cycles The amount of Monte Carlo cycles to do
+ burn_in_time The burn-in time to use
+
+
+
+
Returns data_t
+
+
Definition at line 122 of file monte_carlo.cpp .
+
+
+
+
+◆ pd_estimate()
+
+
+
+
+
+ void montecarlo::pd_estimate
(
double
T ,
@@ -218,7 +277,153 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
const std::string
- filename
+ filename ,
+
+
+
+
+ int
+ burn_in_time = BURN_IN_TIME
+
+
+
+ )
+
+
+
+
+
+
Estimate the probability distribution for the energy.
+
Parameters
+
+ T The temperature of the Ising model
+ L The size of the lattice
+ cycles The amount of Monte Carlo cycles to do
+ filename The file to write to
+ burn_in_time The burn-in time to use
+
+
+
+
+
Definition at line 91 of file monte_carlo.cpp .
+
+
+
+
+◆ phase_transition()
+
+
+
+
+
+ void montecarlo::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.
+
Parameters
+
+ L The size of the lattice
+ start_T The start temperature
+ end_T The end temperature
+ point_T The amount of point to measure
+ monte_carlo Which Monte Carlo implementation to use
+ outfile The file to write the data to
+ burn_in_time The burn-in time to use
+
+
+
+
+
Definition at line 169 of file monte_carlo.cpp .
+
+
+
+
+◆ progression() [1/2]
+
+
+
+
+
+ void montecarlo::progression
+ (
+ double
+ T ,
+
+
+
+
+ int
+ L ,
+
+
+
+
+ int
+ cycles ,
+
+
+
+
+ const std::string
+ filename ,
+
+
+
+
+ int
+ burn_in_time = BURN_IN_TIME
@@ -235,22 +440,23 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
L The size of the lattice
cycles The amount of Monte Carlo cycles to do
filename The file to write to
+ burn_in_time The burn-in time to use
-
Definition at line 17 of file monte_carlo.cpp .
+
Definition at line 15 of file monte_carlo.cpp .
-
-◆ monte_carlo_progression() [2/2]
+
+◆ progression() [2/2]
- void monte_carlo_progression
+ void montecarlo::progression
(
double
T ,
@@ -277,7 +483,13 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
const std::string
- filename
+ filename ,
+
+
+
+
+ int
+ burn_in_time = BURN_IN_TIME
@@ -295,178 +507,12 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
cycles The amount of Monte Carlo cycles to do
value The value to set the elements in the lattice
filename The file to write to
+ burn_in_time The burn-in time to use
-
Definition at line 51 of file monte_carlo.cpp .
-
-
-
-
-◆ monte_carlo_serial()
-
-
-
-
-
- data_t monte_carlo_serial
- (
- int
- L ,
-
-
-
-
- double
- T ,
-
-
-
-
- int
- cycles
-
-
-
- )
-
-
-
-
-
-
Execute the Metropolis algorithm for a certain amount of Monte Carlo cycles.
-
Parameters
-
- L The size of the lattice
- T The Temperature for the Ising model
- cycles The amount of Monte Carlo cycles to do
-
-
-
-
Returns data_t
-
-
Definition at line 111 of file monte_carlo.cpp .
-
-
-
-
-◆ pd_estimate()
-
-
-
-
-
- void pd_estimate
- (
- double
- T ,
-
-
-
-
- int
- L ,
-
-
-
-
- int
- cycles ,
-
-
-
-
- const std::string
- filename
-
-
-
- )
-
-
-
-
-
-
Estimate the probability distribution for the energy.
-
Parameters
-
- T The temperature of the Ising model
- L The size of the lattice
- cycles The amount of Monte Carlo cycles to do
- filename The file to write to
-
-
-
-
-
Definition at line 85 of file monte_carlo.cpp .
-
-
-
-
-◆ phase_transition()
-
-
-
-
-
- void phase_transition
- (
- int
- L ,
-
-
-
-
- double
- start_T ,
-
-
-
-
- double
- end_T ,
-
-
-
-
- int
- points_T ,
-
-
-
-
- std::function< data_t (int, double, int)>
- monte_carlo ,
-
-
-
-
- std::string
- outfile
-
-
-
- )
-
-
-
-
-
-
Perform the MCMC algorithm using a range of temperatures.
-
Parameters
-
- L The size of the lattice
- start_T The start temperature
- end_T The end temperature
- point_T The amount of point to measure
- monte_carlo Which Monte Carlo implementation to use
- outfile The file to write the data to
-
-
-
-
-
Definition at line 156 of file monte_carlo.cpp .
+
Definition at line 53 of file monte_carlo.cpp .
diff --git a/docs/monte__carlo_8cpp.js b/docs/monte__carlo_8cpp.js
index f43bc7d..aacefc6 100644
--- a/docs/monte__carlo_8cpp.js
+++ b/docs/monte__carlo_8cpp.js
@@ -1,9 +1,9 @@
var monte__carlo_8cpp =
[
- [ "monte_carlo_parallel", "monte__carlo_8cpp.html#acc34e2049a5030874f6f548f3adab958", null ],
- [ "monte_carlo_progression", "monte__carlo_8cpp.html#ac97d0de27f2f0d50fc6ecf3a79f32826", null ],
- [ "monte_carlo_progression", "monte__carlo_8cpp.html#a89ddd777796c65eb2b289af11fc0ce09", null ],
- [ "monte_carlo_serial", "monte__carlo_8cpp.html#a8f8d4c5e032ed8565a3ac518b32c6aed", null ],
- [ "pd_estimate", "monte__carlo_8cpp.html#a962f704ab35208bf6541eb3b707a9559", null ],
- [ "phase_transition", "monte__carlo_8cpp.html#a7df22ace588b4d229d1029ce766d0009", null ]
+ [ "mcmc_parallel", "monte__carlo_8cpp.html#ae1e7f904ecfc3d8f3c4dd1ef155dd771", null ],
+ [ "mcmc_serial", "monte__carlo_8cpp.html#ae67483ff00d1b0594d543261c8283ffd", null ],
+ [ "pd_estimate", "monte__carlo_8cpp.html#aea2dd1b5fac7c45633bc6f8dc4541226", null ],
+ [ "phase_transition", "monte__carlo_8cpp.html#a34e9c3e24f26760693266b8a7b6b3d21", null ],
+ [ "progression", "monte__carlo_8cpp.html#a781d946de16211ba18ad6671a5b6838d", null ],
+ [ "progression", "monte__carlo_8cpp.html#a1549fc386bd3cdd1cdbe0261b9dd8415", null ]
];
\ No newline at end of file
diff --git a/docs/monte__carlo_8cpp_source.html b/docs/monte__carlo_8cpp_source.html
index 801427d..cf453d5 100644
--- a/docs/monte__carlo_8cpp_source.html
+++ b/docs/monte__carlo_8cpp_source.html
@@ -101,191 +101,225 @@ $(document).ready(function(){initNavTree('monte__carlo_8cpp_source.html',''); in
-
Go to the documentation of this file.
-
+
Go to the documentation of this file.
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
-
-
-
-
-
18 const std::string filename)
-
-
-
-
-
-
-
25 std::string directory = utils::dirname(filename);
-
-
-
-
29 std::random_device rd;
-
30 uint32_t rd_sample = rd();
-
31 std::mt19937 engine(rd_sample);
+
+
15 void progression (
double T,
int L,
int cycles,
const std::string filename,
+
+
+
+
+
+
+
+
+
+
+
+
27 std::random_device rd;
+
28 uint32_t rd_sample = rd();
+
29 std::mt19937 engine(rd_sample);
+
+
31 std::cout <<
"Seed: " << rd_sample << std::endl;
-
33 std::cout <<
"Seed: " << rd_sample << std::endl;
+
-
-
-
-
38 utils::mkpath(directory);
-
-
-
-
42 for (
size_t i = 1; i <= cycles; i++) {
-
-
44 tmp = data / (i * n_spins);
-
45 ofile << i <<
',' << tmp.E <<
',' << tmp.E2 <<
',' << tmp.M <<
','
-
46 << tmp.M2 <<
',' << tmp.M_abs <<
'\n' ;
-
-
-
-
-
-
52 const std::string filename)
-
-
-
-
-
-
-
59 std::string directory = utils::dirname(filename);
-
-
-
-
63 std::random_device rd;
-
64 uint32_t rd_sample = rd();
-
65 std::mt19937 engine(rd());
-
-
67 std::cout <<
"Seed: " << rd_sample << std::endl;
+
+
+
+
+
39 for (size_t i = 0; i < burn_in_time; i++) {
+
+
+
+
+
44 for (size_t i = 1; i <= cycles; i++) {
+
+
46 tmp = data / (i * n_spins);
+
47 ofile << i <<
',' << tmp
. E <<
',' << tmp
. E2 <<
',' << tmp
. M <<
','
+
+
+
+
+
+
+
54 const std::string filename,
int burn_in_time)
+
+
+
+
+
+
+
+
+
+
+
65 std::random_device rd;
+
66 uint32_t rd_sample = rd();
+
67 std::mt19937 engine(rd());
-
+
69 std::cout <<
"Seed: " << rd_sample << std::endl;
-
-
72 utils::mkpath(directory);
-
-
-
-
76 for (
size_t i = 1; i <= cycles; i++) {
-
-
78 tmp = data / (i * n_spins);
-
79 ofile << i <<
',' << tmp.E <<
',' << tmp.E2 <<
',' << tmp.M <<
','
-
80 << tmp.M2 <<
',' << tmp.M_abs <<
'\n' ;
-
-
-
-
-
85 void pd_estimate (
double T,
int L,
int cycles,
const std::string filename)
-
-
-
-
+
+
+
73 for (size_t i = 0; i < burn_in_time; i++) {
+
+
+
+
+
+
+
+
+
82 for (size_t i = 1; i <= cycles; i++) {
+
+
84 tmp = data / (i * n_spins);
+
85 ofile << i <<
',' << tmp
. E <<
',' << tmp
. E2 <<
',' << tmp
. M <<
','
+
+
+
+
-
-
92 std::string directory = utils::dirname(filename);
-
-
-
-
-
-
98 utils::mkpath(directory);
-
-
-
-
102 for (
size_t i = 1; i <= cycles; i++) {
-
-
104 ofile << data.E <<
',' << data.E2 <<
',' << data.M <<
',' << data.M2
-
105 <<
',' << data.M_abs <<
'\n' ;
+
91 void pd_estimate (
double T,
int L,
int cycles,
const std::string filename,
+
+
+
+
+
+
+
+
+
+
+
+
+
104 for (size_t i = 0; i < burn_in_time; i++) {
+
-
-
-
-
-
-
-
-
-
-
116 for (
size_t i = 0; i < BURN_IN_TIME; i++) {
-
-
-
-
-
121 for (
size_t i = 0; i < (uint)cycles; i++) {
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
110 ofile.open(filename);
+
+
+
113 for (size_t i = 1; i <= cycles; i++) {
+
+
115 ofile << data
. E <<
',' << data
. E2 <<
',' << data
. M <<
',' << data
. M2
+
116 <<
',' << data
. M_abs <<
'\n' ;
+
+
+
+
+
+
+
+
+
+
+
127 for (size_t i = 0; i < burn_in_time; i++) {
+
+
+
+
+
132 for (size_t i = 0; i < (uint)cycles; i++) {
+
+
-
-
-
138 for (
size_t i = 0; i < BURN_IN_TIME; i++) {
-
-
-
-
-
-
-
145 #pragma omp for schedule(static) reduction(+ : data)
-
146 for (
size_t i = 0; i < (uint)cycles; i++) {
-
-
-
-
-
151 double norm = 1. / (double)cycles;
-
-
-
-
-
-
157 std::function<
data_t (
int ,
double ,
int )> monte_carlo,
-
-
-
160 double dt = (end - start) / (
double )points;
-
-
-
-
-
-
-
167 utils::mkpath(utils::dirname(outfile));
-
-
-
170 double temp, CV, X, E_var, M_var;
-
-
172 using utils::scientific_format;
-
173 for (
size_t i = 0; i < points; i++) {
-
174 temp = start + dt * i;
-
175 data = monte_carlo(L, temp, cycles);
-
176 E_var = (data.E2 - data.E * data.E) / (
double )N;
-
177 M_var = (data.M2 - data.M_abs * data.M_abs) / (
double )N;
+
136 double norm = 1. / (
double )cycles;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
151 for (size_t i = 0; i < burn_in_time; i++) {
+
+
+
+
+
+
+
158 # pragma omp for schedule ( static ) reduction ( + : data )
+
159 for (size_t i = 0; i < (uint)cycles; i++) {
+
+
+
+
+
164 double norm = 1. / (
double )cycles;
+
+
+
+
+
+
170 std::function<
data_t (
int ,
double ,
int ,
int )> monte_carlo,
+
171 std::string outfile,
int burn_in_time)
+
+
173 double dt = (end - start) / (
double )points;
+
+
+
+
-
179 ofile << scientific_format(temp) <<
','
-
180 << scientific_format(data.E / (
double )N) <<
','
-
181 << scientific_format(data.M_abs / N) <<
','
-
182 << scientific_format(E_var / (temp * temp)) <<
','
-
183 << scientific_format(M_var / temp) <<
'\n' ;
-
-
-
-
The Ising model in 2 dimensions.
-
data_t Metropolis()
The Metropolis algorithm.
-
-
data_t monte_carlo_serial(int L, double T, int cycles)
Execute the Metropolis algorithm for a certain amount of Monte Carlo cycles.
-
void monte_carlo_progression(double T, int L, int cycles, const std::string filename)
Write the expected values for each Monte Carlo cycles to file.
-
data_t monte_carlo_parallel(int L, double T, int cycles)
Execute the Metropolis algorithm for a certain amount of Monte Carlo cycles in parallel.
-
Functions for monte carlo simulations.
-
void phase_transition(int L, double start_T, double end_T, int points_T, std::function< data_t(int, double, int)> monte_carlo, std::string outfile)
Perform the MCMC algorithm using a range of temperatures.
-
void pd_estimate(double T, int L, int cycles, const std::string filename)
Estimate the probability distribution for the energy.
+
+
+
+
182 double temp, CV, X, E_var, M_var;
+
+
184 using utils::scientific_format;
+
185 for (size_t i = 0; i < points; i++) {
+
186 temp = start + dt * i;
+
187 data = monte_carlo(L, temp, cycles, burn_in_time);
+
188 E_var = (data
. E2 - data
. E * data
. E ) / (
double )N;
+
+
+
+
+
+
+
+
+
+
+
+
The Ising model in 2 dimensions.
+
IsingModel(int L, double T, int val)
Constructor for the Ising model.
+
IsingModel(int L, double T)
Constructor for the Ising model.
+
data_t Metropolis()
The Metropolis algorithm.
+
Type to use with the IsingModel class and montecarlo module.
+
double M_abs
Absolute Magnetization.
+
+
data_t & operator+=(const data_t &b)
Overload of the addition equals operator.
+
double M2
Magnetization squared.
+
+
+
void progression(double T, int L, int cycles, int value, const std::string filename, int burn_in_time=BURN_IN_TIME)
Write the expected values for each Monte Carlo cycles to file.
+
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.
+
void progression(double T, int L, int cycles, const std::string filename, int burn_in_time=BURN_IN_TIME)
Write the expected values for each Monte Carlo cycles to file.
+
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.
+
data_t mcmc_serial(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.
+
void pd_estimate(double T, int L, int cycles, const std::string filename, int burn_in_time=BURN_IN_TIME)
Estimate the probability distribution for the energy.
+
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.
diff --git a/docs/monte__carlo_8hpp.html b/docs/monte__carlo_8hpp.html
index 698a623..8810cbd 100644
--- a/docs/monte__carlo_8hpp.html
+++ b/docs/monte__carlo_8hpp.html
@@ -105,14 +105,14 @@ $(document).ready(function(){initNavTree('monte__carlo_8hpp.html',''); initResiz
-
Functions for monte carlo simulations.
+
Functions for Monte Carlo simulations.
More...
#include "IsingModel.hpp "
#include "data_type.hpp "
#include "utils.hpp "
#include <functional>
-
#include <string>
#include <omp.h>
+
#include <string>
Go to the source code of this file.
@@ -123,35 +123,32 @@ Macros
-int test_2x2_lattice (double tol, int max_cycles)
- Test numerical data with analytical data.
-
-void monte_carlo_progression (double T, int L, int cycles, const std::string filename)
- Write the expected values for each Monte Carlo cycles to file.
-
-void monte_carlo_progression (double T, int L, int cycles, int value, const std::string filename)
- Write the expected values for each Monte Carlo cycles to file.
-
-void pd_estimate (double T, int L, int cycles, const std::string filename)
- Estimate the probability distribution for the energy.
-
-data_t monte_carlo_serial (int L, double T, int cycles)
- Execute the Metropolis algorithm for a certain amount of Monte Carlo cycles.
-
-data_t monte_carlo_parallel (int L, double T, int cycles)
- Execute the Metropolis algorithm for a certain amount of Monte Carlo cycles in parallel.
-
-void phase_transition (int L, double start_T, double end_T, int points_T, std::function< data_t (int, double, int)> monte_carlo, std::string outfile)
- Perform the MCMC algorithm using a range of temperatures.
-
+void montecarlo::progression (double T, int L, int cycles, const std::string filename, int burn_in_time=BURN_IN_TIME)
+ Write the expected values for each Monte Carlo cycles to file.
+
+void montecarlo::progression (double T, int L, int cycles, int value, const std::string filename, int burn_in_time=BURN_IN_TIME)
+ Write the expected values for each Monte Carlo cycles to file.
+
+void montecarlo::pd_estimate (double T, int L, int cycles, const std::string filename, int burn_in_time=BURN_IN_TIME)
+ Estimate the probability distribution for the energy.
+
+data_t montecarlo::mcmc_serial (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.
+
+data_t montecarlo::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 montecarlo::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.
+
-
Functions for monte carlo simulations.
+
Functions for Monte Carlo simulations.
Author Cory Alexander Balaton (coryab)
Janita Ovidie Sandtrøen Willumsen (janitaws)
Version 1.0
-
Bug: No known bugs
+
Bug: No known bugs
Definition in file monte_carlo.hpp .
@@ -172,14 +169,14 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
-
-◆ monte_carlo_parallel()
+
+◆ mcmc_parallel()
- data_t monte_carlo_parallel
+ data_t montecarlo::mcmc_parallel
(
int
L ,
@@ -194,7 +191,13 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
int
- cycles
+ cycles ,
+
+
+
+
+ int
+ burn_in_time = BURN_IN_TIME
@@ -209,24 +212,79 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
L The size of the lattice
T The Temperature for the Ising model
- cycles The amount of Monte Carlo cycles to do
+ cycles The amount of Monte Carlo cycles to do
+ burn_in_time The burn-in time to use
-Returns data_t
+Returns data_t
-Definition at line 128 of file monte_carlo.cpp .
+Definition at line 141 of file monte_carlo.cpp .
-
-◆ monte_carlo_progression() [1/2]
+
+◆ mcmc_serial()
- void monte_carlo_progression
+ data_t montecarlo::mcmc_serial
+ (
+ 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.
+
Parameters
+
+ L The size of the lattice
+ T The Temperature for the Ising model
+ cycles The amount of Monte Carlo cycles to do
+ burn_in_time The burn-in time to use
+
+
+
+
Returns data_t
+
+
Definition at line 122 of file monte_carlo.cpp .
+
+
+
+
+◆ pd_estimate()
+
+
+
+
+
+ void montecarlo::pd_estimate
(
double
T ,
@@ -247,7 +305,153 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
const std::string
- filename
+ filename ,
+
+
+
+
+ int
+ burn_in_time = BURN_IN_TIME
+
+
+
+ )
+
+
+
+
+
+
Estimate the probability distribution for the energy.
+
Parameters
+
+ T The temperature of the Ising model
+ L The size of the lattice
+ cycles The amount of Monte Carlo cycles to do
+ filename The file to write to
+ burn_in_time The burn-in time to use
+
+
+
+
+
Definition at line 91 of file monte_carlo.cpp .
+
+
+
+
+◆ phase_transition()
+
+
+
+
+
+ void montecarlo::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.
+
Parameters
+
+ L The size of the lattice
+ start_T The start temperature
+ end_T The end temperature
+ point_T The amount of point to measure
+ monte_carlo Which Monte Carlo implementation to use
+ outfile The file to write the data to
+ burn_in_time The burn-in time to use
+
+
+
+
+
Definition at line 169 of file monte_carlo.cpp .
+
+
+
+
+◆ progression() [1/2]
+
+
+
+
+
+ void montecarlo::progression
+ (
+ double
+ T ,
+
+
+
+
+ int
+ L ,
+
+
+
+
+ int
+ cycles ,
+
+
+
+
+ const std::string
+ filename ,
+
+
+
+
+ int
+ burn_in_time = BURN_IN_TIME
@@ -264,22 +468,23 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
L The size of the lattice
cycles The amount of Monte Carlo cycles to do
filename The file to write to
+ burn_in_time The burn-in time to use
-
Definition at line 17 of file monte_carlo.cpp .
+
Definition at line 15 of file monte_carlo.cpp .
-
-◆ monte_carlo_progression() [2/2]
+
+◆ progression() [2/2]
- void monte_carlo_progression
+ void montecarlo::progression
(
double
T ,
@@ -306,7 +511,13 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
const std::string
- filename
+ filename ,
+
+
+
+
+ int
+ burn_in_time = BURN_IN_TIME
@@ -324,216 +535,12 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
cycles The amount of Monte Carlo cycles to do
value The value to set the elements in the lattice
filename The file to write to
+ burn_in_time The burn-in time to use
-
Definition at line 51 of file monte_carlo.cpp .
-
-
-
-
-◆ monte_carlo_serial()
-
-
-
-
-
- data_t monte_carlo_serial
- (
- int
- L ,
-
-
-
-
- double
- T ,
-
-
-
-
- int
- cycles
-
-
-
- )
-
-
-
-
-
-
Execute the Metropolis algorithm for a certain amount of Monte Carlo cycles.
-
Parameters
-
- L The size of the lattice
- T The Temperature for the Ising model
- cycles The amount of Monte Carlo cycles to do
-
-
-
-
Returns data_t
-
-
Definition at line 111 of file monte_carlo.cpp .
-
-
-
-
-◆ pd_estimate()
-
-
-
-
-
- void pd_estimate
- (
- double
- T ,
-
-
-
-
- int
- L ,
-
-
-
-
- int
- cycles ,
-
-
-
-
- const std::string
- filename
-
-
-
- )
-
-
-
-
-
-
Estimate the probability distribution for the energy.
-
Parameters
-
- T The temperature of the Ising model
- L The size of the lattice
- cycles The amount of Monte Carlo cycles to do
- filename The file to write to
-
-
-
-
-
Definition at line 85 of file monte_carlo.cpp .
-
-
-
-
-◆ phase_transition()
-
-
-
-
-
- void phase_transition
- (
- int
- L ,
-
-
-
-
- double
- start_T ,
-
-
-
-
- double
- end_T ,
-
-
-
-
- int
- points_T ,
-
-
-
-
- std::function< data_t (int, double, int)>
- monte_carlo ,
-
-
-
-
- std::string
- outfile
-
-
-
- )
-
-
-
-
-
-
Perform the MCMC algorithm using a range of temperatures.
-
Parameters
-
- L The size of the lattice
- start_T The start temperature
- end_T The end temperature
- point_T The amount of point to measure
- monte_carlo Which Monte Carlo implementation to use
- outfile The file to write the data to
-
-
-
-
-
Definition at line 156 of file monte_carlo.cpp .
-
-
-
-
-◆ test_2x2_lattice()
-
-
-
-
-
- int test_2x2_lattice
- (
- double
- tol ,
-
-
-
-
- int
- max_cycles
-
-
-
- )
-
-
-
-
-
-
Test numerical data with analytical data.
-
Parameters
-
- tol The tolerance between the analytical and numerical solution.
- max_cycles The max number of Monte Carlo cycles.
-
-
-
-
return int
+
Definition at line 53 of file monte_carlo.cpp .
diff --git a/docs/monte__carlo_8hpp.js b/docs/monte__carlo_8hpp.js
index 800643a..d0e1ec0 100644
--- a/docs/monte__carlo_8hpp.js
+++ b/docs/monte__carlo_8hpp.js
@@ -1,10 +1,9 @@
var monte__carlo_8hpp =
[
- [ "monte_carlo_parallel", "monte__carlo_8hpp.html#acc34e2049a5030874f6f548f3adab958", null ],
- [ "monte_carlo_progression", "monte__carlo_8hpp.html#ac97d0de27f2f0d50fc6ecf3a79f32826", null ],
- [ "monte_carlo_progression", "monte__carlo_8hpp.html#a89ddd777796c65eb2b289af11fc0ce09", null ],
- [ "monte_carlo_serial", "monte__carlo_8hpp.html#a8f8d4c5e032ed8565a3ac518b32c6aed", null ],
- [ "pd_estimate", "monte__carlo_8hpp.html#a962f704ab35208bf6541eb3b707a9559", null ],
- [ "phase_transition", "monte__carlo_8hpp.html#a2dfe843fbb80e10a763f3260131a148e", null ],
- [ "test_2x2_lattice", "monte__carlo_8hpp.html#aa8b4fc86b26f0e3e253ba5556d2d14dc", null ]
+ [ "mcmc_parallel", "monte__carlo_8hpp.html#ae1e7f904ecfc3d8f3c4dd1ef155dd771", null ],
+ [ "mcmc_serial", "monte__carlo_8hpp.html#ae67483ff00d1b0594d543261c8283ffd", null ],
+ [ "pd_estimate", "monte__carlo_8hpp.html#aea2dd1b5fac7c45633bc6f8dc4541226", null ],
+ [ "phase_transition", "monte__carlo_8hpp.html#a34e9c3e24f26760693266b8a7b6b3d21", null ],
+ [ "progression", "monte__carlo_8hpp.html#a781d946de16211ba18ad6671a5b6838d", null ],
+ [ "progression", "monte__carlo_8hpp.html#a1549fc386bd3cdd1cdbe0261b9dd8415", null ]
];
\ No newline at end of file
diff --git a/docs/monte__carlo_8hpp_source.html b/docs/monte__carlo_8hpp_source.html
index feae31e..b04f385 100644
--- a/docs/monte__carlo_8hpp_source.html
+++ b/docs/monte__carlo_8hpp_source.html
@@ -101,53 +101,124 @@ $(document).ready(function(){initNavTree('monte__carlo_8hpp_source.html',''); in
-
Go to the documentation of this file.
-
12 #ifndef __MONTE_CARLO__
-
13 #define __MONTE_CARLO__
+
Go to the documentation of this file.
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12 # ifndef __MONTE_CARLO__
+
13 # define __MONTE_CARLO__
-
-
-
+
+
+
-
-
-
+
+
+
-
-
24 #define BURN_IN_TIME 5000
+
+
24 # define BURN_IN_TIME 5000
-
26 #pragma omp declare reduction(+: data_t: omp_out += omp_in)
-
-
-
-
-
45 const std::string filename);
-
-
-
56 const std::string filename);
-
-
65 void pd_estimate (
double T,
int L,
int cycles,
const std::string filename);
-
-
-
-
-
-
-
99 int L,
double start_T,
double end_T,
int points_T,
-
100 std::function<
data_t (
int ,
double ,
int )> monte_carlo,
-
101 std::string outfile);
+
+
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35 void progression (
double T,
int L,
int cycles,
const std::string filename,
+
+
+
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47 void progression (
double T,
int L,
int cycles,
int value,
+
48 const std::string filename,
int burn_in_time =
BURN_IN_TIME );
+
+
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58 void pd_estimate (
double T,
int L,
int cycles,
const std::string filename,
+
+
+
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
+
+
+
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+
82
+
83
+
+
+
+
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
+
+
99 std::function<
data_t (
int ,
double ,
int ,
int )> monte_carlo,
+
+
-
-
The definition of the Ising model.
-
-
Header for the data_t type.
-
void phase_transition(int L, double start_T, double end_T, int points_T, std::function< data_t(int, double, int)> monte_carlo, std::string outfile)
Perform the MCMC algorithm using a range of temperatures.
-
data_t monte_carlo_serial(int L, double T, int cycles)
Execute the Metropolis algorithm for a certain amount of Monte Carlo cycles.
-
void pd_estimate(double T, int L, int cycles, const std::string filename)
Estimate the probability distribution for the energy.
-
int test_2x2_lattice(double tol, int max_cycles)
Test numerical data with analytical data.
-
void monte_carlo_progression(double T, int L, int cycles, const std::string filename)
Write the expected values for each Monte Carlo cycles to file.
-
data_t monte_carlo_parallel(int L, double T, int cycles)
Execute the Metropolis algorithm for a certain amount of Monte Carlo cycles in parallel.
-
Function prototypes and macros that are useful.
+
+
Type to use with the IsingModel class and montecarlo module.
+
void test_parallel_speedup()
Test how much Openmp speeds up.
+
int main(int argc, char **argv)
The main function.
+
void create_pd_estimate_data()
Create the data used to estimate the probability distribution for tempratures 1.0 anbd 2....
+
void create_burn_in_time_data()
Create the data for the burn-in time for temperatures 1.0 and 2.4 for both unordered and ordered init...
+
void test_burn_in_time()
Create data using the same parameters except one uses burn-in time, while the other doesn't.
+
void create_phase_transition_data()
Create data for studying phase transition.
+
void usage(std::string filename)
A function that displays how to use the program and quits.
+
void progression(double T, int L, int cycles, int value, const std::string filename, int burn_in_time=BURN_IN_TIME)
Write the expected values for each Monte Carlo cycles to file.
+
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.
+
+
void progression(double T, int L, int cycles, const std::string filename, int burn_in_time=BURN_IN_TIME)
Write the expected values for each Monte Carlo cycles to file.
+
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.
+
data_t mcmc_serial(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.
+
void pd_estimate(double T, int L, int cycles, const std::string filename, int burn_in_time=BURN_IN_TIME)
Estimate the probability distribution for the energy.
diff --git a/docs/namespacedetails.html b/docs/namespacedetails.html
new file mode 100644
index 0000000..3275c50
--- /dev/null
+++ b/docs/namespacedetails.html
@@ -0,0 +1,233 @@
+
+
+
+
+
+
+
+2 Dimensional Ising Model: details Namespace Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2 Dimensional Ising Model
+
+ Simulate the change in energy and magnetization in a ferro magnet
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+
+
+
+
+
+void m_assert (bool expr, std::string expr_str, std::string func, std::string file, int line, std::string msg)
+ Test an expression, confirm that test is ok, or abort execution.
+
+std::string methodName (const std::string &pretty_function)
+ Takes in the PRETTY_FUNCTION string and removes the return type.
+
+
+
+
+
◆ m_assert()
+
+
+
+
+
+ void details::m_assert
+ (
+ bool
+ expr ,
+
+
+
+
+ std::string
+ expr_str ,
+
+
+
+
+ std::string
+ func ,
+
+
+
+
+ std::string
+ file ,
+
+
+
+
+ int
+ line ,
+
+
+
+
+ std::string
+ msg
+
+
+
+ )
+
+
+
+
+
+
Test an expression, confirm that test is ok, or abort execution.
+
This function takes in an expression and prints an OK message if it's true, or it prints a fail message and aborts execution if it fails.
+
Parameters
+
+ expr The expression to be evaluated
+ expr_str The stringified version of the expression
+ func The function name of the caller
+ file The file of the caller
+ line The line number where this function is called from
+ msg The message to be displayed
+
+
+
+
+
Definition at line 15 of file testlib.cpp .
+
+
+
+
+
◆ methodName()
+
+
+
+
+
+
+
+
+ std::string details::methodName
+ (
+ const std::string &
+ pretty_function )
+
+
+
+
+
+inline
+
+
+
+
+
Takes in the PRETTY_FUNCTION string and removes the return type.
+
This function should only be used for the METHOD_NAME macro, since it takes the output from PRETTY_FUNCTION and strips the return type.
+
Parameters
+
+ pretty_function The string from PRETTY_FUNCTION
+
+
+
+
Returns std::string
+
+
Definition at line 58 of file utils.hpp .
+
+
+
+
+
+
+
+
+
diff --git a/docs/namespacemembers.html b/docs/namespacemembers.html
new file mode 100644
index 0000000..7b1cf67
--- /dev/null
+++ b/docs/namespacemembers.html
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+2 Dimensional Ising Model: Namespace Members
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2 Dimensional Ising Model
+
+ Simulate the change in energy and magnetization in a ferro magnet
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+
+
+
Here is a list of all namespace members with links to the namespace documentation for each member:
+
+
+
+
+
+
diff --git a/docs/namespacemembers_func.html b/docs/namespacemembers_func.html
new file mode 100644
index 0000000..6438db1
--- /dev/null
+++ b/docs/namespacemembers_func.html
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+2 Dimensional Ising Model: Namespace Members
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2 Dimensional Ising Model
+
+ Simulate the change in energy and magnetization in a ferro magnet
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/namespacemontecarlo.html b/docs/namespacemontecarlo.html
new file mode 100644
index 0000000..3fb63c7
--- /dev/null
+++ b/docs/namespacemontecarlo.html
@@ -0,0 +1,514 @@
+
+
+
+
+
+
+
+2 Dimensional Ising Model: montecarlo Namespace Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2 Dimensional Ising Model
+
+ Simulate the change in energy and magnetization in a ferro magnet
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+
+
+
+
+
+void progression (double T, int L, int cycles, const std::string filename, int burn_in_time=BURN_IN_TIME )
+ Write the expected values for each Monte Carlo cycles to file.
+
+void progression (double T, int L, int cycles, int value, const std::string filename, int burn_in_time=BURN_IN_TIME )
+ Write the expected values for each Monte Carlo cycles to file.
+
+void pd_estimate (double T, int L, int cycles, const std::string filename, int burn_in_time=BURN_IN_TIME )
+ Estimate the probability distribution for the energy.
+
+data_t mcmc_serial (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.
+
+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 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.
+
+
+
+
+
◆ mcmc_parallel()
+
+
+
+
+
+ data_t montecarlo::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.
+
Parameters
+
+ L The size of the lattice
+ T The Temperature for the Ising model
+ cycles The amount of Monte Carlo cycles to do
+ burn_in_time The burn-in time to use
+
+
+
+
Returns data_t
+
+
Definition at line 141 of file monte_carlo.cpp .
+
+
+
+
+
◆ mcmc_serial()
+
+
+
+
+
+ data_t montecarlo::mcmc_serial
+ (
+ 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.
+
Parameters
+
+ L The size of the lattice
+ T The Temperature for the Ising model
+ cycles The amount of Monte Carlo cycles to do
+ burn_in_time The burn-in time to use
+
+
+
+
Returns data_t
+
+
Definition at line 122 of file monte_carlo.cpp .
+
+
+
+
+
◆ pd_estimate()
+
+
+
+
+
+ void montecarlo::pd_estimate
+ (
+ double
+ T ,
+
+
+
+
+ int
+ L ,
+
+
+
+
+ int
+ cycles ,
+
+
+
+
+ const std::string
+ filename ,
+
+
+
+
+ int
+ burn_in_time = BURN_IN_TIME
+
+
+
+ )
+
+
+
+
+
+
Estimate the probability distribution for the energy.
+
Parameters
+
+ T The temperature of the Ising model
+ L The size of the lattice
+ cycles The amount of Monte Carlo cycles to do
+ filename The file to write to
+ burn_in_time The burn-in time to use
+
+
+
+
+
Definition at line 91 of file monte_carlo.cpp .
+
+
+
+
+
◆ phase_transition()
+
+
+
+
+
+ void montecarlo::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.
+
Parameters
+
+ L The size of the lattice
+ start_T The start temperature
+ end_T The end temperature
+ point_T The amount of point to measure
+ monte_carlo Which Monte Carlo implementation to use
+ outfile The file to write the data to
+ burn_in_time The burn-in time to use
+
+
+
+
+
Definition at line 169 of file monte_carlo.cpp .
+
+
+
+
+
◆ progression() [1/2]
+
+
+
+
+
+ void montecarlo::progression
+ (
+ double
+ T ,
+
+
+
+
+ int
+ L ,
+
+
+
+
+ int
+ cycles ,
+
+
+
+
+ const std::string
+ filename ,
+
+
+
+
+ int
+ burn_in_time = BURN_IN_TIME
+
+
+
+ )
+
+
+
+
+
+
Write the expected values for each Monte Carlo cycles to file.
+
Parameters
+
+ T Temperature
+ L The size of the lattice
+ cycles The amount of Monte Carlo cycles to do
+ filename The file to write to
+ burn_in_time The burn-in time to use
+
+
+
+
+
Definition at line 15 of file monte_carlo.cpp .
+
+
+
+
+
◆ progression() [2/2]
+
+
+
+
+
+ void montecarlo::progression
+ (
+ double
+ T ,
+
+
+
+
+ int
+ L ,
+
+
+
+
+ int
+ cycles ,
+
+
+
+
+ int
+ value ,
+
+
+
+
+ const std::string
+ filename ,
+
+
+
+
+ int
+ burn_in_time = BURN_IN_TIME
+
+
+
+ )
+
+
+
+
+
+
Write the expected values for each Monte Carlo cycles to file.
+
Parameters
+
+ T Temperature
+ L The size of the lattice
+ cycles The amount of Monte Carlo cycles to do
+ value The value to set the elements in the lattice
+ filename The file to write to
+ burn_in_time The burn-in time to use
+
+
+
+
+
Definition at line 53 of file monte_carlo.cpp .
+
+
+
+
+
+
+
+
+
diff --git a/docs/namespaces.html b/docs/namespaces.html
new file mode 100644
index 0000000..ea7e425
--- /dev/null
+++ b/docs/namespaces.html
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+2 Dimensional Ising Model: Namespace List
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2 Dimensional Ising Model
+
+ Simulate the change in energy and magnetization in a ferro magnet
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+
+
+
+
Here is a list of all namespaces with brief descriptions:
+
+
+
+
+
+
diff --git a/docs/namespaces_dup.js b/docs/namespaces_dup.js
new file mode 100644
index 0000000..9846fae
--- /dev/null
+++ b/docs/namespaces_dup.js
@@ -0,0 +1,28 @@
+var namespaces_dup =
+[
+ [ "details", "namespacedetails.html", [
+ [ "m_assert", "namespacedetails.html#a39abb7cba0535176ed62aae136d2fcc7", null ],
+ [ "methodName", "namespacedetails.html#a178c4922157666a6e9c127c2ffd96346", null ]
+ ] ],
+ [ "montecarlo", "namespacemontecarlo.html", [
+ [ "mcmc_parallel", "namespacemontecarlo.html#ae1e7f904ecfc3d8f3c4dd1ef155dd771", null ],
+ [ "mcmc_serial", "namespacemontecarlo.html#ae67483ff00d1b0594d543261c8283ffd", null ],
+ [ "pd_estimate", "namespacemontecarlo.html#aea2dd1b5fac7c45633bc6f8dc4541226", null ],
+ [ "phase_transition", "namespacemontecarlo.html#a34e9c3e24f26760693266b8a7b6b3d21", null ],
+ [ "progression", "namespacemontecarlo.html#a781d946de16211ba18ad6671a5b6838d", null ],
+ [ "progression", "namespacemontecarlo.html#a1549fc386bd3cdd1cdbe0261b9dd8415", null ]
+ ] ],
+ [ "testlib", "namespacetestlib.html", [
+ [ "assert_each", "namespacetestlib.html#ab6585c8aa8c276a3442c67a57c8de6fb", null ],
+ [ "close_to", "namespacetestlib.html#a2cbf3a45367e903de6efbdbea3344cea", null ],
+ [ "close_to", "namespacetestlib.html#a44f47fa3c8654c09712572d75c0ffa7f", null ],
+ [ "is_equal", "namespacetestlib.html#a3db67d8721d2f3cd626526b43186bcf3", null ]
+ ] ],
+ [ "utils", "namespaceutils.html", [
+ [ "concatpath", "namespaceutils.html#ae91fad89394d745d544737e43524bde6", null ],
+ [ "dirname", "namespaceutils.html#aed026119193a9bbe076671809ff0f430", null ],
+ [ "mkpath", "namespaceutils.html#a2b45adc86b70f42021582994e83fa00d", null ],
+ [ "scientific_format", "namespaceutils.html#ab3e89176433ddc9ba721b2eba3d08357", null ],
+ [ "scientific_format", "namespaceutils.html#a3529a74fd2a25d24de73d9d4e1c90835", null ]
+ ] ]
+];
\ No newline at end of file
diff --git a/docs/namespacetestlib.html b/docs/namespacetestlib.html
new file mode 100644
index 0000000..03e1860
--- /dev/null
+++ b/docs/namespacetestlib.html
@@ -0,0 +1,354 @@
+
+
+
+
+
+
+
+2 Dimensional Ising Model: testlib Namespace Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2 Dimensional Ising Model
+
+ Simulate the change in energy and magnetization in a ferro magnet
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+
+
+
+
+
+template<class T , class = typename std::enable_if<std::is_arithmetic<T>::value>::type>
+static bool close_to (arma::Mat< T > &a, arma::Mat< T > &b, double tol=1e-8)
+ Test if two armadillo matrices/vectors are close to each other.
+
+template<class T , class = typename std::enable_if<std::is_arithmetic<T>::value>::type>
+static bool close_to (T a, T b, double tol=1e-8)
+ Test if two numbers are close to each other.
+
+template<class T , class = typename std::enable_if<std::is_integral<T>::value>::type>
+static bool is_equal (arma::Mat< T > &a, arma::Mat< T > &b)
+ Test if two armadillo matrices/vectors are equal.
+
+template<class T , class = typename std::enable_if<std::is_arithmetic<T>::value>::type>
+static bool assert_each (std::function< bool(T)> expr, arma::Mat< T > &M)
+ Test that all elements fulfill the condition.
+
+
+
+
+
◆ assert_each()
+
+
+
+
+template<class T , class = typename std::enable_if<std::is_arithmetic<T>::value>::type>
+
+
+
+
+
+ static bool testlib::assert_each
+ (
+ std::function< bool(T)>
+ expr ,
+
+
+
+
+ arma::Mat< T > &
+ M
+
+
+
+ )
+
+
+
+
+
+static
+
+
+
+
+
Test that all elements fulfill the condition.
+
Parameters
+
+ expr The boolean expression to apply to each element
+ M The matrix/vector to iterate over
+
+
+
+
Returns bool
+
+
Definition at line 130 of file testlib.hpp .
+
+
+
+
+
◆ close_to() [1/2]
+
+
+
+
+template<class T , class = typename std::enable_if<std::is_arithmetic<T>::value>::type>
+
+
+
+
+
+ static bool testlib::close_to
+ (
+ arma::Mat< T > &
+ a ,
+
+
+
+
+ arma::Mat< T > &
+ b ,
+
+
+
+
+ double
+ tol = 1e-8
+
+
+
+ )
+
+
+
+
+
+static
+
+
+
+
+
Test if two armadillo matrices/vectors are close to each other.
+
This function takes in 2 matrices/vectors and checks if they are approximately equal to each other given a tolerance.
+
Parameters
+
+ a Matrix/vector a
+ b Matrix/vector b
+ tol The tolerance
+
+
+
+
Returns bool
+
+
Definition at line 67 of file testlib.hpp .
+
+
+
+
+
◆ close_to() [2/2]
+
+
+
+
+template<class T , class = typename std::enable_if<std::is_arithmetic<T>::value>::type>
+
+
+
+
+
+ static bool testlib::close_to
+ (
+ T
+ a ,
+
+
+
+
+ T
+ b ,
+
+
+
+
+ double
+ tol = 1e-8
+
+
+
+ )
+
+
+
+
+
+static
+
+
+
+
+
Test if two numbers are close to each other.
+
This function takes in 2 matrices/vectors and checks if they are approximately equal to each other given a tolerance.
+
Parameters
+
+ a Matrix/vector a
+ b Matrix/vector b
+ tol The tolerance
+
+
+
+
Returns bool
+
+
Definition at line 94 of file testlib.hpp .
+
+
+
+
+
◆ is_equal()
+
+
+
+
+template<class T , class = typename std::enable_if<std::is_integral<T>::value>::type>
+
+
+
+
+
+ static bool testlib::is_equal
+ (
+ arma::Mat< T > &
+ a ,
+
+
+
+
+ arma::Mat< T > &
+ b
+
+
+
+ )
+
+
+
+
+
+static
+
+
+
+
+
Test if two armadillo matrices/vectors are equal.
+
This function takes in 2 matrices/vectors and checks if they are equal to each other. This should only be used for integral types.
+
Parameters
+
+ a Matrix/vector a
+ b Matrix/vector b
+
+
+
+
Returns bool
+
+
Definition at line 111 of file testlib.hpp .
+
+
+
+
+
+
+
+
+
diff --git a/docs/namespaceutils.html b/docs/namespaceutils.html
new file mode 100644
index 0000000..cd3d9b5
--- /dev/null
+++ b/docs/namespaceutils.html
@@ -0,0 +1,343 @@
+
+
+
+
+
+
+
+2 Dimensional Ising Model: utils Namespace Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2 Dimensional Ising Model
+
+ Simulate the change in energy and magnetization in a ferro magnet
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+
+
+
+
+
+std::string scientific_format (double d, int width=20, int prec=10)
+ Turns a double into a string written in scientific format.
+
+std::string scientific_format (const std::vector< double > &v, int width=20, int prec=10)
+ Turns a vector of doubles into a string written in scientific format.
+
+bool mkpath (std::string path, int mode=0777)
+ Make path given.
+
+std::string dirname (const std::string &path)
+ Get the directory name of the path.
+
+std::string concatpath (const std::string &left, const std::string &right)
+ Take 2 strings and concatenate them and make sure there is a directory separator (/) between them.
+
+
+
+
+
◆ concatpath()
+
+
+
+
+
+ std::string utils::concatpath
+ (
+ const std::string &
+ left ,
+
+
+
+
+ const std::string &
+ right
+
+
+
+ )
+
+
+
+
+
+
Take 2 strings and concatenate them and make sure there is a directory separator (/) between them.
+
This function doesn't care whether or not the values given as parameters are valid path strings. It is the responsibility of the user to make sure that the values given are valid path strings. The function only guarantees that the output string is a valid path string.
+
Parameters
+
+ left The left hand side of the result string
+ right The right hand side of the result string
+
+
+
+
Returns string
+
+
Definition at line 63 of file utils.cpp .
+
+
+
+
+
◆ dirname()
+
+
+
+
+
+ std::string utils::dirname
+ (
+ const std::string &
+ path )
+
+
+
+
+
+
Get the directory name of the path.
+
Parameters
+
+
+
+
Returns string
+
+
Definition at line 58 of file utils.cpp .
+
+
+
+
+
◆ mkpath()
+
+
+
+
+
+ bool utils::mkpath
+ (
+ std::string
+ path ,
+
+
+
+
+ int
+ mode = 0777
+
+
+
+ )
+
+
+
+
+
+
Make path given.
+
This tries to be the equivalent to "mkdir -p" and creates a new directory whenever it needs to.
+
Parameters
+
+ path The path to be created
+ mode The mode/permissions for all the new directories
+
+
+
+
Returns bool Success/Fail
+
+
Definition at line 32 of file utils.cpp .
+
+
+
+
+
◆ scientific_format() [1/2]
+
+
+
+
+
+ std::string utils::scientific_format
+ (
+ const std::vector< double > &
+ v ,
+
+
+
+
+ int
+ width = 20,
+
+
+
+
+ int
+ prec = 10
+
+
+
+ )
+
+
+
+
+
+
Turns a vector of doubles into a string written in scientific format.
+
The code is stolen from https://github.com/anderkve/FYS3150 .
+
Parameters
+
+ v The vector to stringify
+ width The reserved width of the string
+ prec The precision of the stringified number
+
+
+
+
Returns std::string
+
+
Definition at line 23 of file utils.cpp .
+
+
+
+
+
◆ scientific_format() [2/2]
+
+
+
+
+
+ std::string utils::scientific_format
+ (
+ double
+ d ,
+
+
+
+
+ int
+ width = 20,
+
+
+
+
+ int
+ prec = 10
+
+
+
+ )
+
+
+
+
+
+
Turns a double into a string written in scientific format.
+
The code is stolen from https://github.com/anderkve/FYS3150 .
+
Parameters
+
+ d The number to stringify
+ width The reserved width of the string
+ prec The precision of the stringified number
+
+
+
+
Returns std::string
+
+
Definition at line 16 of file utils.cpp .
+
+
+
+
+
+
+
+
+
diff --git a/docs/navtreedata.js b/docs/navtreedata.js
index 0bae02f..33166f7 100644
--- a/docs/navtreedata.js
+++ b/docs/navtreedata.js
@@ -33,7 +33,8 @@ var NAVTREE =
[ "Class Members", "functions.html", [
[ "All", "functions.html", null ],
[ "Functions", "functions_func.html", null ],
- [ "Variables", "functions_vars.html", null ]
+ [ "Variables", "functions_vars.html", null ],
+ [ "Related Functions", "functions_rela.html", null ]
] ]
] ],
[ "Files", "files.html", [
diff --git a/docs/navtreeindex0.js b/docs/navtreeindex0.js
index 28a4183..7f2c662 100644
--- a/docs/navtreeindex0.js
+++ b/docs/navtreeindex0.js
@@ -1,121 +1,170 @@
var NAVTREEINDEX0 =
{
-"IsingModel_8cpp.html":[3,0,1,2],
-"IsingModel_8cpp_source.html":[3,0,1,2],
-"IsingModel_8hpp.html":[3,0,0,2],
-"IsingModel_8hpp_source.html":[3,0,0,2],
+"IsingModel_8cpp.html":[3,0,1,1],
+"IsingModel_8cpp_source.html":[3,0,1,1],
+"IsingModel_8hpp.html":[3,0,0,1],
+"IsingModel_8hpp.html#a1965eaca47dbf3f87acdafc2208f04eb":[3,0,0,1,5],
+"IsingModel_8hpp.html#a3039ac753f46401767c38f867787fae6":[3,0,0,1,2],
+"IsingModel_8hpp.html#a4193cd1c8c2e6ebd0e056fa2364a663f":[3,0,0,1,1],
+"IsingModel_8hpp.html#a437ef08681e7210d6678427030446a54":[3,0,0,1,3],
+"IsingModel_8hpp.html#a80fb826a684cf3f0d306b22aa100ddac":[3,0,0,1,4],
+"IsingModel_8hpp_source.html":[3,0,0,1],
"annotated.html":[2,0],
"bug.html":[1],
-"burn__in__time_8py_source.html":[3,0,1,0,0],
"classIsingModel.html":[2,0,1],
-"classIsingModel.html#a0d373a61baca6b0faa607bb12d82cc47":[2,0,1,15],
-"classIsingModel.html#a1a4ceb1bb2593dbd20c51ed04100cbcd":[2,0,1,12],
-"classIsingModel.html#a20fc4c0c99d8a119f70a1614784d4e5c":[2,0,1,17],
-"classIsingModel.html#a2b8ac43baefeb386186266d5aa4de348":[2,0,1,13],
-"classIsingModel.html#a2c3c76c79717c968d7c227c58b46df41":[2,0,1,14],
-"classIsingModel.html#a34a4710949b4a70f3e37ca223aefcf8a":[2,0,1,7],
+"classIsingModel.html#a1bbe0cb10abee98058e7b45b22b9cd0a":[2,0,1,14],
+"classIsingModel.html#a1c8a2a4331c7e60c3e1350c0cf8300b9":[2,0,1,12],
+"classIsingModel.html#a20fc4c0c99d8a119f70a1614784d4e5c":[2,0,1,19],
+"classIsingModel.html#a2b1cf104e0bda1fce78ed366e1ec7287":[2,0,1,11],
+"classIsingModel.html#a2b8ac43baefeb386186266d5aa4de348":[2,0,1,15],
+"classIsingModel.html#a2c3c76c79717c968d7c227c58b46df41":[2,0,1,16],
+"classIsingModel.html#a34a4710949b4a70f3e37ca223aefcf8a":[2,0,1,6],
"classIsingModel.html#a46c9446e94854452f715d307c77c1c15":[2,0,1,2],
"classIsingModel.html#a4a39ee7fbfbbf566f75bc28900ca9ea5":[2,0,1,1],
"classIsingModel.html#a56559d68dc9aaff1976d84b157f43488":[2,0,1,10],
-"classIsingModel.html#a59fced38c695e2fa647f53be81b9d2a1":[2,0,1,5],
+"classIsingModel.html#a59fced38c695e2fa647f53be81b9d2a1":[2,0,1,3],
"classIsingModel.html#a6776109105051597c275670dabd0054a":[2,0,1,9],
+"classIsingModel.html#a7112dd6433b1bb9512150cbdc1a0b77e":[2,0,1,13],
"classIsingModel.html#a926cf4964d190d2ce23e5a17201787a4":[2,0,1,8],
-"classIsingModel.html#a94093aaf30facca62737f2ac381fdbcd":[2,0,1,16],
-"classIsingModel.html#aa5701496e6483bc4668c486d6d3af625":[2,0,1,4],
-"classIsingModel.html#aaa0787d964b004a17869811a5e947ff5":[2,0,1,3],
+"classIsingModel.html#a94093aaf30facca62737f2ac381fdbcd":[2,0,1,18],
+"classIsingModel.html#aaedc25b7284e04849269f31291590bf5":[2,0,1,5],
+"classIsingModel.html#acc86effd6889bea199a3d70a9f38dc78":[2,0,1,7],
"classIsingModel.html#acf281f6f5ed02911ca6ab07004449864":[2,0,1,0],
-"classIsingModel.html#ae9f872ca2054992161d53306119979dd":[2,0,1,11],
-"classIsingModel.html#aff9a1201933fd5408845a1447e4895b4":[2,0,1,6],
+"classIsingModel.html#aef7232b28df08e064ef58eb5ef32f738":[2,0,1,17],
+"classIsingModel.html#aff9a1201933fd5408845a1447e4895b4":[2,0,1,4],
"classIsingModelTest.html":[2,0,2],
"classIsingModelTest.html#a4ace7013fa2d257ad1747961da6bc4de":[2,0,2,0],
"classIsingModelTest.html#a717e5852ca51432a61fb6ed38da37931":[2,0,2,1],
"classdata__t.html":[2,0,0],
+"classdata__t.html#a13bc1d73eadeb39c507e89f5872d726f":[2,0,0,4],
+"classdata__t.html#a3f2d19ab309e696ba91a2000479bcb83":[2,0,0,1],
+"classdata__t.html#a429a11c53ee7fe08f6a4e75db524521d":[2,0,0,6],
+"classdata__t.html#a586475e0f71322dffda2e75f228ab24b":[2,0,0,12],
+"classdata__t.html#a6c1a196d96e177b11ca98c61fae35a2e":[2,0,0,8],
+"classdata__t.html#a6cb96b4ff750ab29041038ca53f307cb":[2,0,0,5],
+"classdata__t.html#a6ddf3a7372730ef2393aee8bbcb34992":[2,0,0,3],
+"classdata__t.html#a71ae3cd4460f2c66239500c11804e70b":[2,0,0,11],
+"classdata__t.html#a7954efc97086ea50e10c33113b203085":[2,0,0,2],
+"classdata__t.html#a88da5be78439fbdecfa473ec007dffd8":[2,0,0,7],
+"classdata__t.html#aa2690d3e5d711b4baf3c8f8b9095faf7":[2,0,0,0],
+"classdata__t.html#abb622f9c6cc5ffb9dddb151d2e202f72":[2,0,0,9],
+"classdata__t.html#ad08d2488bf913c626157471cf6e8a46a":[2,0,0,10],
"classes.html":[2,1],
-"constants_8hpp.html":[3,0,0,0],
-"constants_8hpp.html#abfa7d6668c777f9516606394bbc9c414":[3,0,0,0,0],
-"constants_8hpp_source.html":[3,0,0,0],
-"data__type_8cpp.html":[3,0,1,1],
-"data__type_8cpp_source.html":[3,0,1,1],
-"data__type_8hpp.html":[3,0,0,1],
-"data__type_8hpp_source.html":[3,0,0,1],
-"dir_634e799a3947388232110823971192a8.html":[3,0,1,0],
+"data__type_8cpp.html":[3,0,1,0],
+"data__type_8cpp_source.html":[3,0,1,0],
+"data__type_8hpp.html":[3,0,0,0],
+"data__type_8hpp_source.html":[3,0,0,0],
"dir_68267d1309a1af8e8297ef4c3efbcdba.html":[3,0,1],
"dir_d44c64559bbebec7f509842c48db8b23.html":[3,0,0],
"files.html":[3,0],
"functions.html":[2,2,0],
"functions_func.html":[2,2,1],
+"functions_rela.html":[2,2,3],
"functions_vars.html":[2,2,2],
"globals.html":[3,1,0],
"globals_defs.html":[3,1,2],
"globals_func.html":[3,1,1],
-"index.html":[0],
"index.html":[],
+"index.html":[0],
"index.html#autotoc_md1":[0,0],
-"index.html#autotoc_md10":[0,2,1,1],
-"index.html#autotoc_md11":[0,2,2],
-"index.html#autotoc_md12":[0,3],
-"index.html#autotoc_md13":[0,3,0],
-"index.html#autotoc_md14":[0,3,1],
-"index.html#autotoc_md15":[0,4],
+"index.html#autotoc_md10":[0,2,0],
+"index.html#autotoc_md11":[0,2,1],
+"index.html#autotoc_md12":[0,2,1,0],
+"index.html#autotoc_md13":[0,2,1,1],
+"index.html#autotoc_md14":[0,2,2],
+"index.html#autotoc_md15":[0,3],
+"index.html#autotoc_md16":[0,3,0],
+"index.html#autotoc_md17":[0,3,1],
+"index.html#autotoc_md18":[0,4],
"index.html#autotoc_md2":[0,0,0],
"index.html#autotoc_md3":[0,0,1],
"index.html#autotoc_md4":[0,0,2],
"index.html#autotoc_md5":[0,1],
-"index.html#autotoc_md6":[0,2],
-"index.html#autotoc_md7":[0,2,0],
-"index.html#autotoc_md8":[0,2,1],
-"index.html#autotoc_md9":[0,2,1,0],
-"main_8cpp.html":[3,0,1,3],
-"main_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627":[3,0,1,3,0],
-"main_8cpp_source.html":[3,0,1,3],
+"index.html#autotoc_md6":[0,1,0],
+"index.html#autotoc_md7":[0,1,1],
+"index.html#autotoc_md8":[0,1,2],
+"index.html#autotoc_md9":[0,2],
+"main_8cpp.html":[3,0,1,2],
+"main_8cpp.html#a0dfa85080578dffff23b68e372cece95":[3,0,1,2,5],
+"main_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627":[3,0,1,2,3],
+"main_8cpp.html#a4f8ea24364d72024915d3753a572cc5b":[3,0,1,2,1],
+"main_8cpp.html#a68406fc2dd8de5849c3984658c171f32":[3,0,1,2,0],
+"main_8cpp.html#a746d8dc451b2b2536abbb1ff1acaf861":[3,0,1,2,4],
+"main_8cpp.html#a9d62cf1399596f4c5a39abdd3196d76d":[3,0,1,2,2],
+"main_8cpp.html#ac907e18135856c90366aaa599a9e10b1":[3,0,1,2,6],
+"main_8cpp_source.html":[3,0,1,2],
+"mcmc__progression_8cpp.html":[3,0,1,3],
+"mcmc__progression_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627":[3,0,1,3,0],
+"mcmc__progression_8cpp.html#ac907e18135856c90366aaa599a9e10b1":[3,0,1,3,1],
+"mcmc__progression_8cpp_source.html":[3,0,1,3],
"monte__carlo_8cpp.html":[3,0,1,4],
-"monte__carlo_8cpp.html#a7df22ace588b4d229d1029ce766d0009":[3,0,1,4,5],
-"monte__carlo_8cpp.html#a89ddd777796c65eb2b289af11fc0ce09":[3,0,1,4,2],
-"monte__carlo_8cpp.html#a8f8d4c5e032ed8565a3ac518b32c6aed":[3,0,1,4,3],
-"monte__carlo_8cpp.html#a962f704ab35208bf6541eb3b707a9559":[3,0,1,4,4],
-"monte__carlo_8cpp.html#ac97d0de27f2f0d50fc6ecf3a79f32826":[3,0,1,4,1],
-"monte__carlo_8cpp.html#acc34e2049a5030874f6f548f3adab958":[3,0,1,4,0],
+"monte__carlo_8cpp.html#a1549fc386bd3cdd1cdbe0261b9dd8415":[3,0,1,4,5],
+"monte__carlo_8cpp.html#a34e9c3e24f26760693266b8a7b6b3d21":[3,0,1,4,3],
+"monte__carlo_8cpp.html#a781d946de16211ba18ad6671a5b6838d":[3,0,1,4,4],
+"monte__carlo_8cpp.html#ae1e7f904ecfc3d8f3c4dd1ef155dd771":[3,0,1,4,0],
+"monte__carlo_8cpp.html#ae67483ff00d1b0594d543261c8283ffd":[3,0,1,4,1],
+"monte__carlo_8cpp.html#aea2dd1b5fac7c45633bc6f8dc4541226":[3,0,1,4,2],
"monte__carlo_8cpp_source.html":[3,0,1,4],
-"monte__carlo_8hpp.html":[3,0,0,3],
-"monte__carlo_8hpp.html#a2dfe843fbb80e10a763f3260131a148e":[3,0,0,3,5],
-"monte__carlo_8hpp.html#a89ddd777796c65eb2b289af11fc0ce09":[3,0,0,3,2],
-"monte__carlo_8hpp.html#a8f8d4c5e032ed8565a3ac518b32c6aed":[3,0,0,3,3],
-"monte__carlo_8hpp.html#a962f704ab35208bf6541eb3b707a9559":[3,0,0,3,4],
-"monte__carlo_8hpp.html#aa8b4fc86b26f0e3e253ba5556d2d14dc":[3,0,0,3,6],
-"monte__carlo_8hpp.html#ac97d0de27f2f0d50fc6ecf3a79f32826":[3,0,0,3,1],
-"monte__carlo_8hpp.html#acc34e2049a5030874f6f548f3adab958":[3,0,0,3,0],
-"monte__carlo_8hpp_source.html":[3,0,0,3],
+"monte__carlo_8hpp.html":[3,0,0,2],
+"monte__carlo_8hpp.html#a1549fc386bd3cdd1cdbe0261b9dd8415":[3,0,0,2,5],
+"monte__carlo_8hpp.html#a34e9c3e24f26760693266b8a7b6b3d21":[3,0,0,2,3],
+"monte__carlo_8hpp.html#a781d946de16211ba18ad6671a5b6838d":[3,0,0,2,4],
+"monte__carlo_8hpp.html#ae1e7f904ecfc3d8f3c4dd1ef155dd771":[3,0,0,2,0],
+"monte__carlo_8hpp.html#ae67483ff00d1b0594d543261c8283ffd":[3,0,0,2,1],
+"monte__carlo_8hpp.html#aea2dd1b5fac7c45633bc6f8dc4541226":[3,0,0,2,2],
+"monte__carlo_8hpp_source.html":[3,0,0,2],
"pages.html":[],
-"pd__estimate_8py_source.html":[3,0,1,0,1],
-"phase__transition_8py_source.html":[3,0,1,0,2],
-"phase__transition__mpi_8cpp.html":[3,0,1,5],
-"phase__transition__mpi_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627":[3,0,1,5,0],
-"phase__transition__mpi_8cpp_source.html":[3,0,1,5],
-"test__suite_8cpp.html":[3,0,1,6],
-"test__suite_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[3,0,1,6,1],
-"test__suite_8cpp_source.html":[3,0,1,6],
-"testlib_8cpp.html":[3,0,1,7],
-"testlib_8cpp.html#a39abb7cba0535176ed62aae136d2fcc7":[3,0,1,7,0],
-"testlib_8cpp_source.html":[3,0,1,7],
-"testlib_8hpp.html":[3,0,0,4],
-"testlib_8hpp.html#a39abb7cba0535176ed62aae136d2fcc7":[3,0,0,4,1],
-"testlib_8hpp.html#a73d4f21ad937dbc50a0c0538c78fd4f9":[3,0,0,4,0],
-"testlib_8hpp_source.html":[3,0,0,4],
-"typedefs_8hpp.html":[3,0,0,5],
-"typedefs_8hpp_source.html":[3,0,0,5],
-"utils_8cpp.html":[3,0,1,8],
-"utils_8cpp.html#a2b45adc86b70f42021582994e83fa00d":[3,0,1,8,1],
-"utils_8cpp.html#a3529a74fd2a25d24de73d9d4e1c90835":[3,0,1,8,3],
-"utils_8cpp.html#ab3e89176433ddc9ba721b2eba3d08357":[3,0,1,8,2],
-"utils_8cpp.html#aed026119193a9bbe076671809ff0f430":[3,0,1,8,0],
-"utils_8cpp_source.html":[3,0,1,8],
-"utils_8hpp.html":[3,0,0,6],
-"utils_8hpp.html#a178c4922157666a6e9c127c2ffd96346":[3,0,0,6,3],
-"utils_8hpp.html#a2b45adc86b70f42021582994e83fa00d":[3,0,0,6,4],
-"utils_8hpp.html#a3529a74fd2a25d24de73d9d4e1c90835":[3,0,0,6,6],
-"utils_8hpp.html#a60dca3177fb9cb5256609adc7af55168":[3,0,0,6,0],
-"utils_8hpp.html#ab3e89176433ddc9ba721b2eba3d08357":[3,0,0,6,5],
-"utils_8hpp.html#aecc1f7a8a2493b9e021e5bff76a00a5b":[3,0,0,6,1],
-"utils_8hpp.html#aed026119193a9bbe076671809ff0f430":[3,0,0,6,2],
-"utils_8hpp_source.html":[3,0,0,6]
+"pd__estimate_8cpp.html":[3,0,1,5],
+"pd__estimate_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627":[3,0,1,5,0],
+"pd__estimate_8cpp.html#ac907e18135856c90366aaa599a9e10b1":[3,0,1,5,1],
+"pd__estimate_8cpp_source.html":[3,0,1,5],
+"phase__transition_8cpp.html":[3,0,1,6],
+"phase__transition_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627":[3,0,1,6,0],
+"phase__transition_8cpp.html#ac907e18135856c90366aaa599a9e10b1":[3,0,1,6,1],
+"phase__transition_8cpp_source.html":[3,0,1,6],
+"phase__transition__mpi_8cpp.html":[3,0,1,7],
+"phase__transition__mpi_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627":[3,0,1,7,0],
+"phase__transition__mpi_8cpp.html#ac907e18135856c90366aaa599a9e10b1":[3,0,1,7,1],
+"phase__transition__mpi_8cpp_source.html":[3,0,1,7],
+"test__suite_8cpp.html":[3,0,1,8],
+"test__suite_8cpp.html#a00367775d110a9537bd06bde2e630471":[3,0,1,8,2],
+"test__suite_8cpp.html#a9fd092d930430eb4693d93e0c9066605":[3,0,1,8,3],
+"test__suite_8cpp.html#ad27c84dda71475ffd365c649b525199e":[3,0,1,8,4],
+"test__suite_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[3,0,1,8,5],
+"test__suite_8cpp.html#af02dd88b4d495baf7af5826d1481634c":[3,0,1,8,1],
+"test__suite_8cpp_source.html":[3,0,1,8],
+"testlib_8cpp.html":[3,0,1,9],
+"testlib_8cpp.html#a39abb7cba0535176ed62aae136d2fcc7":[3,0,1,9,0],
+"testlib_8cpp_source.html":[3,0,1,9],
+"testlib_8hpp.html":[3,0,0,3],
+"testlib_8hpp.html#a2cbf3a45367e903de6efbdbea3344cea":[3,0,0,3,2],
+"testlib_8hpp.html#a39abb7cba0535176ed62aae136d2fcc7":[3,0,0,3,5],
+"testlib_8hpp.html#a3db67d8721d2f3cd626526b43186bcf3":[3,0,0,3,4],
+"testlib_8hpp.html#a44f47fa3c8654c09712572d75c0ffa7f":[3,0,0,3,3],
+"testlib_8hpp.html#a73d4f21ad937dbc50a0c0538c78fd4f9":[3,0,0,3,0],
+"testlib_8hpp.html#ab6585c8aa8c276a3442c67a57c8de6fb":[3,0,0,3,1],
+"testlib_8hpp_source.html":[3,0,0,3],
+"time_8cpp.html":[3,0,1,10],
+"time_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627":[3,0,1,10,0],
+"time_8cpp.html#aa224066f42c47cae5fbd457c1948e4a5":[3,0,1,10,1],
+"time_8cpp.html#ac907e18135856c90366aaa599a9e10b1":[3,0,1,10,3],
+"time_8cpp.html#ace9eb0821fe4edf19cf2e7d8ffe6efb4":[3,0,1,10,2],
+"time_8cpp_source.html":[3,0,1,10],
+"utils_8cpp.html":[3,0,1,11],
+"utils_8cpp.html#a2b45adc86b70f42021582994e83fa00d":[3,0,1,11,2],
+"utils_8cpp.html#a3529a74fd2a25d24de73d9d4e1c90835":[3,0,1,11,4],
+"utils_8cpp.html#ab3e89176433ddc9ba721b2eba3d08357":[3,0,1,11,3],
+"utils_8cpp.html#ae91fad89394d745d544737e43524bde6":[3,0,1,11,0],
+"utils_8cpp.html#aed026119193a9bbe076671809ff0f430":[3,0,1,11,1],
+"utils_8cpp_source.html":[3,0,1,11],
+"utils_8hpp.html":[3,0,0,4],
+"utils_8hpp.html#a178c4922157666a6e9c127c2ffd96346":[3,0,0,4,4],
+"utils_8hpp.html#a2b45adc86b70f42021582994e83fa00d":[3,0,0,4,5],
+"utils_8hpp.html#a3529a74fd2a25d24de73d9d4e1c90835":[3,0,0,4,7],
+"utils_8hpp.html#a60dca3177fb9cb5256609adc7af55168":[3,0,0,4,0],
+"utils_8hpp.html#ab3e89176433ddc9ba721b2eba3d08357":[3,0,0,4,6],
+"utils_8hpp.html#ae91fad89394d745d544737e43524bde6":[3,0,0,4,2],
+"utils_8hpp.html#aecc1f7a8a2493b9e021e5bff76a00a5b":[3,0,0,4,1],
+"utils_8hpp.html#aed026119193a9bbe076671809ff0f430":[3,0,0,4,3],
+"utils_8hpp_source.html":[3,0,0,4]
};
diff --git a/docs/pd__estimate_8cpp.html b/docs/pd__estimate_8cpp.html
new file mode 100644
index 0000000..8d8fc1a
--- /dev/null
+++ b/docs/pd__estimate_8cpp.html
@@ -0,0 +1,201 @@
+
+
+
+
+
+
+
+2 Dimensional Ising Model: src/pd_estimate.cpp File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2 Dimensional Ising Model
+
+ Simulate the change in energy and magnetization in a ferro magnet
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+
+
+
+
+
execute the mcmc algorithm and write data to file after each Monte Carlo cycles.
+More...
+
#include "data_type.hpp "
+
#include "monte_carlo.hpp "
+
#include "utils.hpp "
+
#include <getopt.h>
+
#include <omp.h>
+
#include <string>
+
+
Go to the source code of this file.
+
+
+void usage (std::string filename)
+ A function that displays how to use the program and quits.
+
+int main (int argc, char **argv)
+ The main function.
+
+
+
+
execute the mcmc algorithm and write data to file after each Monte Carlo cycles.
+
Author Cory Alexander Balaton (coryab)
+
+Janita Ovidie Sandtrøen Willumsen (janitaws)
+
Version 1.0
+
Bug: No known bugs
+
+
Definition in file pd_estimate.cpp .
+
+
+
◆ main()
+
+
+
+
+
+ int main
+ (
+ int
+ argc ,
+
+
+
+
+ char **
+ argv
+
+
+
+ )
+
+
+
+
+
+
+
◆ usage()
+
+
+
+
+
+ void usage
+ (
+ std::string
+ filename )
+
+
+
+
+
+
A function that displays how to use the program and quits.
+
+
Definition at line 22 of file pd_estimate.cpp .
+
+
+
+
+
+
+
+
+
diff --git a/docs/pd__estimate_8cpp.js b/docs/pd__estimate_8cpp.js
new file mode 100644
index 0000000..671e358
--- /dev/null
+++ b/docs/pd__estimate_8cpp.js
@@ -0,0 +1,5 @@
+var pd__estimate_8cpp =
+[
+ [ "main", "pd__estimate_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627", null ],
+ [ "usage", "pd__estimate_8cpp.html#ac907e18135856c90366aaa599a9e10b1", null ]
+];
\ No newline at end of file
diff --git a/docs/pd__estimate_8cpp_source.html b/docs/pd__estimate_8cpp_source.html
new file mode 100644
index 0000000..7885bae
--- /dev/null
+++ b/docs/pd__estimate_8cpp_source.html
@@ -0,0 +1,197 @@
+
+
+
+
+
+
+
+2 Dimensional Ising Model: src/pd_estimate.cpp Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2 Dimensional Ising Model
+
+ Simulate the change in energy and magnetization in a ferro magnet
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
+
+
+
+
+
+
+
+
+
+
+
24 std::cout <<
"Usage: " << filename
+
25 <<
" <temperature> <lattice size> "
+
26 "<cycles> <burn-in-time> <output file>\n\n"
+
27 <<
"\t[ -h | --help ]\n" ;
+
+
+
+
+
32
+
33
+
34 int main (
int argc,
char **argv)
+
+
+
37 struct option long_options[] = {{
"help" , 0, 0, 0}, {NULL, 0, NULL, 0}};
+
+
39 int option_index = -1;
+
+
+
+
43 c = getopt_long(argc, argv,
"h" , long_options, &option_index);
+
+
+
+
+
+
+
50 switch (option_index) {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
71 double temp = atoi(argv[1]);
+
72 int L = atoi(argv[2]), cycles = atoi(argv[3]), burn_in_time = atoi(argv[4]);
+
73 std::string outfile = argv[5];
+
+
+
+
+
+
79 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 pd_estimate(double T, int L, int cycles, const std::string filename, int burn_in_time=BURN_IN_TIME)
Estimate the probability distribution for the energy.
+
+
+
+
+
+
diff --git a/docs/phase__transition_8cpp.html b/docs/phase__transition_8cpp.html
new file mode 100644
index 0000000..bcd1725
--- /dev/null
+++ b/docs/phase__transition_8cpp.html
@@ -0,0 +1,202 @@
+
+
+
+
+
+
+
+2 Dimensional Ising Model: src/phase_transition.cpp File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2 Dimensional Ising Model
+
+ Simulate the change in energy and magnetization in a ferro magnet
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+
+
+
+
+
Sweep over different temperatures and generate data.
+More...
+
#include "data_type.hpp "
+
#include "monte_carlo.hpp "
+
#include "utils.hpp "
+
#include <getopt.h>
+
#include <omp.h>
+
#include <string>
+
+
Go to the source code of this file.
+
+
+void usage (std::string filename)
+ A function that displays how to use the program and quits.
+
+int main (int argc, char **argv)
+ The main function.
+
+
+
+
Sweep over different temperatures and generate data.
+
Author Cory Alexander Balaton (coryab)
+
+Janita Ovidie Sandtrøen Willumsen (janitaws)
+
Version 1.0
+
This program takes in 4 arguments: the start temperature, the end temperature, the amount of temperature points to simulate, and the amount of monte carlo samples to collect, in that order.
+
Bug: No known bugs
+
+
Definition in file phase_transition.cpp .
+
+
+
◆ main()
+
+
+
+
+
+ int main
+ (
+ int
+ argc ,
+
+
+
+
+ char **
+ argv
+
+
+
+ )
+
+
+
+
+
+
+
◆ usage()
+
+
+
+
+
+ void usage
+ (
+ std::string
+ filename )
+
+
+
+
+
+
A function that displays how to use the program and quits.
+
+
Definition at line 25 of file phase_transition.cpp .
+
+
+
+
+
+
+
+
+
diff --git a/docs/phase__transition_8cpp.js b/docs/phase__transition_8cpp.js
new file mode 100644
index 0000000..01d6bc9
--- /dev/null
+++ b/docs/phase__transition_8cpp.js
@@ -0,0 +1,5 @@
+var phase__transition_8cpp =
+[
+ [ "main", "phase__transition_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627", null ],
+ [ "usage", "phase__transition_8cpp.html#ac907e18135856c90366aaa599a9e10b1", null ]
+];
\ No newline at end of file
diff --git a/docs/phase__transition_8cpp_source.html b/docs/phase__transition_8cpp_source.html
new file mode 100644
index 0000000..c233f9f
--- /dev/null
+++ b/docs/phase__transition_8cpp_source.html
@@ -0,0 +1,201 @@
+
+
+
+
+
+
+
+2 Dimensional Ising Model: src/phase_transition.cpp Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2 Dimensional Ising Model
+
+ Simulate the change in energy and magnetization in a ferro magnet
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
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" ;
+
+
+
+
+
35 int 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.
+
+
+
+
+
+
diff --git a/docs/phase__transition__mpi_8cpp.html b/docs/phase__transition__mpi_8cpp.html
index 0e88ed6..8966e3d 100644
--- a/docs/phase__transition__mpi_8cpp.html
+++ b/docs/phase__transition__mpi_8cpp.html
@@ -109,17 +109,17 @@ $(document).ready(function(){initNavTree('phase__transition__mpi_8cpp.html','');
#include "data_type.hpp "
#include "monte_carlo.hpp "
#include "utils.hpp "
-
#include <algorithm>
-
#include <fstream>
-
#include <iostream>
-
#include <iterator>
+
#include <getopt.h>
#include <mpi.h>
-
#include <sstream>
+
#include <string>
Go to the source code of this file.
+void usage (std::string filename)
+ A function that displays how to use the program and quits.
+
int main (int argc, char **argv)
The main function.
@@ -130,6 +130,7 @@ Functions
Janita Ovidie Sandtrøen Willumsen (janitaws)
Version 1.0
+This program takes in 4 arguments: the start temperature, the end temperature, the amount of temperature points to simulate, and the amount of monte carlo samples to collect, in that order.
Bug: No known bugs
Definition in file phase_transition_mpi.cpp .
@@ -162,7 +163,29 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
The main function.
-Definition at line 24 of file phase_transition_mpi.cpp .
+Definition at line 38 of file phase_transition_mpi.cpp .
+
+
+
+
+◆ usage()
+
+
+
+
+
+ void usage
+ (
+ std::string
+ filename )
+
+
+
+
diff --git a/docs/phase__transition__mpi_8cpp.js b/docs/phase__transition__mpi_8cpp.js
index 9cad85a..40c7698 100644
--- a/docs/phase__transition__mpi_8cpp.js
+++ b/docs/phase__transition__mpi_8cpp.js
@@ -1,4 +1,5 @@
var phase__transition__mpi_8cpp =
[
- [ "main", "phase__transition__mpi_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627", null ]
+ [ "main", "phase__transition__mpi_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627", null ],
+ [ "usage", "phase__transition__mpi_8cpp.html#ac907e18135856c90366aaa599a9e10b1", null ]
];
\ No newline at end of file
diff --git a/docs/phase__transition__mpi_8cpp_source.html b/docs/phase__transition__mpi_8cpp_source.html
index 0be9b13..f608f12 100644
--- a/docs/phase__transition__mpi_8cpp_source.html
+++ b/docs/phase__transition__mpi_8cpp_source.html
@@ -101,129 +101,188 @@ $(document).ready(function(){initNavTree('phase__transition__mpi_8cpp_source.htm
-
Go to the documentation of this file.
-
-
-
-
-
-
-
-
-
-
-
-
24 int main (
int argc,
char **argv)
-
-
-
27 std::cout <<
"You need at least 4 arguments" << std::endl;
-
-
-
-
-
32 double start = atof(argv[1]), end = atof(argv[2]);
-
33 int points = atoi(argv[3]), N;
-
34 int lattice_sizes[] = {20, 40, 60, 80, 100};
-
35 double dt = (end - start) / points;
-
36 int cycles = atoi(argv[4]);
-
-
-
-
-
-
42 int rank, cluster_size;
-
-
-
45 MPI_Init(&argc, &argv);
-
-
-
48 MPI_Comm_size(MPI_COMM_WORLD, &cluster_size);
-
49 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-
-
51 int remainder = points % cluster_size;
-
-
-
-
55 if (rank < remainder) {
-
56 i_points = points / cluster_size + 1;
-
57 i_start = start + dt * i_points * rank;
-
-
-
60 i_points = points / cluster_size;
-
61 i_start = start + dt * (i_points * rank + remainder);
-
-
-
-
65 std::cout <<
"Rank " << rank <<
": " << i_points <<
',' << i_start <<
'\n' ;
-
-
67 for (
int L : lattice_sizes) {
-
-
69 for (
size_t i = 0; i < i_points; i++) {
-
-
-
-
-
74 std::copy_n(i_data, i_points, data);
-
75 for (
size_t i = 1; i < cluster_size; i++) {
-
76 if (rank < remainder) {
-
77 MPI_Recv((
void *)i_data,
-
78 sizeof (
data_t ) * (points / cluster_size + 1),
-
79 MPI_CHAR, i, MPI_ANY_TAG, MPI_COMM_WORLD,
-
-
81 std::copy_n(i_data, points / cluster_size + 1,
-
82 data + (points / cluster_size) * i);
-
-
-
85 MPI_Recv((
void *)i_data,
-
86 sizeof (
data_t ) * (points / cluster_size), MPI_CHAR,
-
87 i, MPI_ANY_TAG, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
-
88 std::copy_n(i_data, points / cluster_size,
-
89 data + (points / cluster_size) * i + remainder);
-
-
-
92 std::stringstream outfile;
-
93 outfile <<
"output/phase_transition/size_" << L <<
".txt" ;
-
94 utils::mkpath(utils::dirname(outfile.str()));
-
95 ofile.open(outfile.str());
+
Go to the documentation of this file.
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
+
+
+
+
+
+
+
+
+
+
+
+
28 <<
"Usage: " << filename
+
29 <<
" <start temperature> <end temperature> <lattice size> "
+
30 "<points> <cycles> <burn-in-time> <output file>\n"
+
31 <<
"This should be used with mpiexec or mpirun for maximum "
+
+
33 <<
"\t[ -h | --help ]\n" ;
+
+
+
+
+
38 int main (
int argc,
char **argv)
+
+
+
41 struct option long_options[] = {{
"help" , 0, 0, 0}, {NULL, 0, NULL, 0}};
+
+
43 int option_index = -1;
+
+
+
+
47 c = getopt_long(argc, argv,
"h" , long_options, &option_index);
+
+
+
+
+
+
+
54 switch (option_index) {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
75 double start = atof(argv[1]), end = atof(argv[2]);
+
76 int points = atoi(argv[3]), cycles = atoi(argv[5]), L = atoi(argv[4]),
+
77 burn_in_time = atoi(argv[6]), N = L * L;
+
78 double dt = (end - start) / points;
+
+
80 std::string outfile = argv[7];
+
+
+
+
84 int rank, cluster_size;
+
+
+
87 MPI_Init(&argc, &argv);
+
+
+
90 MPI_Comm_size(MPI_COMM_WORLD, &cluster_size);
+
91 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+
+
93 int remainder = points % cluster_size;
+
+
-
-
-
99 using utils::scientific_format;
-
100 for (
size_t i = 0; i < points; i++) {
-
101 temp = start + dt * i;
-
102 CV = (data[i].E2 - data[i].E * data[i].E)
-
103 / ((
double )N * temp * temp);
-
104 X = (data[i].M2 - data[i].M_abs * data[i].M_abs)
-
105 / ((
double )N * temp);
+
+
98 if (rank < remainder) {
+
99 i_points = points / cluster_size + 1;
+
100 i_start = start + dt * i_points * rank;
+
+
+
103 i_points = points / cluster_size;
+
104 i_start = start + dt * (i_points * rank + remainder);
+
-
107 ofile << scientific_format(temp) <<
','
-
108 << scientific_format(data[i].E / N) <<
','
-
109 << scientific_format(data[i].M_abs / N) <<
','
-
110 << scientific_format(CV) <<
',' << scientific_format(X)
-
-
-
-
-
-
116 MPI_Send(i_data, i_points *
sizeof (
data_t ), MPI_CHAR, 0, rank,
-
-
-
-
-
-
-
-
124 std::cout <<
"Time: " << t1 - t0 <<
" seconds\n" ;
-
-
-
-
-
-
Header for the data_t type.
-
Functions for monte carlo simulations.
-
data_t monte_carlo_parallel(int L, double T, int cycles)
Execute the Metropolis algorithm for a certain amount of Monte Carlo cycles in parallel.
-
int main()
The main function.
-
Function prototypes and macros that are useful.
+
+
+
+
+
111 for (size_t i = 0; i < i_points; i++) {
+
+
+
+
+
+
+
+
+
120 std::copy_n(i_data, i_points, data);
+
+
+
123 for (size_t i = 1; i < cluster_size; i++) {
+
124 if (rank < remainder) {
+
125 MPI_Recv((
void *)i_data,
+
126 sizeof (data_t) * (points / cluster_size + 1), MPI_CHAR,
+
127 i, MPI_ANY_TAG, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
+
128 std::copy_n(i_data, points / cluster_size + 1,
+
129 data + (points / cluster_size) * i);
+
+
+
132 MPI_Recv((
void *)i_data,
+
133 sizeof (data_t) * (points / cluster_size), MPI_CHAR, i,
+
134 MPI_ANY_TAG, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
+
135 std::copy_n(i_data, points / cluster_size,
+
136 data + (points / cluster_size) * i + remainder);
+
+
+
+
+
+
+
+
+
+
146 using utils::scientific_format;
+
147 for (size_t i = 0; i < points; i++) {
+
148 temp = start + dt * i;
+
149 CV = (data[i].E2 - data[i].E * data[i].E)
+
150 / ((
double )N * temp * temp);
+
151 X = (data[i].M2 - data[i].M_abs * data[i].M_abs)
+
152 / ((
double )N * temp);
+
+
+
155 << scientific_format(data[i].E / N) <<
','
+
156 << scientific_format(data[i].M_abs / N) <<
','
+
+
+
+
+
+
+
+
164 MPI_Send(i_data, i_points *
sizeof (data_t), MPI_CHAR, 0, rank,
+
+
+
+
+
+
+
171 std::cout <<
"Time: " << t1 - t0 <<
" seconds\n" ;
+
+
+
+
+
Type to use with the IsingModel class and montecarlo module.
+
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.
+
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.
+
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.
diff --git a/docs/search/all_1.js b/docs/search/all_1.js
index e35967d..0af0d30 100644
--- a/docs/search/all_1.js
+++ b/docs/search/all_1.js
@@ -1,4 +1,5 @@
var searchData=
[
- ['assert_0',['ASSERT',['../testlib_8hpp.html#a73d4f21ad937dbc50a0c0538c78fd4f9',1,'testlib.hpp']]]
+ ['assert_0',['ASSERT',['../testlib_8hpp.html#a73d4f21ad937dbc50a0c0538c78fd4f9',1,'testlib.hpp']]],
+ ['assert_5feach_1',['assert_each',['../testlib_8hpp.html#ab6585c8aa8c276a3442c67a57c8de6fb',1,'testlib']]]
];
diff --git a/docs/search/all_10.js b/docs/search/all_10.js
index cd921db..18553b5 100644
--- a/docs/search/all_10.js
+++ b/docs/search/all_10.js
@@ -1,5 +1,4 @@
var searchData=
[
- ['utils_2ecpp_0',['utils.cpp',['../utils_8cpp.html',1,'']]],
- ['utils_2ehpp_1',['utils.hpp',['../utils_8hpp.html',1,'']]]
+ ['x_5f2_0',['X_2',['../test__suite_8cpp.html#ad27c84dda71475ffd365c649b525199e',1,'test_suite.cpp']]]
];
diff --git a/docs/search/all_3.js b/docs/search/all_3.js
index 0648f09..729601d 100644
--- a/docs/search/all_3.js
+++ b/docs/search/all_3.js
@@ -1,4 +1,9 @@
var searchData=
[
- ['constants_2ehpp_0',['constants.hpp',['../constants_8hpp.html',1,'']]]
+ ['close_5fto_0',['close_to',['../testlib_8hpp.html#a2cbf3a45367e903de6efbdbea3344cea',1,'testlib::close_to(arma::Mat< T > &a, arma::Mat< T > &b, double tol=1e-8)'],['../testlib_8hpp.html#a44f47fa3c8654c09712572d75c0ffa7f',1,'testlib::close_to(T a, T b, double tol=1e-8)']]],
+ ['concatpath_1',['concatpath',['../utils_8hpp.html#ae91fad89394d745d544737e43524bde6',1,'utils']]],
+ ['create_5fburn_5fin_5ftime_5fdata_2',['create_burn_in_time_data',['../main_8cpp.html#a68406fc2dd8de5849c3984658c171f32',1,'main.cpp']]],
+ ['create_5fpd_5festimate_5fdata_3',['create_pd_estimate_data',['../main_8cpp.html#a4f8ea24364d72024915d3753a572cc5b',1,'main.cpp']]],
+ ['create_5fphase_5ftransition_5fdata_4',['create_phase_transition_data',['../main_8cpp.html#a9d62cf1399596f4c5a39abdd3196d76d',1,'main.cpp']]],
+ ['cv_5f2_5',['CV_2',['../test__suite_8cpp.html#af02dd88b4d495baf7af5826d1481634c',1,'test_suite.cpp']]]
];
diff --git a/docs/search/all_4.js b/docs/search/all_4.js
index 43c3415..76376d5 100644
--- a/docs/search/all_4.js
+++ b/docs/search/all_4.js
@@ -1,8 +1,9 @@
var searchData=
[
- ['data_5ft_0',['data_t',['../classdata__t.html',1,'']]],
+ ['data_5ft_0',['data_t',['../classdata__t.html',1,'data_t'],['../classdata__t.html#aa2690d3e5d711b4baf3c8f8b9095faf7',1,'data_t::data_t()'],['../classdata__t.html#a3f2d19ab309e696ba91a2000479bcb83',1,'data_t::data_t(double E, double E2, double M, double M2, double M_abs)']]],
['data_5ftype_2ecpp_1',['data_type.cpp',['../data__type_8cpp.html',1,'']]],
['data_5ftype_2ehpp_2',['data_type.hpp',['../data__type_8hpp.html',1,'']]],
['debug_3',['DEBUG',['../utils_8hpp.html#aecc1f7a8a2493b9e021e5bff76a00a5b',1,'utils.hpp']]],
- ['dirname_4',['dirname',['../utils_8hpp.html#aed026119193a9bbe076671809ff0f430',1,'utils']]]
+ ['dirname_4',['dirname',['../utils_8hpp.html#aed026119193a9bbe076671809ff0f430',1,'utils']]],
+ ['down_5',['DOWN',['../IsingModel_8hpp.html#a4193cd1c8c2e6ebd0e056fa2364a663f',1,'IsingModel.hpp']]]
];
diff --git a/docs/search/all_5.js b/docs/search/all_5.js
index 3834eab..1e777af 100644
--- a/docs/search/all_5.js
+++ b/docs/search/all_5.js
@@ -1,5 +1,8 @@
var searchData=
[
- ['e_0',['E',['../classIsingModel.html#ae9f872ca2054992161d53306119979dd',1,'IsingModel']]],
- ['energy_5fdiff_1',['energy_diff',['../classIsingModel.html#a1a4ceb1bb2593dbd20c51ed04100cbcd',1,'IsingModel']]]
+ ['e_0',['E',['../classdata__t.html#a6c1a196d96e177b11ca98c61fae35a2e',1,'data_t::E()'],['../classIsingModel.html#a1c8a2a4331c7e60c3e1350c0cf8300b9',1,'IsingModel::E()']]],
+ ['e2_1',['E2',['../classdata__t.html#abb622f9c6cc5ffb9dddb151d2e202f72',1,'data_t']]],
+ ['energy_5fdiff_2',['energy_diff',['../classIsingModel.html#a7112dd6433b1bb9512150cbdc1a0b77e',1,'IsingModel']]],
+ ['engine_3',['engine',['../classIsingModel.html#a1bbe0cb10abee98058e7b45b22b9cd0a',1,'IsingModel']]],
+ ['eps_5f2_4',['EPS_2',['../test__suite_8cpp.html#a00367775d110a9537bd06bde2e630471',1,'test_suite.cpp']]]
];
diff --git a/docs/search/all_6.js b/docs/search/all_6.js
index 45fb121..db297e3 100644
--- a/docs/search/all_6.js
+++ b/docs/search/all_6.js
@@ -1,5 +1,16 @@
var searchData=
[
- ['get_5fe_0',['get_E',['../classIsingModel.html#aaa0787d964b004a17869811a5e947ff5',1,'IsingModel']]],
- ['get_5fm_1',['get_M',['../classIsingModel.html#aa5701496e6483bc4668c486d6d3af625',1,'IsingModel']]]
+ ['index_0',['INDEX',['../IsingModel_8hpp.html#a3039ac753f46401767c38f867787fae6',1,'IsingModel.hpp']]],
+ ['initialize_5fenergy_1',['initialize_energy',['../classIsingModel.html#a59fced38c695e2fa647f53be81b9d2a1',1,'IsingModel']]],
+ ['initialize_5fenergy_5fdiff_2',['initialize_energy_diff',['../classIsingModel.html#aff9a1201933fd5408845a1447e4895b4',1,'IsingModel']]],
+ ['initialize_5fengine_3',['initialize_engine',['../classIsingModel.html#aaedc25b7284e04849269f31291590bf5',1,'IsingModel']]],
+ ['initialize_5flattice_4',['initialize_lattice',['../classIsingModel.html#a34a4710949b4a70f3e37ca223aefcf8a',1,'IsingModel::initialize_lattice()'],['../classIsingModel.html#acc86effd6889bea199a3d70a9f38dc78',1,'IsingModel::initialize_lattice(int val)']]],
+ ['initialize_5fmagnetization_5',['initialize_magnetization',['../classIsingModel.html#a926cf4964d190d2ce23e5a17201787a4',1,'IsingModel']]],
+ ['initialize_5fneighbors_6',['initialize_neighbors',['../classIsingModel.html#a6776109105051597c275670dabd0054a',1,'IsingModel']]],
+ ['is_5fequal_7',['is_equal',['../testlib_8hpp.html#a3db67d8721d2f3cd626526b43186bcf3',1,'testlib']]],
+ ['ising_20model_8',['Ising Model',['../index.html',1,'']]],
+ ['isingmodel_9',['IsingModel',['../classIsingModel.html#acf281f6f5ed02911ca6ab07004449864',1,'IsingModel::IsingModel()'],['../classIsingModel.html#a4a39ee7fbfbbf566f75bc28900ca9ea5',1,'IsingModel::IsingModel(int L, double T)'],['../classIsingModel.html#a46c9446e94854452f715d307c77c1c15',1,'IsingModel::IsingModel(int L, double T, int val)'],['../classIsingModel.html',1,'IsingModel']]],
+ ['isingmodel_2ecpp_10',['IsingModel.cpp',['../IsingModel_8cpp.html',1,'']]],
+ ['isingmodel_2ehpp_11',['IsingModel.hpp',['../IsingModel_8hpp.html',1,'']]],
+ ['isingmodeltest_12',['IsingModelTest',['../classIsingModel.html#a2b1cf104e0bda1fce78ed366e1ec7287',1,'IsingModel::IsingModelTest()'],['../classIsingModelTest.html',1,'IsingModelTest']]]
];
diff --git a/docs/search/all_7.js b/docs/search/all_7.js
index a2ea4bf..a00b603 100644
--- a/docs/search/all_7.js
+++ b/docs/search/all_7.js
@@ -1,13 +1,6 @@
var searchData=
[
- ['initialize_5fenergy_0',['initialize_energy',['../classIsingModel.html#a59fced38c695e2fa647f53be81b9d2a1',1,'IsingModel']]],
- ['initialize_5fenergy_5fdiff_1',['initialize_energy_diff',['../classIsingModel.html#aff9a1201933fd5408845a1447e4895b4',1,'IsingModel']]],
- ['initialize_5flattice_2',['initialize_lattice',['../classIsingModel.html#a34a4710949b4a70f3e37ca223aefcf8a',1,'IsingModel']]],
- ['initialize_5fmagnetization_3',['initialize_magnetization',['../classIsingModel.html#a926cf4964d190d2ce23e5a17201787a4',1,'IsingModel']]],
- ['initialize_5fneighbors_4',['initialize_neighbors',['../classIsingModel.html#a6776109105051597c275670dabd0054a',1,'IsingModel']]],
- ['ising_20model_5',['Ising Model',['../index.html',1,'']]],
- ['isingmodel_6',['IsingModel',['../classIsingModel.html',1,'IsingModel'],['../classIsingModel.html#acf281f6f5ed02911ca6ab07004449864',1,'IsingModel::IsingModel()'],['../classIsingModel.html#a4a39ee7fbfbbf566f75bc28900ca9ea5',1,'IsingModel::IsingModel(int L, double T)'],['../classIsingModel.html#a46c9446e94854452f715d307c77c1c15',1,'IsingModel::IsingModel(int L, double T, int val)']]],
- ['isingmodel_2ecpp_7',['IsingModel.cpp',['../IsingModel_8cpp.html',1,'']]],
- ['isingmodel_2ehpp_8',['IsingModel.hpp',['../IsingModel_8hpp.html',1,'']]],
- ['isingmodeltest_9',['IsingModelTest',['../classIsingModelTest.html',1,'']]]
+ ['l_0',['L',['../classIsingModel.html#a2b8ac43baefeb386186266d5aa4de348',1,'IsingModel']]],
+ ['lattice_1',['lattice',['../classIsingModel.html#a2c3c76c79717c968d7c227c58b46df41',1,'IsingModel']]],
+ ['left_2',['LEFT',['../IsingModel_8hpp.html#a437ef08681e7210d6678427030446a54',1,'IsingModel.hpp']]]
];
diff --git a/docs/search/all_8.js b/docs/search/all_8.js
index 9d163ac..1324740 100644
--- a/docs/search/all_8.js
+++ b/docs/search/all_8.js
@@ -1,4 +1,18 @@
var searchData=
[
- ['k_5fb_0',['k_B',['../constants_8hpp.html#abfa7d6668c777f9516606394bbc9c414',1,'constants.hpp']]]
+ ['m_0',['M',['../classdata__t.html#ad08d2488bf913c626157471cf6e8a46a',1,'data_t::M()'],['../classIsingModel.html#aef7232b28df08e064ef58eb5ef32f738',1,'IsingModel::M()']]],
+ ['m2_1',['M2',['../classdata__t.html#a71ae3cd4460f2c66239500c11804e70b',1,'data_t']]],
+ ['m_5fabs_2',['M_abs',['../classdata__t.html#a586475e0f71322dffda2e75f228ab24b',1,'data_t']]],
+ ['m_5fassert_3',['m_assert',['../testlib_8hpp.html#a39abb7cba0535176ed62aae136d2fcc7',1,'details']]],
+ ['mag_5f2_4',['MAG_2',['../test__suite_8cpp.html#a9fd092d930430eb4693d93e0c9066605',1,'test_suite.cpp']]],
+ ['main_5',['main',['../time_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627',1,'main(int argc, char **argv): time.cpp'],['../test__suite_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): test_suite.cpp'],['../phase__transition__mpi_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627',1,'main(int argc, char **argv): phase_transition_mpi.cpp'],['../phase__transition_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627',1,'main(int argc, char **argv): phase_transition.cpp'],['../main_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627',1,'main(int argc, char **argv): main.cpp'],['../mcmc__progression_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627',1,'main(int argc, char **argv): mcmc_progression.cpp'],['../pd__estimate_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627',1,'main(int argc, char **argv): pd_estimate.cpp']]],
+ ['main_2ecpp_6',['main.cpp',['../main_8cpp.html',1,'']]],
+ ['mcmc_5fparallel_7',['mcmc_parallel',['../monte__carlo_8hpp.html#ae1e7f904ecfc3d8f3c4dd1ef155dd771',1,'montecarlo']]],
+ ['mcmc_5fprogression_2ecpp_8',['mcmc_progression.cpp',['../mcmc__progression_8cpp.html',1,'']]],
+ ['mcmc_5fserial_9',['mcmc_serial',['../monte__carlo_8hpp.html#ae67483ff00d1b0594d543261c8283ffd',1,'montecarlo']]],
+ ['methodname_10',['methodName',['../utils_8hpp.html#a178c4922157666a6e9c127c2ffd96346',1,'details']]],
+ ['metropolis_11',['Metropolis',['../classIsingModel.html#a56559d68dc9aaff1976d84b157f43488',1,'IsingModel']]],
+ ['mkpath_12',['mkpath',['../utils_8hpp.html#a2b45adc86b70f42021582994e83fa00d',1,'utils']]],
+ ['monte_5fcarlo_2ecpp_13',['monte_carlo.cpp',['../monte__carlo_8cpp.html',1,'']]],
+ ['monte_5fcarlo_2ehpp_14',['monte_carlo.hpp',['../monte__carlo_8hpp.html',1,'']]]
];
diff --git a/docs/search/all_9.js b/docs/search/all_9.js
index d4681d4..9fae6f7 100644
--- a/docs/search/all_9.js
+++ b/docs/search/all_9.js
@@ -1,5 +1,4 @@
var searchData=
[
- ['l_0',['L',['../classIsingModel.html#a2b8ac43baefeb386186266d5aa4de348',1,'IsingModel']]],
- ['lattice_1',['lattice',['../classIsingModel.html#a2c3c76c79717c968d7c227c58b46df41',1,'IsingModel']]]
+ ['neighbors_0',['neighbors',['../classIsingModel.html#a94093aaf30facca62737f2ac381fdbcd',1,'IsingModel']]]
];
diff --git a/docs/search/all_a.js b/docs/search/all_a.js
index 670bfbb..e5e6e9e 100644
--- a/docs/search/all_a.js
+++ b/docs/search/all_a.js
@@ -1,15 +1,9 @@
var searchData=
[
- ['m_0',['M',['../classIsingModel.html#a0d373a61baca6b0faa607bb12d82cc47',1,'IsingModel']]],
- ['m_5fassert_1',['m_assert',['../testlib_8hpp.html#a39abb7cba0535176ed62aae136d2fcc7',1,'details']]],
- ['main_2',['main',['../test__suite_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): test_suite.cpp'],['../phase__transition__mpi_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627',1,'main(int argc, char **argv): phase_transition_mpi.cpp'],['../main_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627',1,'main(int argc, char **argv): main.cpp']]],
- ['main_2ecpp_3',['main.cpp',['../main_8cpp.html',1,'']]],
- ['methodname_4',['methodName',['../utils_8hpp.html#a178c4922157666a6e9c127c2ffd96346',1,'details']]],
- ['metropolis_5',['Metropolis',['../classIsingModel.html#a56559d68dc9aaff1976d84b157f43488',1,'IsingModel']]],
- ['mkpath_6',['mkpath',['../utils_8hpp.html#a2b45adc86b70f42021582994e83fa00d',1,'utils']]],
- ['monte_5fcarlo_2ecpp_7',['monte_carlo.cpp',['../monte__carlo_8cpp.html',1,'']]],
- ['monte_5fcarlo_2ehpp_8',['monte_carlo.hpp',['../monte__carlo_8hpp.html',1,'']]],
- ['monte_5fcarlo_5fparallel_9',['monte_carlo_parallel',['../monte__carlo_8hpp.html#acc34e2049a5030874f6f548f3adab958',1,'monte_carlo_parallel(int L, double T, int cycles): monte_carlo.cpp'],['../monte__carlo_8cpp.html#acc34e2049a5030874f6f548f3adab958',1,'monte_carlo_parallel(int L, double T, int cycles): monte_carlo.cpp']]],
- ['monte_5fcarlo_5fprogression_10',['monte_carlo_progression',['../monte__carlo_8hpp.html#ac97d0de27f2f0d50fc6ecf3a79f32826',1,'monte_carlo_progression(double T, int L, int cycles, const std::string filename): monte_carlo.cpp'],['../monte__carlo_8hpp.html#a89ddd777796c65eb2b289af11fc0ce09',1,'monte_carlo_progression(double T, int L, int cycles, int value, const std::string filename): monte_carlo.cpp'],['../monte__carlo_8cpp.html#ac97d0de27f2f0d50fc6ecf3a79f32826',1,'monte_carlo_progression(double T, int L, int cycles, const std::string filename): monte_carlo.cpp'],['../monte__carlo_8cpp.html#a89ddd777796c65eb2b289af11fc0ce09',1,'monte_carlo_progression(double T, int L, int cycles, int value, const std::string filename): monte_carlo.cpp']]],
- ['monte_5fcarlo_5fserial_11',['monte_carlo_serial',['../monte__carlo_8hpp.html#a8f8d4c5e032ed8565a3ac518b32c6aed',1,'monte_carlo_serial(int L, double T, int cycles): monte_carlo.cpp'],['../monte__carlo_8cpp.html#a8f8d4c5e032ed8565a3ac518b32c6aed',1,'monte_carlo_serial(int L, double T, int cycles): monte_carlo.cpp']]]
+ ['operator_2a_0',['operator*',['../classdata__t.html#a7954efc97086ea50e10c33113b203085',1,'data_t']]],
+ ['operator_2a_3d_1',['operator*=',['../classdata__t.html#a6ddf3a7372730ef2393aee8bbcb34992',1,'data_t']]],
+ ['operator_2b_2',['operator+',['../classdata__t.html#a13bc1d73eadeb39c507e89f5872d726f',1,'data_t']]],
+ ['operator_2b_3d_3',['operator+=',['../classdata__t.html#a6cb96b4ff750ab29041038ca53f307cb',1,'data_t']]],
+ ['operator_2f_4',['operator/',['../classdata__t.html#a429a11c53ee7fe08f6a4e75db524521d',1,'data_t']]],
+ ['operator_2f_3d_5',['operator/=',['../classdata__t.html#a88da5be78439fbdecfa473ec007dffd8',1,'data_t']]]
];
diff --git a/docs/search/all_b.js b/docs/search/all_b.js
index 9fae6f7..e40c691 100644
--- a/docs/search/all_b.js
+++ b/docs/search/all_b.js
@@ -1,4 +1,9 @@
var searchData=
[
- ['neighbors_0',['neighbors',['../classIsingModel.html#a94093aaf30facca62737f2ac381fdbcd',1,'IsingModel']]]
+ ['pd_5festimate_0',['pd_estimate',['../monte__carlo_8hpp.html#aea2dd1b5fac7c45633bc6f8dc4541226',1,'montecarlo']]],
+ ['pd_5festimate_2ecpp_1',['pd_estimate.cpp',['../pd__estimate_8cpp.html',1,'']]],
+ ['phase_5ftransition_2',['phase_transition',['../monte__carlo_8hpp.html#a34e9c3e24f26760693266b8a7b6b3d21',1,'montecarlo']]],
+ ['phase_5ftransition_2ecpp_3',['phase_transition.cpp',['../phase__transition_8cpp.html',1,'']]],
+ ['phase_5ftransition_5fmpi_2ecpp_4',['phase_transition_mpi.cpp',['../phase__transition__mpi_8cpp.html',1,'']]],
+ ['progression_5',['progression',['../monte__carlo_8hpp.html#a781d946de16211ba18ad6671a5b6838d',1,'montecarlo::progression(double T, int L, int cycles, const std::string filename, int burn_in_time=BURN_IN_TIME)'],['../monte__carlo_8hpp.html#a1549fc386bd3cdd1cdbe0261b9dd8415',1,'montecarlo::progression(double T, int L, int cycles, int value, const std::string filename, int burn_in_time=BURN_IN_TIME)']]]
];
diff --git a/docs/search/all_c.js b/docs/search/all_c.js
index fef9e21..1196503 100644
--- a/docs/search/all_c.js
+++ b/docs/search/all_c.js
@@ -1,6 +1,4 @@
var searchData=
[
- ['pd_5festimate_0',['pd_estimate',['../monte__carlo_8hpp.html#a962f704ab35208bf6541eb3b707a9559',1,'pd_estimate(double T, int L, int cycles, const std::string filename): monte_carlo.cpp'],['../monte__carlo_8cpp.html#a962f704ab35208bf6541eb3b707a9559',1,'pd_estimate(double T, int L, int cycles, const std::string filename): monte_carlo.cpp']]],
- ['phase_5ftransition_1',['phase_transition',['../monte__carlo_8hpp.html#a2dfe843fbb80e10a763f3260131a148e',1,'phase_transition(int L, double start_T, double end_T, int points_T, std::function< data_t(int, double, int)> monte_carlo, std::string outfile): monte_carlo.cpp'],['../monte__carlo_8cpp.html#a7df22ace588b4d229d1029ce766d0009',1,'phase_transition(int L, double start, double end, int points, std::function< data_t(int, double, int)> monte_carlo, std::string outfile): monte_carlo.cpp']]],
- ['phase_5ftransition_5fmpi_2ecpp_2',['phase_transition_mpi.cpp',['../phase__transition__mpi_8cpp.html',1,'']]]
+ ['right_0',['RIGHT',['../IsingModel_8hpp.html#a80fb826a684cf3f0d306b22aa100ddac',1,'IsingModel.hpp']]]
];
diff --git a/docs/search/all_e.js b/docs/search/all_e.js
index b656b4b..609c264 100644
--- a/docs/search/all_e.js
+++ b/docs/search/all_e.js
@@ -1,10 +1,14 @@
var searchData=
[
['t_0',['T',['../classIsingModel.html#a20fc4c0c99d8a119f70a1614784d4e5c',1,'IsingModel']]],
- ['test_5f2x2_5flattice_1',['test_2x2_lattice',['../classIsingModelTest.html#a4ace7013fa2d257ad1747961da6bc4de',1,'IsingModelTest::test_2x2_lattice()'],['../monte__carlo_8hpp.html#aa8b4fc86b26f0e3e253ba5556d2d14dc',1,'test_2x2_lattice(): monte_carlo.hpp']]],
- ['test_5finit_5ffunctions_2',['test_init_functions',['../classIsingModelTest.html#a717e5852ca51432a61fb6ed38da37931',1,'IsingModelTest']]],
- ['test_5fsuite_2ecpp_3',['test_suite.cpp',['../test__suite_8cpp.html',1,'']]],
- ['testlib_2ecpp_4',['testlib.cpp',['../testlib_8cpp.html',1,'']]],
- ['testlib_2ehpp_5',['testlib.hpp',['../testlib_8hpp.html',1,'']]],
- ['typedefs_2ehpp_6',['typedefs.hpp',['../typedefs_8hpp.html',1,'']]]
+ ['test_5f2x2_5flattice_1',['test_2x2_lattice',['../classIsingModelTest.html#a4ace7013fa2d257ad1747961da6bc4de',1,'IsingModelTest']]],
+ ['test_5fburn_5fin_5ftime_2',['test_burn_in_time',['../main_8cpp.html#a746d8dc451b2b2536abbb1ff1acaf861',1,'main.cpp']]],
+ ['test_5finit_5ffunctions_3',['test_init_functions',['../classIsingModelTest.html#a717e5852ca51432a61fb6ed38da37931',1,'IsingModelTest']]],
+ ['test_5fparallel_5fspeedup_4',['test_parallel_speedup',['../main_8cpp.html#a0dfa85080578dffff23b68e372cece95',1,'main.cpp']]],
+ ['test_5fsuite_2ecpp_5',['test_suite.cpp',['../test__suite_8cpp.html',1,'']]],
+ ['testlib_2ecpp_6',['testlib.cpp',['../testlib_8cpp.html',1,'']]],
+ ['testlib_2ehpp_7',['testlib.hpp',['../testlib_8hpp.html',1,'']]],
+ ['time_2ecpp_8',['time.cpp',['../time_8cpp.html',1,'']]],
+ ['time_5flattice_5fsizes_9',['time_lattice_sizes',['../time_8cpp.html#aa224066f42c47cae5fbd457c1948e4a5',1,'time.cpp']]],
+ ['time_5fsample_5fsizes_10',['time_sample_sizes',['../time_8cpp.html#ace9eb0821fe4edf19cf2e7d8ffe6efb4',1,'time.cpp']]]
];
diff --git a/docs/search/all_f.js b/docs/search/all_f.js
index cd921db..256f9d4 100644
--- a/docs/search/all_f.js
+++ b/docs/search/all_f.js
@@ -1,5 +1,7 @@
var searchData=
[
- ['utils_2ecpp_0',['utils.cpp',['../utils_8cpp.html',1,'']]],
- ['utils_2ehpp_1',['utils.hpp',['../utils_8hpp.html',1,'']]]
+ ['up_0',['UP',['../IsingModel_8hpp.html#a1965eaca47dbf3f87acdafc2208f04eb',1,'IsingModel.hpp']]],
+ ['usage_1',['usage',['../main_8cpp.html#ac907e18135856c90366aaa599a9e10b1',1,'usage(std::string filename): main.cpp'],['../mcmc__progression_8cpp.html#ac907e18135856c90366aaa599a9e10b1',1,'usage(std::string filename): mcmc_progression.cpp'],['../pd__estimate_8cpp.html#ac907e18135856c90366aaa599a9e10b1',1,'usage(std::string filename): pd_estimate.cpp'],['../phase__transition_8cpp.html#ac907e18135856c90366aaa599a9e10b1',1,'usage(std::string filename): phase_transition.cpp'],['../phase__transition__mpi_8cpp.html#ac907e18135856c90366aaa599a9e10b1',1,'usage(std::string filename): phase_transition_mpi.cpp'],['../time_8cpp.html#ac907e18135856c90366aaa599a9e10b1',1,'usage(std::string filename): time.cpp']]],
+ ['utils_2ecpp_2',['utils.cpp',['../utils_8cpp.html',1,'']]],
+ ['utils_2ehpp_3',['utils.hpp',['../utils_8hpp.html',1,'']]]
];
diff --git a/docs/search/defines_2.js b/docs/search/defines_2.js
index c6466cb..fb20ef6 100644
--- a/docs/search/defines_2.js
+++ b/docs/search/defines_2.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['debug_0',['DEBUG',['../utils_8hpp.html#aecc1f7a8a2493b9e021e5bff76a00a5b',1,'utils.hpp']]]
+ ['cv_5f2_0',['CV_2',['../test__suite_8cpp.html#af02dd88b4d495baf7af5826d1481634c',1,'test_suite.cpp']]]
];
diff --git a/docs/search/defines_3.js b/docs/search/defines_3.js
index 9d163ac..f00a465 100644
--- a/docs/search/defines_3.js
+++ b/docs/search/defines_3.js
@@ -1,4 +1,5 @@
var searchData=
[
- ['k_5fb_0',['k_B',['../constants_8hpp.html#abfa7d6668c777f9516606394bbc9c414',1,'constants.hpp']]]
+ ['debug_0',['DEBUG',['../utils_8hpp.html#aecc1f7a8a2493b9e021e5bff76a00a5b',1,'utils.hpp']]],
+ ['down_1',['DOWN',['../IsingModel_8hpp.html#a4193cd1c8c2e6ebd0e056fa2364a663f',1,'IsingModel.hpp']]]
];
diff --git a/docs/search/defines_4.js b/docs/search/defines_4.js
new file mode 100644
index 0000000..782ca6c
--- /dev/null
+++ b/docs/search/defines_4.js
@@ -0,0 +1,4 @@
+var searchData=
+[
+ ['eps_5f2_0',['EPS_2',['../test__suite_8cpp.html#a00367775d110a9537bd06bde2e630471',1,'test_suite.cpp']]]
+];
diff --git a/docs/search/defines_5.js b/docs/search/defines_5.js
new file mode 100644
index 0000000..d53c4a7
--- /dev/null
+++ b/docs/search/defines_5.js
@@ -0,0 +1,4 @@
+var searchData=
+[
+ ['index_0',['INDEX',['../IsingModel_8hpp.html#a3039ac753f46401767c38f867787fae6',1,'IsingModel.hpp']]]
+];
diff --git a/docs/search/defines_6.js b/docs/search/defines_6.js
new file mode 100644
index 0000000..9f2f559
--- /dev/null
+++ b/docs/search/defines_6.js
@@ -0,0 +1,4 @@
+var searchData=
+[
+ ['left_0',['LEFT',['../IsingModel_8hpp.html#a437ef08681e7210d6678427030446a54',1,'IsingModel.hpp']]]
+];
diff --git a/docs/search/defines_7.js b/docs/search/defines_7.js
new file mode 100644
index 0000000..e3d3aa7
--- /dev/null
+++ b/docs/search/defines_7.js
@@ -0,0 +1,4 @@
+var searchData=
+[
+ ['mag_5f2_0',['MAG_2',['../test__suite_8cpp.html#a9fd092d930430eb4693d93e0c9066605',1,'test_suite.cpp']]]
+];
diff --git a/docs/search/defines_8.js b/docs/search/defines_8.js
new file mode 100644
index 0000000..1196503
--- /dev/null
+++ b/docs/search/defines_8.js
@@ -0,0 +1,4 @@
+var searchData=
+[
+ ['right_0',['RIGHT',['../IsingModel_8hpp.html#a80fb826a684cf3f0d306b22aa100ddac',1,'IsingModel.hpp']]]
+];
diff --git a/docs/search/defines_9.js b/docs/search/defines_9.js
new file mode 100644
index 0000000..c7887aa
--- /dev/null
+++ b/docs/search/defines_9.js
@@ -0,0 +1,4 @@
+var searchData=
+[
+ ['up_0',['UP',['../IsingModel_8hpp.html#a1965eaca47dbf3f87acdafc2208f04eb',1,'IsingModel.hpp']]]
+];
diff --git a/docs/search/defines_a.js b/docs/search/defines_a.js
new file mode 100644
index 0000000..18553b5
--- /dev/null
+++ b/docs/search/defines_a.js
@@ -0,0 +1,4 @@
+var searchData=
+[
+ ['x_5f2_0',['X_2',['../test__suite_8cpp.html#ad27c84dda71475ffd365c649b525199e',1,'test_suite.cpp']]]
+];
diff --git a/docs/search/defines_b.js b/docs/search/defines_b.js
new file mode 100644
index 0000000..18553b5
--- /dev/null
+++ b/docs/search/defines_b.js
@@ -0,0 +1,4 @@
+var searchData=
+[
+ ['x_5f2_0',['X_2',['../test__suite_8cpp.html#ad27c84dda71475ffd365c649b525199e',1,'test_suite.cpp']]]
+];
diff --git a/docs/search/files_0.js b/docs/search/files_0.js
index 0648f09..99d33f4 100644
--- a/docs/search/files_0.js
+++ b/docs/search/files_0.js
@@ -1,4 +1,5 @@
var searchData=
[
- ['constants_2ehpp_0',['constants.hpp',['../constants_8hpp.html',1,'']]]
+ ['data_5ftype_2ecpp_0',['data_type.cpp',['../data__type_8cpp.html',1,'']]],
+ ['data_5ftype_2ehpp_1',['data_type.hpp',['../data__type_8hpp.html',1,'']]]
];
diff --git a/docs/search/files_1.js b/docs/search/files_1.js
index 99d33f4..172e9fd 100644
--- a/docs/search/files_1.js
+++ b/docs/search/files_1.js
@@ -1,5 +1,5 @@
var searchData=
[
- ['data_5ftype_2ecpp_0',['data_type.cpp',['../data__type_8cpp.html',1,'']]],
- ['data_5ftype_2ehpp_1',['data_type.hpp',['../data__type_8hpp.html',1,'']]]
+ ['isingmodel_2ecpp_0',['IsingModel.cpp',['../IsingModel_8cpp.html',1,'']]],
+ ['isingmodel_2ehpp_1',['IsingModel.hpp',['../IsingModel_8hpp.html',1,'']]]
];
diff --git a/docs/search/files_2.js b/docs/search/files_2.js
index 172e9fd..5bfde32 100644
--- a/docs/search/files_2.js
+++ b/docs/search/files_2.js
@@ -1,5 +1,7 @@
var searchData=
[
- ['isingmodel_2ecpp_0',['IsingModel.cpp',['../IsingModel_8cpp.html',1,'']]],
- ['isingmodel_2ehpp_1',['IsingModel.hpp',['../IsingModel_8hpp.html',1,'']]]
+ ['main_2ecpp_0',['main.cpp',['../main_8cpp.html',1,'']]],
+ ['mcmc_5fprogression_2ecpp_1',['mcmc_progression.cpp',['../mcmc__progression_8cpp.html',1,'']]],
+ ['monte_5fcarlo_2ecpp_2',['monte_carlo.cpp',['../monte__carlo_8cpp.html',1,'']]],
+ ['monte_5fcarlo_2ehpp_3',['monte_carlo.hpp',['../monte__carlo_8hpp.html',1,'']]]
];
diff --git a/docs/search/files_3.js b/docs/search/files_3.js
index 4878898..42fa72d 100644
--- a/docs/search/files_3.js
+++ b/docs/search/files_3.js
@@ -1,6 +1,6 @@
var searchData=
[
- ['main_2ecpp_0',['main.cpp',['../main_8cpp.html',1,'']]],
- ['monte_5fcarlo_2ecpp_1',['monte_carlo.cpp',['../monte__carlo_8cpp.html',1,'']]],
- ['monte_5fcarlo_2ehpp_2',['monte_carlo.hpp',['../monte__carlo_8hpp.html',1,'']]]
+ ['pd_5festimate_2ecpp_0',['pd_estimate.cpp',['../pd__estimate_8cpp.html',1,'']]],
+ ['phase_5ftransition_2ecpp_1',['phase_transition.cpp',['../phase__transition_8cpp.html',1,'']]],
+ ['phase_5ftransition_5fmpi_2ecpp_2',['phase_transition_mpi.cpp',['../phase__transition__mpi_8cpp.html',1,'']]]
];
diff --git a/docs/search/files_4.js b/docs/search/files_4.js
index 44579d3..70f4074 100644
--- a/docs/search/files_4.js
+++ b/docs/search/files_4.js
@@ -1,4 +1,7 @@
var searchData=
[
- ['phase_5ftransition_5fmpi_2ecpp_0',['phase_transition_mpi.cpp',['../phase__transition__mpi_8cpp.html',1,'']]]
+ ['test_5fsuite_2ecpp_0',['test_suite.cpp',['../test__suite_8cpp.html',1,'']]],
+ ['testlib_2ecpp_1',['testlib.cpp',['../testlib_8cpp.html',1,'']]],
+ ['testlib_2ehpp_2',['testlib.hpp',['../testlib_8hpp.html',1,'']]],
+ ['time_2ecpp_3',['time.cpp',['../time_8cpp.html',1,'']]]
];
diff --git a/docs/search/files_5.js b/docs/search/files_5.js
index f687ddb..cd921db 100644
--- a/docs/search/files_5.js
+++ b/docs/search/files_5.js
@@ -1,7 +1,5 @@
var searchData=
[
- ['test_5fsuite_2ecpp_0',['test_suite.cpp',['../test__suite_8cpp.html',1,'']]],
- ['testlib_2ecpp_1',['testlib.cpp',['../testlib_8cpp.html',1,'']]],
- ['testlib_2ehpp_2',['testlib.hpp',['../testlib_8hpp.html',1,'']]],
- ['typedefs_2ehpp_3',['typedefs.hpp',['../typedefs_8hpp.html',1,'']]]
+ ['utils_2ecpp_0',['utils.cpp',['../utils_8cpp.html',1,'']]],
+ ['utils_2ehpp_1',['utils.hpp',['../utils_8hpp.html',1,'']]]
];
diff --git a/docs/search/functions_0.js b/docs/search/functions_0.js
index 4199254..9bf63f1 100644
--- a/docs/search/functions_0.js
+++ b/docs/search/functions_0.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['dirname_0',['dirname',['../utils_8hpp.html#aed026119193a9bbe076671809ff0f430',1,'utils']]]
+ ['assert_5feach_0',['assert_each',['../testlib_8hpp.html#ab6585c8aa8c276a3442c67a57c8de6fb',1,'testlib']]]
];
diff --git a/docs/search/functions_1.js b/docs/search/functions_1.js
index 45fb121..6750ee2 100644
--- a/docs/search/functions_1.js
+++ b/docs/search/functions_1.js
@@ -1,5 +1,8 @@
var searchData=
[
- ['get_5fe_0',['get_E',['../classIsingModel.html#aaa0787d964b004a17869811a5e947ff5',1,'IsingModel']]],
- ['get_5fm_1',['get_M',['../classIsingModel.html#aa5701496e6483bc4668c486d6d3af625',1,'IsingModel']]]
+ ['close_5fto_0',['close_to',['../testlib_8hpp.html#a2cbf3a45367e903de6efbdbea3344cea',1,'testlib::close_to(arma::Mat< T > &a, arma::Mat< T > &b, double tol=1e-8)'],['../testlib_8hpp.html#a44f47fa3c8654c09712572d75c0ffa7f',1,'testlib::close_to(T a, T b, double tol=1e-8)']]],
+ ['concatpath_1',['concatpath',['../utils_8hpp.html#ae91fad89394d745d544737e43524bde6',1,'utils']]],
+ ['create_5fburn_5fin_5ftime_5fdata_2',['create_burn_in_time_data',['../main_8cpp.html#a68406fc2dd8de5849c3984658c171f32',1,'main.cpp']]],
+ ['create_5fpd_5festimate_5fdata_3',['create_pd_estimate_data',['../main_8cpp.html#a4f8ea24364d72024915d3753a572cc5b',1,'main.cpp']]],
+ ['create_5fphase_5ftransition_5fdata_4',['create_phase_transition_data',['../main_8cpp.html#a9d62cf1399596f4c5a39abdd3196d76d',1,'main.cpp']]]
];
diff --git a/docs/search/functions_2.js b/docs/search/functions_2.js
index 7bbfb9b..a993caf 100644
--- a/docs/search/functions_2.js
+++ b/docs/search/functions_2.js
@@ -1,9 +1,5 @@
var searchData=
[
- ['initialize_5fenergy_0',['initialize_energy',['../classIsingModel.html#a59fced38c695e2fa647f53be81b9d2a1',1,'IsingModel']]],
- ['initialize_5fenergy_5fdiff_1',['initialize_energy_diff',['../classIsingModel.html#aff9a1201933fd5408845a1447e4895b4',1,'IsingModel']]],
- ['initialize_5flattice_2',['initialize_lattice',['../classIsingModel.html#a34a4710949b4a70f3e37ca223aefcf8a',1,'IsingModel']]],
- ['initialize_5fmagnetization_3',['initialize_magnetization',['../classIsingModel.html#a926cf4964d190d2ce23e5a17201787a4',1,'IsingModel']]],
- ['initialize_5fneighbors_4',['initialize_neighbors',['../classIsingModel.html#a6776109105051597c275670dabd0054a',1,'IsingModel']]],
- ['isingmodel_5',['IsingModel',['../classIsingModel.html#acf281f6f5ed02911ca6ab07004449864',1,'IsingModel::IsingModel()'],['../classIsingModel.html#a4a39ee7fbfbbf566f75bc28900ca9ea5',1,'IsingModel::IsingModel(int L, double T)'],['../classIsingModel.html#a46c9446e94854452f715d307c77c1c15',1,'IsingModel::IsingModel(int L, double T, int val)']]]
+ ['data_5ft_0',['data_t',['../classdata__t.html#aa2690d3e5d711b4baf3c8f8b9095faf7',1,'data_t::data_t()'],['../classdata__t.html#a3f2d19ab309e696ba91a2000479bcb83',1,'data_t::data_t(double E, double E2, double M, double M2, double M_abs)']]],
+ ['dirname_1',['dirname',['../utils_8hpp.html#aed026119193a9bbe076671809ff0f430',1,'utils']]]
];
diff --git a/docs/search/functions_3.js b/docs/search/functions_3.js
index de0435f..3677807 100644
--- a/docs/search/functions_3.js
+++ b/docs/search/functions_3.js
@@ -1,11 +1,11 @@
var searchData=
[
- ['m_5fassert_0',['m_assert',['../testlib_8hpp.html#a39abb7cba0535176ed62aae136d2fcc7',1,'details']]],
- ['main_1',['main',['../main_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627',1,'main(int argc, char **argv): main.cpp'],['../phase__transition__mpi_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627',1,'main(int argc, char **argv): phase_transition_mpi.cpp'],['../test__suite_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): test_suite.cpp']]],
- ['methodname_2',['methodName',['../utils_8hpp.html#a178c4922157666a6e9c127c2ffd96346',1,'details']]],
- ['metropolis_3',['Metropolis',['../classIsingModel.html#a56559d68dc9aaff1976d84b157f43488',1,'IsingModel']]],
- ['mkpath_4',['mkpath',['../utils_8hpp.html#a2b45adc86b70f42021582994e83fa00d',1,'utils']]],
- ['monte_5fcarlo_5fparallel_5',['monte_carlo_parallel',['../monte__carlo_8hpp.html#acc34e2049a5030874f6f548f3adab958',1,'monte_carlo_parallel(int L, double T, int cycles): monte_carlo.cpp'],['../monte__carlo_8cpp.html#acc34e2049a5030874f6f548f3adab958',1,'monte_carlo_parallel(int L, double T, int cycles): monte_carlo.cpp']]],
- ['monte_5fcarlo_5fprogression_6',['monte_carlo_progression',['../monte__carlo_8hpp.html#ac97d0de27f2f0d50fc6ecf3a79f32826',1,'monte_carlo_progression(double T, int L, int cycles, const std::string filename): monte_carlo.cpp'],['../monte__carlo_8hpp.html#a89ddd777796c65eb2b289af11fc0ce09',1,'monte_carlo_progression(double T, int L, int cycles, int value, const std::string filename): monte_carlo.cpp'],['../monte__carlo_8cpp.html#ac97d0de27f2f0d50fc6ecf3a79f32826',1,'monte_carlo_progression(double T, int L, int cycles, const std::string filename): monte_carlo.cpp'],['../monte__carlo_8cpp.html#a89ddd777796c65eb2b289af11fc0ce09',1,'monte_carlo_progression(double T, int L, int cycles, int value, const std::string filename): monte_carlo.cpp']]],
- ['monte_5fcarlo_5fserial_7',['monte_carlo_serial',['../monte__carlo_8hpp.html#a8f8d4c5e032ed8565a3ac518b32c6aed',1,'monte_carlo_serial(int L, double T, int cycles): monte_carlo.cpp'],['../monte__carlo_8cpp.html#a8f8d4c5e032ed8565a3ac518b32c6aed',1,'monte_carlo_serial(int L, double T, int cycles): monte_carlo.cpp']]]
+ ['initialize_5fenergy_0',['initialize_energy',['../classIsingModel.html#a59fced38c695e2fa647f53be81b9d2a1',1,'IsingModel']]],
+ ['initialize_5fenergy_5fdiff_1',['initialize_energy_diff',['../classIsingModel.html#aff9a1201933fd5408845a1447e4895b4',1,'IsingModel']]],
+ ['initialize_5fengine_2',['initialize_engine',['../classIsingModel.html#aaedc25b7284e04849269f31291590bf5',1,'IsingModel']]],
+ ['initialize_5flattice_3',['initialize_lattice',['../classIsingModel.html#a34a4710949b4a70f3e37ca223aefcf8a',1,'IsingModel::initialize_lattice()'],['../classIsingModel.html#acc86effd6889bea199a3d70a9f38dc78',1,'IsingModel::initialize_lattice(int val)']]],
+ ['initialize_5fmagnetization_4',['initialize_magnetization',['../classIsingModel.html#a926cf4964d190d2ce23e5a17201787a4',1,'IsingModel']]],
+ ['initialize_5fneighbors_5',['initialize_neighbors',['../classIsingModel.html#a6776109105051597c275670dabd0054a',1,'IsingModel']]],
+ ['is_5fequal_6',['is_equal',['../testlib_8hpp.html#a3db67d8721d2f3cd626526b43186bcf3',1,'testlib']]],
+ ['isingmodel_7',['IsingModel',['../classIsingModel.html#acf281f6f5ed02911ca6ab07004449864',1,'IsingModel::IsingModel()'],['../classIsingModel.html#a4a39ee7fbfbbf566f75bc28900ca9ea5',1,'IsingModel::IsingModel(int L, double T)'],['../classIsingModel.html#a46c9446e94854452f715d307c77c1c15',1,'IsingModel::IsingModel(int L, double T, int val)']]]
];
diff --git a/docs/search/functions_4.js b/docs/search/functions_4.js
index 4577437..e2c1ec3 100644
--- a/docs/search/functions_4.js
+++ b/docs/search/functions_4.js
@@ -1,5 +1,10 @@
var searchData=
[
- ['pd_5festimate_0',['pd_estimate',['../monte__carlo_8hpp.html#a962f704ab35208bf6541eb3b707a9559',1,'pd_estimate(double T, int L, int cycles, const std::string filename): monte_carlo.cpp'],['../monte__carlo_8cpp.html#a962f704ab35208bf6541eb3b707a9559',1,'pd_estimate(double T, int L, int cycles, const std::string filename): monte_carlo.cpp']]],
- ['phase_5ftransition_1',['phase_transition',['../monte__carlo_8hpp.html#a2dfe843fbb80e10a763f3260131a148e',1,'phase_transition(int L, double start_T, double end_T, int points_T, std::function< data_t(int, double, int)> monte_carlo, std::string outfile): monte_carlo.cpp'],['../monte__carlo_8cpp.html#a7df22ace588b4d229d1029ce766d0009',1,'phase_transition(int L, double start, double end, int points, std::function< data_t(int, double, int)> monte_carlo, std::string outfile): monte_carlo.cpp']]]
+ ['m_5fassert_0',['m_assert',['../testlib_8hpp.html#a39abb7cba0535176ed62aae136d2fcc7',1,'details']]],
+ ['main_1',['main',['../main_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627',1,'main(int argc, char **argv): main.cpp'],['../mcmc__progression_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627',1,'main(int argc, char **argv): mcmc_progression.cpp'],['../pd__estimate_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627',1,'main(int argc, char **argv): pd_estimate.cpp'],['../phase__transition_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627',1,'main(int argc, char **argv): phase_transition.cpp'],['../phase__transition__mpi_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627',1,'main(int argc, char **argv): phase_transition_mpi.cpp'],['../test__suite_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): test_suite.cpp'],['../time_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627',1,'main(int argc, char **argv): time.cpp']]],
+ ['mcmc_5fparallel_2',['mcmc_parallel',['../monte__carlo_8hpp.html#ae1e7f904ecfc3d8f3c4dd1ef155dd771',1,'montecarlo']]],
+ ['mcmc_5fserial_3',['mcmc_serial',['../monte__carlo_8hpp.html#ae67483ff00d1b0594d543261c8283ffd',1,'montecarlo']]],
+ ['methodname_4',['methodName',['../utils_8hpp.html#a178c4922157666a6e9c127c2ffd96346',1,'details']]],
+ ['metropolis_5',['Metropolis',['../classIsingModel.html#a56559d68dc9aaff1976d84b157f43488',1,'IsingModel']]],
+ ['mkpath_6',['mkpath',['../utils_8hpp.html#a2b45adc86b70f42021582994e83fa00d',1,'utils']]]
];
diff --git a/docs/search/functions_5.js b/docs/search/functions_5.js
index 83e74c2..e5e6e9e 100644
--- a/docs/search/functions_5.js
+++ b/docs/search/functions_5.js
@@ -1,4 +1,9 @@
var searchData=
[
- ['scientific_5fformat_0',['scientific_format',['../utils_8hpp.html#a3529a74fd2a25d24de73d9d4e1c90835',1,'utils::scientific_format(double d, int width=20, int prec=10)'],['../utils_8hpp.html#ab3e89176433ddc9ba721b2eba3d08357',1,'utils::scientific_format(const std::vector< double > &v, int width=20, int prec=10)']]]
+ ['operator_2a_0',['operator*',['../classdata__t.html#a7954efc97086ea50e10c33113b203085',1,'data_t']]],
+ ['operator_2a_3d_1',['operator*=',['../classdata__t.html#a6ddf3a7372730ef2393aee8bbcb34992',1,'data_t']]],
+ ['operator_2b_2',['operator+',['../classdata__t.html#a13bc1d73eadeb39c507e89f5872d726f',1,'data_t']]],
+ ['operator_2b_3d_3',['operator+=',['../classdata__t.html#a6cb96b4ff750ab29041038ca53f307cb',1,'data_t']]],
+ ['operator_2f_4',['operator/',['../classdata__t.html#a429a11c53ee7fe08f6a4e75db524521d',1,'data_t']]],
+ ['operator_2f_3d_5',['operator/=',['../classdata__t.html#a88da5be78439fbdecfa473ec007dffd8',1,'data_t']]]
];
diff --git a/docs/search/functions_6.js b/docs/search/functions_6.js
index 23c5afa..c061015 100644
--- a/docs/search/functions_6.js
+++ b/docs/search/functions_6.js
@@ -1,5 +1,6 @@
var searchData=
[
- ['test_5f2x2_5flattice_0',['test_2x2_lattice',['../classIsingModelTest.html#a4ace7013fa2d257ad1747961da6bc4de',1,'IsingModelTest::test_2x2_lattice()'],['../monte__carlo_8hpp.html#aa8b4fc86b26f0e3e253ba5556d2d14dc',1,'test_2x2_lattice(): monte_carlo.hpp']]],
- ['test_5finit_5ffunctions_1',['test_init_functions',['../classIsingModelTest.html#a717e5852ca51432a61fb6ed38da37931',1,'IsingModelTest']]]
+ ['pd_5festimate_0',['pd_estimate',['../monte__carlo_8hpp.html#aea2dd1b5fac7c45633bc6f8dc4541226',1,'montecarlo']]],
+ ['phase_5ftransition_1',['phase_transition',['../monte__carlo_8hpp.html#a34e9c3e24f26760693266b8a7b6b3d21',1,'montecarlo']]],
+ ['progression_2',['progression',['../monte__carlo_8hpp.html#a781d946de16211ba18ad6671a5b6838d',1,'montecarlo::progression(double T, int L, int cycles, const std::string filename, int burn_in_time=BURN_IN_TIME)'],['../monte__carlo_8hpp.html#a1549fc386bd3cdd1cdbe0261b9dd8415',1,'montecarlo::progression(double T, int L, int cycles, int value, const std::string filename, int burn_in_time=BURN_IN_TIME)']]]
];
diff --git a/docs/search/functions_7.js b/docs/search/functions_7.js
index c18dff8..83e74c2 100644
--- a/docs/search/functions_7.js
+++ b/docs/search/functions_7.js
@@ -1,5 +1,4 @@
var searchData=
[
- ['test_5f2x2_5flattice_0',['test_2x2_lattice',['../monte__carlo_8hpp.html#a64fd72aa1f6ff03e36c35f6265d0f874',1,'test_2x2_lattice(double tol, uint max_cycles): monte_carlo.cpp'],['../monte__carlo_8cpp.html#a64fd72aa1f6ff03e36c35f6265d0f874',1,'test_2x2_lattice(double tol, uint max_cycles): monte_carlo.cpp']]],
- ['test_5finit_5ffunctions_1',['test_init_functions',['../classIsingModelTest.html#a717e5852ca51432a61fb6ed38da37931',1,'IsingModelTest']]]
+ ['scientific_5fformat_0',['scientific_format',['../utils_8hpp.html#a3529a74fd2a25d24de73d9d4e1c90835',1,'utils::scientific_format(double d, int width=20, int prec=10)'],['../utils_8hpp.html#ab3e89176433ddc9ba721b2eba3d08357',1,'utils::scientific_format(const std::vector< double > &v, int width=20, int prec=10)']]]
];
diff --git a/docs/search/functions_8.js b/docs/search/functions_8.js
new file mode 100644
index 0000000..40534f4
--- /dev/null
+++ b/docs/search/functions_8.js
@@ -0,0 +1,9 @@
+var searchData=
+[
+ ['test_5f2x2_5flattice_0',['test_2x2_lattice',['../classIsingModelTest.html#a4ace7013fa2d257ad1747961da6bc4de',1,'IsingModelTest']]],
+ ['test_5fburn_5fin_5ftime_1',['test_burn_in_time',['../main_8cpp.html#a746d8dc451b2b2536abbb1ff1acaf861',1,'main.cpp']]],
+ ['test_5finit_5ffunctions_2',['test_init_functions',['../classIsingModelTest.html#a717e5852ca51432a61fb6ed38da37931',1,'IsingModelTest']]],
+ ['test_5fparallel_5fspeedup_3',['test_parallel_speedup',['../main_8cpp.html#a0dfa85080578dffff23b68e372cece95',1,'main.cpp']]],
+ ['time_5flattice_5fsizes_4',['time_lattice_sizes',['../time_8cpp.html#aa224066f42c47cae5fbd457c1948e4a5',1,'time.cpp']]],
+ ['time_5fsample_5fsizes_5',['time_sample_sizes',['../time_8cpp.html#ace9eb0821fe4edf19cf2e7d8ffe6efb4',1,'time.cpp']]]
+];
diff --git a/docs/search/functions_9.js b/docs/search/functions_9.js
new file mode 100644
index 0000000..788434a
--- /dev/null
+++ b/docs/search/functions_9.js
@@ -0,0 +1,4 @@
+var searchData=
+[
+ ['usage_0',['usage',['../main_8cpp.html#ac907e18135856c90366aaa599a9e10b1',1,'usage(std::string filename): main.cpp'],['../mcmc__progression_8cpp.html#ac907e18135856c90366aaa599a9e10b1',1,'usage(std::string filename): mcmc_progression.cpp'],['../pd__estimate_8cpp.html#ac907e18135856c90366aaa599a9e10b1',1,'usage(std::string filename): pd_estimate.cpp'],['../phase__transition_8cpp.html#ac907e18135856c90366aaa599a9e10b1',1,'usage(std::string filename): phase_transition.cpp'],['../phase__transition__mpi_8cpp.html#ac907e18135856c90366aaa599a9e10b1',1,'usage(std::string filename): phase_transition_mpi.cpp'],['../time_8cpp.html#ac907e18135856c90366aaa599a9e10b1',1,'usage(std::string filename): time.cpp']]]
+];
diff --git a/docs/search/namespaces_0.js b/docs/search/namespaces_0.js
new file mode 100644
index 0000000..7a6d15c
--- /dev/null
+++ b/docs/search/namespaces_0.js
@@ -0,0 +1,4 @@
+var searchData=
+[
+ ['details_0',['details',['../namespacedetails.html',1,'']]]
+];
diff --git a/docs/search/namespaces_1.js b/docs/search/namespaces_1.js
new file mode 100644
index 0000000..9cc45b2
--- /dev/null
+++ b/docs/search/namespaces_1.js
@@ -0,0 +1,4 @@
+var searchData=
+[
+ ['montecarlo_0',['montecarlo',['../namespacemontecarlo.html',1,'']]]
+];
diff --git a/docs/search/namespaces_2.js b/docs/search/namespaces_2.js
new file mode 100644
index 0000000..14ee089
--- /dev/null
+++ b/docs/search/namespaces_2.js
@@ -0,0 +1,4 @@
+var searchData=
+[
+ ['testlib_0',['testlib',['../namespacetestlib.html',1,'']]]
+];
diff --git a/docs/search/namespaces_3.js b/docs/search/namespaces_3.js
new file mode 100644
index 0000000..c76a02d
--- /dev/null
+++ b/docs/search/namespaces_3.js
@@ -0,0 +1,4 @@
+var searchData=
+[
+ ['utils_0',['utils',['../namespaceutils.html',1,'']]]
+];
diff --git a/docs/search/related_0.js b/docs/search/related_0.js
new file mode 100644
index 0000000..d32ef0d
--- /dev/null
+++ b/docs/search/related_0.js
@@ -0,0 +1,4 @@
+var searchData=
+[
+ ['isingmodeltest_0',['IsingModelTest',['../classIsingModel.html#a2b1cf104e0bda1fce78ed366e1ec7287',1,'IsingModel']]]
+];
diff --git a/docs/search/searchdata.js b/docs/search/searchdata.js
index 2a8f22a..817754f 100644
--- a/docs/search/searchdata.js
+++ b/docs/search/searchdata.js
@@ -1,12 +1,13 @@
var indexSectionsWithContent =
{
- 0: "_abcdegiklmnpstu",
+ 0: "_abcdeilmnoprstux",
1: "di",
- 2: "cdimptu",
- 3: "dgimpst",
+ 2: "dimptu",
+ 3: "acdimopstu",
4: "elmnt",
- 5: "_adk",
- 6: "bi"
+ 5: "i",
+ 6: "_acdeilmrux",
+ 7: "bi"
};
var indexSectionNames =
@@ -16,8 +17,9 @@ var indexSectionNames =
2: "files",
3: "functions",
4: "variables",
- 5: "defines",
- 6: "pages"
+ 5: "related",
+ 6: "defines",
+ 7: "pages"
};
var indexSectionLabels =
@@ -27,7 +29,8 @@ var indexSectionLabels =
2: "Files",
3: "Functions",
4: "Variables",
- 5: "Macros",
- 6: "Pages"
+ 5: "Friends",
+ 6: "Macros",
+ 7: "Pages"
};
diff --git a/docs/search/variables_0.js b/docs/search/variables_0.js
index 3834eab..248709d 100644
--- a/docs/search/variables_0.js
+++ b/docs/search/variables_0.js
@@ -1,5 +1,7 @@
var searchData=
[
- ['e_0',['E',['../classIsingModel.html#ae9f872ca2054992161d53306119979dd',1,'IsingModel']]],
- ['energy_5fdiff_1',['energy_diff',['../classIsingModel.html#a1a4ceb1bb2593dbd20c51ed04100cbcd',1,'IsingModel']]]
+ ['e_0',['E',['../classdata__t.html#a6c1a196d96e177b11ca98c61fae35a2e',1,'data_t::E()'],['../classIsingModel.html#a1c8a2a4331c7e60c3e1350c0cf8300b9',1,'IsingModel::E()']]],
+ ['e2_1',['E2',['../classdata__t.html#abb622f9c6cc5ffb9dddb151d2e202f72',1,'data_t']]],
+ ['energy_5fdiff_2',['energy_diff',['../classIsingModel.html#a7112dd6433b1bb9512150cbdc1a0b77e',1,'IsingModel']]],
+ ['engine_3',['engine',['../classIsingModel.html#a1bbe0cb10abee98058e7b45b22b9cd0a',1,'IsingModel']]]
];
diff --git a/docs/search/variables_2.js b/docs/search/variables_2.js
index c556415..4b62716 100644
--- a/docs/search/variables_2.js
+++ b/docs/search/variables_2.js
@@ -1,4 +1,6 @@
var searchData=
[
- ['m_0',['M',['../classIsingModel.html#a0d373a61baca6b0faa607bb12d82cc47',1,'IsingModel']]]
+ ['m_0',['M',['../classdata__t.html#ad08d2488bf913c626157471cf6e8a46a',1,'data_t::M()'],['../classIsingModel.html#aef7232b28df08e064ef58eb5ef32f738',1,'IsingModel::M()']]],
+ ['m2_1',['M2',['../classdata__t.html#a71ae3cd4460f2c66239500c11804e70b',1,'data_t']]],
+ ['m_5fabs_2',['M_abs',['../classdata__t.html#a586475e0f71322dffda2e75f228ab24b',1,'data_t']]]
];
diff --git a/docs/test__suite_8cpp.html b/docs/test__suite_8cpp.html
index ff4138e..dd47d54 100644
--- a/docs/test__suite_8cpp.html
+++ b/docs/test__suite_8cpp.html
@@ -110,7 +110,6 @@ $(document).ready(function(){initNavTree('test__suite_8cpp.html',''); initResiza
More...
#include "IsingModel.hpp "
#include "testlib.hpp "
-
#include <fstream>
Go to the source code of this file.
@@ -123,12 +122,16 @@ Classes
#define EPS_2 (-2 * std::sinh(8.)) / (std::cosh(8.) + 3)
+ The analytic expected energy for a \( 2 \times 2 \) lattice.
#define MAG_2 (std::exp(8.) + 1) / (2 * (cosh(8.) + 3))
+ The analytic expected magnetization for a \( 2 \times 2 \) lattice.
#define CV_2 16 * (3 * std::cosh(8.) + 1) / ((std::cosh(8.) + 3) * (std::cosh(8.) + 3))
+ The analytic heat capacity for a \( 2 \times 2 \) lattice.
#define X_2
+ The analytic susceptibility for a \( 2 \times 2 \) lattice.
@@ -175,6 +180,8 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
+
The analytic expected energy for a \( 2 \times 2 \) lattice.
+
Definition at line 17 of file test_suite.cpp .
@@ -191,7 +198,9 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
-
Definition at line 19 of file test_suite.cpp .
+
The analytic expected magnetization for a \( 2 \times 2 \) lattice.
+
+
Definition at line 22 of file test_suite.cpp .
@@ -209,7 +218,9 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
Value: (3 * std::exp(8.) + std::exp(-8.) + 3) \
/ ((std::cosh(8.) + 3) * (std::cosh(8.) + 3))
-Definition at line 24 of file test_suite.cpp .
+The analytic susceptibility for a \( 2 \times 2 \) lattice.
+
+Definition at line 30 of file test_suite.cpp .
@@ -231,7 +242,7 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
The main function.
-Definition at line 148 of file test_suite.cpp .
+Definition at line 110 of file test_suite.cpp .
diff --git a/docs/test__suite_8cpp.js b/docs/test__suite_8cpp.js
index f9b584a..2b1212f 100644
--- a/docs/test__suite_8cpp.js
+++ b/docs/test__suite_8cpp.js
@@ -1,5 +1,9 @@
var test__suite_8cpp =
[
[ "IsingModelTest", "classIsingModelTest.html", "classIsingModelTest" ],
+ [ "CV_2", "test__suite_8cpp.html#af02dd88b4d495baf7af5826d1481634c", null ],
+ [ "EPS_2", "test__suite_8cpp.html#a00367775d110a9537bd06bde2e630471", null ],
+ [ "MAG_2", "test__suite_8cpp.html#a9fd092d930430eb4693d93e0c9066605", null ],
+ [ "X_2", "test__suite_8cpp.html#ad27c84dda71475ffd365c649b525199e", null ],
[ "main", "test__suite_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ]
];
\ No newline at end of file
diff --git a/docs/test__suite_8cpp_source.html b/docs/test__suite_8cpp_source.html
index 7ab3051..ef0f705 100644
--- a/docs/test__suite_8cpp_source.html
+++ b/docs/test__suite_8cpp_source.html
@@ -101,170 +101,164 @@ $(document).ready(function(){initNavTree('test__suite_8cpp_source.html',''); ini
-
Go to the documentation of this file.
-
-
+
Go to the documentation of this file.
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
+
-
-
-
17 #define EPS_2 (-2 * std::sinh(8.)) / (std::cosh(8.) + 3)
+
+
16
+
17 # define EPS_2 ( - 2
* std :: sinh ( 8.
) ) / ( std :: cosh ( 8.
) + 3
)
-
19 #define MAG_2 (std::exp(8.) + 1) / (2 * (cosh(8.) + 3))
-
-
-
22 16 * (3 * std::cosh(8.) + 1) / ((std::cosh(8.) + 3) * (std::cosh(8.) + 3))
+
+
20
+
21
+
22 # define MAG_2 ( std :: exp ( 8.
) + 1
) / ( 2
* ( cosh ( 8.
) + 3
) )
-
-
25 (3 * std::exp(8.) + std::exp(-8.) + 3) \
-
26 / ((std::cosh(8.) + 3) * (std::cosh(8.) + 3))
-
-
-
-
-
-
-
-
-
-
-
-
42 std::function<bool(
int )> f = [](
int x) {
return x == 1 || x == -1; };
-
-
44 "Test lattice initialization." );
+
+
25
+
+
27 16
* ( 3
* std :: cosh ( 8.
) + 1
) / ( ( std :: cosh ( 8.
) + 3
) * ( std :: cosh ( 8.
) + 3
) )
+
+
+
+
31 ( 3
* std :: exp ( 8.
) + std :: exp ( - 8.
) + 3
)
+
32 / ( ( std :: cosh ( 8.
) + 3
) * ( std :: cosh ( 8.
) + 3
) )
+
+
+
35
+
+
+
+
39
+
+
+
+
+
-
-
47 arma::Mat<int> neighbor_matrix(
"2, 1 ; 0, 2 ; 1, 0" );
-
-
49 "Test neighbor matrix." );
-
-
-
-
-
-
-
56 ASSERT (std::fabs(test.
M - 9.) < 1e-8,
"Test intial magnetization" );
-
-
-
-
60 ASSERT (std::fabs(test.
E - (-18)) < 1e-8,
"Test initial energy." );
-
-
-
-
-
-
-
74 size_t n_spins = L * L;
-
-
-
-
-
79 std::random_device rd;
-
80 std::mt19937 engine(rd());
-
-
+
+
+
48 std::function<
bool (
int )> f = [](
int x) {
return x == 1 || x == -1; };
+
49 ASSERT (testlib::assert_each(f, test.lattice),
+
50 "Test lattice initialization." );
+
+
+
53 arma::Mat<
int > neighbor_matrix(
"2, 1 ; 0, 2 ; 1, 0" );
+
54 ASSERT (testlib::is_equal(neighbor_matrix, test.neighbors),
+
55 "Test neighbor matrix." );
+
+
+
+
+
+
+
62 ASSERT (std::fabs(test
. M - 9.) < 1e-8,
"Test intial magnetization" );
+
+
+
+
66 ASSERT (std::fabs(test
. E - (-18)) < 1e-8,
"Test initial energy." );
+
+
+
+
70
+
71
+
72
+
73
+
74
+
75
+
+
+
+
+
80 size_t n_spins = L * L;
+
+
-
84 int arr[]{0, 0, 0, 0};
-
-
-
-
-
89 while (cycles++ < max_cycles) {
-
-
-
-
-
-
-
96 if (testlib::close_to(EPS_2, tmp.E / n_spins, tol)
-
97 && testlib::close_to(MAG_2, tmp.M_abs / n_spins, tol)
-
98 && testlib::close_to(CV_2, (tmp.E2 - tmp.E * tmp.E) / (T * T)
-
-
100 && testlib::close_to(X_2, (tmp.M2 - tmp.M_abs * tmp.M_abs) / T
-
+
+
85 std::random_device rd;
+
86 std::mt19937 engine(rd());
+
+
+
+
90 int arr[]{0, 0, 0, 0};
+
+
+
93 while (cycles++ < max_cycles) {
+
+
+
96 if (testlib::close_to(
EPS_2 , tmp
. E / n_spins, tol)
+
97 && testlib::close_to(
MAG_2 , tmp
. M_abs / n_spins, tol)
+
+
99 CV_2 , (tmp
. E2 - tmp
. E * tmp
. E ) / (T * T) / n_spins, tol)
+
100 && testlib::close_to(
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
155 for (
size_t i=0; i < 1000; i++) {
-
-
-
158 std::cout <<
"not enough cycles\n" ;
-
-
-
-
-
-
164 std::cout <<
"Res: " << res / 1000 << std::endl;
-
-
-
-
The definition of the Ising model.
-
Test class for the Ising model.
-
int test_2x2_lattice(double tol, int max_cycles)
Test numerical data with analytical data.
-
void test_init_functions()
Test That initializing works as intended.
-
The Ising model in 2 dimensions.
-
int M
The current magnetic strength. unit: Unitless.
-
double T
The temperature of the model.
-
int L
Size of the lattice.
-
arma::Mat< int > lattice
matrix where element .
-
void initialize_lattice()
Initialize the lattice with a random distribution of 1s and -1s.
-
data_t Metropolis()
The Metropolis algorithm.
-
void initialize_energy()
Initialize the energy.
-
void initialize_neighbors()
initialize the neighbors matrix.
-
void initialize_magnetization()
Initialize the magnetization.
-
arma::Mat< int > neighbors
matrix with the neighbors of each element .
-
int E
The current energy state. unit: .
-
-
int main()
The main function.
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
118 int iterations = 10000;
+
119 int accepted_values = 0;
+
+
+
122 for (size_t i = 0; i < iterations; i++) {
+
+
+
+
+
+
+
+
+
131 std::cout <<
"Res: " << res / accepted_values << std::endl;
+
+
+
+
Test class for the Ising model.
+
int test_2x2_lattice(double tol, int max_cycles)
Test numerical data with analytical data.
+
void test_init_functions()
Test that initializing works as intended.
+
The Ising model in 2 dimensions.
+
int64_t E
The current energy state. unit: .
+
double T
The temperature of the model.
+
int L
Size of the lattice.
+
void initialize_lattice()
Initialize the lattice with a random distribution of 1s and -1s.
+
data_t Metropolis()
The Metropolis algorithm.
+
void initialize_energy()
Initialize the energy of the system.
+
void initialize_neighbors()
initialize the neighbors matrix.
+
void initialize_magnetization()
Initialize the magnetization of the system.
+
int64_t M
The current magnetic strength. unit: Unitless.
+
Type to use with the IsingModel class and montecarlo module.
+
double M_abs
Absolute Magnetization.
+
+
data_t & operator+=(const data_t &b)
Overload of the addition equals operator.
+
double M2
Magnetization squared.
+
+
#define EPS_2
The analytic expected energy for a lattice.
+
#define MAG_2
The analytic expected magnetization for a lattice.
+
#define X_2
The analytic susceptibility for a lattice.
+
int main()
The main function.
+
#define CV_2
The analytic heat capacity for a lattice.
#define ASSERT(expr, msg)
A prettier assertion function.
diff --git a/docs/testlib_8cpp.html b/docs/testlib_8cpp.html
index 759935c..644d4c2 100644
--- a/docs/testlib_8cpp.html
+++ b/docs/testlib_8cpp.html
@@ -122,7 +122,7 @@ Functions
Janita Ovidie Sandtrøen Willumsen (janitaws)
Version 1.0
-Bug: No known bugs
+Bug: No known bugs
Definition in file testlib.cpp .
diff --git a/docs/testlib_8cpp_source.html b/docs/testlib_8cpp_source.html
index 1b8d3f7..3e93441 100644
--- a/docs/testlib_8cpp_source.html
+++ b/docs/testlib_8cpp_source.html
@@ -101,14 +101,24 @@ $(document).ready(function(){initNavTree('testlib_8cpp_source.html',''); initRes
-
Go to the documentation of this file.
-
+
Go to the documentation of this file.
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
-
+
15 void m_assert (
bool expr, std::string expr_str, std::string f, std::string file,
16 int line, std::string msg)
-
18 std::function<void(
const std::string &)> print_message =
+
18 std::function<
void (
const std::string &)> print_message =
19 [](
const std::string &msg) {
21 std::cout <<
"message: " << msg <<
"\n\n" ;
@@ -117,7 +127,7 @@ $(document).ready(function(){initNavTree('testlib_8cpp_source.html',''); initRes
-
27 std::string new_assert(f.size() + (expr ? 4 : 6),
'-' );
+
27 std::string new_assert(f.size() + (expr ? 4 : 6),
'-' );
28 std::cout <<
"\x1B[36m" << new_assert <<
"\033[0m\n" ;
29 std::cout << f <<
": " ;
@@ -133,7 +143,6 @@ $(document).ready(function(){initNavTree('testlib_8cpp_source.html',''); initRes
-
void m_assert(bool expr, std::string expr_str, std::string func, std::string file, int line, std::string msg)
Test an expression, confirm that test is ok, or abort execution.
diff --git a/docs/testlib_8hpp.html b/docs/testlib_8hpp.html
index 60ec200..99eafb6 100644
--- a/docs/testlib_8hpp.html
+++ b/docs/testlib_8hpp.html
@@ -125,6 +125,22 @@ Functions
void details::m_assert (bool expr, std::string expr_str, std::string func, std::string file, int line, std::string msg)
Test an expression, confirm that test is ok, or abort execution.
+template<class T , class = typename std::enable_if<std::is_arithmetic<T>::value>::type>
+static bool testlib::close_to (arma::Mat< T > &a, arma::Mat< T > &b, double tol=1e-8)
+ Test if two armadillo matrices/vectors are close to each other.
+
+template<class T , class = typename std::enable_if<std::is_arithmetic<T>::value>::type>
+static bool testlib::close_to (T a, T b, double tol=1e-8)
+ Test if two numbers are close to each other.
+
+template<class T , class = typename std::enable_if<std::is_integral<T>::value>::type>
+static bool testlib::is_equal (arma::Mat< T > &a, arma::Mat< T > &b)
+ Test if two armadillo matrices/vectors are equal.
+
+template<class T , class = typename std::enable_if<std::is_arithmetic<T>::value>::type>
+static bool testlib::assert_each (std::function< bool(T)> expr, arma::Mat< T > &M)
+ Test that all elements fulfill the condition.
+
A small test library.
@@ -133,7 +149,7 @@ Functions
Janita Ovidie Sandtrøen Willumsen (janitaws)
Version 1.0
This a small testing library that is tailored for the needs of the project. Anything that is in the details namespace should not be used directly, or else it might cause undefined behavior if not used correctly.
-
Bug: No known bugs
+
Bug: No known bugs
Definition in file testlib.hpp .
@@ -171,6 +187,223 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
+
+◆ assert_each()
+
+
+
+
+template<class T , class = typename std::enable_if<std::is_arithmetic<T>::value>::type>
+
+
+
+
+
+ static bool testlib::assert_each
+ (
+ std::function< bool(T)>
+ expr ,
+
+
+
+
+ arma::Mat< T > &
+ M
+
+
+
+ )
+
+
+
+
+
+static
+
+
+
+
+
Test that all elements fulfill the condition.
+
Parameters
+
+ expr The boolean expression to apply to each element
+ M The matrix/vector to iterate over
+
+
+
+
Returns bool
+
+
Definition at line 130 of file testlib.hpp .
+
+
+
+
+◆ close_to() [1/2]
+
+
+
+
+template<class T , class = typename std::enable_if<std::is_arithmetic<T>::value>::type>
+
+
+
+
+
+ static bool testlib::close_to
+ (
+ arma::Mat< T > &
+ a ,
+
+
+
+
+ arma::Mat< T > &
+ b ,
+
+
+
+
+ double
+ tol = 1e-8
+
+
+
+ )
+
+
+
+
+
+static
+
+
+
+
+
Test if two armadillo matrices/vectors are close to each other.
+
This function takes in 2 matrices/vectors and checks if they are approximately equal to each other given a tolerance.
+
Parameters
+
+ a Matrix/vector a
+ b Matrix/vector b
+ tol The tolerance
+
+
+
+
Returns bool
+
+
Definition at line 67 of file testlib.hpp .
+
+
+
+
+◆ close_to() [2/2]
+
+
+
+
+template<class T , class = typename std::enable_if<std::is_arithmetic<T>::value>::type>
+
+
+
+
+
+ static bool testlib::close_to
+ (
+ T
+ a ,
+
+
+
+
+ T
+ b ,
+
+
+
+
+ double
+ tol = 1e-8
+
+
+
+ )
+
+
+
+
+
+static
+
+
+
+
+
Test if two numbers are close to each other.
+
This function takes in 2 matrices/vectors and checks if they are approximately equal to each other given a tolerance.
+
Parameters
+
+ a Matrix/vector a
+ b Matrix/vector b
+ tol The tolerance
+
+
+
+
Returns bool
+
+
Definition at line 94 of file testlib.hpp .
+
+
+
+
+◆ is_equal()
+
+
+
+
+template<class T , class = typename std::enable_if<std::is_integral<T>::value>::type>
+
+
+
+
+
+ static bool testlib::is_equal
+ (
+ arma::Mat< T > &
+ a ,
+
+
+
+
+ arma::Mat< T > &
+ b
+
+
+
+ )
+
+
+
+
+
+static
+
+
+
+
+
Test if two armadillo matrices/vectors are equal.
+
This function takes in 2 matrices/vectors and checks if they are equal to each other. This should only be used for integral types.
+
Parameters
+
+ a Matrix/vector a
+ b Matrix/vector b
+
+
+
+
Returns bool
+
+
Definition at line 111 of file testlib.hpp .
+
+
+
◆ m_assert()
diff --git a/docs/testlib_8hpp.js b/docs/testlib_8hpp.js
index 9b491a8..09a5613 100644
--- a/docs/testlib_8hpp.js
+++ b/docs/testlib_8hpp.js
@@ -1,5 +1,9 @@
var testlib_8hpp =
[
[ "ASSERT", "testlib_8hpp.html#a73d4f21ad937dbc50a0c0538c78fd4f9", null ],
+ [ "assert_each", "testlib_8hpp.html#ab6585c8aa8c276a3442c67a57c8de6fb", null ],
+ [ "close_to", "testlib_8hpp.html#a2cbf3a45367e903de6efbdbea3344cea", null ],
+ [ "close_to", "testlib_8hpp.html#a44f47fa3c8654c09712572d75c0ffa7f", null ],
+ [ "is_equal", "testlib_8hpp.html#a3db67d8721d2f3cd626526b43186bcf3", null ],
[ "m_assert", "testlib_8hpp.html#a39abb7cba0535176ed62aae136d2fcc7", null ]
];
\ No newline at end of file
diff --git a/docs/testlib_8hpp_source.html b/docs/testlib_8hpp_source.html
index bfd14a2..8c92105 100644
--- a/docs/testlib_8hpp_source.html
+++ b/docs/testlib_8hpp_source.html
@@ -101,74 +101,177 @@ $(document).ready(function(){initNavTree('testlib_8hpp_source.html',''); initRes
-
Go to the documentation of this file.
-
-
+
Go to the documentation of this file.
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
+
-
+
-
-
-
+
+
+
-
31 #define ASSERT(expr, msg) \
-
32 details::m_assert(expr, #expr, __METHOD_NAME__, __FILE__, __LINE__, msg)
+
+
26
+
27
+
28
+
29
+
30
+
31 # define ASSERT ( expr , msg )
+
32 details :: m_assert ( expr , # expr , __METHOD_NAME__ , __FILE__ , __LINE__ , msg )
-
-
47 void m_assert(
bool expr, std::string expr_str, std::string func,
-
48 std::string file,
int line, std::string msg);
-
-
-
-
-
64 class =
typename std::enable_if<std::is_arithmetic<T>::value>::type>
-
65 static bool close_to(arma::Mat<T> &a, arma::Mat<T> &b,
double tol = 1e-8)
-
-
67 if (a.n_elem != b.n_elem) {
-
-
-
-
71 for (
size_t i = 0; i < a.n_elem; i++) {
-
72 if (!close_to(a(i), b(i))) {
-
-
-
-
-
-
-
-
91 class =
typename std::enable_if<std::is_arithmetic<T>::value>::type>
-
92 static bool close_to(T a, T b,
double tol = 1e-8)
-
-
94 return std::fabs(a - b) < tol;
-
-
-
-
108 class =
typename std::enable_if<std::is_integral<T>::value>::type>
-
109 static bool is_equal(arma::Mat<T> &a, arma::Mat<T> &b)
-
-
111 for (
size_t i = 0; i < a.n_elem; i++) {
-
112 if (!(a(i) == b(i))) {
-
-
-
-
-
-
-
-
127 class =
typename std::enable_if<std::is_arithmetic<T>::value>::type>
-
128 static bool assert_each(std::function<
bool (T)> expr, arma::Mat<T> &M)
-
-
130 for (
size_t i = 0; i < M.n_elem; i++) {
-
-
-
-
-
-
-
-
-
Function prototypes and macros that are useful.
+
+
+
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48 void m_assert (
bool expr, std::string expr_str, std::string func,
+
49 std::string file,
int line, std::string msg);
+
+
+
+
+
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
+
+
67 static bool close_to (arma::Mat<T> &a, arma::Mat<T> &b,
double tol = 1e-8)
+
+
69 if (a.n_elem != b.n_elem) {
+
+
+
+
73 for (size_t i = 0; i < a.n_elem; i++) {
+
74 if (!close_to(a(i), b(i))) {
+
+
+
+
+
+
+
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
+
+
94 static bool close_to (T a, T b,
double tol = 1e-8)
+
+
96 return std::fabs(a - b) < tol;
+
+
+
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
+
+
111 static bool is_equal (arma::Mat<T> &a, arma::Mat<T> &b)
+
+
113 for (size_t i = 0; i < a.n_elem; i++) {
+
114 if (!(a(i) == b(i))) {
+
+
+
+
+
+
+
+
122
+
123
+
124
+
125
+
126
+
127
+
+
+
130 static bool assert_each (std::function<
bool (T)> expr, arma::Mat<T> &M)
+
+
132 for (size_t i = 0; i < M.n_elem; i++) {
+
+
+
+
+
+
+
+
+
Test class for the Ising model.
+
int test_2x2_lattice(double tol, int max_cycles)
Test numerical data with analytical data.
+
void test_init_functions()
Test that initializing works as intended.
+
The Ising model in 2 dimensions.
+
int64_t E
The current energy state. unit: .
+
double T
The temperature of the model.
+
int L
Size of the lattice.
+
void initialize_lattice()
Initialize the lattice with a random distribution of 1s and -1s.
+
data_t Metropolis()
The Metropolis algorithm.
+
void initialize_energy()
Initialize the energy of the system.
+
void initialize_neighbors()
initialize the neighbors matrix.
+
void initialize_magnetization()
Initialize the magnetization of the system.
+
int64_t M
The current magnetic strength. unit: Unitless.
+
Type to use with the IsingModel class and montecarlo module.
+
double M_abs
Absolute Magnetization.
+
+
data_t & operator+=(const data_t &b)
Overload of the addition equals operator.
+
double M2
Magnetization squared.
+
+
#define EPS_2
The analytic expected energy for a lattice.
+
#define MAG_2
The analytic expected magnetization for a lattice.
+
#define X_2
The analytic susceptibility for a lattice.
+
int main()
The main function.
+
#define CV_2
The analytic heat capacity for a lattice.
+
static bool close_to(arma::Mat< T > &a, arma::Mat< T > &b, double tol=1e-8)
Test if two armadillo matrices/vectors are close to each other.
+
void m_assert(bool expr, std::string expr_str, std::string func, std::string file, int line, std::string msg)
Test an expression, confirm that test is ok, or abort execution.
+
static bool is_equal(arma::Mat< T > &a, arma::Mat< T > &b)
Test if two armadillo matrices/vectors are equal.
+
static bool close_to(T a, T b, double tol=1e-8)
Test if two numbers are close to each other.
+
#define ASSERT(expr, msg)
A prettier assertion function.
+
static bool assert_each(std::function< bool(T)> expr, arma::Mat< T > &M)
Test that all elements fulfill the condition.
+
#define __METHOD_NAME__
Get the name of the current method/function without the return type.
diff --git a/docs/time_8cpp.html b/docs/time_8cpp.html
new file mode 100644
index 0000000..809c11e
--- /dev/null
+++ b/docs/time_8cpp.html
@@ -0,0 +1,249 @@
+
+
+
+
+
+
+
+2 Dimensional Ising Model: src/time.cpp File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2 Dimensional Ising Model
+
+ Simulate the change in energy and magnetization in a ferro magnet
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+
+
+
+
+
Timing various things.
+More...
+
#include "data_type.hpp "
+
#include "monte_carlo.hpp "
+
#include "utils.hpp "
+
#include <getopt.h>
+
#include <omp.h>
+
#include <ostream>
+
+
Go to the source code of this file.
+
+
+void time_lattice_sizes ()
+ Time phase transition using different lattice sizes.
+
+void time_sample_sizes ()
+ Time phase transition using different sample sizes.
+
+void usage (std::string filename)
+ A function that displays how to use the program and quits.
+
+int main (int argc, char **argv)
+ The main function.
+
+
+
+
Timing various things.
+
Author Cory Alexander Balaton (coryab)
+
+Janita Ovidie Sandtrøen Willumsen (janitaws)
+
Version 0.1
+
Bug: No known bugs
+
+
Definition in file time.cpp .
+
+
+
◆ main()
+
+
+
+
+
+ int main
+ (
+ int
+ argc ,
+
+
+
+
+ char **
+ argv
+
+
+
+ )
+
+
+
+
+
+
The main function.
+
+
Definition at line 79 of file time.cpp .
+
+
+
+
+
◆ time_lattice_sizes()
+
+
+
+
+
+ void time_lattice_sizes
+ (
+ )
+
+
+
+
+
+
Time phase transition using different lattice sizes.
+
+
Definition at line 22 of file time.cpp .
+
+
+
+
+
◆ time_sample_sizes()
+
+
+
+
+
+ void time_sample_sizes
+ (
+ )
+
+
+
+
+
+
Time phase transition using different sample sizes.
+
+
Definition at line 45 of file time.cpp .
+
+
+
+
+
◆ usage()
+
+
+
+
+
+ void usage
+ (
+ std::string
+ filename )
+
+
+
+
+
+
A function that displays how to use the program and quits.
+
+
Definition at line 67 of file time.cpp .
+
+
+
+
+
+
+
+
+
diff --git a/docs/time_8cpp.js b/docs/time_8cpp.js
new file mode 100644
index 0000000..d8d555c
--- /dev/null
+++ b/docs/time_8cpp.js
@@ -0,0 +1,7 @@
+var time_8cpp =
+[
+ [ "main", "time_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627", null ],
+ [ "time_lattice_sizes", "time_8cpp.html#aa224066f42c47cae5fbd457c1948e4a5", null ],
+ [ "time_sample_sizes", "time_8cpp.html#ace9eb0821fe4edf19cf2e7d8ffe6efb4", null ],
+ [ "usage", "time_8cpp.html#ac907e18135856c90366aaa599a9e10b1", null ]
+];
\ No newline at end of file
diff --git a/docs/time_8cpp_source.html b/docs/time_8cpp_source.html
new file mode 100644
index 0000000..b4559b7
--- /dev/null
+++ b/docs/time_8cpp_source.html
@@ -0,0 +1,244 @@
+
+
+
+
+
+
+
+2 Dimensional Ising Model: src/time.cpp Source File
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2 Dimensional Ising Model
+
+ Simulate the change in energy and magnetization in a ferro magnet
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+
+
+
+
Go to the documentation of this file.
+
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" ;
+
+
+
+
+
79 int 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.
+
+
+
+
+
+
diff --git a/docs/typedefs_8hpp.html b/docs/typedefs_8hpp.html
index 1f2efc5..4362ecf 100644
--- a/docs/typedefs_8hpp.html
+++ b/docs/typedefs_8hpp.html
@@ -113,7 +113,7 @@ $(document).ready(function(){initNavTree('typedefs_8hpp.html',''); initResizable
Janita Ovidie Sandtrøen Willumsen (janitaws)
Version 1.0
These typedefs make the code more readable and easy to follow along.
-Bug: No known bugs
+Bug: No known bugs
Definition in file typedefs.hpp .
diff --git a/docs/utils_8cpp.html b/docs/utils_8cpp.html
index fdff28a..bde3745 100644
--- a/docs/utils_8cpp.html
+++ b/docs/utils_8cpp.html
@@ -124,6 +124,9 @@ Functions
std::string utils::dirname (const std::string &path)
Get the directory name of the path.
+std::string utils::concatpath (const std::string &left, const std::string &right)
+ Take 2 strings and concatenate them and make sure there is a directory separator (/) between them.
+
Implementation of the utils.
@@ -131,10 +134,51 @@ Functions
Janita Ovidie Sandtrøen Willumsen (janitaws)
Version 1.0
-
Bug: No known bugs
+
Bug: No known bugs
Definition in file utils.cpp .
+
+◆ concatpath()
+
+
+
+
+
+ std::string utils::concatpath
+ (
+ const std::string &
+ left ,
+
+
+
+
+ const std::string &
+ right
+
+
+
+ )
+
+
+
+
+
+
Take 2 strings and concatenate them and make sure there is a directory separator (/) between them.
+
This function doesn't care whether or not the values given as parameters are valid path strings. It is the responsibility of the user to make sure that the values given are valid path strings. The function only guarantees that the output string is a valid path string.
+
Parameters
+
+ left The left hand side of the result string
+ right The right hand side of the result string
+
+
+
+
Returns string
+
+
Definition at line 63 of file utils.cpp .
+
+
+
◆ dirname()
diff --git a/docs/utils_8cpp.js b/docs/utils_8cpp.js
index edb7fe6..8450d12 100644
--- a/docs/utils_8cpp.js
+++ b/docs/utils_8cpp.js
@@ -1,5 +1,6 @@
var utils_8cpp =
[
+ [ "concatpath", "utils_8cpp.html#ae91fad89394d745d544737e43524bde6", null ],
[ "dirname", "utils_8cpp.html#aed026119193a9bbe076671809ff0f430", null ],
[ "mkpath", "utils_8cpp.html#a2b45adc86b70f42021582994e83fa00d", null ],
[ "scientific_format", "utils_8cpp.html#ab3e89176433ddc9ba721b2eba3d08357", null ],
diff --git a/docs/utils_8cpp_source.html b/docs/utils_8cpp_source.html
index ab3a676..74ed3fb 100644
--- a/docs/utils_8cpp_source.html
+++ b/docs/utils_8cpp_source.html
@@ -101,10 +101,20 @@ $(document).ready(function(){initNavTree('utils_8cpp_source.html',''); initResiz
-
Go to the documentation of this file.
-
+
Go to the documentation of this file.
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
-
+
@@ -113,11 +123,11 @@ $(document).ready(function(){initNavTree('utils_8cpp_source.html',''); initResiz
-
+
26 for (
double elem : v) {
-
+
27 ss << scientific_format(elem, width, prec);
@@ -126,14 +136,14 @@ $(document).ready(function(){initNavTree('utils_8cpp_source.html',''); initResiz
35 std::string::size_type pos = -1;
-
+
-
38 if (path.back() !=
'/' ) {
-
+
38 if (path.back() !=
'/' ) {
+
-
43 pos = path.find(
'/' , pos);
+
43 pos = path.find(
'/' , pos);
44 if (pos != std::string::npos) {
45 cur_dir = path.substr(0, pos);
46 if (mkdir(cur_dir.c_str(), mode) != 0
@@ -153,10 +163,21 @@ $(document).ready(function(){initNavTree('utils_8cpp_source.html',''); initResiz
60 return path.substr(0, path.find_last_of(
"/" ));
-
-
Function prototypes and macros that are useful.
+
63 std::string
concatpath (
const std::string &left,
const std::string &right)
+
+
65 if (left.back() !=
'/' and right.front() !=
'/' ) {
+
66 return left +
'/' + right;
+
+
+
+
+
+
+
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 scientific_format(const std::vector< double > &v, int width=20, int prec=10)
Turns a vector of doubles into a string written in scientific format.
+
std::string concatpath(const std::string &left, const std::string &right)
Take 2 strings and concatenate them and make sure there is a directory separator (/) between them.
std::string dirname(const std::string &path)
Get the directory name of the path.
diff --git a/docs/utils_8hpp.html b/docs/utils_8hpp.html
index 44140c6..ee2413b 100644
--- a/docs/utils_8hpp.html
+++ b/docs/utils_8hpp.html
@@ -142,6 +142,9 @@ Functions
std::string utils::dirname (const std::string &path)
Get the directory name of the path.
+std::string utils::concatpath (const std::string &left, const std::string &right)
+ Take 2 strings and concatenate them and make sure there is a directory separator (/) between them.
+
Function prototypes and macros that are useful.
@@ -196,6 +199,47 @@ Janita Ovidie Sandtrøen Willumsen (janitaws)
+
+◆ concatpath()
+
+
+
+
+
+ std::string utils::concatpath
+ (
+ const std::string &
+ left ,
+
+
+
+
+ const std::string &
+ right
+
+
+
+ )
+
+
+
+
+
+
Take 2 strings and concatenate them and make sure there is a directory separator (/) between them.
+
This function doesn't care whether or not the values given as parameters are valid path strings. It is the responsibility of the user to make sure that the values given are valid path strings. The function only guarantees that the output string is a valid path string.
+
Parameters
+
+ left The left hand side of the result string
+ right The right hand side of the result string
+
+
+
+
Returns string
+
+
Definition at line 63 of file utils.cpp .
+
+
+
◆ dirname()
diff --git a/docs/utils_8hpp.js b/docs/utils_8hpp.js
index 9c9e4b4..e68e7de 100644
--- a/docs/utils_8hpp.js
+++ b/docs/utils_8hpp.js
@@ -2,6 +2,7 @@ var utils_8hpp =
[
[ "__METHOD_NAME__", "utils_8hpp.html#a60dca3177fb9cb5256609adc7af55168", null ],
[ "DEBUG", "utils_8hpp.html#aecc1f7a8a2493b9e021e5bff76a00a5b", null ],
+ [ "concatpath", "utils_8hpp.html#ae91fad89394d745d544737e43524bde6", null ],
[ "dirname", "utils_8hpp.html#aed026119193a9bbe076671809ff0f430", null ],
[ "methodName", "utils_8hpp.html#a178c4922157666a6e9c127c2ffd96346", null ],
[ "mkpath", "utils_8hpp.html#a2b45adc86b70f42021582994e83fa00d", null ],
diff --git a/docs/utils_8hpp_source.html b/docs/utils_8hpp_source.html
index 2d2a1bd..84ff5bc 100644
--- a/docs/utils_8hpp_source.html
+++ b/docs/utils_8hpp_source.html
@@ -101,55 +101,173 @@ $(document).ready(function(){initNavTree('utils_8hpp_source.html',''); initResiz
-
Go to the documentation of this file.
-
-
+
Go to the documentation of this file.
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
37 std::cout << __FILE__ << " " << __LINE__ << ": " << msg << std::endl
-
-
-
+
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
+
+
37 std :: cout << __FILE__ << " " << __LINE__ << ": " << msg << std :: endl
+
+
+
-
45 #define __METHOD_NAME__ details::methodName(__PRETTY_FUNCTION__)
+
+
43
+
44
+
45 # define __METHOD_NAME__ details :: methodName ( __PRETTY_FUNCTION__ )
-
+
+
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
58 inline std::string
methodName (
const std::string &pretty_function)
-
60 size_t colons = pretty_function.find(
"::" );
-
61 size_t begin = pretty_function.substr(0, colons).rfind(
" " ) + 1;
-
62 size_t end = pretty_function.rfind(
"(" ) - begin;
+
60 size_t colons = pretty_function.find(
"::" );
+
61 size_t begin = pretty_function.substr(0, colons).rfind(
" " ) + 1;
+
62 size_t end = pretty_function.rfind(
"(" ) - begin;
64 return pretty_function.substr(begin, end) +
"()" ;
-
+
+
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
-
+
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
+
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
107 bool mkpath (std::string path,
int mode = 0777);
+
+
110
+
111
+
112
+
113
+
114
115 std::string
dirname (
const std::string &path);
-
-
-
+
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130 std::string
concatpath (
const std::string &left,
const std::string &right);
+
+
+
+
+
#define UP
Used for the neighbor matrix in the class.
+
#define INDEX(I, N)
I modulo N.
+
#define DOWN
Used for the neighbor matrix in the class.
+
#define LEFT
Used for the neighbor matrix in the class.
+
#define RIGHT
Used for the neighbor matrix in the class.
+
Test class for the Ising model.
+
The Ising model in 2 dimensions.
+
std::mt19937 engine
The RNG that is used for the Metropolis algorithm.
+
int64_t E
The current energy state. unit: .
+
double T
The temperature of the model.
+
int L
Size of the lattice.
+
arma::Mat< int > lattice
matrix where element .
+
void initialize_lattice()
Initialize the lattice with a random distribution of 1s and -1s.
+
IsingModel(int L, double T, int val)
Constructor for the Ising model.
+
IsingModel(int L, double T)
Constructor for the Ising model.
+
data_t Metropolis()
The Metropolis algorithm.
+
void initialize_energy()
Initialize the energy of the system.
+
void initialize_neighbors()
initialize the neighbors matrix.
+
double energy_diff[17]
An array containing all possible energy differences.
+
void initialize_magnetization()
Initialize the magnetization of the system.
+
arma::Mat< int > neighbors
matrix with the neighbors of each element .
+
void initialize_engine()
Initialize the RNG.
+
void initialize_lattice(int val)
Initialize the lattice with a specific value.
+
IsingModel()
Constructor used for testing.
+
int64_t M
The current magnetic strength. unit: Unitless.
+
void initialize_energy_diff()
Initialize the energy_diff array with the correct values.
+
Type to use with the IsingModel class and montecarlo module.
+
data_t(double E, double E2, double M, double M2, double M_abs)
Constructor with parameters.
std::string methodName(const std::string &pretty_function)
Takes in the PRETTY_FUNCTION string and removes the return type.
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 scientific_format(const std::vector< double > &v, int width=20, int prec=10)
Turns a vector of doubles into a string written in scientific format.
+
std::string concatpath(const std::string &left, const std::string &right)
Take 2 strings and concatenate them and make sure there is a directory separator (/) between them.
std::string dirname(const std::string &path)
Get the directory name of the path.