Skip to content

Commit b32ca34

Browse files
committed
Prim tests
1 parent 20c244e commit b32ca34

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

test/unit/math/prim/fun/log_sum_exp_test.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include <stan/math/prim.hpp>
2+
#include <test/unit/math/prim/fun/binary_scalar_tester.hpp>
23
#include <gtest/gtest.h>
34
#include <cmath>
45
#include <limits>
@@ -129,3 +130,16 @@ TEST(MathFunctions, log_sum_exp_mat) {
129130
ii << -std::numeric_limits<double>::infinity();
130131
test_log_sum_exp(ii);
131132
}
133+
134+
TEST(MathFunctions, log_sum_exp_vec) {
135+
auto f = [](const auto& x1, const auto& x2) {
136+
using stan::math::log_sum_exp;
137+
return log_sum_exp(x1, x2);
138+
};
139+
140+
Eigen::VectorXd in1(3);
141+
in1 << 4.1, 3.24, 6.8;
142+
Eigen::VectorXd in2(3);
143+
in2 << 2.8, 1.7, 3.1;
144+
stan::test::binary_scalar_tester(f, in1, in2);
145+
}

0 commit comments

Comments
 (0)