Skip to content

Commit 9ed7532

Browse files
committed
fix cpplint
1 parent 293eccc commit 9ed7532

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

test/unit/math/rev/functor/lorenz_ode_typed_fd_test.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,16 @@ using lorenz_test_types = boost::mp11::mp_product<
2222

2323
TYPED_TEST_SUITE_P(lorenz_test);
2424
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) {
25+
constexpr bool is_rk45 = std::is_same<TypeParam, std::tuple<ode_rk45_functor,
26+
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) {
2731
this->test_fd_vd(1.e-6, 3e-2);
2832
this->test_fd_dv(1.e-6, 3e-2);
2933
this->test_fd_vv(1.e-6, 3e-2);
30-
} else if constexpr (std::is_same<TypeParam,
31-
std::tuple<ode_ckrk_functor,
32-
ode_ckrk_functor>>::value) {
34+
} else if constexpr (is_ckrk) {
3335
this->test_fd_vd(1.e-6, 5e-2);
3436
this->test_fd_dv(1.e-6, 5e-2);
3537
this->test_fd_vv(1.e-6, 5e-2);

test/unit/math/test_ad_matvar.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,12 +426,12 @@ void expect_ad_matvar_impl(const ad_tolerances& tols, const F& f,
426426
using stan::math::var;
427427
using stan::math::var_value;
428428
using stan::math::test::type_name;
429-
429+
constexpr bool has_at_least_one_var = stan::math::disjunction<
430+
is_var<scalar_type_t<Types>>...>::value;
430431
if constexpr (!stan::math::disjunction<is_var_matrix<Types>...>::value) {
431432
FAIL() << "expect_ad_matvar requires at least one varmat input!"
432433
<< std::endl;
433-
} else if constexpr (!stan::math::disjunction<
434-
is_var<scalar_type_t<Types>>...>::value) {
434+
} else if constexpr (!has_at_least_one_var) {
435435
FAIL() << "expect_ad_matvar requires at least one autodiff input!"
436436
<< std::endl;
437437
} else {

0 commit comments

Comments
 (0)