diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2020-02-25 19:40:35 -0500 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2020-02-25 19:40:35 -0500 |
commit | a1c5f64f3c8c9812cb0b4658630f79dab1856c0c (patch) | |
tree | fe81af9d35febe7287a63fc9288ecd44ac24a401 /vector.hpp | |
parent | b96c82a1c1d95cfa090c4c99e4b4851a5c96e202 (diff) | |
download | space_wolff-a1c5f64f3c8c9812cb0b4658630f79dab1856c0c.tar.gz space_wolff-a1c5f64f3c8c9812cb0b4658630f79dab1856c0c.tar.bz2 space_wolff-a1c5f64f3c8c9812cb0b4658630f79dab1856c0c.zip |
Fance inheritance
Diffstat (limited to 'vector.hpp')
-rw-r--r-- | vector.hpp | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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); } |