diff options
author | ancarola <raffaele.ancarola@epfl.ch> | 2019-06-28 22:25:12 +0200 |
---|---|---|
committer | ancarola <raffaele.ancarola@epfl.ch> | 2019-06-28 22:25:12 +0200 |
commit | de6e0465e709a6951d5683956c7adf00749a58ad (patch) | |
tree | eb80564cbca42e9c46edbe57ab787a5495e8f47d | |
parent | Iterators compacting code improvements, still not compiles (diff) | |
download | libmm-de6e0465e709a6951d5683956c7adf00749a58ad.tar.gz libmm-de6e0465e709a6951d5683956c7adf00749a58ad.zip |
Small correction on interators
-rw-r--r-- | include/mm/mmmatrix.hpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/mm/mmmatrix.hpp b/include/mm/mmmatrix.hpp index d366df2..7834a3e 100644 --- a/include/mm/mmmatrix.hpp +++ b/include/mm/mmmatrix.hpp @@ -574,7 +574,7 @@ T& mm::vector_iterator<T, Rows, Cols, IterType, Grid>::operator*() const else if constexpr (IterType == MM_COL_ITER) return M.data[index * Cols + position]; else if constexpr (IterType == MM_DIAG_ITER) - return (k > 0) ? + return (position > 0) ? M.data[(index + position) * Cols + index] : M.data[index * Cols + (index - position)]; } @@ -587,7 +587,7 @@ T& mm::vector_iterator<T, Rows, Cols, IterType, Grid>::operator[](std::size_t i) else if constexpr (IterType == MM_COL_ITER) return M.data[i * Cols + position]; else if constexpr (IterType == MM_DIAG_ITER) - return (k > 0) ? + return (position > 0) ? M.data[(i + position) * Cols + i] : M.data[i * Cols + (i - position)]; } |