-
-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update integrate_1d to use variadic autodiff stuff internally in preparation for closures #2397
Merged
Merged
Changes from 22 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
6e0f680
Saving work
bbbales2 340e62c
integrate_1d_new working (variadic integrate_1d) (Issue #2110)
bbbales2 767ebb6
Merge remote-tracking branch 'origin/develop' into feature/variadic-i…
bbbales2 f84f7eb
Bit of cleanup and added adapter file (Issue #2197)
bbbales2 5019637
Renamed tests (Issue #2197)
bbbales2 403987f
Turned on reverse mode tests (Issue #2197)
bbbales2 7f53b90
Merge remote-tracking branch 'origin/develop' into feature/variadic-i…
bbbales2 132cd2c
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot 59d1099
Switch binds to lambdas
bbbales2 989cb49
Merge commit 'a426eea0ec9d9a7547061bc776a08e509d3406f3' into HEAD
yashikno a6cebfc
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot abaa602
use double nested reverse pass to save making N tuple copies
SteveBronder 82624e8
Update stan/math/rev/functor/integrate_1d.hpp
bbbales2 3469fa1
Update stan/math/prim/functor/integrate_1d.hpp
bbbales2 eaaeeb2
Updated docs
bbbales2 95b4032
Update stan/math/rev/functor/integrate_1d.hpp
bbbales2 485e089
Merge branch 'feature/variadic-integrate-1d' of github.com:stan-dev/m…
bbbales2 c4540c5
Reordered if
bbbales2 e4eb66f
Merge remote-tracking branch 'origin/review/variadic-integrate-1d' in…
bbbales2 aba98b6
Put error checks into functions
bbbales2 231b0e9
Merge commit 'f390d823261266c2a0999eeaedcd5ac216f857b3' into HEAD
yashikno 77164cc
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot 4e882f2
small cleanups and use get the adjoint in each integration by a looku…
SteveBronder a2e8e57
Merge remote-tracking branch 'origin/develop' into feature/variadic-i…
bbbales2 36847d9
Merge remote-tracking branch 'origin/review/integrate-1d-variadic-2' …
bbbales2 cd1b0cb
Use varis to get nth gradient
bbbales2 9360084
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot 49ba955
remove changes to math::get() now that we don't need it in integrate1d
SteveBronder File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#ifndef STAN_MATH_PRIM_FUNCTOR_INTEGRATE_1D_ADAPTER_HPP | ||
#define STAN_MATH_PRIM_FUNCTOR_INTEGRATE_1D_ADAPTER_HPP | ||
|
||
#include <ostream> | ||
#include <vector> | ||
|
||
/** | ||
* Adapt the non-variadic integrate_1d arguments to the variadic | ||
* integrate_1d_impl interface | ||
* | ||
* @tparam F type of function to adapt | ||
*/ | ||
template <typename F> | ||
struct integrate_1d_adapter { | ||
const F& f_; | ||
|
||
explicit integrate_1d_adapter(const F& f) : f_(f) {} | ||
|
||
template <typename T_a, typename T_b, typename T_theta> | ||
auto operator()(const T_a& x, const T_b& xc, std::ostream* msgs, | ||
const std::vector<T_theta>& theta, | ||
const std::vector<double>& x_r, | ||
const std::vector<int>& x_i) const { | ||
return f_(x, xc, theta, x_r, x_i, msgs); | ||
} | ||
}; | ||
|
||
#endif |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[optional] We can do this some other time but it would be nice to make the errors in the
if (used_two_integrals)
into a function that's just called in the places we use two integralsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I split these into lambda functions. That look better or is used_two_integrals clearer?