Skip to content

Commit 3f3a52f

Browse files
committed
[Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1
1 parent 04fe232 commit 3f3a52f

2 files changed

Lines changed: 26 additions & 16 deletions

File tree

stan/math/prim/fun/to_matrix.hpp

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,18 +130,22 @@ template <typename T, require_std_vector_vt<is_stan_scalar, T>* = nullptr>
130130
inline auto to_matrix(T&& x, int m, int n) {
131131
static constexpr const char* function = "to_matrix(array)";
132132
check_size_match(function, "rows * columns", m * n, "vector size", x.size());
133-
return make_holder([m, n](auto&& x_) {
134-
if constexpr (std::is_integral_v<value_type_t<decltype(x_)>>) {
135-
return Eigen::Map<const Eigen::Matrix<value_type_t<decltype(x_)>, Eigen::Dynamic, Eigen::Dynamic>>(
136-
&x_[0], m, n).template cast<double>();
137-
} else {
138-
return Eigen::Map<const Eigen::Matrix<value_type_t<decltype(x_)>, Eigen::Dynamic, Eigen::Dynamic>>(
139-
&x_[0], m, n);
140-
}
141-
}, std::forward<T>(x));
133+
return make_holder(
134+
[m, n](auto&& x_) {
135+
if constexpr (std::is_integral_v<value_type_t<decltype(x_)>>) {
136+
return Eigen::Map<const Eigen::Matrix<
137+
value_type_t<decltype(x_)>, Eigen::Dynamic, Eigen::Dynamic>>(
138+
&x_[0], m, n)
139+
.template cast<double>();
140+
} else {
141+
return Eigen::Map<const Eigen::Matrix<
142+
value_type_t<decltype(x_)>, Eigen::Dynamic, Eigen::Dynamic>>(
143+
&x_[0], m, n);
144+
}
145+
},
146+
std::forward<T>(x));
142147
}
143148

144-
145149
/**
146150
* Returns a matrix representation of the vector in column-major
147151
* order with the specified number of rows and columns.

stan/math/prim/functor/apply_scalar_binary.hpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,12 @@ inline auto apply_scalar_binary(F&& f, T1&& x, T2&& y) {
8585
[](auto&& f_inner, auto&& x_inner, auto&& y_inner) {
8686
using int_vec_t = promote_scalar_t<value_type_t<decltype(y_inner)>,
8787
plain_type_t<decltype(x_inner)>>;
88-
auto y_map = make_holder([](auto&& y_inner_) {
89-
return Eigen::Map<const int_vec_t>(y_inner_.data(), y_inner_.size());
90-
}, std::forward<decltype(y_inner)>(y_inner));
88+
auto y_map = make_holder(
89+
[](auto&& y_inner_) {
90+
return Eigen::Map<const int_vec_t>(y_inner_.data(),
91+
y_inner_.size());
92+
},
93+
std::forward<decltype(y_inner)>(y_inner));
9194
return std::forward<decltype(x_inner)>(x_inner).binaryExpr(
9295
y_map, std::forward<decltype(f_inner)>(f_inner));
9396
},
@@ -115,9 +118,12 @@ inline auto apply_scalar_binary(F&& f, T1&& x, T2&& y) {
115118
[](auto&& f_inner, auto&& x_inner, auto&& y_inner) {
116119
using int_vec_t = promote_scalar_t<value_type_t<decltype(x_inner)>,
117120
plain_type_t<decltype(y_inner)>>;
118-
auto x_map = make_holder([](auto&& x_inner_) {
119-
return Eigen::Map<const int_vec_t>(x_inner_.data(), x_inner_.size());
120-
}, std::forward<decltype(x_inner)>(x_inner));
121+
auto x_map = make_holder(
122+
[](auto&& x_inner_) {
123+
return Eigen::Map<const int_vec_t>(x_inner_.data(),
124+
x_inner_.size());
125+
},
126+
std::forward<decltype(x_inner)>(x_inner));
121127
return x_map.binaryExpr(std::forward<decltype(y_inner)>(y_inner),
122128
std::forward<decltype(f_inner)>(f_inner));
123129
},

0 commit comments

Comments
 (0)