Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix template error for matrix fma #2688

Merged
merged 3 commits into from
Mar 19, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update matrix tests
  • Loading branch information
SteveBronder committed Mar 17, 2022
commit 6e81d6f5b5fae4351e3b937ff77ec6f6f9b9c9f9
7 changes: 6 additions & 1 deletion test/unit/math/mix/fun/fma_2_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@

TEST(mathMixScalFun, fma_vector) {
auto f = [](const auto& x1, const auto& x2, const auto& x3) {
return stan::math::fma(x1, x2, x3);
auto ret = stan::math::fma(x1, x2, x3).eval();
using ret_t = std::decay_t<decltype(ret)>;
constexpr bool is_correct_return_type = stan::is_var_matrix<ret_t>::value
|| stan::is_eigen_dense_base<ret_t>::value;
static_assert(is_correct_return_type, "Matrix type was supposed to be returned.");
return ret;
};

double xd = 1.0;
Expand Down
7 changes: 6 additions & 1 deletion test/unit/math/mix/fun/fma_3_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@

TEST(mathMixScalFun, fma_row_vector) {
auto f = [](const auto& x1, const auto& x2, const auto& x3) {
return stan::math::fma(x1, x2, x3);
auto ret = stan::math::fma(x1, x2, x3).eval();
using ret_t = std::decay_t<decltype(ret)>;
constexpr bool is_correct_return_type = stan::is_var_matrix<ret_t>::value
|| stan::is_eigen_dense_base<ret_t>::value;
static_assert(is_correct_return_type, "Matrix type was supposed to be returned.");
return ret;
};

double xd = 1.0;
Expand Down
7 changes: 6 additions & 1 deletion test/unit/math/mix/fun/fma_4_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@

TEST(mathMixScalFun, fma_matrix) {
auto f = [](const auto& x1, const auto& x2, const auto& x3) {
return stan::math::fma(x1, x2, x3).eval();
auto ret = stan::math::fma(x1, x2, x3).eval();
using ret_t = std::decay_t<decltype(ret)>;
constexpr bool is_correct_return_type = stan::is_var_matrix<ret_t>::value
|| stan::is_eigen_dense_base<ret_t>::value;
static_assert(is_correct_return_type, "Matrix type was supposed to be returned.");
return ret;
};

double xd = 1.0;
Expand Down