summaryrefslogtreecommitdiff
path: root/vector.hpp
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2020-02-25 19:40:35 -0500
committerJaron Kent-Dobias <jaron@kent-dobias.com>2020-02-25 19:40:35 -0500
commita1c5f64f3c8c9812cb0b4658630f79dab1856c0c (patch)
treefe81af9d35febe7287a63fc9288ecd44ac24a401 /vector.hpp
parentb96c82a1c1d95cfa090c4c99e4b4851a5c96e202 (diff)
downloadspace_wolff-a1c5f64f3c8c9812cb0b4658630f79dab1856c0c.tar.gz
space_wolff-a1c5f64f3c8c9812cb0b4658630f79dab1856c0c.tar.bz2
space_wolff-a1c5f64f3c8c9812cb0b4658630f79dab1856c0c.zip
Fance inheritance
Diffstat (limited to 'vector.hpp')
-rw-r--r--vector.hpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/vector.hpp b/vector.hpp
index 2e87acd..f642816 100644
--- a/vector.hpp
+++ b/vector.hpp
@@ -1,6 +1,7 @@
#pragma once
+#include "mod.hpp"
#include <eigen3/Eigen/Dense>
template <class T, int D> using Vector = Eigen::Matrix<T, D, 1>;
@@ -9,7 +10,7 @@ template <class T, int D> Vector<T, D> diff(T L, Vector<T, D> v1, Vector<T, D> v
Vector<T, D> v;
for (unsigned i = 0; i < D; i++) {
- v(i) = std::abs(v1(i) - v2(i));
+ v(i) = std::abs(mod(v1(i), L) - mod(v2(i), L));
if (v(i) > L / 2) {
v(i) = L - v(i);
}