Skip to content

Commit f463d39

Browse files
committed
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
1 parent 93b1a13 commit f463d39

File tree

4 files changed

+24
-25
lines changed

4 files changed

+24
-25
lines changed

stan/math/prim/functor/apply_scalar_binary.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ inline auto apply_scalar_binary(const T1& x, const T2& y, const F& f) {
124124
throw std::invalid_argument(msg.str());
125125
}
126126
using return_st = decltype(f(x(0), y[0][0]));
127-
Eigen::Matrix<return_st, Eigen::Dynamic, Eigen::Dynamic>
128-
result(x.rows(), x.cols());
127+
Eigen::Matrix<return_st, Eigen::Dynamic, Eigen::Dynamic> result(x.rows(),
128+
x.cols());
129129
for (size_t i = 0; i < y.size(); ++i) {
130130
result.row(i) = apply_scalar_binary(x.row(i).transpose(),
131131
as_column_vector_or_scalar(y[i]), f);
@@ -157,8 +157,8 @@ inline auto apply_scalar_binary(const T1& x, const T2& y, const F& f) {
157157
throw std::invalid_argument(msg.str());
158158
}
159159
using return_st = decltype(f(x[0][0], y(0)));
160-
Eigen::Matrix<return_st, Eigen::Dynamic, Eigen::Dynamic>
161-
result(y.rows(), y.cols());
160+
Eigen::Matrix<return_st, Eigen::Dynamic, Eigen::Dynamic> result(y.rows(),
161+
y.cols());
162162
for (size_t i = 0; i < x.size(); ++i) {
163163
result.row(i) = apply_scalar_binary(as_column_vector_or_scalar(x[i]),
164164
y.row(i).transpose(), f);

test/unit/math/mix/fun/falling_factorial_test.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ TEST(mathMixScalFun, fallingFactorial_vec) {
3232
std::vector<int> std_in2{3, 1};
3333
stan::test::expect_ad_vectorized_binary(f, in1, std_in2);
3434

35-
3635
Eigen::MatrixXd mat_in1 = in1.replicate(1, 2);
3736
std::vector<std::vector<int>> std_std_in2{std_in2, std_in2};
3837
stan::test::expect_ad_vectorized_binary(f, mat_in1, std_std_in2);

test/unit/math/prim/fun/bessel_first_kind_test.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,4 @@ TEST(MathFunctions, bessel_first_kind_vec) {
3434
Eigen::MatrixXd mat_in2 = in2.replicate(1, 3);
3535
std::vector<std::vector<int>> std_std_in1{std_in1, std_in1, std_in1};
3636
stan::test::binary_scalar_tester(f, std_std_in1, mat_in2);
37-
3837
}

test/unit/math/prim/fun/binary_scalar_tester.hpp

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,10 @@ void binary_scalar_tester_impl(const F& f, const T1& x, const T2& y) {
119119
EXPECT_THROW(f(nest_x, nest_y_small), std::invalid_argument);
120120
EXPECT_THROW(f(nest_x_small, nest_y), std::invalid_argument);
121121

122-
std::vector<std::vector<plain_type_t<T1>>> nest_nest_x{nest_x, nest_x, nest_x};
123-
std::vector<std::vector<plain_type_t<T2>>> nest_nest_y{nest_y, nest_y, nest_y};
122+
std::vector<std::vector<plain_type_t<T1>>> nest_nest_x{nest_x, nest_x,
123+
nest_x};
124+
std::vector<std::vector<plain_type_t<T2>>> nest_nest_y{nest_y, nest_y,
125+
nest_y};
124126
auto nestnestvec_nestnestvec = f(nest_nest_x, nest_nest_y);
125127
auto nestnestvec_scal = f(nest_nest_x, y[0]);
126128
auto scal_nestnestvec = f(x[0], nest_nest_y);
@@ -142,7 +144,6 @@ void binary_scalar_tester_impl(const F& f, const T1& x, const T2& y) {
142144
EXPECT_THROW(f(nest_nest_x_small, nest_nest_y), std::invalid_argument);
143145
}
144146

145-
146147
/**
147148
* Implementation function which checks that the binary vectorisation
148149
* framework returns the same value as the function with scalar inputs,
@@ -155,14 +156,13 @@ void binary_scalar_tester_impl(const F& f, const T1& x, const T2& y) {
155156
* @param y Second vector input to which operation is applied.
156157
* @param f functor to apply to inputs.
157158
*/
158-
template <typename F, typename T1, typename T2,
159-
typename T1_plain = plain_type_t<T1>,
160-
require_eigen_matrix_t<T1>* = nullptr,
161-
require_std_vector_t<T2>* = nullptr>
159+
template <
160+
typename F, typename T1, typename T2, typename T1_plain = plain_type_t<T1>,
161+
require_eigen_matrix_t<T1>* = nullptr, require_std_vector_t<T2>* = nullptr>
162162
void binary_scalar_tester_impl(const F& f, const T1& x, const T2& y) {
163163
auto vec_vec = f(x, y);
164164
for (int r = 0; r < x.rows(); ++r) {
165-
for(int c = 0; c < x.cols(); ++c) {
165+
for (int c = 0; c < x.cols(); ++c) {
166166
EXPECT_FLOAT_EQ(f(x(r, c), y[r][c]), vec_vec(r, c));
167167
}
168168
}
@@ -177,8 +177,9 @@ void binary_scalar_tester_impl(const F& f, const T1& x, const T2& y) {
177177
auto nestvec_nestvec = f(nest_x, nest_y);
178178
for (int i = 0; i < 3; ++i) {
179179
for (int r = 0; r < x.rows(); ++r) {
180-
for(int c = 0; c < x.cols(); ++c) {
181-
EXPECT_FLOAT_EQ(f(nest_x[i](r, c), nest_y[i][r][c]), nestvec_nestvec[i](r, c));
180+
for (int c = 0; c < x.cols(); ++c) {
181+
EXPECT_FLOAT_EQ(f(nest_x[i](r, c), nest_y[i][r][c]),
182+
nestvec_nestvec[i](r, c));
182183
}
183184
}
184185
}
@@ -194,7 +195,7 @@ void binary_scalar_tester_impl(const F& f, const T1& x, const T2& y) {
194195
for (int i = 0; i < 3; ++i) {
195196
for (int j = 0; j < 3; ++j) {
196197
for (int r = 0; r < x.rows(); ++r) {
197-
for(int c = 0; c < x.cols(); ++c) {
198+
for (int c = 0; c < x.cols(); ++c) {
198199
EXPECT_FLOAT_EQ(f(nest_nest_x[i][j](r, c), nest_nest_y[i][j][r][c]),
199200
nestnestvec_nestnestvec[i][j](r, c));
200201
}
@@ -207,14 +208,13 @@ void binary_scalar_tester_impl(const F& f, const T1& x, const T2& y) {
207208
EXPECT_THROW(f(nest_nest_x_small, nest_nest_y), std::invalid_argument);
208209
}
209210

210-
template <typename F, typename T1, typename T2,
211-
typename T2_plain = plain_type_t<T2>,
212-
require_std_vector_t<T1>* = nullptr,
213-
require_eigen_matrix_t<T2>* = nullptr>
211+
template <
212+
typename F, typename T1, typename T2, typename T2_plain = plain_type_t<T2>,
213+
require_std_vector_t<T1>* = nullptr, require_eigen_matrix_t<T2>* = nullptr>
214214
void binary_scalar_tester_impl(const F& f, const T1& x, const T2& y) {
215215
auto vec_vec = f(x, y);
216216
for (int r = 0; r < y.rows(); ++r) {
217-
for(int c = 0; c < y.cols(); ++c) {
217+
for (int c = 0; c < y.cols(); ++c) {
218218
EXPECT_FLOAT_EQ(f(x[r][c], y(r, c)), vec_vec(r, c));
219219
}
220220
}
@@ -229,8 +229,9 @@ void binary_scalar_tester_impl(const F& f, const T1& x, const T2& y) {
229229
auto nestvec_nestvec = f(nest_x, nest_y);
230230
for (int i = 0; i < 3; ++i) {
231231
for (int r = 0; r < y.rows(); ++r) {
232-
for(int c = 0; c < y.cols(); ++c) {
233-
EXPECT_FLOAT_EQ(f(nest_x[i][r][c], nest_y[i](r, c)), nestvec_nestvec[i](r, c));
232+
for (int c = 0; c < y.cols(); ++c) {
233+
EXPECT_FLOAT_EQ(f(nest_x[i][r][c], nest_y[i](r, c)),
234+
nestvec_nestvec[i](r, c));
234235
}
235236
}
236237
}
@@ -246,7 +247,7 @@ void binary_scalar_tester_impl(const F& f, const T1& x, const T2& y) {
246247
for (int i = 0; i < 3; ++i) {
247248
for (int j = 0; j < 3; ++j) {
248249
for (int r = 0; r < y.rows(); ++r) {
249-
for(int c = 0; c < y.cols(); ++c) {
250+
for (int c = 0; c < y.cols(); ++c) {
250251
EXPECT_FLOAT_EQ(f(nest_nest_x[i][j][r][c], nest_nest_y[i][j](r, c)),
251252
nestnestvec_nestnestvec[i][j](r, c));
252253
}

0 commit comments

Comments
 (0)