Skip to content

Commit f2c7505

Browse files
committed
[Jenkins] auto-formatting by clang-format version 6.0.0
1 parent 3f1f5a8 commit f2c7505

4 files changed

Lines changed: 15 additions & 18 deletions

File tree

stan/math/fwd/functor/reduce_sum.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ struct reduce_sum_impl {
7373
}
7474

7575
if (auto_partitioning) {
76-
return ReduceFunction()(std::forward<Vec>(vmapped),
77-
0, vmapped.size() - 1,
76+
return ReduceFunction()(std::forward<Vec>(vmapped), 0, vmapped.size() - 1,
7877
msgs, std::forward<Args>(args)...);
7978
} else {
8079
return_type_t<Vec, Args...> sum = 0.0;
@@ -89,8 +88,8 @@ struct reduce_sum_impl {
8988
sub_slice.emplace_back(vmapped[i]);
9089
}
9190

92-
sum += ReduceFunction()(std::forward<Vec>(sub_slice), start, end,
93-
msgs, std::forward<Args>(args)...);
91+
sum += ReduceFunction()(std::forward<Vec>(sub_slice), start, end, msgs,
92+
std::forward<Args>(args)...);
9493
}
9594
return sum;
9695
}

stan/math/rev/functor/reduce_sum.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ struct reduce_sum_impl<ReduceFunction, require_var_t<ReturnType>, ReturnType,
116116
// Perform calculation
117117
var sub_sum_v = apply(
118118
[&](auto&&... args) {
119-
return ReduceFunction()(local_sub_slice,
120-
r.begin(), r.end() - 1,
119+
return ReduceFunction()(local_sub_slice, r.begin(), r.end() - 1,
121120
msgs_, args...);
122121
},
123122
args_tuple_local_copy);

test/unit/math/prim/functor/reduce_sum_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ TEST(StanMathPrim_reduce_sum, sum) {
237237
std::vector<int> threading_test_global;
238238
struct threading_test_lpdf {
239239
template <typename T1>
240-
inline auto operator()(const std::vector<T1>&, std::size_t start, std::size_t end,
241-
std::ostream* msgs) const {
240+
inline auto operator()(const std::vector<T1>&, std::size_t start,
241+
std::size_t end, std::ostream* msgs) const {
242242
threading_test_global[start] = tbb::this_task_arena::current_thread_index();
243243

244244
return stan::return_type_t<T1>(0);

test/unit/math/prim/functor/reduce_sum_util.hpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@ struct count_lpdf {
2121
count_lpdf() {}
2222

2323
// does the reduction in the sub-slice start to end
24-
inline T operator()(const std::vector<int>& sub_slice,
25-
std::size_t start, std::size_t end,
26-
std::ostream* msgs,
24+
inline T operator()(const std::vector<int>& sub_slice, std::size_t start,
25+
std::size_t end, std::ostream* msgs,
2726
const std::vector<T>& lambda,
2827
const std::vector<int>& idata) const {
2928
return stan::math::poisson_lpmf(sub_slice, lambda[0]);
@@ -35,8 +34,8 @@ struct nesting_count_lpdf {
3534
nesting_count_lpdf() {}
3635

3736
// does the reduction in the sub-slice start to end
38-
inline T operator()(const std::vector<int>& sub_slice,
39-
std::size_t start, std::size_t end, std::ostream* msgs,
37+
inline T operator()(const std::vector<int>& sub_slice, std::size_t start,
38+
std::size_t end, std::ostream* msgs,
4039
const std::vector<T>& lambda,
4140
const std::vector<int>& idata) const {
4241
return stan::math::reduce_sum<count_lpdf<T>>(sub_slice, 5, msgs, lambda,
@@ -98,9 +97,8 @@ struct slice_group_count_lpdf {
9897
slice_group_count_lpdf() {}
9998

10099
// does the reduction in the sub-slice start to end
101-
inline T operator()(const std::vector<T>& lambda_slice,
102-
std::size_t start, std::size_t end,
103-
std::ostream* msgs,
100+
inline T operator()(const std::vector<T>& lambda_slice, std::size_t start,
101+
std::size_t end, std::ostream* msgs,
104102
const std::vector<int>& y,
105103
const std::vector<int>& gsidx) const {
106104
const std::size_t num_groups = end - start + 1;
@@ -170,8 +168,9 @@ auto reduce_sum_sum_lpdf = [](auto&& data, auto&&... args) {
170168
template <int grainsize>
171169
struct static_check_lpdf {
172170
template <typename T>
173-
inline auto operator()(const std::vector<int>&, std::size_t start, std::size_t end,
174-
std::ostream* msgs, const std::vector<T>& data) const {
171+
inline auto operator()(const std::vector<int>&, std::size_t start,
172+
std::size_t end, std::ostream* msgs,
173+
const std::vector<T>& data) const {
175174
T sum = 0;
176175
EXPECT_LE(end - start + 1, grainsize);
177176
for (size_t i = start; i <= end; i++) {

0 commit comments

Comments
 (0)