summaryrefslogtreecommitdiff
path: root/langevin.cpp
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2021-01-05 11:20:03 +0100
committerJaron Kent-Dobias <jaron@kent-dobias.com>2021-01-05 11:20:03 +0100
commitc0cbb233d16306fec19c7c4325d61ae4b1248c1c (patch)
treebce665ba5c4e43336adf44b9f36361c212049557 /langevin.cpp
parent40499ac858485c63b64b0ecaa892b10b62dbe8a7 (diff)
downloadcode-c0cbb233d16306fec19c7c4325d61ae4b1248c1c.tar.gz
code-c0cbb233d16306fec19c7c4325d61ae4b1248c1c.tar.bz2
code-c0cbb233d16306fec19c7c4325d61ae4b1248c1c.zip
Ran clang-format.
Diffstat (limited to 'langevin.cpp')
-rw-r--r--langevin.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/langevin.cpp b/langevin.cpp
index dcf8c68..d704266 100644
--- a/langevin.cpp
+++ b/langevin.cpp
@@ -1,8 +1,8 @@
-#include <getopt.h>
-#include <cstdlib>
-#include <random>
#include <complex>
+#include <cstdlib>
#include <functional>
+#include <getopt.h>
+#include <random>
#include <eigen3/Eigen/Core>
#include <eigen3/unsupported/Eigen/CXX11/Tensor>
@@ -60,7 +60,8 @@ std::tuple<double, Vector> WdW(const Tensor& J, const Vector& z) {
return {W, dW};
}
-Vector langevin(const Tensor& J, const Vector& z0, double T, double γ0, std::function<bool(double, unsigned)> quit, Rng& r) {
+Vector langevin(const Tensor& J, const Vector& z0, double T, double γ0,
+ std::function<bool(double, unsigned)> quit, Rng& r) {
Vector z = z0;
double W;
@@ -97,13 +98,13 @@ Vector langevin(const Tensor& J, const Vector& z0, double T, double γ0, std::fu
int main(int argc, char* argv[]) {
// model parameters
unsigned N = 10; // number of spins
- double T = 1; // temperature
- double Rκ = 1; // real part of distribution parameter
- double Iκ = 0; // imaginary part of distribution parameter
+ double T = 1; // temperature
+ double Rκ = 1; // real part of distribution parameter
+ double Iκ = 0; // imaginary part of distribution parameter
// simulation parameters
- double δ = 1e-2; // threshold for determining saddle
- double γ = 1e-2; // step size
+ double δ = 1e-2; // threshold for determining saddle
+ double γ = 1e-2; // step size
unsigned t = 1000; // number of Langevin steps
int opt;