Skip to content

Commit 23905c2

Browse files
committed
[Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1
1 parent 82e59a3 commit 23905c2

39 files changed

+181
-139
lines changed

stan/math/fwd/fun/multiply.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ inline auto multiply(Mat1&& m1, Mat2&& m2) {
2222
decltype(auto) m1_ref = to_ref(m1);
2323
decltype(auto) m2_ref = to_ref(m2);
2424
return to_fvar(multiply(m1_ref.val(), m2_ref.val()),
25-
add(multiply(m1_ref.val(), m2_ref.d()), multiply(m1_ref.d(), m2_ref.val())));
25+
add(multiply(m1_ref.val(), m2_ref.d()),
26+
multiply(m1_ref.d(), m2_ref.val())));
2627
}
2728

2829
template <typename Mat1, typename Mat2,

stan/math/fwd/fun/quad_form_sym.hpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@ inline promote_scalar_t<return_type_t<EigMat1, EigMat2>, EigMat2> quad_form_sym(
3535
check_symmetric("quad_form_sym", "A", A_ref);
3636
decltype(auto) B_ref = to_ref(std::forward<EigMat2>(B));
3737
promote_scalar_t<T_ret, plain_type_t<EigMat2>> ret(
38-
multiply(B_ref.transpose(), multiply(std::forward<decltype(A_ref)>(A_ref), B_ref)));
39-
return make_holder([](auto&& ret) {
40-
return T_ret(0.5) * (ret + ret.transpose());
41-
}, std::move(ret));
38+
multiply(B_ref.transpose(),
39+
multiply(std::forward<decltype(A_ref)>(A_ref), B_ref)));
40+
return make_holder(
41+
[](auto&& ret) { return T_ret(0.5) * (ret + ret.transpose()); },
42+
std::move(ret));
4243
}
4344

4445
/**
@@ -61,9 +62,13 @@ inline return_type_t<EigMat, ColVec> quad_form_sym(EigMat&& A, ColVec&& B) {
6162
decltype(auto) A_ref = to_ref(std::forward<EigMat>(A));
6263
check_symmetric("quad_form_sym", "A", A_ref);
6364
decltype(auto) B_ref = to_ref(std::forward<ColVec>(B));
64-
return make_holder([](auto&& B_ref_, auto&& A_ref_) {
65-
return dot_product(B_ref_, multiply(std::forward<decltype(A_ref_)>(A_ref_), B_ref_));
66-
}, std::forward<decltype(B_ref)>(B_ref), std::forward<decltype(A_ref)>(A_ref));
65+
return make_holder(
66+
[](auto&& B_ref_, auto&& A_ref_) {
67+
return dot_product(
68+
B_ref_, multiply(std::forward<decltype(A_ref_)>(A_ref_), B_ref_));
69+
},
70+
std::forward<decltype(B_ref)>(B_ref),
71+
std::forward<decltype(A_ref)>(A_ref));
6772
}
6873

6974
} // namespace math

stan/math/prim/constraint/corr_matrix_constrain.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ corr_matrix_constrain(T&& x, Eigen::Index k) {
4444
decltype(auto) x_ref = to_ref(std::forward<T>(x));
4545
check_size_match("cov_matrix_constrain", "x.size()", x_ref.size(),
4646
"k_choose_2", k_choose_2);
47-
decltype(auto) cpc_ref = to_ref(corr_constrain(std::forward<decltype(x_ref)>(x_ref)));
47+
decltype(auto) cpc_ref
48+
= to_ref(corr_constrain(std::forward<decltype(x_ref)>(x_ref)));
4849
return read_corr_matrix(cpc_ref, k);
4950
}
5051

@@ -78,7 +79,8 @@ corr_matrix_constrain(T&& x, Eigen::Index k, Lp& lp) {
7879
decltype(auto) x_ref = to_ref(std::forward<T>(x));
7980
check_size_match("cov_matrix_constrain", "x.size()", x_ref.size(),
8081
"k_choose_2", k_choose_2);
81-
decltype(auto) cpc_ref = to_ref(corr_constrain(std::forward<decltype(x_ref)>(x_ref), lp));
82+
decltype(auto) cpc_ref
83+
= to_ref(corr_constrain(std::forward<decltype(x_ref)>(x_ref), lp));
8284
return read_corr_matrix(cpc_ref, k, lp);
8385
}
8486

stan/math/prim/fun/add.hpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,8 @@ template <typename Mat1, typename Mat2,
4242
require_all_not_st_var<Mat1, Mat2>* = nullptr>
4343
inline auto add(Mat1&& m1, Mat2&& m2) {
4444
check_matching_dims("add", "m1", m1, "m2", m2);
45-
return make_holder([](auto&& m1_, auto&& m2_) {
46-
return m1_ + m2_;
47-
}, std::forward<Mat1>(m1), std::forward<Mat2>(m2));
45+
return make_holder([](auto&& m1_, auto&& m2_) { return m1_ + m2_; },
46+
std::forward<Mat1>(m1), std::forward<Mat2>(m2));
4847
}
4948

5049
/**
@@ -60,9 +59,8 @@ template <typename Mat, typename Scal, require_eigen_t<Mat>* = nullptr,
6059
require_stan_scalar_t<Scal>* = nullptr,
6160
require_all_not_st_var<Mat, Scal>* = nullptr>
6261
inline auto add(Mat&& m, const Scal c) {
63-
return make_holder([c](auto&& m_) {
64-
return (m_.array() + c).matrix();
65-
}, std::forward<Mat>(m));
62+
return make_holder([c](auto&& m_) { return (m_.array() + c).matrix(); },
63+
std::forward<Mat>(m));
6664
}
6765

6866
/**
@@ -78,9 +76,8 @@ template <typename Scal, typename Mat, require_stan_scalar_t<Scal>* = nullptr,
7876
require_eigen_t<Mat>* = nullptr,
7977
require_all_not_st_var<Scal, Mat>* = nullptr>
8078
inline auto add(const Scal c, Mat&& m) {
81-
return make_holder([c](auto&& m_) {
82-
return (c + m_.array()).matrix();
83-
}, std::forward<Mat>(m));
79+
return make_holder([c](auto&& m_) { return (c + m_.array()).matrix(); },
80+
std::forward<Mat>(m));
8481
}
8582

8683
} // namespace math

stan/math/prim/fun/all.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ constexpr inline bool all(T x) {
3535
template <typename ContainerT,
3636
require_eigen_st<std::is_integral, ContainerT>* = nullptr>
3737
inline bool all(ContainerT&& x) {
38-
return make_holder([](auto&& x_) {
39-
return x_.all();
40-
}, std::forward<ContainerT>(x));
38+
return make_holder([](auto&& x_) { return x_.all(); },
39+
std::forward<ContainerT>(x));
4140
}
4241

4342
// Forward-declaration for correct resolution of all(std::vector<std::tuple>)

stan/math/prim/fun/any.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ constexpr inline bool any(T x) {
3535
template <typename ContainerT,
3636
require_eigen_st<std::is_integral, ContainerT>* = nullptr>
3737
inline bool any(ContainerT&& x) {
38-
return make_holder([](auto&& x_) {
39-
return x_.any();
40-
}, std::forward<ContainerT>(x));
38+
return make_holder([](auto&& x_) { return x_.any(); },
39+
std::forward<ContainerT>(x));
4140
}
4241

4342
// Forward-declaration for correct resolution of any(std::vector<std::tuple>)

stan/math/prim/fun/block.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ inline auto block(T&& m, size_t i, size_t j, size_t nrows, size_t ncols) {
2424
check_row_index("block", "i+nrows-1", m, i + nrows - 1);
2525
check_column_index("block", "j", m, j);
2626
check_column_index("block", "j+ncols-1", m, j + ncols - 1);
27-
return make_holder([i, j, nrows, ncols](auto&& m_) {
28-
return m_.block(i - 1, j - 1, nrows, ncols);
29-
}, std::forward<T>(m));
27+
return make_holder(
28+
[i, j, nrows, ncols](auto&& m_) {
29+
return m_.block(i - 1, j - 1, nrows, ncols);
30+
},
31+
std::forward<T>(m));
3032
}
3133

3234
} // namespace math

stan/math/prim/fun/chol2inv.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ inline plain_type_t<T> chol2inv(T&& L) {
3535
X.coeffRef(0) = inv_square(L_ref.coeff(0, 0));
3636
return X;
3737
}
38-
return crossprod(mdivide_left_tri<Eigen::Lower>(std::forward<decltype(L_ref)>(L_ref)));
38+
return crossprod(
39+
mdivide_left_tri<Eigen::Lower>(std::forward<decltype(L_ref)>(L_ref)));
3940
}
4041

4142
} // namespace math

stan/math/prim/fun/col.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ namespace math {
2424
template <typename T, require_matrix_t<T>* = nullptr>
2525
inline auto col(T&& m, size_t j) {
2626
check_column_index("col", "j", m, j);
27-
return make_holder([j](auto&& m_) {
28-
return m_.col(j - 1);
29-
}, std::forward<T>(m));
27+
return make_holder([j](auto&& m_) { return m_.col(j - 1); },
28+
std::forward<T>(m));
3029
}
3130

3231
} // namespace math

stan/math/prim/fun/columns_dot_product.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ template <typename Mat1, typename Mat2,
2626
require_all_not_eigen_vt<is_var, Mat1, Mat2>* = nullptr>
2727
inline auto columns_dot_product(Mat1&& v1, Mat2&& v2) {
2828
check_matching_dims("columns_dot_product", "v1", v1, "v2", v2);
29-
return make_holder([](auto&& v1_, auto&& v2_) {
30-
return v1_.cwiseProduct(v2_).colwise().sum();
31-
}, to_ref(std::forward<Mat1>(v1)), to_ref(std::forward<Mat2>(v2)));
29+
return make_holder(
30+
[](auto&& v1_, auto&& v2_) {
31+
return v1_.cwiseProduct(v2_).colwise().sum();
32+
},
33+
to_ref(std::forward<Mat1>(v1)), to_ref(std::forward<Mat2>(v2)));
3234
}
3335

3436
} // namespace math

0 commit comments

Comments
 (0)