summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2018-07-01 00:52:31 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2018-07-01 00:52:31 -0400
commit90ae915b5a7961a36e6a33509b16229244c6615a (patch)
tree16c6642868b9bb998864918ba2d86fefc648dc91 /src
parent78d8de381f0b1e99ad98364709cbf876689628b2 (diff)
downloadc++-90ae915b5a7961a36e6a33509b16229244c6615a.tar.gz
c++-90ae915b5a7961a36e6a33509b16229244c6615a.tar.bz2
c++-90ae915b5a7961a36e6a33509b16229244c6615a.zip
fixed both the system for determining bond energy and how global state is tracked
Diffstat (limited to 'src')
-rw-r--r--src/wolff_finite.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/wolff_finite.c b/src/wolff_finite.c
index e41c326..4bf96b9 100644
--- a/src/wolff_finite.c
+++ b/src/wolff_finite.c
@@ -96,7 +96,7 @@ int main(int argc, char *argv[]) {
char *filename_S = (char *)malloc(256 * sizeof(char));
sprintf(filename_M, "wolff_%s_%" PRIq "_%" PRID "_%" PRIL "_%.8f", finite_model_t_strings[model], q, D, L, T);
- for (q_t i = 0; i < q; i++) {
+ for (q_t i = 0; i < s->q; i++) {
sprintf(filename_M + strlen(filename_M), "_%.8f", s->H[i]);
}
@@ -126,8 +126,8 @@ int main(int argc, char *argv[]) {
bool changed = false;
while (!changed) {
- step = gsl_rng_uniform_int(r, s->n_transformations);
- if (symmetric_act(s->transformations + q * step, s->spins[v0]) != s->spins[v0]) {
+ step = gsl_rng_uniform_int(r, s->n_involutions);
+ if (symmetric_act(s->transformations + s->q * s->involutions[step], s->spins[v0]) != s->spins[v0]) {
changed = true;
}
}
@@ -138,9 +138,9 @@ int main(int argc, char *argv[]) {
// as a fast time many machines will actually have it be 64 bits. we cast
// it down here to halve space.
- for (q_t i = 0; i < q - 1; i++) {
- fwrite(&(s->M[i]), sizeof(uint32_t), 1, outfile_M); // if we know the occupation of the first q - 1 states, we know the occupation of the last
- fwrite(&(s->B[i]), sizeof(uint32_t), 1, outfile_B); // if we know the occupation of the first q - 1 states, we know the occupation of the last
+ for (q_t i = 0; i < s->q - 1; i++) { // if we know the occupation of the first q - 1 states, we know the occupation of the last
+ fwrite(&(s->M[i]), sizeof(uint32_t), 1, outfile_M);
+ fwrite(&(s->B[i]), sizeof(uint32_t), 1, outfile_B);
}
fwrite(&cluster_size, sizeof(uint32_t), 1, outfile_S);