bugfix for temporary falling out of scope in poisson_ccdf_log #3203
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
I'm still investigating this as it only happens on my work desktop and not my mac.
An error shows up on my linux desktop for several tests
I tracked it down to this line in poisson_ccdf
Removing the
to_ref_if
there causes the tests to pass. I need to make an MIR showing the effect here, but I'm pretty sure thatn_val + 1.0
is falling out of scope after we build up all of our expressions. theto_ref_if
's template parameter evaluates tofalse
here so it is returning back an expression on the right hand side. But once the expression is maden_val + 1.0
falls out of scope and so we get a wrong answer.@t4c1 if you are around to have a look at this it would be great.
Tests
Side Effects
Are there any side effects that we should be aware of?
Release notes
Replace this text with a short note on what will change if this pull request is merged in which case this will be included in the release notes.
Checklist
Copyright holder: Steve Bronder
The copyright holder is typically you or your assignee, such as a university or company. By submitting this pull request, the copyright holder is agreeing to the license the submitted work under the following licenses:
- Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)
- Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
the basic tests are passing
./runTests.py test/unit
)make test-headers
)make test-math-dependencies
)make doxygen
)make cpplint
)the code is written in idiomatic C++ and changes are documented in the doxygen
the new changes are tested