On 1/17/12 1:55 AM, Ben Goodrich wrote:
>
> y[i] // checks to make sure i is not outside range
> y(i) // checks range unless NDEBUG is defined
> y(i,j) // checks range unless NDEBUG is defined
> Our makefile passes -DNDEBUG, but you can take that out temporarily to
> check whether a new function has range errors. And we should probably
> have Jenkins not pass -DNDEBUG ever.
I agree.
Maybe we could even do a strict check
that both work.
> But the big problem is that there are a ton of instances in stan's C++
> files that use the bracket notation, meaning that we waste wall time
> range checking every little thing. I grepped 547 instances, but some
> of those are false positives. We probably should fix all of them.
I agree here, too.
Probably most of those are false positives. I don't
do much manipulation of Eigen matrices outside of
I/O and the promotion to auto-dif, but then again,
I'll probably be surprised.
We'll still need to check std::vector ranges for arrays.
- Bob