summaryrefslogtreecommitdiff
path: root/lib/correlation.h
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2018-07-26 16:55:17 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2018-07-26 16:55:17 -0400
commit5f1eb9a12821e7462b7b2853e0d95c8c863bf900 (patch)
tree6aa091a95846923e253a83886c5da2a8a62d5e93 /lib/correlation.h
parent1160baa61bad605cf8a1d583e8ae356a54a942df (diff)
downloadc++-5f1eb9a12821e7462b7b2853e0d95c8c863bf900.tar.gz
c++-5f1eb9a12821e7462b7b2853e0d95c8c863bf900.tar.bz2
c++-5f1eb9a12821e7462b7b2853e0d95c8c863bf900.zip
now using const passing of object reference instead of pointers
Diffstat (limited to 'lib/correlation.h')
-rw-r--r--lib/correlation.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/correlation.h b/lib/correlation.h
index 49c6ff2..23b1bd9 100644
--- a/lib/correlation.h
+++ b/lib/correlation.h
@@ -7,13 +7,13 @@
#include <fftw3.h>
template <class R_t, class X_t>
-double correlation_length(const state_t <R_t, X_t> *s) {
+double correlation_length(const state_t <R_t, X_t>& s) {
double total = 0;
- for (D_t j = 0; j < s->D; j++) {
- total += norm_squared(s->ReF[j]) + norm_squared(s->ReF[j]);
+ for (D_t j = 0; j < s.D; j++) {
+ total += norm_squared(s.ReF[j]) + norm_squared(s.ReF[j]);
}
- return total / s->D;
+ return total / s.D;
}