@@ -65,6 +65,7 @@ void test_promote_scalar() {
65
65
inner_promo_type>>(tester);
66
66
stan::math::test::expect_same_value_of_rec (tester, result);
67
67
}
68
+
68
69
TEST (mixFun, promote_scalar_tuple) {
69
70
using stan::math::fvar;
70
71
using stan::math::var;
@@ -83,3 +84,22 @@ TEST(mixFun, promote_scalar_tuple) {
83
84
test_promote_scalar<std::complex<var>, double >();
84
85
test_promote_scalar<std::complex<fvar<var>>, double >();
85
86
}
87
+
88
+ template <typename UnPromotedType>
89
+ void test_promote_scalar_basic () {
90
+ std::tuple<UnPromotedType, UnPromotedType> x{UnPromotedType (3.5 ),
91
+ UnPromotedType (4.5 )};
92
+ std::tuple<std::complex<UnPromotedType>, UnPromotedType> z
93
+ = stan::math::promote_scalar<
94
+ std::tuple<std::complex<UnPromotedType>, UnPromotedType>>(x);
95
+ stan::math::test::expect_same_value_of_rec (x, z);
96
+ }
97
+
98
+ TEST (mixFun, promote_scalar_tuple_basic) {
99
+ using stan::math::fvar;
100
+ using stan::math::var;
101
+ test_promote_scalar_basic<double >();
102
+ test_promote_scalar_basic<var>();
103
+ test_promote_scalar_basic<fvar<double >>();
104
+ test_promote_scalar_basic<fvar<var>>();
105
+ }
0 commit comments