Skip to content

Commit 1c28dd7

Browse files
committed
[Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1
1 parent dec359c commit 1c28dd7

File tree

2 files changed

+21
-24
lines changed

2 files changed

+21
-24
lines changed

stan/math/prim/fun/abs.hpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -62,28 +62,28 @@ struct abs_fun {
6262
* @param x argument
6363
* @return Absolute value of each variable in the container.
6464
*/
65-
template <typename Container,
66-
require_not_container_st<std::is_arithmetic, Container>* = nullptr,
67-
require_not_var_matrix_t<Container>* = nullptr,
68-
require_not_stan_scalar_t<Container>* = nullptr>
69-
inline auto abs(const Container& x) {
70-
return apply_scalar_unary<abs_fun, Container>::apply(x);
65+
template <typename Container,
66+
require_not_container_st<std::is_arithmetic, Container>* = nullptr,
67+
require_not_var_matrix_t<Container>* = nullptr,
68+
require_not_stan_scalar_t<Container>* = nullptr>
69+
inline auto abs(const Container& x) {
70+
return apply_scalar_unary<abs_fun, Container>::apply(x);
7171
}
7272

73-
/**
74-
* Version of `abs()` that accepts std::vectors, Eigen Matrix/Array objects
75-
* or expressions, and containers of these.
76-
*
77-
* @tparam Container Type of x
78-
* @param x argument
79-
* @return Absolute value of each variable in the container.
80-
*/
81-
template <typename Container,
82-
require_container_st<std::is_arithmetic, Container>* = nullptr>
83-
inline auto abs(const Container& x) {
84-
return apply_vector_unary<Container>::apply(
85-
x, [&](const auto& v) { return v.array().abs(); });
86-
}
73+
/**
74+
* Version of `abs()` that accepts std::vectors, Eigen Matrix/Array objects
75+
* or expressions, and containers of these.
76+
*
77+
* @tparam Container Type of x
78+
* @param x argument
79+
* @return Absolute value of each variable in the container.
80+
*/
81+
template <typename Container,
82+
require_container_st<std::is_arithmetic, Container>* = nullptr>
83+
inline auto abs(const Container& x) {
84+
return apply_vector_unary<Container>::apply(
85+
x, [&](const auto& v) { return v.array().abs(); });
86+
}
8787

8888
namespace internal {
8989
/**

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ TEST(mixFun, absBasics) {
1919
}
2020

2121
TEST(mixFun, abs) {
22-
auto f = [](const auto& x) {
23-
return stan::math::abs(x);
24-
};
22+
auto f = [](const auto& x) { return stan::math::abs(x); };
2523
stan::test::expect_common_nonzero_unary(f);
2624
// 0 (no derivative at 0)
2725
stan::test::expect_value(f, 0);
@@ -44,7 +42,6 @@ TEST(mixFun, abs) {
4442
}
4543
}
4644

47-
4845
// vector<double>
4946
using svd_t = std::vector<double>;
5047
stan::test::expect_ad(f, svd_t{});

0 commit comments

Comments
 (0)