33
44TEST (mathMixScalFun, besselSecondKind) {
55 // bind integer arg because can't autodiff through
6- auto f = [](const int x1) {
6+ auto f = [](const auto & x1) {
77 return
88 [=](const auto & x2) { return stan::math::bessel_second_kind (x1, x2); };
99 };
@@ -13,6 +13,13 @@ TEST(mathMixScalFun, besselSecondKind) {
1313 stan::test::expect_ad (f (1 ), 3.0 );
1414 stan::test::expect_ad (f (1 ), std::numeric_limits<double >::quiet_NaN ());
1515 stan::test::expect_ad (f (2 ), 2.79 );
16+ std::vector<int > std_in1{3 , 1 };
17+ stan::test::expect_ad (f (std_in1), 4.0 );
18+ stan::test::expect_ad (f (std_in1), std::numeric_limits<double >::quiet_NaN ());
19+ stan::test::expect_ad (f (std_in1), -3.0 );
20+ stan::test::expect_ad (f (std_in1), 3.0 );
21+ stan::test::expect_ad (f (std_in1), std::numeric_limits<double >::quiet_NaN ());
22+ stan::test::expect_ad (f (std_in1), 2.79 );
1623}
1724
1825TEST (mathMixScalFun, besselSecondKind_vec) {
@@ -25,10 +32,12 @@ TEST(mathMixScalFun, besselSecondKind_vec) {
2532 Eigen::VectorXd in2 (2 );
2633 in2 << 0.5 , 3.4 ;
2734 stan::test::expect_ad_vectorized_binary (f, std_in1, in2);
35+ stan::test::expect_ad_matvar (f, std_in1, in2);
2836
2937 std::vector<std::vector<int >> std_std_in1{std_in1, std_in1};
3038 Eigen::MatrixXd mat_in2 = in2.replicate (1 , 2 );
3139 stan::test::expect_ad_vectorized_binary (f, std_std_in1, mat_in2);
40+ stan::test::expect_ad_matvar (f, std_std_in1, mat_in2);
3241}
3342
3443TEST (mathMixScalFun, besselSecondKind_matvec) {
0 commit comments