You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Length 0 checks should come after checking for mismatched sizes #336
I'd also rather remove all those redundant spaces. I also
prefer tighter negations for less nesting and to make it clear
that if any of the lengths is zero, the result should be zero.
So I'd write that as:
if (!length(y) || !length(mu) || !length(sigma)) return 0;
And that test should go after the mismatched size tests, which
would indicate a bug, right?
Activity
bob-carpenter commentedon Aug 18, 2016
I also think these are clearer as
because the nesting is less deep and it's clearer that if any of them are length zero, we return
0(don't need that0.0).We should also make sure not to allocate a variable if we're going to just return constant 0 because it can cause autodiff overhead.
syclik commentedon Nov 28, 2016
This is easy, but it'll need to wait until #320 is finished or else we'll end up with lots of merge conflicts.
rok-cesnovar commentedon May 7, 2019
Closed via #1207