diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2018-10-10 21:45:32 -0400 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2018-10-10 21:45:32 -0400 |
commit | a43ff1f98e9b9814f858bccb11c174b418458491 (patch) | |
tree | ae7e094d914eddb8a1ae9548420ba8c2f329ffae /lib/finite_states.h | |
parent | 6e264d243f0b29d90e90b605b6cdeab8227129c9 (diff) | |
download | c++-a43ff1f98e9b9814f858bccb11c174b418458491.tar.gz c++-a43ff1f98e9b9814f858bccb11c174b418458491.tar.bz2 c++-a43ff1f98e9b9814f858bccb11c174b418458491.zip |
big rearrangement of files to make libraries and example (research) files clearer, and changed to c++ std lib random numbers
Diffstat (limited to 'lib/finite_states.h')
-rw-r--r-- | lib/finite_states.h | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/lib/finite_states.h b/lib/finite_states.h deleted file mode 100644 index 426edad..0000000 --- a/lib/finite_states.h +++ /dev/null @@ -1,40 +0,0 @@ - -#pragma once - -#include <cmath> -#include <functional> -#include <array> - -#define FINITE_STATES - -// must have N_STATES, states[N_STATES], and state_to_ind defined before -// invoking header - -std::array<std::array<std::array<double, N_STATES>, N_STATES>, N_STATES> J_probs; -#ifndef NOFIELD -std::array<std::array<double, N_STATES>, N_STATES> H_probs; -#endif - -template <class X_t> -#ifndef NOFIELD -void initialize_probs(std::function <double(X_t, X_t)> J, std::function <double(X_t)> H, double T) { - for (q_t i = 0; i < N_STATES; i++) { - for (q_t j = 0; j < N_STATES; j++) { - H_probs[i][j] = 1.0 - exp(-(H(states[i]) - H(states[j])) / T); - } - } -#else -void initialize_probs(std::function <double(X_t, X_t)> J, double T) { -#endif - for (q_t i = 0; i < N_STATES; i++) { - for (q_t j = 0; j < N_STATES; j++) { - for (q_t k = 0; k < N_STATES; k++) { - J_probs[i][j][k] = 1.0 - exp(-(J(states[i], states[k]) - J(states[j], states[k])) / T); - } - } - } -} - - - - |