Skip to content

Commit c6e1396

Browse files
committed
Merge branch 'develop' into fix/double-rpath
2 parents 11ba18e + 617ae34 commit c6e1396

5 files changed

Lines changed: 25 additions & 23 deletions

File tree

stan/math/prim/prob/bernoulli_cdf.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ return_type_t<T_prob> bernoulli_cdf(const T_n& n, const T_prob& theta) {
3434
check_consistent_sizes(function, "Random variable", n,
3535
"Probability parameter", theta);
3636
T_theta_ref theta_ref = theta;
37-
const auto& n_arr = as_array_or_scalar(n);
37+
const auto& n_arr = as_value_column_array_or_scalar(n);
3838
const auto& theta_arr = as_value_column_array_or_scalar(theta_ref);
3939
check_bounded(function, "Probability parameter", theta_arr, 0.0, 1.0);
4040

stan/math/prim/prob/bernoulli_lccdf.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ return_type_t<T_prob> bernoulli_lccdf(const T_n& n, const T_prob& theta) {
3535
check_consistent_sizes(function, "Random variable", n,
3636
"Probability parameter", theta);
3737
T_theta_ref theta_ref = theta;
38-
const auto& n_arr = as_array_or_scalar(n);
38+
const auto& n_arr = as_value_column_array_or_scalar(n);
3939
const auto& theta_arr = as_value_column_array_or_scalar(theta_ref);
4040
check_bounded(function, "Probability parameter", theta_arr, 0.0, 1.0);
4141

stan/math/prim/prob/bernoulli_lcdf.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ return_type_t<T_prob> bernoulli_lcdf(const T_n& n, const T_prob& theta) {
3333
check_consistent_sizes(function, "Random variable", n,
3434
"Probability parameter", theta);
3535
T_theta_ref theta_ref = theta;
36-
const auto& n_arr = as_array_or_scalar(n);
36+
const auto& n_arr = as_value_column_array_or_scalar(n);
3737
const auto& theta_arr = as_value_column_array_or_scalar(theta_ref);
3838
check_bounded(function, "Probability parameter", theta_arr, 0.0, 1.0);
3939

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include <test/unit/math/test_ad.hpp>
2+
#include <stdexcept>
3+
4+
TEST(mathMixFun, eigendecompose) {
5+
auto f = [](const auto& x) {
6+
using stan::math::eigendecompose;
7+
return std::get<0>(eigendecompose(x));
8+
};
9+
auto g = [](const auto& x) {
10+
using stan::math::eigendecompose;
11+
return std::get<1>(eigendecompose(x));
12+
};
13+
for (const auto& x : stan::test::square_test_matrices(0, 2)) {
14+
stan::test::expect_ad(f, x);
15+
stan::test::expect_ad(g, x);
16+
}
17+
18+
Eigen::MatrixXd a32(3, 2);
19+
a32 << 3, -5, 7, -7.2, 9.1, -6.3;
20+
EXPECT_THROW(f(a32), std::invalid_argument);
21+
EXPECT_THROW(g(a32), std::invalid_argument);
22+
}

test/unit/math/mix/fun/eigendecompose_test.cpp renamed to test/unit/math/mix/fun/eigendecompose_part2_test.cpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,6 @@
11
#include <test/unit/math/test_ad.hpp>
22
#include <stdexcept>
33

4-
TEST(mathMixFun, eigendecompose) {
5-
auto f = [](const auto& x) {
6-
using stan::math::eigendecompose;
7-
return std::get<0>(eigendecompose(x));
8-
};
9-
auto g = [](const auto& x) {
10-
using stan::math::eigendecompose;
11-
return std::get<1>(eigendecompose(x));
12-
};
13-
for (const auto& x : stan::test::square_test_matrices(0, 2)) {
14-
stan::test::expect_ad(f, x);
15-
stan::test::expect_ad(g, x);
16-
}
17-
18-
Eigen::MatrixXd a32(3, 2);
19-
a32 << 3, -5, 7, -7.2, 9.1, -6.3;
20-
EXPECT_THROW(f(a32), std::invalid_argument);
21-
EXPECT_THROW(g(a32), std::invalid_argument);
22-
}
23-
244
TEST(mathMixFun, eigendecomposeComplex) {
255
auto f = [](const auto& x) {
266
using stan::math::eigendecompose;

0 commit comments

Comments
 (0)