diff options
Diffstat (limited to 'src/generic/matrix.hpp')
-rw-r--r-- | src/generic/matrix.hpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/generic/matrix.hpp b/src/generic/matrix.hpp index 3530ba7..b337249 100644 --- a/src/generic/matrix.hpp +++ b/src/generic/matrix.hpp @@ -3,6 +3,8 @@ # include "../sanity.hpp" +# include <cassert> + # include "../compat/memory.hpp" template<class T> @@ -34,10 +36,14 @@ public: T& ref(size_t x, size_t y) { + assert (x < _xs); + assert (y < _ys); return _data[x + y * _xs]; } const T& ref(size_t x, size_t y) const { + assert (x < _xs); + assert (y < _ys); return _data[x + y * _xs]; } |