summaryrefslogtreecommitdiff
path: root/lib/correlation.h
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2018-07-30 06:32:51 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2018-07-30 06:32:51 -0400
commitfc242f52e835be85cc6030b6cae5619d18df7670 (patch)
treeeff9095238fbc9de89702b69863fca1f7bdcc29d /lib/correlation.h
parent3223b527890e3090184384374f45a964cffa254a (diff)
downloadc++-fc242f52e835be85cc6030b6cae5619d18df7670.tar.gz
c++-fc242f52e835be85cc6030b6cae5619d18df7670.tar.bz2
c++-fc242f52e835be85cc6030b6cae5619d18df7670.zip
various changes
Diffstat (limited to 'lib/correlation.h')
-rw-r--r--lib/correlation.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/correlation.h b/lib/correlation.h
index d08f713..29357a5 100644
--- a/lib/correlation.h
+++ b/lib/correlation.h
@@ -10,7 +10,11 @@ template <class R_t, class X_t>
double correlation_length(const state_t <R_t, X_t>& s) {
double total = 0;
+#ifdef DIMENSION
+ for (D_t j = 0; j < DIMENSION; j++) {
+#else
for (D_t j = 0; j < s.D; j++) {
+#endif
total += norm_squared(s.ReF[j]) + norm_squared(s.ImF[j]);
}