diff options
-rw-r--r-- | Carpet/CarpetLib/src/vect.hh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Carpet/CarpetLib/src/vect.hh b/Carpet/CarpetLib/src/vect.hh index 3c4232525..56898d970 100644 --- a/Carpet/CarpetLib/src/vect.hh +++ b/Carpet/CarpetLib/src/vect.hh @@ -442,7 +442,9 @@ inline T index (const vect<T,D>& lsh, const vect<T,D>& ind) { T r(0); for (int d=D-1; d>=0; --d) { assert (lsh[d]>=0); - assert (ind[d]>=0 and ind[d]<lsh[d]); + // Be generous, and allow relative indices which may be negtive + // assert (ind[d]>=0 and ind[d]<lsh[d]); + assert (abs(ind[d])<=lsh[d]); r = r * lsh[d] + ind[d]; } return r; |