@@ -6,29 +6,45 @@ template <typename T1, typename T2, typename T3>
66inline void expect (const T1& x, const T2& lb, const T3& ub) {
77 auto f1 = [](auto && x, auto && lb, auto && ub) {
88 stan::return_type_t <decltype (x), decltype (lb), decltype (ub)> lp = 0 ;
9- return stan::math::lub_constrain<false >(std::forward<decltype (x)>(x), std::forward<decltype (lb)>(lb), std::forward<decltype (ub)>(ub), lp);
9+ return stan::math::lub_constrain<false >(std::forward<decltype (x)>(x),
10+ std::forward<decltype (lb)>(lb),
11+ std::forward<decltype (ub)>(ub), lp);
1012 };
1113 auto f2 = [](auto && x, auto && lb, auto && ub) {
1214 stan::return_type_t <decltype (x), decltype (lb), decltype (ub)> lp = 0 ;
13- return stan::math::lub_constrain<true >(std::forward<decltype (x)>(x), std::forward<decltype (lb)>(lb), std::forward<decltype (ub)>(ub), lp);
15+ return stan::math::lub_constrain<true >(std::forward<decltype (x)>(x),
16+ std::forward<decltype (lb)>(lb),
17+ std::forward<decltype (ub)>(ub), lp);
1418 };
1519 auto f3 = [](auto && x, auto && lb, auto && ub) {
1620 stan::return_type_t <decltype (x), decltype (lb), decltype (ub)> lp = 0 ;
17- stan::math::lub_constrain<true >(std::forward<decltype (x)>(x), std::forward<decltype (lb)>(lb), std::forward<decltype (ub)>(ub), lp);
21+ stan::math::lub_constrain<true >(std::forward<decltype (x)>(x),
22+ std::forward<decltype (lb)>(lb),
23+ std::forward<decltype (ub)>(ub), lp);
1824 return lp;
1925 };
2026 auto f4 = [](auto && x, auto && lb, auto && ub) {
2127 stan::return_type_t <decltype (x), decltype (lb), decltype (ub)> lp = 0 ;
22- auto xx = stan::math::lub_constrain<true >(std::forward<decltype (x)>(x), std::forward<decltype (lb)>(lb), std::forward<decltype (ub)>(ub), lp);
28+ auto xx = stan::math::lub_constrain<true >(
29+ std::forward<decltype (x)>(x), std::forward<decltype (lb)>(lb),
30+ std::forward<decltype (ub)>(ub), lp);
2331 return stan::math::add (lp, stan::math::sum (std::move (xx)));
2432 };
2533 auto f5 = [](auto && x, auto && lb, auto && ub) {
2634 stan::return_type_t <decltype (x), decltype (lb), decltype (ub)> lp = 0 ;
27- return stan::math::lub_constrain<false >(std::forward<decltype (x)>(x), std::forward_as_tuple (std::forward<decltype (lb)>(lb), std::forward<decltype (ub)>(ub)), lp);
35+ return stan::math::lub_constrain<false >(
36+ std::forward<decltype (x)>(x),
37+ std::forward_as_tuple (std::forward<decltype (lb)>(lb),
38+ std::forward<decltype (ub)>(ub)),
39+ lp);
2840 };
2941 auto f6 = [](auto && x, auto && lb, auto && ub) {
3042 stan::return_type_t <decltype (x), decltype (lb), decltype (ub)> lp = 0 ;
31- return stan::math::lub_constrain<true >(std::forward<decltype (x)>(x), std::forward_as_tuple (std::forward<decltype (lb)>(lb), std::forward<decltype (ub)>(ub)), lp);
43+ return stan::math::lub_constrain<true >(
44+ std::forward<decltype (x)>(x),
45+ std::forward_as_tuple (std::forward<decltype (lb)>(lb),
46+ std::forward<decltype (ub)>(ub)),
47+ lp);
3248 };
3349
3450 stan::test::expect_ad (f1, x, lb, ub);
@@ -42,20 +58,28 @@ template <typename T1, typename T2, typename T3>
4258inline void expect_vec (const T1& x, const T2& lb, const T3& ub) {
4359 auto f1 = [](auto && x, auto && lb, auto && ub) {
4460 stan::return_type_t <decltype (x), decltype (lb), decltype (ub)> lp = 0 ;
45- return stan::math::lub_constrain<false >(std::forward<decltype (x)>(x), std::forward<decltype (lb)>(lb), std::forward<decltype (ub)>(ub), lp);
61+ return stan::math::lub_constrain<false >(std::forward<decltype (x)>(x),
62+ std::forward<decltype (lb)>(lb),
63+ std::forward<decltype (ub)>(ub), lp);
4664 };
4765 auto f2 = [](auto && x, auto && lb, auto && ub) {
4866 stan::return_type_t <decltype (x), decltype (lb), decltype (ub)> lp = 0 ;
49- return stan::math::lub_constrain<true >(std::forward<decltype (x)>(x), std::forward<decltype (lb)>(lb), std::forward<decltype (ub)>(ub), lp);
67+ return stan::math::lub_constrain<true >(std::forward<decltype (x)>(x),
68+ std::forward<decltype (lb)>(lb),
69+ std::forward<decltype (ub)>(ub), lp);
5070 };
5171 auto f3 = [](auto && x, auto && lb, auto && ub) {
5272 stan::return_type_t <decltype (x), decltype (lb), decltype (ub)> lp = 0 ;
53- stan::math::lub_constrain<true >(std::forward<decltype (x)>(x), std::forward<decltype (lb)>(lb), std::forward<decltype (ub)>(ub), lp);
73+ stan::math::lub_constrain<true >(std::forward<decltype (x)>(x),
74+ std::forward<decltype (lb)>(lb),
75+ std::forward<decltype (ub)>(ub), lp);
5476 return lp;
5577 };
5678 auto f4 = [](auto && x, auto && lb, auto && ub) {
5779 stan::return_type_t <decltype (x), decltype (lb), decltype (ub)> lp = 0 ;
58- auto xx = stan::math::eval (stan::math::lub_constrain<true >(std::forward<decltype (x)>(x), std::forward<decltype (lb)>(lb), std::forward<decltype (ub)>(ub), lp));
80+ auto xx = stan::math::eval (stan::math::lub_constrain<true >(
81+ std::forward<decltype (x)>(x), std::forward<decltype (lb)>(lb),
82+ std::forward<decltype (ub)>(ub), lp));
5983 stan::return_type_t <decltype (x), decltype (lb), decltype (ub)> xx_acc = 0 ;
6084 for (size_t i = 0 ; i < xx.size (); ++i) {
6185 xx_acc += stan::math::sum (xx[i]);
@@ -64,11 +88,19 @@ inline void expect_vec(const T1& x, const T2& lb, const T3& ub) {
6488 };
6589 auto f5 = [](auto && x, auto && lb, auto && ub) {
6690 stan::return_type_t <decltype (x), decltype (lb), decltype (ub)> lp = 0 ;
67- return stan::math::lub_constrain<false >(std::forward<decltype (x)>(x), std::make_tuple (std::forward<decltype (lb)>(lb), std::forward<decltype (ub)>(ub)), lp);
91+ return stan::math::lub_constrain<false >(
92+ std::forward<decltype (x)>(x),
93+ std::make_tuple (std::forward<decltype (lb)>(lb),
94+ std::forward<decltype (ub)>(ub)),
95+ lp);
6896 };
6997 auto f6 = [](auto && x, auto && lb, auto && ub) {
7098 stan::return_type_t <decltype (x), decltype (lb), decltype (ub)> lp = 0 ;
71- return stan::math::lub_constrain<true >(std::forward<decltype (x)>(x), std::make_tuple (std::forward<decltype (lb)>(lb), std::forward<decltype (ub)>(ub)), lp);
99+ return stan::math::lub_constrain<true >(
100+ std::forward<decltype (x)>(x),
101+ std::make_tuple (std::forward<decltype (lb)>(lb),
102+ std::forward<decltype (ub)>(ub)),
103+ lp);
72104 };
73105
74106 stan::test::expect_ad (f1, x, lb, ub);
0 commit comments