We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 293eccc commit 9ed7532Copy full SHA for 9ed7532
2 files changed
test/unit/math/rev/functor/lorenz_ode_typed_fd_test.cpp
@@ -22,14 +22,16 @@ using lorenz_test_types = boost::mp11::mp_product<
22
23
TYPED_TEST_SUITE_P(lorenz_test);
24
TYPED_TEST_P(lorenz_test, param_and_data_finite_diff) {
25
- if constexpr (std::is_same<TypeParam, std::tuple<ode_rk45_functor,
26
- ode_rk45_functor>>::value) {
+ constexpr bool is_rk45 = std::is_same<TypeParam, std::tuple<ode_rk45_functor,
+ ode_rk45_functor>>::value;
27
+ constexpr bool is_ckrk = std::is_same<TypeParam,
28
+ std::tuple<ode_ckrk_functor,
29
+ ode_ckrk_functor>>::value;
30
+ if constexpr (is_rk45) {
31
this->test_fd_vd(1.e-6, 3e-2);
32
this->test_fd_dv(1.e-6, 3e-2);
33
this->test_fd_vv(1.e-6, 3e-2);
- } else if constexpr (std::is_same<TypeParam,
- std::tuple<ode_ckrk_functor,
- ode_ckrk_functor>>::value) {
34
+ } else if constexpr (is_ckrk) {
35
this->test_fd_vd(1.e-6, 5e-2);
36
this->test_fd_dv(1.e-6, 5e-2);
37
this->test_fd_vv(1.e-6, 5e-2);
test/unit/math/test_ad_matvar.hpp
@@ -426,12 +426,12 @@ void expect_ad_matvar_impl(const ad_tolerances& tols, const F& f,
426
using stan::math::var;
427
using stan::math::var_value;
428
using stan::math::test::type_name;
429
-
+ constexpr bool has_at_least_one_var = stan::math::disjunction<
430
+ is_var<scalar_type_t<Types>>...>::value;
431
if constexpr (!stan::math::disjunction<is_var_matrix<Types>...>::value) {
432
FAIL() << "expect_ad_matvar requires at least one varmat input!"
433
<< std::endl;
- } else if constexpr (!stan::math::disjunction<
434
- is_var<scalar_type_t<Types>>...>::value) {
+ } else if constexpr (!has_at_least_one_var) {
435
FAIL() << "expect_ad_matvar requires at least one autodiff input!"
436
437
} else {
0 commit comments