Skip to content

Commit 9d9d58c

Browse files
committed
[Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1
1 parent c09bcf4 commit 9d9d58c

2 files changed

Lines changed: 8 additions & 13 deletions

File tree

stan/math/fwd/functor/fvar_finite_diff.hpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,8 @@ auto fvar_finite_diff(const F& func, const TArgs&... args) {
7171
// Create a 'wrapper' functor which will take the flattened column-vector
7272
// and transform it to individual arguments which are passed to the
7373
// user-provided functor
74-
auto serial_functor = [&](const auto& v) {
75-
return func(to_deserializer(v).read(args)...);
76-
};
74+
auto serial_functor
75+
= [&](const auto& v) { return func(to_deserializer(v).read(args)...); };
7776

7877
FvarInnerT rtn_value;
7978
Eigen::Matrix<FvarInnerT, -1, 1> grad;
@@ -82,10 +81,9 @@ auto fvar_finite_diff(const F& func, const TArgs&... args) {
8281

8382
FvarInnerT rtn_grad = 0;
8483
// Use a fold-expression to aggregate tangents for input arguments
85-
(void)std::initializer_list<int>{
86-
(rtn_grad += internal::aggregate_tangent(
87-
to_deserializer(grad).read(args), args),
88-
0)...};
84+
(void)std::initializer_list<int>{(rtn_grad += internal::aggregate_tangent(
85+
to_deserializer(grad).read(args), args),
86+
0)...};
8987

9088
return FvarT(rtn_value, rtn_grad);
9189
}

stan/math/prim/fun/serializer.hpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ struct deserializer {
113113
* @return deserialized value with shape and size matching argument
114114
*/
115115
template <typename U, require_std_vector_st<is_complex, U>* = nullptr>
116-
typename promote_scalar_type<std::complex<T>, U>::type read(
117-
const U& x) {
116+
typename promote_scalar_type<std::complex<T>, U>::type read(const U& x) {
118117
typename promote_scalar_type<std::complex<T>, U>::type y;
119118
y.reserve(x.size());
120119
for (size_t i = 0; i < x.size(); ++i)
@@ -257,9 +256,7 @@ struct serializer {
257256
*
258257
* @return serialized values
259258
*/
260-
const Eigen::Matrix<T, -1, 1>& vector_vals() {
261-
return to_vector(vals_);
262-
}
259+
const Eigen::Matrix<T, -1, 1>& vector_vals() { return to_vector(vals_); }
263260
};
264261

265262
/**
@@ -341,7 +338,7 @@ Eigen::VectorXd serialize_args(const Ts... xs) {
341338
return to_vector(serialize<double>(xs...));
342339
}
343340

344-
} // namespace test
341+
} // namespace math
345342
} // namespace stan
346343

347344
#endif

0 commit comments

Comments
 (0)