Skip to content

Commit

Permalink
[Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1
Browse files Browse the repository at this point in the history
  • Loading branch information
stan-buildbot committed Aug 6, 2023
1 parent 910995b commit 5738ece
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 3 additions & 1 deletion stan/math/prim/fun/all.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ namespace math {
* @return The input unchanged
*/
template <typename T, require_integral_t<T>* = nullptr>
constexpr inline T all(T x) { return x; }
constexpr inline T all(T x) {
return x;
}

/**
* Return true if all values in the input are true.
Expand Down
4 changes: 3 additions & 1 deletion stan/math/prim/fun/any.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ namespace math {
* @return The input unchanged
*/
template <typename T, require_integral_t<T>* = nullptr>
constexpr inline T any(T x) { return x; }
constexpr inline T any(T x) {
return x;
}

/**
* Return true if any values in the input are true.
Expand Down
10 changes: 6 additions & 4 deletions stan/math/prim/fun/select.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ inline T_true_plain select(const bool c, const T_true y_true,
check_matching_dims("select", "left hand side", y_true, "right hand side",
y_false);
return c ? T_true_plain(std::forward<T_true>(y_true))
: T_true_plain(std::forward<T_false>(y_false));
: T_true_plain(std::forward<T_false>(y_false));
}

/**
Expand Down Expand Up @@ -148,8 +148,10 @@ template <typename T_bool, typename T_true, typename T_false,
require_eigen_array_vt<std::is_integral, T_bool>* = nullptr,
require_all_stan_scalar_t<T_true, T_false>* = nullptr>
inline auto select(const T_bool c, const T_true y_true, const T_false y_false) {
return c.unaryExpr(
[y_true, y_false](bool cond) { return cond ? y_true : y_false; }).eval();
return c
.unaryExpr(
[y_true, y_false](bool cond) { return cond ? y_true : y_false; })
.eval();
}

/**
Expand All @@ -169,7 +171,7 @@ template <typename T_bool, typename T_true, typename T_false,
require_any_eigen_array_t<T_true, T_false>* = nullptr>
inline auto select(const T_bool c, const T_true y_true, const T_false y_false) {
check_consistent_sizes("select", "boolean", c, "left hand side", y_true,
"right hand side", y_false);
"right hand side", y_false);
return c.select(y_true, y_false).eval();
}

Expand Down

0 comments on commit 5738ece

Please sign in to comment.