Skip to content
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

Clang tidy cleanup and using std algorithms #1373

Closed
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
copy-pasted an accumulate without changing the variable names from on…
…e file to another
  • Loading branch information
SteveBronder committed Sep 30, 2019
commit 2407b7a226722484f52f9653b306dc631007d83b
7 changes: 3 additions & 4 deletions stan/math/rev/arr/fun/sum.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ class sum_v_vari : public vari {
size_t length_;

inline static double sum_of_val(const std::vector<var>& v) {
double result = std::accumulate(
x.begin(), x.end(), 0.0,
[](auto& acc, auto&& x_i) { return acc + x_i.val(); });
return result;
return std::accumulate(
v.begin(), v.end(), 0.0,
[](auto& acc, auto&& v_i) { return acc + v_i.val(); });
}

public:
Expand Down