Merge pull request #3773 from RosettaCommons/vmullig/debug_mode_mathvector_overruns
Correct bounds-checking on MathVectors
MathVectors are zero-based, not one-based, but the bounds checking on the class assumes that indices 0 through (size) are valid. This corrects that.
This turns out to be exactly what was wrong with my PolycubicSpline unit tests, too. This pull request corrects the indexing in the MathVector that I use in that test, so that I don't write past the end of an array.
Finally, the bounds check was being performed in release and debug modes. This adds an #ifdef to ensure that the bounds check only happens in debug mode, for speed.