summaryrefslogtreecommitdiff
path: root/examples/ising_no_field.cpp
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2019-01-14 15:47:59 -0500
committerJaron Kent-Dobias <jaron@kent-dobias.com>2019-01-14 15:47:59 -0500
commit49ac78a6c04e215950bc9c0f97368605e63da15b (patch)
tree64b770c543a0c90bc7dcbc06ceaaa31e96e541ce /examples/ising_no_field.cpp
parent994cbf1a3b611ff4c94ced3b1630e51fd249d7ed (diff)
downloadc++-49ac78a6c04e215950bc9c0f97368605e63da15b.tar.gz
c++-49ac78a6c04e215950bc9c0f97368605e63da15b.tar.bz2
c++-49ac78a6c04e215950bc9c0f97368605e63da15b.zip
Large refactoring around changes in the graph class.
- Graphs now use lists of references instead of vectors of indicies. - Vertices and edges have associated classes that can be given arbitrary properties via template specification. - All essential library headers have been combined into one, wolff.hpp.
Diffstat (limited to 'examples/ising_no_field.cpp')
-rw-r--r--examples/ising_no_field.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/examples/ising_no_field.cpp b/examples/ising_no_field.cpp
index 28d7c70..0a5b722 100644
--- a/examples/ising_no_field.cpp
+++ b/examples/ising_no_field.cpp
@@ -5,22 +5,18 @@
#define WOLFF_NO_FIELD
#define WOLFF_USE_FINITE_STATES
-
-#include <wolff/models/ising.hpp>
-
-#include <wolff.hpp>
+#include <wolff_models/ising.hpp>
#include "simple_measurement.hpp"
-
using namespace wolff;
int main(int argc, char *argv[]) {
// set defaults
- N_t N = (N_t)1e4;
- D_t D = 2;
- L_t L = 128;
+ unsigned N = (unsigned)1e4;
+ unsigned D = 2;
+ unsigned L = 128;
double T = 2.26918531421;
int opt;
@@ -29,7 +25,7 @@ int main(int argc, char *argv[]) {
while ((opt = getopt(argc, argv, "N:D:L:T:")) != -1) {
switch (opt) {
case 'N': // number of steps
- N = (N_t)atof(optarg);
+ N = (unsigned)atof(optarg);
break;
case 'D': // dimension
D = atoi(optarg);
@@ -51,17 +47,17 @@ int main(int argc, char *argv[]) {
};
// initialize the lattice
- graph G(D, L);
+ graph<> G(D, L);
// initialize the system
- system<ising_t, ising_t> S(G, T, Z);
+ system<ising_t, ising_t, graph<>> S(G, T, Z);
// initialize the random number generator
auto seed = std::chrono::high_resolution_clock::now().time_since_epoch().count();
std::mt19937 rng{seed};
// define function that generates self-inverse rotations
- std::function <ising_t(std::mt19937&, const system<ising_t, ising_t>&, v_t)> gen_r = gen_ising;
+ std::function <ising_t(std::mt19937&, const system<ising_t, ising_t, graph<>>&, const graph<>::vertex&)> gen_r = gen_ising<graph<>>;
// initailze the measurement object
simple_measurement A(S);