diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2018-05-08 17:31:10 -0400 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2018-05-08 17:31:10 -0400 |
commit | ec96a308e11c4195fd278913acba3b675372cdb5 (patch) | |
tree | 18ae0add313688de99fa7f2ba2ee32e5a8bd69e1 /src | |
parent | 136620008502ce5c43999203a6915c26cde81ffd (diff) | |
parent | 0ad14f44b3f2ef37765ed5b454de526b19d3ff4b (diff) | |
download | c++-ec96a308e11c4195fd278913acba3b675372cdb5.tar.gz c++-ec96a308e11c4195fd278913acba3b675372cdb5.tar.bz2 c++-ec96a308e11c4195fd278913acba3b675372cdb5.zip |
Merge branch 'tmp'
Diffstat (limited to 'src')
-rw-r--r-- | src/wolff_vector.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/wolff_vector.c b/src/wolff_vector.c index da93a15..c5ebcb5 100644 --- a/src/wolff_vector.c +++ b/src/wolff_vector.c @@ -36,13 +36,13 @@ double modulated(q_t n, double *H_info, double *x) { } double cubic(q_t n, double *H_info, double *x) { - double tmp = 0; + double v_sum = 0; for (q_t i = 0; i < n; i++) { - tmp += pow(x[i], 4); + v_sum += pow(x[i], 4); } - return - H_info[0] * tmp; + return - H_info[0] * v_sum; } double quadratic(q_t n, double *H_info, double *x) { @@ -181,8 +181,9 @@ int main(int argc, char *argv[]) { } s->M = (double *)calloc(q, sizeof(double)); - s->M[0] = 1.0 * (double)h->nv; - s->E = - ((double)h->ne) * s->J(1.0) - s->H(s->n, s->H_info, s->M); + s->M[0] = 1.0; + s->E = - ((double)h->ne) * s->J(1.0) - (double)h->nv * s->H(s->n, s->H_info, s->M); + s->M[0] *= (double)h->nv; double diff = 1e31; count_t n_runs = 0; |