From 6b5d89c0a36b32028581d19ceed8b498f9a4d773 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 28 Mar 2022 19:23:56 +0800 Subject: [PATCH 01/29] Add namespace qualifier to apply --- make/compiler_flags | 2 +- stan/math/prim/fun/offset_multiplier_constrain.hpp | 4 ++-- stan/math/prim/fun/size_zero.hpp | 3 ++- stan/math/prim/functor/coupled_ode_system.hpp | 2 +- stan/math/prim/functor/ode_ckrk.hpp | 6 +++--- stan/math/prim/functor/ode_rk45.hpp | 6 +++--- stan/math/prim/functor/reduce_sum.hpp | 2 +- stan/math/rev/functor/algebra_solver_newton.hpp | 8 ++++---- stan/math/rev/functor/algebra_solver_powell.hpp | 8 ++++---- stan/math/rev/functor/coupled_ode_system.hpp | 4 ++-- stan/math/rev/functor/cvodes_integrator.hpp | 8 ++++---- stan/math/rev/functor/cvodes_integrator_adjoint.hpp | 4 ++-- stan/math/rev/functor/dae.hpp | 4 ++-- stan/math/rev/functor/dae_system.hpp | 4 ++-- stan/math/rev/functor/integrate_1d.hpp | 10 +++++----- stan/math/rev/functor/kinsol_data.hpp | 4 ++-- stan/math/rev/functor/ode_adams.hpp | 2 +- stan/math/rev/functor/ode_bdf.hpp | 2 +- stan/math/rev/functor/reduce_sum.hpp | 6 +++--- 19 files changed, 45 insertions(+), 44 deletions(-) diff --git a/make/compiler_flags b/make/compiler_flags index b59b75b7f82..830bb6b22e5 100644 --- a/make/compiler_flags +++ b/make/compiler_flags @@ -116,7 +116,7 @@ CPPFLAGS_SUNDIALS ?= -DNO_FPRINTF_OUTPUT $(CPPFLAGS_OPTIM_SUNDIALS) $(CXXFLAGS_F ## setup compiler flags -CXXFLAGS_LANG ?= -std=c++1y +CXXFLAGS_LANG ?= -std=c++17 #CXXFLAGS_BOOST ?= CXXFLAGS_SUNDIALS ?= -pipe $(CXXFLAGS_OPTIM_SUNDIALS) $(CPPFLAGS_FLTO_SUNDIALS) #CXXFLAGS_GTEST diff --git a/stan/math/prim/fun/offset_multiplier_constrain.hpp b/stan/math/prim/fun/offset_multiplier_constrain.hpp index a1fd18ee228..067eb5c8ac8 100644 --- a/stan/math/prim/fun/offset_multiplier_constrain.hpp +++ b/stan/math/prim/fun/offset_multiplier_constrain.hpp @@ -106,8 +106,8 @@ inline auto offset_multiplier_constrain(const T& x, const M& mu, const S& sigma, check_finite("offset_multiplier_constrain", "offset", value_of_rec(mu_ref)); check_positive_finite("offset_multiplier_constrain", "multiplier", value_of_rec(sigma_ref)); - if (size(sigma_ref) == 1) { - lp += sum(multiply_log(size(x), sigma_ref)); + if (math::size(sigma_ref) == 1) { + lp += sum(multiply_log(math::size(x), sigma_ref)); } else { lp += sum(log(sigma_ref)); } diff --git a/stan/math/prim/fun/size_zero.hpp b/stan/math/prim/fun/size_zero.hpp index 8af469eee9f..c6aa81da3fa 100644 --- a/stan/math/prim/fun/size_zero.hpp +++ b/stan/math/prim/fun/size_zero.hpp @@ -1,6 +1,7 @@ #ifndef STAN_MATH_PRIM_FUN_SIZE_ZERO_HPP #define STAN_MATH_PRIM_FUN_SIZE_ZERO_HPP +#include #include #include @@ -16,7 +17,7 @@ namespace math { */ template inline bool size_zero(const T& x) { - return !size(x); + return !math::size(x); } /** diff --git a/stan/math/prim/functor/coupled_ode_system.hpp b/stan/math/prim/functor/coupled_ode_system.hpp index 90df071de8b..78a48ebb25a 100644 --- a/stan/math/prim/functor/coupled_ode_system.hpp +++ b/stan/math/prim/functor/coupled_ode_system.hpp @@ -68,7 +68,7 @@ struct coupled_ode_system_impl { dz_dt.resize(y.size()); Eigen::VectorXd f_y_t - = apply([&](const Args&... args) { return f_(t, y, msgs_, args...); }, + = math::apply([&](const Args&... args) { return f_(t, y, msgs_, args...); }, args_tuple_); check_size_match("coupled_ode_system", "dy_dt", f_y_t.size(), "states", diff --git a/stan/math/prim/functor/ode_ckrk.hpp b/stan/math/prim/functor/ode_ckrk.hpp index 3f8fd0a0972..10c7f901aa7 100644 --- a/stan/math/prim/functor/ode_ckrk.hpp +++ b/stan/math/prim/functor/ode_ckrk.hpp @@ -78,7 +78,7 @@ ode_ckrk_tol_impl(const char* function_name, const F& f, const T_y0& y0_arg, std::tuple...> args_ref_tuple(args...); - apply( + math::apply( [&](const auto&... args_ref) { // Code from https://stackoverflow.com/a/17340003 std::vector unused_temp{ @@ -101,7 +101,7 @@ ode_ckrk_tol_impl(const char* function_name, const F& f, const T_y0& y0_arg, using return_t = return_type_t; // creates basic or coupled system by template specializations - auto&& coupled_system = apply( + auto&& coupled_system = math::apply( [&](const auto&... args_ref) { return coupled_ode_system...>(f, y0, msgs, args_ref...); @@ -127,7 +127,7 @@ ode_ckrk_tol_impl(const char* function_name, const F& f, const T_y0& y0_arg, observer_initial_recorded = true; return; } - apply( + math::apply( [&](const auto&... args_ref) { y.emplace_back(ode_store_sensitivities( f, coupled_state, y0, t0, ts[time_index], msgs, args_ref...)); diff --git a/stan/math/prim/functor/ode_rk45.hpp b/stan/math/prim/functor/ode_rk45.hpp index 8a90bd1e2c7..4850b1169c6 100644 --- a/stan/math/prim/functor/ode_rk45.hpp +++ b/stan/math/prim/functor/ode_rk45.hpp @@ -79,7 +79,7 @@ ode_rk45_tol_impl(const char* function_name, const F& f, const T_y0& y0_arg, std::tuple...> args_ref_tuple(args...); - apply( + math::apply( [&](const auto&... args_ref) { // Code from https://stackoverflow.com/a/17340003 std::vector unused_temp{ @@ -102,7 +102,7 @@ ode_rk45_tol_impl(const char* function_name, const F& f, const T_y0& y0_arg, using return_t = return_type_t; // creates basic or coupled system by template specializations - auto&& coupled_system = apply( + auto&& coupled_system = math::apply( [&](const auto&... args_ref) { return coupled_ode_system...>(f, y0, msgs, args_ref...); @@ -128,7 +128,7 @@ ode_rk45_tol_impl(const char* function_name, const F& f, const T_y0& y0_arg, observer_initial_recorded = true; return; } - apply( + math::apply( [&](const auto&... args_ref) { y.emplace_back(ode_store_sensitivities( f, coupled_state, y0, t0, ts[time_index], msgs, args_ref...)); diff --git a/stan/math/prim/functor/reduce_sum.hpp b/stan/math/prim/functor/reduce_sum.hpp index 868de060f32..85390f1fcc4 100644 --- a/stan/math/prim/functor/reduce_sum.hpp +++ b/stan/math/prim/functor/reduce_sum.hpp @@ -80,7 +80,7 @@ struct reduce_sum_impl, sub_slice.emplace_back(vmapped_[i]); } - sum_ += apply( + sum_ += math::apply( [&](auto&&... args) { return ReduceFunction()(sub_slice, r.begin(), r.end() - 1, &msgs_, args...); diff --git a/stan/math/rev/functor/algebra_solver_newton.hpp b/stan/math/rev/functor/algebra_solver_newton.hpp index d77921cd90c..05729a4808a 100644 --- a/stan/math/rev/functor/algebra_solver_newton.hpp +++ b/stan/math/rev/functor/algebra_solver_newton.hpp @@ -142,7 +142,7 @@ Eigen::Matrix algebra_solver_newton_impl( const int64_t max_num_steps, const T_Args&... args) { const auto& x_ref = to_ref(value_of(x)); auto arena_args_tuple = make_chainable_ptr(std::make_tuple(eval(args)...)); - auto args_vals_tuple = apply( + auto args_vals_tuple = math::apply( [&](const auto&... args) { return std::make_tuple(to_ref(value_of(args))...); }, @@ -157,7 +157,7 @@ Eigen::Matrix algebra_solver_newton_impl( check_positive("algebra_solver_newton", "max_num_steps", max_num_steps); // Solve the system - Eigen::VectorXd theta_dbl = apply( + Eigen::VectorXd theta_dbl = math::apply( [&](const auto&... vals) { return kinsol_solve(f, x_ref, scaling_step_size, function_tolerance, max_num_steps, 1, 10, KIN_LINESEARCH, msgs, @@ -166,7 +166,7 @@ Eigen::Matrix algebra_solver_newton_impl( args_vals_tuple); auto f_wrt_x = [&](const auto& x) { - return apply([&](const auto&... args) { return f(x, msgs, args...); }, + return math::apply([&](const auto&... args) { return f(x, msgs, args...); }, args_vals_tuple); }; @@ -190,7 +190,7 @@ Eigen::Matrix algebra_solver_newton_impl( nested_rev_autodiff rev; Eigen::VectorXd ret_val = ret.val(); - auto x_nrad_ = apply( + auto x_nrad_ = math::apply( [&ret_val, &f, msgs](const auto&... args) { return eval(f(ret_val, msgs, args...)); }, diff --git a/stan/math/rev/functor/algebra_solver_powell.hpp b/stan/math/rev/functor/algebra_solver_powell.hpp index 5415f361cad..2d09f97ea8c 100644 --- a/stan/math/rev/functor/algebra_solver_powell.hpp +++ b/stan/math/rev/functor/algebra_solver_powell.hpp @@ -136,7 +136,7 @@ Eigen::VectorXd algebra_solver_powell_impl(const F& f, const T& x, auto args_vals_tuple = std::make_tuple(to_ref(args)...); auto f_wrt_x = [&args_vals_tuple, &f, msgs](const auto& x) { - return apply( + return math::apply( [&x, &f, msgs](const auto&... args) { return f(x, msgs, args...); }, args_vals_tuple); }; @@ -338,14 +338,14 @@ Eigen::Matrix algebra_solver_powell_impl( const int64_t max_num_steps, const T_Args&... args) { auto x_ref = eval(value_of(x)); auto arena_args_tuple = make_chainable_ptr(std::make_tuple(eval(args)...)); - auto args_vals_tuple = apply( + auto args_vals_tuple = math::apply( [&](const auto&... args) { return std::make_tuple(to_ref(value_of(args))...); }, *arena_args_tuple); auto f_wrt_x = [&args_vals_tuple, &f, msgs](const auto& x) { - return apply( + return math::apply( [&x, &f, msgs](const auto&... args) { return f(x, msgs, args...); }, args_vals_tuple); }; @@ -384,7 +384,7 @@ Eigen::Matrix algebra_solver_powell_impl( { nested_rev_autodiff rev; Eigen::VectorXd ret_val = ret.val(); - auto x_nrad_ = apply( + auto x_nrad_ = math::apply( [&](const auto&... args) { return eval(f(ret_val, msgs, args...)); }, *arena_args_tuple); x_nrad_.adj() = eta; diff --git a/stan/math/rev/functor/coupled_ode_system.hpp b/stan/math/rev/functor/coupled_ode_system.hpp index 1f043fe0e9a..b8b633b6378 100644 --- a/stan/math/rev/functor/coupled_ode_system.hpp +++ b/stan/math/rev/functor/coupled_ode_system.hpp @@ -126,7 +126,7 @@ struct coupled_ode_system_impl { y_vars.coeffRef(n) = z[n]; Eigen::Matrix f_y_t_vars - = apply([&](auto&&... args) { return f_(t, y_vars, msgs_, args...); }, + = math::apply([&](auto&&... args) { return f_(t, y_vars, msgs_, args...); }, local_args_tuple_); check_size_match("coupled_ode_system", "dy_dt", f_y_t_vars.size(), "states", @@ -143,7 +143,7 @@ struct coupled_ode_system_impl { sizeof(double) * args_adjoints_.size()); } - apply( + math::apply( [&](auto&&... args) { accumulate_adjoints(args_adjoints_.data(), args...); }, diff --git a/stan/math/rev/functor/cvodes_integrator.hpp b/stan/math/rev/functor/cvodes_integrator.hpp index 637526938e7..86e1da4aab1 100644 --- a/stan/math/rev/functor/cvodes_integrator.hpp +++ b/stan/math/rev/functor/cvodes_integrator.hpp @@ -105,7 +105,7 @@ class cvodes_integrator { const Eigen::VectorXd y_vec = Eigen::Map(y, N_); Eigen::VectorXd dy_dt_vec - = apply([&](auto&&... args) { return f_(t, y_vec, msgs_, args...); }, + = math::apply([&](auto&&... args) { return f_(t, y_vec, msgs_, args...); }, value_of_args_tuple_); check_size_match("cvodes_integrator", "dy_dt", dy_dt_vec.size(), "states", @@ -123,7 +123,7 @@ class cvodes_integrator { Eigen::MatrixXd Jfy; auto f_wrapped = [&](const Eigen::Matrix& y) { - return apply([&](auto&&... args) { return f_(t, y, msgs_, args...); }, + return math::apply([&](auto&&... args) { return f_(t, y, msgs_, args...); }, value_of_args_tuple_); }; @@ -214,7 +214,7 @@ class cvodes_integrator { // Code from: https://stackoverflow.com/a/17340003 . Should probably do // something better - apply( + math::apply( [&](auto&&... args) { std::vector unused_temp{ 0, (check_finite(function_name, "ode parameters and data", args), @@ -313,7 +313,7 @@ class cvodes_integrator { } } - y.emplace_back(apply( + y.emplace_back(math::apply( [&](auto&&... args) { return ode_store_sensitivities(f_, coupled_state_, y0_, t0_, ts_[n], msgs_, args...); diff --git a/stan/math/rev/functor/cvodes_integrator_adjoint.hpp b/stan/math/rev/functor/cvodes_integrator_adjoint.hpp index 117b869e89f..504605c171f 100644 --- a/stan/math/rev/functor/cvodes_integrator_adjoint.hpp +++ b/stan/math/rev/functor/cvodes_integrator_adjoint.hpp @@ -544,7 +544,7 @@ class cvodes_integrator_adjoint_vari : public vari_base { template constexpr auto rhs(double t, const yT& y, const std::tuple& args_tuple) const { - return apply( + return math::apply( [&](auto&&... args) { return solver_->f_(t, y, msgs_, args...); }, args_tuple); } @@ -641,7 +641,7 @@ class cvodes_integrator_adjoint_vari : public vari_base { f_y_t_vars.size(), "states", N_); f_y_t_vars.adj() = -Eigen::Map(NV_DATA_S(yB), N_); grad(); - apply( + math::apply( [&qBdot](auto&&... args) { accumulate_adjoints(NV_DATA_S(qBdot), args...); }, diff --git a/stan/math/rev/functor/dae.hpp b/stan/math/rev/functor/dae.hpp index b3ca6d2c6dc..92921fddcd8 100644 --- a/stan/math/rev/functor/dae.hpp +++ b/stan/math/rev/functor/dae.hpp @@ -66,14 +66,14 @@ dae_tol_impl(const char* func, const F& f, const T_yy& yy0, const T_yp& yp0, check_positive(func, "max_num_steps", max_num_steps); const auto& args_ref_tuple = std::make_tuple(to_ref(args)...); - apply( + math::apply( [&](auto&&... args) { std::vector unused_temp{ 0, (check_finite("dae", "DAE parameters and data", args), 0)...}; }, args_ref_tuple); - return apply( + return math::apply( [&](const auto&... args_refs) { dae_system...> dae(f, yy0, yp0, msgs, args_refs...); diff --git a/stan/math/rev/functor/dae_system.hpp b/stan/math/rev/functor/dae_system.hpp index 4e694524b7f..2a1f97f2bd8 100644 --- a/stan/math/rev/functor/dae_system.hpp +++ b/stan/math/rev/functor/dae_system.hpp @@ -99,7 +99,7 @@ class dae_system { } void eval_residual(double t) { - dbl_rr = apply( + dbl_rr = math::apply( [&](auto&&... args) { return f_(t, dbl_yy, dbl_yp, msgs_, args...); }, dbl_args_tuple_); } @@ -144,7 +144,7 @@ class dae_system { } Eigen::VectorXd g(m); - Eigen::Matrix fy = apply( + Eigen::Matrix fy = math::apply( [&](auto&&... args) { return dae->f_(t, yy_var, yp_var, dae->msgs_, args...); }, diff --git a/stan/math/rev/functor/integrate_1d.hpp b/stan/math/rev/functor/integrate_1d.hpp index be8ff106393..f9ba455ce38 100644 --- a/stan/math/rev/functor/integrate_1d.hpp +++ b/stan/math/rev/functor/integrate_1d.hpp @@ -57,7 +57,7 @@ inline return_type_t integrate_1d_impl( double integral = integrate( [&](const auto &x, const auto &xc) { - return apply( + return math::apply( [&](auto &&... val_args) { return f(x, xc, msgs, val_args...); }, args_val_tuple); }, @@ -79,7 +79,7 @@ inline return_type_t integrate_1d_impl( } if (is_var::value && !is_inf(a)) { - *partials_ptr = apply( + *partials_ptr = math::apply( [&f, a_val, msgs](auto &&... val_args) { return -f(a_val, 0.0, msgs, val_args...); }, @@ -88,7 +88,7 @@ inline return_type_t integrate_1d_impl( } if (!is_inf(b) && is_var::value) { - *partials_ptr = apply( + *partials_ptr = math::apply( [&f, b_val, msgs](auto &&... val_args) { return f(b_val, 0.0, msgs, val_args...); }, @@ -104,7 +104,7 @@ inline return_type_t integrate_1d_impl( // Save the varis so it's easy to efficiently access the nth adjoint std::vector local_varis(num_vars_args); - apply( + math::apply( [&](const auto &... args) { save_varis(local_varis.data(), args...); }, @@ -118,7 +118,7 @@ inline return_type_t integrate_1d_impl( argument_nest.set_zero_all_adjoints(); nested_rev_autodiff gradient_nest; - var fx = apply( + var fx = math::apply( [&f, &x, &xc, msgs](auto &&... local_args) { return f(x, xc, msgs, local_args...); }, diff --git a/stan/math/rev/functor/kinsol_data.hpp b/stan/math/rev/functor/kinsol_data.hpp index 73f74d9e684..a0847cf9fbd 100644 --- a/stan/math/rev/functor/kinsol_data.hpp +++ b/stan/math/rev/functor/kinsol_data.hpp @@ -74,7 +74,7 @@ class kinsol_system_data { Eigen::Map f_eval_map(N_VGetArrayPointer(f_eval), explicit_system->N_); - auto result = apply( + auto result = math::apply( [&](const auto&... args) { return explicit_system->f_(x_eigen, explicit_system->msgs_, args...); }, @@ -109,7 +109,7 @@ class kinsol_system_data { explicit_system->N_); auto f_wrt_x = [&](const auto& x) { - return apply( + return math::apply( [&](const auto&... args) { return explicit_system->f_(x, explicit_system->msgs_, args...); }, diff --git a/stan/math/rev/functor/ode_adams.hpp b/stan/math/rev/functor/ode_adams.hpp index ee0bdafbbd5..1c694539f18 100644 --- a/stan/math/rev/functor/ode_adams.hpp +++ b/stan/math/rev/functor/ode_adams.hpp @@ -54,7 +54,7 @@ ode_adams_tol_impl(const char* function_name, const F& f, const T_y0& y0, long int max_num_steps, // NOLINT(runtime/int) std::ostream* msgs, const T_Args&... args) { const auto& args_ref_tuple = std::make_tuple(to_ref(args)...); - return apply( + return math::apply( [&](const auto&... args_refs) { cvodes_integrator...> integrator(function_name, f, y0, t0, ts, relative_tolerance, diff --git a/stan/math/rev/functor/ode_bdf.hpp b/stan/math/rev/functor/ode_bdf.hpp index a07af2e3339..b9775992fc4 100644 --- a/stan/math/rev/functor/ode_bdf.hpp +++ b/stan/math/rev/functor/ode_bdf.hpp @@ -55,7 +55,7 @@ ode_bdf_tol_impl(const char* function_name, const F& f, const T_y0& y0, long int max_num_steps, // NOLINT(runtime/int) std::ostream* msgs, const T_Args&... args) { const auto& args_ref_tuple = std::make_tuple(to_ref(args)...); - return apply( + return math::apply( [&](const auto&... args_refs) { cvodes_integrator...> integrator(function_name, f, y0, t0, ts, relative_tolerance, diff --git a/stan/math/rev/functor/reduce_sum.hpp b/stan/math/rev/functor/reduce_sum.hpp index 8002a320117..da9ac216880 100644 --- a/stan/math/rev/functor/reduce_sum.hpp +++ b/stan/math/rev/functor/reduce_sum.hpp @@ -114,7 +114,7 @@ struct reduce_sum_impl, ReturnType, // scope. In this case no need for zeroing adjoints, since the // fresh copy has all adjoints set to zero. local_args_tuple_scope_.stack_.execute([&]() { - apply( + math::apply( [&](auto&&... args) { local_args_tuple_scope_.args_tuple_holder_ = std::make_unique< typename scoped_args_tuple::args_tuple_t>( @@ -141,7 +141,7 @@ struct reduce_sum_impl, ReturnType, } // Perform calculation - var sub_sum_v = apply( + var sub_sum_v = math::apply( [&](auto&&... args) { return ReduceFunction()(local_sub_slice, r.begin(), r.end() - 1, &msgs_, args...); @@ -159,7 +159,7 @@ struct reduce_sum_impl, ReturnType, std::move(local_sub_slice)); // Accumulate adjoints of shared_arguments - apply( + math::apply( [&](auto&&... args) { accumulate_adjoints(args_adjoints_.data(), args...); }, From 5805d9706d1123270ffe264f904c76bc2402585a Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 28 Mar 2022 19:43:11 +0800 Subject: [PATCH 02/29] Update includes --- stan/math/prim/fun/offset_multiplier_constrain.hpp | 1 + stan/math/prim/functor/reduce_sum.hpp | 1 + stan/math/rev/functor/algebra_solver_newton.hpp | 1 + stan/math/rev/functor/coupled_ode_system.hpp | 1 + stan/math/rev/functor/cvodes_integrator.hpp | 1 + stan/math/rev/functor/cvodes_integrator_adjoint.hpp | 1 + stan/math/rev/functor/dae.hpp | 1 + stan/math/rev/functor/integrate_1d.hpp | 1 + stan/math/rev/functor/ode_adams.hpp | 1 + stan/math/rev/functor/ode_bdf.hpp | 1 + 10 files changed, 10 insertions(+) diff --git a/stan/math/prim/fun/offset_multiplier_constrain.hpp b/stan/math/prim/fun/offset_multiplier_constrain.hpp index 067eb5c8ac8..85a58ce4771 100644 --- a/stan/math/prim/fun/offset_multiplier_constrain.hpp +++ b/stan/math/prim/fun/offset_multiplier_constrain.hpp @@ -9,6 +9,7 @@ #include #include #include +#include #include namespace stan { diff --git a/stan/math/prim/functor/reduce_sum.hpp b/stan/math/prim/functor/reduce_sum.hpp index 85390f1fcc4..ff0b4f5d592 100644 --- a/stan/math/prim/functor/reduce_sum.hpp +++ b/stan/math/prim/functor/reduce_sum.hpp @@ -3,6 +3,7 @@ #include #include +#include #include #include diff --git a/stan/math/rev/functor/algebra_solver_newton.hpp b/stan/math/rev/functor/algebra_solver_newton.hpp index 05729a4808a..abf9b074216 100644 --- a/stan/math/rev/functor/algebra_solver_newton.hpp +++ b/stan/math/rev/functor/algebra_solver_newton.hpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include diff --git a/stan/math/rev/functor/coupled_ode_system.hpp b/stan/math/rev/functor/coupled_ode_system.hpp index b8b633b6378..1b78f51111d 100644 --- a/stan/math/rev/functor/coupled_ode_system.hpp +++ b/stan/math/rev/functor/coupled_ode_system.hpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include diff --git a/stan/math/rev/functor/cvodes_integrator.hpp b/stan/math/rev/functor/cvodes_integrator.hpp index 86e1da4aab1..4d0c959cc64 100644 --- a/stan/math/rev/functor/cvodes_integrator.hpp +++ b/stan/math/rev/functor/cvodes_integrator.hpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include diff --git a/stan/math/rev/functor/cvodes_integrator_adjoint.hpp b/stan/math/rev/functor/cvodes_integrator_adjoint.hpp index 504605c171f..0c23f0758bf 100644 --- a/stan/math/rev/functor/cvodes_integrator_adjoint.hpp +++ b/stan/math/rev/functor/cvodes_integrator_adjoint.hpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include diff --git a/stan/math/rev/functor/dae.hpp b/stan/math/rev/functor/dae.hpp index 92921fddcd8..77538e1f64e 100644 --- a/stan/math/rev/functor/dae.hpp +++ b/stan/math/rev/functor/dae.hpp @@ -1,6 +1,7 @@ #ifndef STAN_MATH_REV_FUNCTOR_DAE_HPP #define STAN_MATH_REV_FUNCTOR_DAE_HPP +#include #include #include #include diff --git a/stan/math/rev/functor/integrate_1d.hpp b/stan/math/rev/functor/integrate_1d.hpp index f9ba455ce38..60607db7894 100644 --- a/stan/math/rev/functor/integrate_1d.hpp +++ b/stan/math/rev/functor/integrate_1d.hpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include diff --git a/stan/math/rev/functor/ode_adams.hpp b/stan/math/rev/functor/ode_adams.hpp index 1c694539f18..500cd2e4c92 100644 --- a/stan/math/rev/functor/ode_adams.hpp +++ b/stan/math/rev/functor/ode_adams.hpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include diff --git a/stan/math/rev/functor/ode_bdf.hpp b/stan/math/rev/functor/ode_bdf.hpp index b9775992fc4..009bfe75c00 100644 --- a/stan/math/rev/functor/ode_bdf.hpp +++ b/stan/math/rev/functor/ode_bdf.hpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include From 2742f3d5535fafd4b4ff36d5a46c95a82ad007f4 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 28 Mar 2022 20:00:25 +0800 Subject: [PATCH 03/29] Size qualifier --- stan/math/prim/prob/beta_proportion_lpdf.hpp | 2 +- stan/math/prim/prob/binomial_logit_lpmf.hpp | 4 ++-- stan/math/prim/prob/cauchy_lpdf.hpp | 2 +- stan/math/prim/prob/chi_square_lpdf.hpp | 4 ++-- stan/math/prim/prob/double_exponential_lpdf.hpp | 2 +- stan/math/prim/prob/exp_mod_normal_lpdf.hpp | 2 +- stan/math/prim/prob/exponential_lccdf.hpp | 4 ++-- stan/math/prim/prob/exponential_lpdf.hpp | 4 ++-- stan/math/prim/prob/frechet_lpdf.hpp | 2 +- stan/math/prim/prob/gamma_lpdf.hpp | 2 +- stan/math/prim/prob/gumbel_lpdf.hpp | 2 +- stan/math/prim/prob/inv_chi_square_lpdf.hpp | 4 ++-- stan/math/prim/prob/inv_gamma_lpdf.hpp | 2 +- stan/math/prim/prob/logistic_lpdf.hpp | 2 +- stan/math/prim/prob/lognormal_lpdf.hpp | 4 ++-- stan/math/prim/prob/normal_lpdf.hpp | 2 +- stan/math/prim/prob/normal_sufficient_lpdf.hpp | 6 +++--- stan/math/prim/prob/ordered_logistic_lpmf.hpp | 2 +- stan/math/prim/prob/ordered_probit_lpmf.hpp | 2 +- stan/math/prim/prob/pareto_lpdf.hpp | 2 +- stan/math/prim/prob/pareto_type_2_lpdf.hpp | 4 ++-- stan/math/prim/prob/poisson_log_lpmf.hpp | 4 ++-- stan/math/prim/prob/poisson_lpmf.hpp | 4 ++-- stan/math/prim/prob/rayleigh_lpdf.hpp | 4 ++-- stan/math/prim/prob/skew_double_exponential_lpdf.hpp | 4 ++-- stan/math/prim/prob/skew_normal_lpdf.hpp | 2 +- stan/math/prim/prob/student_t_lpdf.hpp | 4 ++-- stan/math/prim/prob/uniform_lcdf.hpp | 4 ++-- stan/math/prim/prob/uniform_lpdf.hpp | 4 ++-- stan/math/prim/prob/von_mises_lpdf.hpp | 2 +- stan/math/prim/prob/weibull_lpdf.hpp | 2 +- 31 files changed, 47 insertions(+), 47 deletions(-) diff --git a/stan/math/prim/prob/beta_proportion_lpdf.hpp b/stan/math/prim/prob/beta_proportion_lpdf.hpp index c82ba7d40b5..523fdc1c138 100644 --- a/stan/math/prim/prob/beta_proportion_lpdf.hpp +++ b/stan/math/prim/prob/beta_proportion_lpdf.hpp @@ -89,7 +89,7 @@ return_type_t beta_proportion_lpdf(const T_y& y, size_t N = max_size(y, mu, kappa); T_partials_return logp(0); if (include_summand::value) { - logp += sum(lgamma(kappa_val)) * N / size(kappa); + logp += sum(lgamma(kappa_val)) * N / math::size(kappa); } if (include_summand::value) { logp -= sum(lgamma(mukappa) + lgamma(kappa_val - mukappa)) * N diff --git a/stan/math/prim/prob/binomial_logit_lpmf.hpp b/stan/math/prim/prob/binomial_logit_lpmf.hpp index d530ee15a4b..6c784c714da 100644 --- a/stan/math/prim/prob/binomial_logit_lpmf.hpp +++ b/stan/math/prim/prob/binomial_logit_lpmf.hpp @@ -87,10 +87,10 @@ return_type_t binomial_logit_lpmf(const T_n& n, const T_N& N, ops_partials.edge1_.partials_ = n_val * inv_logit_neg_alpha - (N_val - n_val) * inv_logit_alpha; } else { - T_partials_return sum_n = sum(n_val) * maximum_size / size(n); + T_partials_return sum_n = sum(n_val) * maximum_size / math::size(n); ops_partials.edge1_.partials_[0] = forward_as( sum_n * inv_logit_neg_alpha - - (sum(N_val) * maximum_size / size(N) - sum_n) * inv_logit_alpha); + - (sum(N_val) * maximum_size / math::size(N) - sum_n) * inv_logit_alpha); } } diff --git a/stan/math/prim/prob/cauchy_lpdf.hpp b/stan/math/prim/prob/cauchy_lpdf.hpp index 59dba34dcfc..6e16581e786 100644 --- a/stan/math/prim/prob/cauchy_lpdf.hpp +++ b/stan/math/prim/prob/cauchy_lpdf.hpp @@ -84,7 +84,7 @@ return_type_t cauchy_lpdf(const T_y& y, const T_loc& mu, logp -= N * LOG_PI; } if (include_summand::value) { - logp -= sum(log(sigma_val)) * N / size(sigma); + logp -= sum(log(sigma_val)) * N / math::size(sigma); } if (!is_constant_all::value) { diff --git a/stan/math/prim/prob/chi_square_lpdf.hpp b/stan/math/prim/prob/chi_square_lpdf.hpp index d2044d75986..885d9a3c988 100644 --- a/stan/math/prim/prob/chi_square_lpdf.hpp +++ b/stan/math/prim/prob/chi_square_lpdf.hpp @@ -74,12 +74,12 @@ return_type_t chi_square_lpdf(const T_y& y, const T_dof& nu) { T_partials_return logp(0); if (include_summand::value) { - logp -= sum(nu_val * HALF_LOG_TWO + lgamma(half_nu)) * N / size(nu); + logp -= sum(nu_val * HALF_LOG_TWO + lgamma(half_nu)) * N / math::size(nu); } logp += sum((half_nu - 1.0) * log_y); if (include_summand::value) { - logp -= 0.5 * sum(y_val) * N / size(y); + logp -= 0.5 * sum(y_val) * N / math::size(y); } operands_and_partials ops_partials(y_ref, nu_ref); diff --git a/stan/math/prim/prob/double_exponential_lpdf.hpp b/stan/math/prim/prob/double_exponential_lpdf.hpp index e15dfeceebe..3db919362d2 100644 --- a/stan/math/prim/prob/double_exponential_lpdf.hpp +++ b/stan/math/prim/prob/double_exponential_lpdf.hpp @@ -83,7 +83,7 @@ return_type_t double_exponential_lpdf( logp -= N * LOG_TWO; } if (include_summand::value) { - logp -= sum(log(sigma_val)) * N / size(sigma); + logp -= sum(log(sigma_val)) * N / math::size(sigma); } logp -= sum(scaled_diff); diff --git a/stan/math/prim/prob/exp_mod_normal_lpdf.hpp b/stan/math/prim/prob/exp_mod_normal_lpdf.hpp index b2db8f387c9..ba3eddbcbde 100644 --- a/stan/math/prim/prob/exp_mod_normal_lpdf.hpp +++ b/stan/math/prim/prob/exp_mod_normal_lpdf.hpp @@ -79,7 +79,7 @@ return_type_t exp_mod_normal_lpdf( logp -= LOG_TWO * N; } if (include_summand::value) { - logp += sum(log(lambda_val)) * N / size(lambda); + logp += sum(log(lambda_val)) * N / math::size(lambda); } const auto& log_erfc_calc = log(erfc_calc); logp diff --git a/stan/math/prim/prob/exponential_lccdf.hpp b/stan/math/prim/prob/exponential_lccdf.hpp index d3e9d09deb4..c48c90ab9d3 100644 --- a/stan/math/prim/prob/exponential_lccdf.hpp +++ b/stan/math/prim/prob/exponential_lccdf.hpp @@ -47,7 +47,7 @@ return_type_t exponential_lccdf(const T_y& y, using beta_val_array = Eigen::Array; if (is_vector::value && !is_vector::value) { ops_partials.edge1_.partials_ = T_partials_array::Constant( - size(y), -forward_as(beta_val)); + math::size(y), -forward_as(beta_val)); } else if (is_vector::value) { ops_partials.edge1_.partials_ = -forward_as(beta_val); } else { @@ -59,7 +59,7 @@ return_type_t exponential_lccdf(const T_y& y, using y_val_array = Eigen::Array; if (is_vector::value && !is_vector::value) { ops_partials.edge2_.partials_ = T_partials_array::Constant( - size(beta), -forward_as(y_val)); + math::size(beta), -forward_as(y_val)); } else if (is_vector::value) { ops_partials.edge2_.partials_ = -forward_as(y_val); } else { diff --git a/stan/math/prim/prob/exponential_lpdf.hpp b/stan/math/prim/prob/exponential_lpdf.hpp index 4328c1af2d6..18f3bbfd0da 100644 --- a/stan/math/prim/prob/exponential_lpdf.hpp +++ b/stan/math/prim/prob/exponential_lpdf.hpp @@ -76,7 +76,7 @@ return_type_t exponential_lpdf(const T_y& y, T_partials_return logp(0.0); if (include_summand::value) { - logp = sum(log(beta_val)) * max_size(y, beta) / size(beta); + logp = sum(log(beta_val)) * max_size(y, beta) / math::size(beta); } if (include_summand::value) { logp -= sum(beta_val * y_val); @@ -87,7 +87,7 @@ return_type_t exponential_lpdf(const T_y& y, using beta_val_array = Eigen::Array; if (is_vector::value && !is_vector::value) { ops_partials.edge1_.partials_ = T_partials_array::Constant( - size(y), -forward_as(beta_val)); + math::size(y), -forward_as(beta_val)); } else if (is_vector::value) { ops_partials.edge1_.partials_ = -forward_as(beta_val); } else { diff --git a/stan/math/prim/prob/frechet_lpdf.hpp b/stan/math/prim/prob/frechet_lpdf.hpp index fe0f6783bef..b305f0a8f20 100644 --- a/stan/math/prim/prob/frechet_lpdf.hpp +++ b/stan/math/prim/prob/frechet_lpdf.hpp @@ -72,7 +72,7 @@ return_type_t frechet_lpdf(const T_y& y, size_t N = max_size(y, alpha, sigma); T_partials_return logp = -sum(sigma_div_y_pow_alpha); if (include_summand::value) { - logp += sum(log(alpha_val)) * N / size(alpha); + logp += sum(log(alpha_val)) * N / math::size(alpha); } if (include_summand::value) { logp -= sum((alpha_val + 1.0) * log_y) * N / max_size(y, alpha); diff --git a/stan/math/prim/prob/gamma_lpdf.hpp b/stan/math/prim/prob/gamma_lpdf.hpp index ba289902c9d..50e7a6b65c8 100644 --- a/stan/math/prim/prob/gamma_lpdf.hpp +++ b/stan/math/prim/prob/gamma_lpdf.hpp @@ -92,7 +92,7 @@ return_type_t gamma_lpdf(const T_y& y, size_t N = max_size(y, alpha, beta); T_partials_return logp(0.0); if (include_summand::value) { - logp = -sum(lgamma(alpha_val)) * N / size(alpha); + logp = -sum(lgamma(alpha_val)) * N / math::size(alpha); } const auto& log_y = to_ref_if::value>(log(y_val)); if (include_summand::value) { diff --git a/stan/math/prim/prob/gumbel_lpdf.hpp b/stan/math/prim/prob/gumbel_lpdf.hpp index 998e4140f37..22814b8982b 100644 --- a/stan/math/prim/prob/gumbel_lpdf.hpp +++ b/stan/math/prim/prob/gumbel_lpdf.hpp @@ -78,7 +78,7 @@ return_type_t gumbel_lpdf(const T_y& y, const T_loc& mu, size_t N = max_size(y, mu, beta); T_partials_return logp = -sum(y_minus_mu_over_beta + exp_y_m_mu_over_beta); if (include_summand::value) { - logp -= sum(log(beta_val)) * N / size(beta); + logp -= sum(log(beta_val)) * N / math::size(beta); } if (!is_constant_all::value) { diff --git a/stan/math/prim/prob/inv_chi_square_lpdf.hpp b/stan/math/prim/prob/inv_chi_square_lpdf.hpp index aff4dece7f8..d55838677e0 100644 --- a/stan/math/prim/prob/inv_chi_square_lpdf.hpp +++ b/stan/math/prim/prob/inv_chi_square_lpdf.hpp @@ -82,11 +82,11 @@ return_type_t inv_chi_square_lpdf(const T_y& y, const T_dof& nu) { size_t N = max_size(y, nu); T_partials_return logp = -sum((half_nu + 1.0) * log_y); if (include_summand::value) { - logp -= (sum(nu_val) * HALF_LOG_TWO + sum(lgamma(half_nu))) * N / size(nu); + logp -= (sum(nu_val) * HALF_LOG_TWO + sum(lgamma(half_nu))) * N / math::size(nu); } if (include_summand::value) { const auto& inv_y = to_ref_if::value>(inv(y_val)); - logp -= 0.5 * sum(inv_y) * N / size(y); + logp -= 0.5 * sum(inv_y) * N / math::size(y); if (!is_constant_all::value) { ops_partials.edge1_.partials_ = (0.5 * inv_y - half_nu - 1.0) * inv_y; } diff --git a/stan/math/prim/prob/inv_gamma_lpdf.hpp b/stan/math/prim/prob/inv_gamma_lpdf.hpp index ceee125329f..0184a6ba572 100644 --- a/stan/math/prim/prob/inv_gamma_lpdf.hpp +++ b/stan/math/prim/prob/inv_gamma_lpdf.hpp @@ -83,7 +83,7 @@ return_type_t inv_gamma_lpdf(const T_y& y, size_t N = max_size(y, alpha, beta); if (include_summand::value) { - logp -= sum(lgamma(alpha_val)) * N / size(alpha); + logp -= sum(lgamma(alpha_val)) * N / math::size(alpha); } if (include_summand::value) { const auto& log_beta diff --git a/stan/math/prim/prob/logistic_lpdf.hpp b/stan/math/prim/prob/logistic_lpdf.hpp index 5ed1b4982ba..f6359a50142 100644 --- a/stan/math/prim/prob/logistic_lpdf.hpp +++ b/stan/math/prim/prob/logistic_lpdf.hpp @@ -66,7 +66,7 @@ return_type_t logistic_lpdf(const T_y& y, const T_loc& mu, T_partials_return logp = -sum(y_minus_mu_div_sigma) - 2.0 * sum(log1p(exp(-y_minus_mu_div_sigma))); if (include_summand::value) { - logp -= sum(log(sigma_val)) * N / size(sigma); + logp -= sum(log(sigma_val)) * N / math::size(sigma); } if (!is_constant_all::value) { diff --git a/stan/math/prim/prob/lognormal_lpdf.hpp b/stan/math/prim/prob/lognormal_lpdf.hpp index 4afdbae67b5..422b19d65d6 100644 --- a/stan/math/prim/prob/lognormal_lpdf.hpp +++ b/stan/math/prim/prob/lognormal_lpdf.hpp @@ -74,10 +74,10 @@ return_type_t lognormal_lpdf(const T_y& y, const T_loc& mu, T_partials_return logp = N * NEG_LOG_SQRT_TWO_PI - 0.5 * sum(square(logy_m_mu) * inv_sigma_sq); if (include_summand::value) { - logp -= sum(log(sigma_val)) * N / size(sigma); + logp -= sum(log(sigma_val)) * N / math::size(sigma); } if (include_summand::value) { - logp -= sum(log_y) * N / size(y); + logp -= sum(log_y) * N / math::size(y); } if (!is_constant_all::value) { diff --git a/stan/math/prim/prob/normal_lpdf.hpp b/stan/math/prim/prob/normal_lpdf.hpp index e5a1be8265a..5d688964549 100644 --- a/stan/math/prim/prob/normal_lpdf.hpp +++ b/stan/math/prim/prob/normal_lpdf.hpp @@ -85,7 +85,7 @@ inline return_type_t normal_lpdf(const T_y& y, logp += NEG_LOG_SQRT_TWO_PI * N; } if (include_summand::value) { - logp -= sum(log(sigma_val)) * N / size(sigma); + logp -= sum(log(sigma_val)) * N / math::size(sigma); } if (!is_constant_all::value) { diff --git a/stan/math/prim/prob/normal_sufficient_lpdf.hpp b/stan/math/prim/prob/normal_sufficient_lpdf.hpp index 475a13aefd1..52b5d4ed359 100644 --- a/stan/math/prim/prob/normal_sufficient_lpdf.hpp +++ b/stan/math/prim/prob/normal_sufficient_lpdf.hpp @@ -40,7 +40,7 @@ namespace math { * * @param y_bar (Sequence of) scalar(s) (sample average(s)). * @param s_squared (Sequence of) sum(s) of sample squared errors - * @param n_obs (Sequence of) sample size(s) + * @param n_obs (Sequence of) sample math::size(s) * @param mu (Sequence of) location parameter(s) * for the normal distribution. * @param sigma (Sequence of) scale parameters for the normal @@ -107,7 +107,7 @@ return_type_t normal_sufficient_lpdf( size_t N = max_size(y_bar, s_squared, n_obs, mu, sigma); T_partials_return logp = -sum(cons_expr / (2 * sigma_squared)); if (include_summand::value) { - logp += NEG_LOG_SQRT_TWO_PI * sum(n_obs_val) * N / size(n_obs); + logp += NEG_LOG_SQRT_TWO_PI * sum(n_obs_val) * N / math::size(n_obs); } if (include_summand::value) { logp -= sum(n_obs_val * log(sigma_val)) * N / max_size(n_obs, sigma); @@ -141,7 +141,7 @@ return_type_t normal_sufficient_lpdf( } else { forward_as>( ops_partials.edge2_.partials_) - = -0.5 / sigma_squared * N / size(sigma); + = -0.5 / sigma_squared * N / math::size(sigma); } } } diff --git a/stan/math/prim/prob/ordered_logistic_lpmf.hpp b/stan/math/prim/prob/ordered_logistic_lpmf.hpp index ccc92be4bd5..858c6c720ce 100644 --- a/stan/math/prim/prob/ordered_logistic_lpmf.hpp +++ b/stan/math/prim/prob/ordered_logistic_lpmf.hpp @@ -86,7 +86,7 @@ return_type_t ordered_logistic_lpmf(const T_y& y, T_cut_ref c_ref = c; vector_seq_view c_vec(c_ref); - int N = size(lambda); + int N = math::size(lambda); int C_l = size_mvt(c); check_consistent_sizes(function, "Integers", y, "Locations", lambda); diff --git a/stan/math/prim/prob/ordered_probit_lpmf.hpp b/stan/math/prim/prob/ordered_probit_lpmf.hpp index b7a89401737..18bbfdd0174 100644 --- a/stan/math/prim/prob/ordered_probit_lpmf.hpp +++ b/stan/math/prim/prob/ordered_probit_lpmf.hpp @@ -54,7 +54,7 @@ return_type_t ordered_probit_lpmf(const T_y& y, static const char* function = "ordered_probit"; check_nonzero_size(function, "Cut-points", c); - int N = size(lambda); + int N = math::size(lambda); int C_l = size_mvt(c); vector_seq_view c_vec(c); int K = c_vec[0].size() + 1; diff --git a/stan/math/prim/prob/pareto_lpdf.hpp b/stan/math/prim/prob/pareto_lpdf.hpp index 65f7d0e646d..e003450d7d7 100644 --- a/stan/math/prim/prob/pareto_lpdf.hpp +++ b/stan/math/prim/prob/pareto_lpdf.hpp @@ -63,7 +63,7 @@ return_type_t pareto_lpdf(const T_y& y, size_t N = max_size(y, y_min, alpha); T_partials_return logp(0); if (include_summand::value) { - logp = sum(log(alpha_val)) * N / size(alpha); + logp = sum(log(alpha_val)) * N / math::size(alpha); } if (include_summand::value) { logp -= sum(alpha_val * log_y + log_y) * N / max_size(alpha, y); diff --git a/stan/math/prim/prob/pareto_type_2_lpdf.hpp b/stan/math/prim/prob/pareto_type_2_lpdf.hpp index 3946f0a29d8..37500c11fd8 100644 --- a/stan/math/prim/prob/pareto_type_2_lpdf.hpp +++ b/stan/math/prim/prob/pareto_type_2_lpdf.hpp @@ -66,10 +66,10 @@ return_type_t pareto_type_2_lpdf( size_t N = max_size(y, mu, lambda, alpha); T_partials_return logp(0.0); if (include_summand::value) { - logp += sum(log(alpha_val)) * N / size(alpha); + logp += sum(log(alpha_val)) * N / math::size(alpha); } if (include_summand::value) { - logp -= sum(log(lambda_val)) * N / size(lambda); + logp -= sum(log(lambda_val)) * N / math::size(lambda); } if (include_summand::value) { logp -= sum((alpha_val + 1.0) * log1p_scaled_diff); diff --git a/stan/math/prim/prob/poisson_log_lpmf.hpp b/stan/math/prim/prob/poisson_log_lpmf.hpp index 44c884d8839..85be278124c 100644 --- a/stan/math/prim/prob/poisson_log_lpmf.hpp +++ b/stan/math/prim/prob/poisson_log_lpmf.hpp @@ -73,10 +73,10 @@ return_type_t poisson_log_lpmf(const T_n& n, T_partials_return logp = sum(n_val * alpha_val); if (include_summand::value) { - logp -= sum(exp_alpha) * N / size(alpha); + logp -= sum(exp_alpha) * N / math::size(alpha); } if (include_summand::value) { - logp -= sum(lgamma(n_val + 1.0)) * N / size(n); + logp -= sum(lgamma(n_val + 1.0)) * N / math::size(n); } if (!is_constant_all::value) { diff --git a/stan/math/prim/prob/poisson_lpmf.hpp b/stan/math/prim/prob/poisson_lpmf.hpp index 85732a158ed..01ab3832a95 100644 --- a/stan/math/prim/prob/poisson_lpmf.hpp +++ b/stan/math/prim/prob/poisson_lpmf.hpp @@ -68,10 +68,10 @@ return_type_t poisson_lpmf(const T_n& n, const T_rate& lambda) { T_partials_return logp = stan::math::sum(multiply_log(n_val, lambda_val)); if (include_summand::value) { - logp -= sum(lambda_val) * N / size(lambda); + logp -= sum(lambda_val) * N / math::size(lambda); } if (include_summand::value) { - logp -= sum(lgamma(n_val + 1.0)) * N / size(n); + logp -= sum(lgamma(n_val + 1.0)) * N / math::size(n); } if (!is_constant_all::value) { diff --git a/stan/math/prim/prob/rayleigh_lpdf.hpp b/stan/math/prim/prob/rayleigh_lpdf.hpp index aebd139c317..1e447b33956 100644 --- a/stan/math/prim/prob/rayleigh_lpdf.hpp +++ b/stan/math/prim/prob/rayleigh_lpdf.hpp @@ -56,10 +56,10 @@ return_type_t rayleigh_lpdf(const T_y& y, const T_scale& sigma) { size_t N = max_size(y, sigma); T_partials_return logp = -0.5 * sum(square(y_over_sigma)); if (include_summand::value) { - logp -= 2.0 * sum(log(sigma_val)) * N / size(sigma); + logp -= 2.0 * sum(log(sigma_val)) * N / math::size(sigma); } if (include_summand::value) { - logp += sum(log(y_val)) * N / size(y); + logp += sum(log(y_val)) * N / math::size(y); } if (!is_constant_all::value) { diff --git a/stan/math/prim/prob/skew_double_exponential_lpdf.hpp b/stan/math/prim/prob/skew_double_exponential_lpdf.hpp index c14ba95f0c1..d3b6d5cea3e 100644 --- a/stan/math/prim/prob/skew_double_exponential_lpdf.hpp +++ b/stan/math/prim/prob/skew_double_exponential_lpdf.hpp @@ -97,10 +97,10 @@ return_type_t skew_double_exponential_lpdf( logp += N * LOG_TWO; } if (include_summand::value) { - logp -= sum(log(sigma_val)) * N / size(sigma); + logp -= sum(log(sigma_val)) * N / math::size(sigma); } if (include_summand::value) { - logp += sum(log(tau_val) + log1m(tau_val)) * N / size(tau); + logp += sum(log(tau_val) + log1m(tau_val)) * N / math::size(tau); } if (!is_constant_all::value) { diff --git a/stan/math/prim/prob/skew_normal_lpdf.hpp b/stan/math/prim/prob/skew_normal_lpdf.hpp index c8481abf6c2..d811f507ae5 100644 --- a/stan/math/prim/prob/skew_normal_lpdf.hpp +++ b/stan/math/prim/prob/skew_normal_lpdf.hpp @@ -76,7 +76,7 @@ return_type_t skew_normal_lpdf( logp -= HALF_LOG_TWO_PI * N; } if (include_summand::value) { - logp -= sum(log(sigma_val)) * N / size(sigma); + logp -= sum(log(sigma_val)) * N / math::size(sigma); } if (include_summand::value) { logp -= sum(square(y_minus_mu_over_sigma)) * 0.5 * N diff --git a/stan/math/prim/prob/student_t_lpdf.hpp b/stan/math/prim/prob/student_t_lpdf.hpp index 7df5ea97a22..b6ee5f3f176 100644 --- a/stan/math/prim/prob/student_t_lpdf.hpp +++ b/stan/math/prim/prob/student_t_lpdf.hpp @@ -111,10 +111,10 @@ return_type_t student_t_lpdf(const T_y& y, if (include_summand::value) { logp += (sum(lgamma(half_nu + 0.5)) - sum(lgamma(half_nu)) - 0.5 * sum(log(nu_val))) - * N / size(nu); + * N / math::size(nu); } if (include_summand::value) { - logp -= sum(log(sigma_val)) * N / size(sigma); + logp -= sum(log(sigma_val)) * N / math::size(sigma); } if (!is_constant_all::value) { diff --git a/stan/math/prim/prob/uniform_lcdf.hpp b/stan/math/prim/prob/uniform_lcdf.hpp index 174a847b0db..83e8b22e0d8 100644 --- a/stan/math/prim/prob/uniform_lcdf.hpp +++ b/stan/math/prim/prob/uniform_lcdf.hpp @@ -68,7 +68,7 @@ return_type_t uniform_lcdf(const T_y& y, const T_low& alpha, if (!is_constant_all::value) { if (!is_vector::value && is_vector::value && !is_vector::value) { - ops_partials.edge1_.partials_ = size(beta) * inv(y_minus_alpha); + ops_partials.edge1_.partials_ = math::size(beta) * inv(y_minus_alpha); } else { ops_partials.edge1_.partials_ = inv(y_minus_alpha); } @@ -80,7 +80,7 @@ return_type_t uniform_lcdf(const T_y& y, const T_low& alpha, if (!is_constant_all::value) { if (is_vector::value && !is_vector::value && !is_vector::value) { - ops_partials.edge3_.partials_ = inv(-b_minus_a) * size(y); + ops_partials.edge3_.partials_ = inv(-b_minus_a) * math::size(y); } else { ops_partials.edge3_.partials_ = inv(-b_minus_a); } diff --git a/stan/math/prim/prob/uniform_lpdf.hpp b/stan/math/prim/prob/uniform_lpdf.hpp index cbb2d50261a..e19290bad1c 100644 --- a/stan/math/prim/prob/uniform_lpdf.hpp +++ b/stan/math/prim/prob/uniform_lpdf.hpp @@ -95,7 +95,7 @@ return_type_t uniform_lpdf(const T_y& y, const T_low& alpha, if (!is_constant_all::value) { if (is_vector::value && !is_vector::value && !is_vector::value) { - ops_partials.edge3_.partials_ = -inv_beta_minus_alpha * size(y); + ops_partials.edge3_.partials_ = -inv_beta_minus_alpha * math::size(y); } else { ops_partials.edge3_.partials_ = -inv_beta_minus_alpha; } @@ -103,7 +103,7 @@ return_type_t uniform_lpdf(const T_y& y, const T_low& alpha, if (!is_constant_all::value) { if (is_vector::value && !is_vector::value && !is_vector::value) { - ops_partials.edge2_.partials_ = inv_beta_minus_alpha * size(y); + ops_partials.edge2_.partials_ = inv_beta_minus_alpha * math::size(y); } else { ops_partials.edge2_.partials_ = std::move(inv_beta_minus_alpha); } diff --git a/stan/math/prim/prob/von_mises_lpdf.hpp b/stan/math/prim/prob/von_mises_lpdf.hpp index dec4681dc87..33f99552087 100644 --- a/stan/math/prim/prob/von_mises_lpdf.hpp +++ b/stan/math/prim/prob/von_mises_lpdf.hpp @@ -63,7 +63,7 @@ return_type_t von_mises_lpdf(T_y const& y, T_loc const& mu, logp -= LOG_TWO_PI * N; } if (include_summand::value) { - logp -= sum(log_modified_bessel_first_kind(0, kappa_val)) * N / size(kappa); + logp -= sum(log_modified_bessel_first_kind(0, kappa_val)) * N / math::size(kappa); } if (!is_constant_all::value) { diff --git a/stan/math/prim/prob/weibull_lpdf.hpp b/stan/math/prim/prob/weibull_lpdf.hpp index 5f69eff760d..b0eeeb43ea7 100644 --- a/stan/math/prim/prob/weibull_lpdf.hpp +++ b/stan/math/prim/prob/weibull_lpdf.hpp @@ -89,7 +89,7 @@ return_type_t weibull_lpdf(const T_y& y, size_t N = max_size(y, alpha, sigma); T_partials_return logp = -sum(y_div_sigma_pow_alpha); if (include_summand::value) { - logp += sum(log(alpha_val)) * N / size(alpha); + logp += sum(log(alpha_val)) * N / math::size(alpha); } if (include_summand::value) { logp += sum((alpha_val - 1.0) * log_y) * N / max_size(alpha, y); From e3c7d27806ae1f87b562eae2f7f18c47da1c9fed Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 28 Mar 2022 20:04:00 +0800 Subject: [PATCH 04/29] Size qualifier for opencl --- stan/math/opencl/prim/bernoulli_cdf.hpp | 2 +- stan/math/opencl/prim/bernoulli_lccdf.hpp | 2 +- stan/math/opencl/prim/bernoulli_lcdf.hpp | 2 +- stan/math/opencl/prim/bernoulli_logit_glm_lpmf.hpp | 6 +++--- stan/math/opencl/prim/bernoulli_logit_lpmf.hpp | 2 +- stan/math/opencl/prim/bernoulli_lpmf.hpp | 2 +- stan/math/opencl/prim/categorical_logit_glm_lpmf.hpp | 4 ++-- stan/math/opencl/prim/neg_binomial_2_log_glm_lpmf.hpp | 8 ++++---- stan/math/opencl/prim/normal_id_glm_lpdf.hpp | 8 ++++---- stan/math/opencl/prim/num_elements.hpp | 2 +- stan/math/opencl/prim/ordered_logistic_glm_lpmf.hpp | 10 +++++----- stan/math/opencl/prim/ordered_logistic_lpmf.hpp | 4 ++-- stan/math/opencl/prim/poisson_log_glm_lpmf.hpp | 6 +++--- stan/math/opencl/prim/poisson_log_lpmf.hpp | 2 +- stan/math/opencl/prim/poisson_lpmf.hpp | 2 +- stan/math/opencl/prim/size.hpp | 2 +- stan/math/opencl/prim/std_normal_cdf.hpp | 2 +- stan/math/opencl/prim/std_normal_lccdf.hpp | 2 +- stan/math/opencl/prim/std_normal_lcdf.hpp | 2 +- stan/math/opencl/prim/std_normal_lpdf.hpp | 2 +- stan/math/prim/prob/normal_sufficient_lpdf.hpp | 2 +- 21 files changed, 37 insertions(+), 37 deletions(-) diff --git a/stan/math/opencl/prim/bernoulli_cdf.hpp b/stan/math/opencl/prim/bernoulli_cdf.hpp index 219e5785050..38e987f3b4d 100644 --- a/stan/math/opencl/prim/bernoulli_cdf.hpp +++ b/stan/math/opencl/prim/bernoulli_cdf.hpp @@ -37,7 +37,7 @@ return_type_t bernoulli_cdf(const T_n_cl& n, check_consistent_sizes(function, "Random variable", n, "Probability parameter", theta); - const size_t N = is_n_vector ? size(n) : size(theta); + const size_t N = is_n_vector ? math::size(n) : math::size(theta); if (N == 0) { return 1.0; } diff --git a/stan/math/opencl/prim/bernoulli_lccdf.hpp b/stan/math/opencl/prim/bernoulli_lccdf.hpp index 44530cbde89..d2fd582b775 100644 --- a/stan/math/opencl/prim/bernoulli_lccdf.hpp +++ b/stan/math/opencl/prim/bernoulli_lccdf.hpp @@ -38,7 +38,7 @@ return_type_t bernoulli_lccdf(const T_n_cl& n, check_consistent_sizes(function, "Random variable", n, "Probability parameter", theta); - const size_t N = is_n_vector ? size(n) : size(theta); + const size_t N = is_n_vector ? math::size(n) : math::size(theta); if (N == 0) { return 0.0; } diff --git a/stan/math/opencl/prim/bernoulli_lcdf.hpp b/stan/math/opencl/prim/bernoulli_lcdf.hpp index 2b3dafc778e..30e42538f43 100644 --- a/stan/math/opencl/prim/bernoulli_lcdf.hpp +++ b/stan/math/opencl/prim/bernoulli_lcdf.hpp @@ -38,7 +38,7 @@ return_type_t bernoulli_lcdf(const T_n_cl& n, check_consistent_sizes(function, "Random variable", n, "Probability parameter", theta); - const size_t N = is_n_vector ? size(n) : size(theta); + const size_t N = is_n_vector ? math::size(n) : math::size(theta); if (N == 0) { return 0.0; } diff --git a/stan/math/opencl/prim/bernoulli_logit_glm_lpmf.hpp b/stan/math/opencl/prim/bernoulli_logit_glm_lpmf.hpp index 038e024e7b1..544c48fffaf 100644 --- a/stan/math/opencl/prim/bernoulli_logit_glm_lpmf.hpp +++ b/stan/math/opencl/prim/bernoulli_logit_glm_lpmf.hpp @@ -66,13 +66,13 @@ return_type_t bernoulli_logit_glm_lpmf( const size_t M = x.cols(); if (is_y_vector) { - check_size_match(function, "Rows of ", "x", N, "rows of ", "y", size(y)); + check_size_match(function, "Rows of ", "x", N, "rows of ", "y", math::size(y)); } check_size_match(function, "Columns of ", "x_cl", M, "size of ", "beta", - size(beta)); + math::size(beta)); if (is_alpha_vector) { check_size_match(function, "Rows of ", "x", N, "size of ", "alpha", - size(alpha)); + math::size(alpha)); } if (N == 0) { diff --git a/stan/math/opencl/prim/bernoulli_logit_lpmf.hpp b/stan/math/opencl/prim/bernoulli_logit_lpmf.hpp index 8db546a1853..accc947ab17 100644 --- a/stan/math/opencl/prim/bernoulli_logit_lpmf.hpp +++ b/stan/math/opencl/prim/bernoulli_logit_lpmf.hpp @@ -36,7 +36,7 @@ return_type_t bernoulli_logit_lpmf(const T_n_cl& n, check_consistent_sizes(function, "Random variable", n, "Probability parameter", theta); - const size_t N = is_n_vector ? size(n) : size(theta); + const size_t N = is_n_vector ? math::size(n) : math::size(theta); if (N == 0) { return 0.0; } diff --git a/stan/math/opencl/prim/bernoulli_lpmf.hpp b/stan/math/opencl/prim/bernoulli_lpmf.hpp index b6335842b60..ddbfb5e9074 100644 --- a/stan/math/opencl/prim/bernoulli_lpmf.hpp +++ b/stan/math/opencl/prim/bernoulli_lpmf.hpp @@ -38,7 +38,7 @@ return_type_t bernoulli_lpmf(const T_n_cl& n, check_consistent_sizes(function, "Random variable", n, "Probability parameter", theta); - const size_t N = is_n_vector ? size(n) : size(theta); + const size_t N = is_n_vector ? math::size(n) : math::size(theta); if (N == 0) { return 0.0; } diff --git a/stan/math/opencl/prim/categorical_logit_glm_lpmf.hpp b/stan/math/opencl/prim/categorical_logit_glm_lpmf.hpp index 337daf326dd..baf4974f60d 100644 --- a/stan/math/opencl/prim/categorical_logit_glm_lpmf.hpp +++ b/stan/math/opencl/prim/categorical_logit_glm_lpmf.hpp @@ -61,10 +61,10 @@ return_type_t categorical_logit_glm_lpmf( static const char* function = "categorical_logit_glm_lpmf"; if (is_y_vector) { check_size_match(function, "Rows of ", "x", N_instances, "size of ", "y", - size(y)); + math::size(y)); } check_size_match(function, "Columns of ", "beta", N_classes, "size of ", - "alpha", size(alpha)); + "alpha", math::size(alpha)); check_size_match(function, "Columns of ", "x", N_attributes, "Rows of", "beta", beta.rows()); diff --git a/stan/math/opencl/prim/neg_binomial_2_log_glm_lpmf.hpp b/stan/math/opencl/prim/neg_binomial_2_log_glm_lpmf.hpp index 4f0ac0b2aec..ce2a99d53e0 100644 --- a/stan/math/opencl/prim/neg_binomial_2_log_glm_lpmf.hpp +++ b/stan/math/opencl/prim/neg_binomial_2_log_glm_lpmf.hpp @@ -82,17 +82,17 @@ neg_binomial_2_log_glm_lpmf(const T_y_cl& y, const T_x_cl& x, const size_t M = x.cols(); if (is_y_vector) { - check_size_match(function, "Rows of ", "x", N, "rows of ", "y", size(y)); + check_size_match(function, "Rows of ", "x", N, "rows of ", "y", math::size(y)); } check_size_match(function, "Columns of ", "x", M, "size of ", "beta", - size(beta)); + math::size(beta)); if (is_phi_vector) { check_size_match(function, "Rows of ", "x", N, "size of ", "phi", - size(phi)); + math::size(phi)); } if (is_alpha_vector) { check_size_match(function, "Rows of ", "x", N, "size of ", "alpha", - size(alpha)); + math::size(alpha)); } if (N == 0) { return 0; diff --git a/stan/math/opencl/prim/normal_id_glm_lpdf.hpp b/stan/math/opencl/prim/normal_id_glm_lpdf.hpp index b2210f94683..03f96893350 100644 --- a/stan/math/opencl/prim/normal_id_glm_lpdf.hpp +++ b/stan/math/opencl/prim/normal_id_glm_lpdf.hpp @@ -74,17 +74,17 @@ normal_id_glm_lpdf(const T_y_cl& y, const T_x_cl& x, const T_alpha_cl& alpha, const size_t M = x.cols(); if (is_y_vector) { - check_size_match(function, "Rows of ", "x", N, "rows of ", "y", size(y)); + check_size_match(function, "Rows of ", "x", N, "rows of ", "y", math::size(y)); } check_size_match(function, "Columns of ", "x_cl", M, "size of ", "beta", - size(beta)); + math::size(beta)); if (is_sigma_vector) { check_size_match(function, "Rows of ", "x", N, "size of ", "sigma", - size(sigma)); + math::size(sigma)); } if (is_alpha_vector) { check_size_match(function, "Rows of ", "x", N, "size of ", "alpha", - size(alpha)); + math::size(alpha)); } if (!include_summand::value) { diff --git a/stan/math/opencl/prim/num_elements.hpp b/stan/math/opencl/prim/num_elements.hpp index a5d965290d3..37e576382a4 100644 --- a/stan/math/opencl/prim/num_elements.hpp +++ b/stan/math/opencl/prim/num_elements.hpp @@ -16,7 +16,7 @@ namespace math { template * = nullptr> size_t num_elements(const T& m) { - return size(m); + return math::size(m); } } // namespace math diff --git a/stan/math/opencl/prim/ordered_logistic_glm_lpmf.hpp b/stan/math/opencl/prim/ordered_logistic_glm_lpmf.hpp index b09e48c990c..5f5912b2328 100644 --- a/stan/math/opencl/prim/ordered_logistic_glm_lpmf.hpp +++ b/stan/math/opencl/prim/ordered_logistic_glm_lpmf.hpp @@ -63,19 +63,19 @@ return_type_t ordered_logistic_glm_lpmf( const size_t N_instances = x.rows(); const size_t N_attributes = x.cols(); - const size_t N_classes = size(cuts) + 1; + const size_t N_classes = math::size(cuts) + 1; if (is_y_vector) { check_size_match(function, "Rows of ", "x", N_instances, "rows of ", "y", - size(y)); + math::size(y)); } check_size_match(function, "Columns of ", "x", N_attributes, "Size of", - "beta", size(beta)); + "beta", math::size(beta)); const auto& cuts_val = eval(value_of(cuts)); if (N_classes >= 2) { - auto cuts_head = block_zero_based(cuts_val, 0, 0, size(cuts) - 1, 1); - auto cuts_tail = block_zero_based(cuts_val, 1, 0, size(cuts) - 1, 1); + auto cuts_head = block_zero_based(cuts_val, 0, 0, math::size(cuts) - 1, 1); + auto cuts_tail = block_zero_based(cuts_val, 1, 0, math::size(cuts) - 1, 1); check_cl(function, "Cuts", cuts_head, "ordered and finite") = cuts_head < cuts_tail && isfinite(cuts_head) && isfinite(cuts_tail); } else { diff --git a/stan/math/opencl/prim/ordered_logistic_lpmf.hpp b/stan/math/opencl/prim/ordered_logistic_lpmf.hpp index e72276b05aa..cf2fa442ec8 100644 --- a/stan/math/opencl/prim/ordered_logistic_lpmf.hpp +++ b/stan/math/opencl/prim/ordered_logistic_lpmf.hpp @@ -73,8 +73,8 @@ inline return_type_t ordered_logistic_lpmf( static const char* function = "ordered_logistic_lpmf(OpenCL)"; if (size(y) != 1) { - check_size_match(function, "Size of ", "y", size(y), "Size of", "lambda", - size(lambda)); + check_size_match(function, "Size of ", "y", math::size(y), "Size of", "lambda", + math::size(lambda)); } int N_instances = max_size(y, lambda); diff --git a/stan/math/opencl/prim/poisson_log_glm_lpmf.hpp b/stan/math/opencl/prim/poisson_log_glm_lpmf.hpp index 541fe38d5be..807eda3d175 100644 --- a/stan/math/opencl/prim/poisson_log_glm_lpmf.hpp +++ b/stan/math/opencl/prim/poisson_log_glm_lpmf.hpp @@ -66,13 +66,13 @@ return_type_t poisson_log_glm_lpmf( const size_t M = x.cols(); if (is_y_vector) { - check_size_match(function, "Rows of ", "x", N, "rows of ", "y", size(y)); + check_size_match(function, "Rows of ", "x", N, "rows of ", "y", math::size(y)); } check_size_match(function, "Columns of ", "x_cl", M, "size of ", "beta", - size(beta)); + math::size(beta)); if (is_alpha_vector) { check_size_match(function, "Rows of ", "x", N, "size of ", "alpha", - size(alpha)); + math::size(alpha)); } if (N == 0) { return 0; diff --git a/stan/math/opencl/prim/poisson_log_lpmf.hpp b/stan/math/opencl/prim/poisson_log_lpmf.hpp index 4d01d570441..31ed3dfaecd 100644 --- a/stan/math/opencl/prim/poisson_log_lpmf.hpp +++ b/stan/math/opencl/prim/poisson_log_lpmf.hpp @@ -39,7 +39,7 @@ return_type_t poisson_log_lpmf(const T_n_cl& n, check_consistent_sizes(function, "Random variable", n, "Log rate parameter", alpha); - const size_t N = is_n_vector ? size(n) : size(alpha); + const size_t N = is_n_vector ? math::size(n) : math::size(alpha); if (N == 0) { return 0.0; } diff --git a/stan/math/opencl/prim/poisson_lpmf.hpp b/stan/math/opencl/prim/poisson_lpmf.hpp index 6e7ef9dd2aa..2878e9d2849 100644 --- a/stan/math/opencl/prim/poisson_lpmf.hpp +++ b/stan/math/opencl/prim/poisson_lpmf.hpp @@ -38,7 +38,7 @@ return_type_t poisson_lpmf(const T_n_cl& n, check_consistent_sizes(function, "Random variable", n, "Rate parameter", lambda); - const size_t N = is_n_vector ? size(n) : size(lambda); + const size_t N = is_n_vector ? math::size(n) : math::size(lambda); if (N == 0) { return 0.0; } diff --git a/stan/math/opencl/prim/size.hpp b/stan/math/opencl/prim/size.hpp index 37d037a2943..ef82fc6c49b 100644 --- a/stan/math/opencl/prim/size.hpp +++ b/stan/math/opencl/prim/size.hpp @@ -15,7 +15,7 @@ namespace math { */ template * = nullptr> -size_t size(const T& m) { +size_t math::size(const T& m) { return m.rows() * m.cols(); } diff --git a/stan/math/opencl/prim/std_normal_cdf.hpp b/stan/math/opencl/prim/std_normal_cdf.hpp index 23448b45747..739d496780b 100644 --- a/stan/math/opencl/prim/std_normal_cdf.hpp +++ b/stan/math/opencl/prim/std_normal_cdf.hpp @@ -29,7 +29,7 @@ return_type_t std_normal_cdf(const T_y_cl& y) { using std::isfinite; using std::isnan; - const size_t N = size(y); + const size_t N = math::size(y); if (N == 0) { return 1.0; } diff --git a/stan/math/opencl/prim/std_normal_lccdf.hpp b/stan/math/opencl/prim/std_normal_lccdf.hpp index c16138d944c..1e531fdaf0f 100644 --- a/stan/math/opencl/prim/std_normal_lccdf.hpp +++ b/stan/math/opencl/prim/std_normal_lccdf.hpp @@ -30,7 +30,7 @@ return_type_t std_normal_lccdf(const T_y_cl& y) { using std::isfinite; using std::isnan; - const size_t N = size(y); + const size_t N = math::size(y); if (N == 0) { return 1.0; } diff --git a/stan/math/opencl/prim/std_normal_lcdf.hpp b/stan/math/opencl/prim/std_normal_lcdf.hpp index ffee5704877..86966cf7a60 100644 --- a/stan/math/opencl/prim/std_normal_lcdf.hpp +++ b/stan/math/opencl/prim/std_normal_lcdf.hpp @@ -183,7 +183,7 @@ return_type_t std_normal_lcdf(const T_y_cl& y) { using std::isfinite; using std::isnan; - const size_t N = size(y); + const size_t N = math::size(y); if (N == 0) { return 1.0; } diff --git a/stan/math/opencl/prim/std_normal_lpdf.hpp b/stan/math/opencl/prim/std_normal_lpdf.hpp index b9782db683e..2bf4de436c1 100644 --- a/stan/math/opencl/prim/std_normal_lpdf.hpp +++ b/stan/math/opencl/prim/std_normal_lpdf.hpp @@ -35,7 +35,7 @@ inline return_type_t std_normal_lpdf(const T_y_cl& y) { using std::isfinite; using std::isnan; - const size_t N = size(y); + const size_t N = math::size(y); if (N == 0) { return 0.0; } diff --git a/stan/math/prim/prob/normal_sufficient_lpdf.hpp b/stan/math/prim/prob/normal_sufficient_lpdf.hpp index 52b5d4ed359..abf5924b75d 100644 --- a/stan/math/prim/prob/normal_sufficient_lpdf.hpp +++ b/stan/math/prim/prob/normal_sufficient_lpdf.hpp @@ -40,7 +40,7 @@ namespace math { * * @param y_bar (Sequence of) scalar(s) (sample average(s)). * @param s_squared (Sequence of) sum(s) of sample squared errors - * @param n_obs (Sequence of) sample math::size(s) + * @param n_obs (Sequence of) sample size(s) * @param mu (Sequence of) location parameter(s) * for the normal distribution. * @param sigma (Sequence of) scale parameters for the normal From e13f4bc23cf21e90124a1d02a85d36f7b530f5dc Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 28 Mar 2022 20:15:10 +0800 Subject: [PATCH 05/29] Missed size --- stan/math/opencl/matrix_cl.hpp | 14 +++++------ .../opencl/prim/ordered_logistic_lpmf.hpp | 2 +- stan/math/opencl/zeros_strict_tri.hpp | 2 +- stan/math/prim/functor/coupled_ode_system.hpp | 2 +- stan/math/prim/prob/bernoulli_lpmf.hpp | 2 +- stan/math/prim/prob/chi_square_cdf.hpp | 4 ++-- stan/math/prim/prob/chi_square_lccdf.hpp | 4 ++-- stan/math/prim/prob/chi_square_lcdf.hpp | 4 ++-- stan/math/prim/prob/gamma_cdf.hpp | 4 ++-- stan/math/prim/prob/gamma_lccdf.hpp | 4 ++-- stan/math/prim/prob/gamma_lcdf.hpp | 4 ++-- stan/math/prim/prob/inv_chi_square_cdf.hpp | 4 ++-- stan/math/prim/prob/inv_chi_square_lccdf.hpp | 4 ++-- stan/math/prim/prob/inv_chi_square_lcdf.hpp | 4 ++-- stan/math/prim/prob/inv_gamma_cdf.hpp | 4 ++-- stan/math/prim/prob/inv_gamma_lccdf.hpp | 4 ++-- stan/math/prim/prob/inv_gamma_lcdf.hpp | 4 ++-- .../prim/prob/scaled_inv_chi_square_cdf.hpp | 4 ++-- .../prim/prob/scaled_inv_chi_square_lccdf.hpp | 4 ++-- .../prim/prob/scaled_inv_chi_square_lcdf.hpp | 4 ++-- .../prim/prob/scaled_inv_chi_square_lpdf.hpp | 14 +++++------ stan/math/prim/prob/student_t_cdf.hpp | 6 ++--- stan/math/prim/prob/student_t_lccdf.hpp | 6 ++--- stan/math/prim/prob/student_t_lcdf.hpp | 6 ++--- stan/math/rev/functor/coupled_ode_system.hpp | 4 ++-- test/unit/math/prim/err_1_test.cpp | 15 ++++++++++++ test/unit/math/prim/err_2_test.cpp | 15 ++++++++++++ test/unit/math/prim/err_3_test.cpp | 15 ++++++++++++ test/unit/math/prim/err_4_test.cpp | 15 ++++++++++++ test/unit/math/prim/err_5_test.cpp | 9 +++++++ test/unit/math/prim/fun_10_test.cpp | 15 ++++++++++++ test/unit/math/prim/fun_11_test.cpp | 15 ++++++++++++ test/unit/math/prim/fun_12_test.cpp | 15 ++++++++++++ test/unit/math/prim/fun_13_test.cpp | 15 ++++++++++++ test/unit/math/prim/fun_14_test.cpp | 15 ++++++++++++ test/unit/math/prim/fun_15_test.cpp | 15 ++++++++++++ test/unit/math/prim/fun_16_test.cpp | 15 ++++++++++++ test/unit/math/prim/fun_17_test.cpp | 15 ++++++++++++ test/unit/math/prim/fun_18_test.cpp | 15 ++++++++++++ test/unit/math/prim/fun_19_test.cpp | 15 ++++++++++++ test/unit/math/prim/fun_1_test.cpp | 15 ++++++++++++ test/unit/math/prim/fun_20_test.cpp | 15 ++++++++++++ test/unit/math/prim/fun_21_test.cpp | 9 +++++++ test/unit/math/prim/fun_2_test.cpp | 15 ++++++++++++ test/unit/math/prim/fun_3_test.cpp | 15 ++++++++++++ test/unit/math/prim/fun_4_test.cpp | 15 ++++++++++++ test/unit/math/prim/fun_5_test.cpp | 15 ++++++++++++ test/unit/math/prim/fun_6_test.cpp | 15 ++++++++++++ test/unit/math/prim/fun_7_test.cpp | 15 ++++++++++++ test/unit/math/prim/fun_8_test.cpp | 15 ++++++++++++ test/unit/math/prim/fun_9_test.cpp | 15 ++++++++++++ test/unit/math/prim/functor_1_test.cpp | 12 ++++++++++ .../math/prim/meta/StdVectorBuilder_test.cpp | 16 ++++++------- .../prim/meta/VectorBuilderHelper_test.cpp | 16 ++++++------- .../math/prim/meta/VectorBuilder_test.cpp | 16 ++++++------- test/unit/math/prim/meta_1_test.cpp | 15 ++++++++++++ test/unit/math/prim/meta_2_test.cpp | 15 ++++++++++++ test/unit/math/prim/meta_3_test.cpp | 5 ++++ test/unit/math/prim/prob_10_test.cpp | 15 ++++++++++++ test/unit/math/prim/prob_11_test.cpp | 15 ++++++++++++ test/unit/math/prim/prob_12_test.cpp | 15 ++++++++++++ test/unit/math/prim/prob_13_test.cpp | 15 ++++++++++++ test/unit/math/prim/prob_14_test.cpp | 3 +++ test/unit/math/prim/prob_1_test.cpp | 15 ++++++++++++ test/unit/math/prim/prob_2_test.cpp | 15 ++++++++++++ test/unit/math/prim/prob_3_test.cpp | 15 ++++++++++++ test/unit/math/prim/prob_4_test.cpp | 15 ++++++++++++ test/unit/math/prim/prob_5_test.cpp | 15 ++++++++++++ test/unit/math/prim/prob_6_test.cpp | 15 ++++++++++++ test/unit/math/prim/prob_7_test.cpp | 15 ++++++++++++ test/unit/math/prim/prob_8_test.cpp | 15 ++++++++++++ test/unit/math/prim/prob_9_test.cpp | 15 ++++++++++++ .../rev/meta/VectorBuilderHelper_test.cpp | 24 +++++++++---------- .../unit/math/rev/meta/VectorBuilder_test.cpp | 20 ++++++++-------- 74 files changed, 728 insertions(+), 105 deletions(-) create mode 100644 test/unit/math/prim/err_1_test.cpp create mode 100644 test/unit/math/prim/err_2_test.cpp create mode 100644 test/unit/math/prim/err_3_test.cpp create mode 100644 test/unit/math/prim/err_4_test.cpp create mode 100644 test/unit/math/prim/err_5_test.cpp create mode 100644 test/unit/math/prim/fun_10_test.cpp create mode 100644 test/unit/math/prim/fun_11_test.cpp create mode 100644 test/unit/math/prim/fun_12_test.cpp create mode 100644 test/unit/math/prim/fun_13_test.cpp create mode 100644 test/unit/math/prim/fun_14_test.cpp create mode 100644 test/unit/math/prim/fun_15_test.cpp create mode 100644 test/unit/math/prim/fun_16_test.cpp create mode 100644 test/unit/math/prim/fun_17_test.cpp create mode 100644 test/unit/math/prim/fun_18_test.cpp create mode 100644 test/unit/math/prim/fun_19_test.cpp create mode 100644 test/unit/math/prim/fun_1_test.cpp create mode 100644 test/unit/math/prim/fun_20_test.cpp create mode 100644 test/unit/math/prim/fun_21_test.cpp create mode 100644 test/unit/math/prim/fun_2_test.cpp create mode 100644 test/unit/math/prim/fun_3_test.cpp create mode 100644 test/unit/math/prim/fun_4_test.cpp create mode 100644 test/unit/math/prim/fun_5_test.cpp create mode 100644 test/unit/math/prim/fun_6_test.cpp create mode 100644 test/unit/math/prim/fun_7_test.cpp create mode 100644 test/unit/math/prim/fun_8_test.cpp create mode 100644 test/unit/math/prim/fun_9_test.cpp create mode 100644 test/unit/math/prim/functor_1_test.cpp create mode 100644 test/unit/math/prim/meta_1_test.cpp create mode 100644 test/unit/math/prim/meta_2_test.cpp create mode 100644 test/unit/math/prim/meta_3_test.cpp create mode 100644 test/unit/math/prim/prob_10_test.cpp create mode 100644 test/unit/math/prim/prob_11_test.cpp create mode 100644 test/unit/math/prim/prob_12_test.cpp create mode 100644 test/unit/math/prim/prob_13_test.cpp create mode 100644 test/unit/math/prim/prob_14_test.cpp create mode 100644 test/unit/math/prim/prob_1_test.cpp create mode 100644 test/unit/math/prim/prob_2_test.cpp create mode 100644 test/unit/math/prim/prob_3_test.cpp create mode 100644 test/unit/math/prim/prob_4_test.cpp create mode 100644 test/unit/math/prim/prob_5_test.cpp create mode 100644 test/unit/math/prim/prob_6_test.cpp create mode 100644 test/unit/math/prim/prob_7_test.cpp create mode 100644 test/unit/math/prim/prob_8_test.cpp create mode 100644 test/unit/math/prim/prob_9_test.cpp diff --git a/stan/math/opencl/matrix_cl.hpp b/stan/math/opencl/matrix_cl.hpp index 6f92f6f62b6..af53f4f0805 100644 --- a/stan/math/opencl/matrix_cl.hpp +++ b/stan/math/opencl/matrix_cl.hpp @@ -283,7 +283,7 @@ class matrix_cl : public matrix_cl_base { matrix_cl(const int rows, const int cols, matrix_cl_view partial_view = matrix_cl_view::Entire) : rows_(rows), cols_(cols), view_(partial_view) { - if (size() == 0) { + if (math::size() == 0) { return; } cl::Context& ctx = opencl_context.context(); @@ -321,7 +321,7 @@ class matrix_cl : public matrix_cl_base { matrix_cl_view partial_view = matrix_cl_view::Entire) : rows_(A.rows()), cols_(A.cols()), view_(partial_view) { using Mat_type = std::decay_t>; - if (size() == 0) { + if (math::size() == 0) { return; } initialize_buffer_no_heap_if< @@ -457,7 +457,7 @@ class matrix_cl : public matrix_cl_base { return *this; } this->wait_for_read_write_events(); - if (size() != a.size()) { + if (math::size() != a.size()) { buffer_cl_ = cl::Buffer(opencl_context.context(), CL_MEM_READ_WRITE, sizeof(T) * a.size()); } @@ -518,7 +518,7 @@ class matrix_cl : public matrix_cl_base { template cl::Event initialize_buffer(const T* A) { cl::Event transfer_event; - if (size() == 0) { + if (math::size() == 0) { return transfer_event; } cl::Context& ctx = opencl_context.context(); @@ -538,7 +538,7 @@ class matrix_cl : public matrix_cl_base { template cl::Event initialize_buffer(T* A) { cl::Event transfer_event; - if (size() == 0) { + if (math::size() == 0) { return transfer_event; } cl::Context& ctx = opencl_context.context(); @@ -577,7 +577,7 @@ class matrix_cl : public matrix_cl_base { */ template * = nullptr> void initialize_buffer_no_heap_if(U&& obj) { - if (size() == 0) { + if (math::size() == 0) { return; } initialize_buffer(obj.data()); @@ -587,7 +587,7 @@ class matrix_cl : public matrix_cl_base { template * = nullptr> void initialize_buffer_no_heap_if(U&& obj) { using U_val = std::decay_t>; - if (size() == 0) { + if (math::size() == 0) { return; } auto* obj_heap = new U_val(std::move(obj)); diff --git a/stan/math/opencl/prim/ordered_logistic_lpmf.hpp b/stan/math/opencl/prim/ordered_logistic_lpmf.hpp index cf2fa442ec8..713a2386d2f 100644 --- a/stan/math/opencl/prim/ordered_logistic_lpmf.hpp +++ b/stan/math/opencl/prim/ordered_logistic_lpmf.hpp @@ -72,7 +72,7 @@ inline return_type_t ordered_logistic_lpmf( constexpr bool is_y_vector = !is_stan_scalar::value; static const char* function = "ordered_logistic_lpmf(OpenCL)"; - if (size(y) != 1) { + if (math::size(y) != 1) { check_size_match(function, "Size of ", "y", math::size(y), "Size of", "lambda", math::size(lambda)); } diff --git a/stan/math/opencl/zeros_strict_tri.hpp b/stan/math/opencl/zeros_strict_tri.hpp index 1c916c0e90c..983b0448ac4 100644 --- a/stan/math/opencl/zeros_strict_tri.hpp +++ b/stan/math/opencl/zeros_strict_tri.hpp @@ -40,7 +40,7 @@ inline void matrix_cl::zeros_strict_tri() try { "zeros_strict_tri", "matrix_view", "matrix_cl_view::Diagonal is not a valid template parameter value", ""); } - if (size() == 0) { + if (math::size() == 0) { return; } this->view_ = both(this->view_, invert(matrix_view)); diff --git a/stan/math/prim/functor/coupled_ode_system.hpp b/stan/math/prim/functor/coupled_ode_system.hpp index 78a48ebb25a..f49d8432bd9 100644 --- a/stan/math/prim/functor/coupled_ode_system.hpp +++ b/stan/math/prim/functor/coupled_ode_system.hpp @@ -91,7 +91,7 @@ struct coupled_ode_system_impl { * @return the initial condition of the coupled system */ std::vector initial_state() const { - std::vector initial(size(), 0.0); + std::vector initial(math::size(), 0.0); for (size_t i = 0; i < N_; i++) { initial[i] = value_of(y0_(i)); diff --git a/stan/math/prim/prob/bernoulli_lpmf.hpp b/stan/math/prim/prob/bernoulli_lpmf.hpp index 29fc79d1bf8..9b54f02d839 100644 --- a/stan/math/prim/prob/bernoulli_lpmf.hpp +++ b/stan/math/prim/prob/bernoulli_lpmf.hpp @@ -59,7 +59,7 @@ return_type_t bernoulli_lpmf(const T_n& n, const T_prob& theta) { scalar_seq_view theta_vec(theta_ref); size_t N = max_size(n, theta); - if (size(theta) == 1) { + if (math::size(theta) == 1) { size_t sum = 0; for (size_t n = 0; n < N; n++) { sum += n_vec.val(n); diff --git a/stan/math/prim/prob/chi_square_cdf.hpp b/stan/math/prim/prob/chi_square_cdf.hpp index ea439f86bf6..8e8f6cf5148 100644 --- a/stan/math/prim/prob/chi_square_cdf.hpp +++ b/stan/math/prim/prob/chi_square_cdf.hpp @@ -69,9 +69,9 @@ return_type_t chi_square_cdf(const T_y& y, const T_dof& nu) { } VectorBuilder::value, T_partials_return, T_dof> - gamma_vec(size(nu)); + gamma_vec(math::size(nu)); VectorBuilder::value, T_partials_return, T_dof> - digamma_vec(size(nu)); + digamma_vec(math::size(nu)); if (!is_constant_all::value) { for (size_t i = 0; i < stan::math::size(nu); i++) { diff --git a/stan/math/prim/prob/chi_square_lccdf.hpp b/stan/math/prim/prob/chi_square_lccdf.hpp index 8347406a373..cb6bead9799 100644 --- a/stan/math/prim/prob/chi_square_lccdf.hpp +++ b/stan/math/prim/prob/chi_square_lccdf.hpp @@ -71,9 +71,9 @@ return_type_t chi_square_lccdf(const T_y& y, const T_dof& nu) { } VectorBuilder::value, T_partials_return, T_dof> - gamma_vec(size(nu)); + gamma_vec(math::size(nu)); VectorBuilder::value, T_partials_return, T_dof> - digamma_vec(size(nu)); + digamma_vec(math::size(nu)); if (!is_constant_all::value) { for (size_t i = 0; i < stan::math::size(nu); i++) { diff --git a/stan/math/prim/prob/chi_square_lcdf.hpp b/stan/math/prim/prob/chi_square_lcdf.hpp index dc7c196a454..5fefad3fe3a 100644 --- a/stan/math/prim/prob/chi_square_lcdf.hpp +++ b/stan/math/prim/prob/chi_square_lcdf.hpp @@ -71,9 +71,9 @@ return_type_t chi_square_lcdf(const T_y& y, const T_dof& nu) { } VectorBuilder::value, T_partials_return, T_dof> - gamma_vec(size(nu)); + gamma_vec(math::size(nu)); VectorBuilder::value, T_partials_return, T_dof> - digamma_vec(size(nu)); + digamma_vec(math::size(nu)); if (!is_constant_all::value) { for (size_t i = 0; i < stan::math::size(nu); i++) { diff --git a/stan/math/prim/prob/gamma_cdf.hpp b/stan/math/prim/prob/gamma_cdf.hpp index 2918ebb9f22..fb9f88f788c 100644 --- a/stan/math/prim/prob/gamma_cdf.hpp +++ b/stan/math/prim/prob/gamma_cdf.hpp @@ -81,9 +81,9 @@ return_type_t gamma_cdf(const T_y& y, using std::pow; VectorBuilder::value, T_partials_return, T_shape> - gamma_vec(size(alpha)); + gamma_vec(math::size(alpha)); VectorBuilder::value, T_partials_return, T_shape> - digamma_vec(size(alpha)); + digamma_vec(math::size(alpha)); if (!is_constant_all::value) { for (size_t i = 0; i < stan::math::size(alpha); i++) { diff --git a/stan/math/prim/prob/gamma_lccdf.hpp b/stan/math/prim/prob/gamma_lccdf.hpp index 12fbd24a9f2..c031c1a7e63 100644 --- a/stan/math/prim/prob/gamma_lccdf.hpp +++ b/stan/math/prim/prob/gamma_lccdf.hpp @@ -64,9 +64,9 @@ return_type_t gamma_lccdf(const T_y& y, } VectorBuilder::value, T_partials_return, T_shape> - gamma_vec(size(alpha)); + gamma_vec(math::size(alpha)); VectorBuilder::value, T_partials_return, T_shape> - digamma_vec(size(alpha)); + digamma_vec(math::size(alpha)); if (!is_constant_all::value) { for (size_t i = 0; i < stan::math::size(alpha); i++) { diff --git a/stan/math/prim/prob/gamma_lcdf.hpp b/stan/math/prim/prob/gamma_lcdf.hpp index b40c75bc7f3..19c15050873 100644 --- a/stan/math/prim/prob/gamma_lcdf.hpp +++ b/stan/math/prim/prob/gamma_lcdf.hpp @@ -64,9 +64,9 @@ return_type_t gamma_lcdf(const T_y& y, } VectorBuilder::value, T_partials_return, T_shape> - gamma_vec(size(alpha)); + gamma_vec(math::size(alpha)); VectorBuilder::value, T_partials_return, T_shape> - digamma_vec(size(alpha)); + digamma_vec(math::size(alpha)); if (!is_constant_all::value) { for (size_t i = 0; i < stan::math::size(alpha); i++) { diff --git a/stan/math/prim/prob/inv_chi_square_cdf.hpp b/stan/math/prim/prob/inv_chi_square_cdf.hpp index 1f1ff29c386..429dbfadcc7 100644 --- a/stan/math/prim/prob/inv_chi_square_cdf.hpp +++ b/stan/math/prim/prob/inv_chi_square_cdf.hpp @@ -69,9 +69,9 @@ return_type_t inv_chi_square_cdf(const T_y& y, const T_dof& nu) { } VectorBuilder::value, T_partials_return, T_dof> - gamma_vec(size(nu)); + gamma_vec(math::size(nu)); VectorBuilder::value, T_partials_return, T_dof> - digamma_vec(size(nu)); + digamma_vec(math::size(nu)); if (!is_constant_all::value) { for (size_t i = 0; i < stan::math::size(nu); i++) { diff --git a/stan/math/prim/prob/inv_chi_square_lccdf.hpp b/stan/math/prim/prob/inv_chi_square_lccdf.hpp index 394e7956f97..e7c6a1e9c88 100644 --- a/stan/math/prim/prob/inv_chi_square_lccdf.hpp +++ b/stan/math/prim/prob/inv_chi_square_lccdf.hpp @@ -71,9 +71,9 @@ return_type_t inv_chi_square_lccdf(const T_y& y, const T_dof& nu) { } VectorBuilder::value, T_partials_return, T_dof> - gamma_vec(size(nu)); + gamma_vec(math::size(nu)); VectorBuilder::value, T_partials_return, T_dof> - digamma_vec(size(nu)); + digamma_vec(math::size(nu)); if (!is_constant_all::value) { for (size_t i = 0; i < stan::math::size(nu); i++) { diff --git a/stan/math/prim/prob/inv_chi_square_lcdf.hpp b/stan/math/prim/prob/inv_chi_square_lcdf.hpp index abd879cb2c6..b48922fbd63 100644 --- a/stan/math/prim/prob/inv_chi_square_lcdf.hpp +++ b/stan/math/prim/prob/inv_chi_square_lcdf.hpp @@ -71,9 +71,9 @@ return_type_t inv_chi_square_lcdf(const T_y& y, const T_dof& nu) { } VectorBuilder::value, T_partials_return, T_dof> - gamma_vec(size(nu)); + gamma_vec(math::size(nu)); VectorBuilder::value, T_partials_return, T_dof> - digamma_vec(size(nu)); + digamma_vec(math::size(nu)); if (!is_constant_all::value) { for (size_t i = 0; i < stan::math::size(nu); i++) { diff --git a/stan/math/prim/prob/inv_gamma_cdf.hpp b/stan/math/prim/prob/inv_gamma_cdf.hpp index 89271caa42d..3ac21f757d4 100644 --- a/stan/math/prim/prob/inv_gamma_cdf.hpp +++ b/stan/math/prim/prob/inv_gamma_cdf.hpp @@ -80,9 +80,9 @@ return_type_t inv_gamma_cdf(const T_y& y, } VectorBuilder::value, T_partials_return, T_shape> - gamma_vec(size(alpha)); + gamma_vec(math::size(alpha)); VectorBuilder::value, T_partials_return, T_shape> - digamma_vec(size(alpha)); + digamma_vec(math::size(alpha)); if (!is_constant_all::value) { for (size_t i = 0; i < stan::math::size(alpha); i++) { diff --git a/stan/math/prim/prob/inv_gamma_lccdf.hpp b/stan/math/prim/prob/inv_gamma_lccdf.hpp index 22212e5adff..c731eccd0e3 100644 --- a/stan/math/prim/prob/inv_gamma_lccdf.hpp +++ b/stan/math/prim/prob/inv_gamma_lccdf.hpp @@ -66,9 +66,9 @@ return_type_t inv_gamma_lccdf(const T_y& y, } VectorBuilder::value, T_partials_return, T_shape> - gamma_vec(size(alpha)); + gamma_vec(math::size(alpha)); VectorBuilder::value, T_partials_return, T_shape> - digamma_vec(size(alpha)); + digamma_vec(math::size(alpha)); if (!is_constant_all::value) { for (size_t i = 0; i < stan::math::size(alpha); i++) { diff --git a/stan/math/prim/prob/inv_gamma_lcdf.hpp b/stan/math/prim/prob/inv_gamma_lcdf.hpp index 27e6800b444..7ad55a35302 100644 --- a/stan/math/prim/prob/inv_gamma_lcdf.hpp +++ b/stan/math/prim/prob/inv_gamma_lcdf.hpp @@ -66,9 +66,9 @@ return_type_t inv_gamma_lcdf(const T_y& y, } VectorBuilder::value, T_partials_return, T_shape> - gamma_vec(size(alpha)); + gamma_vec(math::size(alpha)); VectorBuilder::value, T_partials_return, T_shape> - digamma_vec(size(alpha)); + digamma_vec(math::size(alpha)); if (!is_constant_all::value) { for (size_t i = 0; i < stan::math::size(alpha); i++) { diff --git a/stan/math/prim/prob/scaled_inv_chi_square_cdf.hpp b/stan/math/prim/prob/scaled_inv_chi_square_cdf.hpp index f441852d649..7ec39b46e56 100644 --- a/stan/math/prim/prob/scaled_inv_chi_square_cdf.hpp +++ b/stan/math/prim/prob/scaled_inv_chi_square_cdf.hpp @@ -78,9 +78,9 @@ return_type_t scaled_inv_chi_square_cdf(const T_y& y, } VectorBuilder::value, T_partials_return, T_dof> - gamma_vec(size(nu)); + gamma_vec(math::size(nu)); VectorBuilder::value, T_partials_return, T_dof> - digamma_vec(size(nu)); + digamma_vec(math::size(nu)); if (!is_constant_all::value) { for (size_t i = 0; i < stan::math::size(nu); i++) { diff --git a/stan/math/prim/prob/scaled_inv_chi_square_lccdf.hpp b/stan/math/prim/prob/scaled_inv_chi_square_lccdf.hpp index 83b31549806..52c122b6f4a 100644 --- a/stan/math/prim/prob/scaled_inv_chi_square_lccdf.hpp +++ b/stan/math/prim/prob/scaled_inv_chi_square_lccdf.hpp @@ -64,9 +64,9 @@ return_type_t scaled_inv_chi_square_lccdf( } VectorBuilder::value, T_partials_return, T_dof> - gamma_vec(size(nu)); + gamma_vec(math::size(nu)); VectorBuilder::value, T_partials_return, T_dof> - digamma_vec(size(nu)); + digamma_vec(math::size(nu)); if (!is_constant_all::value) { for (size_t i = 0; i < stan::math::size(nu); i++) { diff --git a/stan/math/prim/prob/scaled_inv_chi_square_lcdf.hpp b/stan/math/prim/prob/scaled_inv_chi_square_lcdf.hpp index c25413b2831..a5f480a438c 100644 --- a/stan/math/prim/prob/scaled_inv_chi_square_lcdf.hpp +++ b/stan/math/prim/prob/scaled_inv_chi_square_lcdf.hpp @@ -64,9 +64,9 @@ return_type_t scaled_inv_chi_square_lcdf( } VectorBuilder::value, T_partials_return, T_dof> - gamma_vec(size(nu)); + gamma_vec(math::size(nu)); VectorBuilder::value, T_partials_return, T_dof> - digamma_vec(size(nu)); + digamma_vec(math::size(nu)); if (!is_constant_all::value) { for (size_t i = 0; i < stan::math::size(nu); i++) { diff --git a/stan/math/prim/prob/scaled_inv_chi_square_lpdf.hpp b/stan/math/prim/prob/scaled_inv_chi_square_lpdf.hpp index 5187e4b03f5..8c03961ed3f 100644 --- a/stan/math/prim/prob/scaled_inv_chi_square_lpdf.hpp +++ b/stan/math/prim/prob/scaled_inv_chi_square_lpdf.hpp @@ -86,7 +86,7 @@ return_type_t scaled_inv_chi_square_lpdf( VectorBuilder::value, T_partials_return, T_dof> - half_nu(size(nu)); + half_nu(math::size(nu)); for (size_t i = 0; i < stan::math::size(nu); i++) { if (include_summand::value) { half_nu[i] = 0.5 * nu_vec.val(i); @@ -95,7 +95,7 @@ return_type_t scaled_inv_chi_square_lpdf( VectorBuilder::value, T_partials_return, T_y> - log_y(size(y)); + log_y(math::size(y)); for (size_t i = 0; i < stan::math::size(y); i++) { if (include_summand::value) { log_y[i] = log(y_vec.val(i)); @@ -104,7 +104,7 @@ return_type_t scaled_inv_chi_square_lpdf( VectorBuilder::value, T_partials_return, T_y> - inv_y(size(y)); + inv_y(math::size(y)); for (size_t i = 0; i < stan::math::size(y); i++) { if (include_summand::value) { inv_y[i] = 1.0 / y_vec.val(i); @@ -113,7 +113,7 @@ return_type_t scaled_inv_chi_square_lpdf( VectorBuilder::value, T_partials_return, T_scale> - log_s(size(s)); + log_s(math::size(s)); for (size_t i = 0; i < stan::math::size(s); i++) { if (include_summand::value) { log_s[i] = log(s_vec.val(i)); @@ -121,11 +121,11 @@ return_type_t scaled_inv_chi_square_lpdf( } VectorBuilder::value, T_partials_return, T_dof> - log_half_nu(size(nu)); + log_half_nu(math::size(nu)); VectorBuilder::value, T_partials_return, T_dof> - lgamma_half_nu(size(nu)); + lgamma_half_nu(math::size(nu)); VectorBuilder::value, T_partials_return, T_dof> - digamma_half_nu_over_two(size(nu)); + digamma_half_nu_over_two(math::size(nu)); for (size_t i = 0; i < stan::math::size(nu); i++) { if (include_summand::value) { lgamma_half_nu[i] = lgamma(half_nu[i]); diff --git a/stan/math/prim/prob/student_t_cdf.hpp b/stan/math/prim/prob/student_t_cdf.hpp index 38232b2ea0a..87c50cccf44 100644 --- a/stan/math/prim/prob/student_t_cdf.hpp +++ b/stan/math/prim/prob/student_t_cdf.hpp @@ -65,11 +65,11 @@ return_type_t student_t_cdf(const T_y& y, T_partials_return digammaHalf = 0; VectorBuilder::value, T_partials_return, T_dof> - digamma_vec(size(nu)); + digamma_vec(math::size(nu)); VectorBuilder::value, T_partials_return, T_dof> - digammaNu_vec(size(nu)); + digammaNu_vec(math::size(nu)); VectorBuilder::value, T_partials_return, T_dof> - digammaNuPlusHalf_vec(size(nu)); + digammaNuPlusHalf_vec(math::size(nu)); if (!is_constant_all::value) { digammaHalf = digamma(0.5); diff --git a/stan/math/prim/prob/student_t_lccdf.hpp b/stan/math/prim/prob/student_t_lccdf.hpp index 5c9e39865d2..cfc6e5608ef 100644 --- a/stan/math/prim/prob/student_t_lccdf.hpp +++ b/stan/math/prim/prob/student_t_lccdf.hpp @@ -65,11 +65,11 @@ return_type_t student_t_lccdf( T_partials_return digammaHalf = 0; VectorBuilder::value, T_partials_return, T_dof> - digamma_vec(size(nu)); + digamma_vec(math::size(nu)); VectorBuilder::value, T_partials_return, T_dof> - digammaNu_vec(size(nu)); + digammaNu_vec(math::size(nu)); VectorBuilder::value, T_partials_return, T_dof> - digammaNuPlusHalf_vec(size(nu)); + digammaNuPlusHalf_vec(math::size(nu)); if (!is_constant_all::value) { digammaHalf = digamma(0.5); diff --git a/stan/math/prim/prob/student_t_lcdf.hpp b/stan/math/prim/prob/student_t_lcdf.hpp index 401e938cc5b..84158993b47 100644 --- a/stan/math/prim/prob/student_t_lcdf.hpp +++ b/stan/math/prim/prob/student_t_lcdf.hpp @@ -67,11 +67,11 @@ return_type_t student_t_lcdf(const T_y& y, T_partials_return digammaHalf = 0; VectorBuilder::value, T_partials_return, T_dof> - digamma_vec(size(nu)); + digamma_vec(math::size(nu)); VectorBuilder::value, T_partials_return, T_dof> - digammaNu_vec(size(nu)); + digammaNu_vec(math::size(nu)); VectorBuilder::value, T_partials_return, T_dof> - digammaNuPlusHalf_vec(size(nu)); + digammaNuPlusHalf_vec(math::size(nu)); if (!is_constant_all::value) { digammaHalf = digamma(0.5); diff --git a/stan/math/rev/functor/coupled_ode_system.hpp b/stan/math/rev/functor/coupled_ode_system.hpp index 1b78f51111d..f1762c25aa7 100644 --- a/stan/math/rev/functor/coupled_ode_system.hpp +++ b/stan/math/rev/functor/coupled_ode_system.hpp @@ -117,7 +117,7 @@ struct coupled_ode_system_impl { double t) { using std::vector; - dz_dt.resize(size()); + dz_dt.resize(math::size()); // Run nested autodiff in this scope nested_rev_autodiff nested; @@ -211,7 +211,7 @@ struct coupled_ode_system_impl { * parameters at the initial time-point, which is zero. */ std::vector initial_state() const { - std::vector initial(size(), 0.0); + std::vector initial(math::size(), 0.0); for (size_t i = 0; i < N_; i++) { initial[i] = value_of(y0_(i)); } diff --git a/test/unit/math/prim/err_1_test.cpp b/test/unit/math/prim/err_1_test.cpp new file mode 100644 index 00000000000..0438e759f61 --- /dev/null +++ b/test/unit/math/prim/err_1_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/err_2_test.cpp b/test/unit/math/prim/err_2_test.cpp new file mode 100644 index 00000000000..37f8b8a8014 --- /dev/null +++ b/test/unit/math/prim/err_2_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/err_3_test.cpp b/test/unit/math/prim/err_3_test.cpp new file mode 100644 index 00000000000..513651d52e2 --- /dev/null +++ b/test/unit/math/prim/err_3_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/err_4_test.cpp b/test/unit/math/prim/err_4_test.cpp new file mode 100644 index 00000000000..3e5535f918e --- /dev/null +++ b/test/unit/math/prim/err_4_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/err_5_test.cpp b/test/unit/math/prim/err_5_test.cpp new file mode 100644 index 00000000000..958245a3a49 --- /dev/null +++ b/test/unit/math/prim/err_5_test.cpp @@ -0,0 +1,9 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/fun_10_test.cpp b/test/unit/math/prim/fun_10_test.cpp new file mode 100644 index 00000000000..19dd27c1d8d --- /dev/null +++ b/test/unit/math/prim/fun_10_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/fun_11_test.cpp b/test/unit/math/prim/fun_11_test.cpp new file mode 100644 index 00000000000..d10c8253a27 --- /dev/null +++ b/test/unit/math/prim/fun_11_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/fun_12_test.cpp b/test/unit/math/prim/fun_12_test.cpp new file mode 100644 index 00000000000..6c620fb9701 --- /dev/null +++ b/test/unit/math/prim/fun_12_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/fun_13_test.cpp b/test/unit/math/prim/fun_13_test.cpp new file mode 100644 index 00000000000..bbb28f8214b --- /dev/null +++ b/test/unit/math/prim/fun_13_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/fun_14_test.cpp b/test/unit/math/prim/fun_14_test.cpp new file mode 100644 index 00000000000..124b4f8e3d1 --- /dev/null +++ b/test/unit/math/prim/fun_14_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/fun_15_test.cpp b/test/unit/math/prim/fun_15_test.cpp new file mode 100644 index 00000000000..4937f60f6c0 --- /dev/null +++ b/test/unit/math/prim/fun_15_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/fun_16_test.cpp b/test/unit/math/prim/fun_16_test.cpp new file mode 100644 index 00000000000..02eda17846d --- /dev/null +++ b/test/unit/math/prim/fun_16_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/fun_17_test.cpp b/test/unit/math/prim/fun_17_test.cpp new file mode 100644 index 00000000000..b091627f8ef --- /dev/null +++ b/test/unit/math/prim/fun_17_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/fun_18_test.cpp b/test/unit/math/prim/fun_18_test.cpp new file mode 100644 index 00000000000..d7a12be8012 --- /dev/null +++ b/test/unit/math/prim/fun_18_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/fun_19_test.cpp b/test/unit/math/prim/fun_19_test.cpp new file mode 100644 index 00000000000..537754934f5 --- /dev/null +++ b/test/unit/math/prim/fun_19_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/fun_1_test.cpp b/test/unit/math/prim/fun_1_test.cpp new file mode 100644 index 00000000000..ec6954c9421 --- /dev/null +++ b/test/unit/math/prim/fun_1_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/fun_20_test.cpp b/test/unit/math/prim/fun_20_test.cpp new file mode 100644 index 00000000000..8c512ba94ea --- /dev/null +++ b/test/unit/math/prim/fun_20_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/fun_21_test.cpp b/test/unit/math/prim/fun_21_test.cpp new file mode 100644 index 00000000000..14873034db4 --- /dev/null +++ b/test/unit/math/prim/fun_21_test.cpp @@ -0,0 +1,9 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/fun_2_test.cpp b/test/unit/math/prim/fun_2_test.cpp new file mode 100644 index 00000000000..071626160de --- /dev/null +++ b/test/unit/math/prim/fun_2_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/fun_3_test.cpp b/test/unit/math/prim/fun_3_test.cpp new file mode 100644 index 00000000000..6bb7d50447e --- /dev/null +++ b/test/unit/math/prim/fun_3_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/fun_4_test.cpp b/test/unit/math/prim/fun_4_test.cpp new file mode 100644 index 00000000000..933ce960bc9 --- /dev/null +++ b/test/unit/math/prim/fun_4_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/fun_5_test.cpp b/test/unit/math/prim/fun_5_test.cpp new file mode 100644 index 00000000000..25a27a4cd42 --- /dev/null +++ b/test/unit/math/prim/fun_5_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/fun_6_test.cpp b/test/unit/math/prim/fun_6_test.cpp new file mode 100644 index 00000000000..dbedbf38c7d --- /dev/null +++ b/test/unit/math/prim/fun_6_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/fun_7_test.cpp b/test/unit/math/prim/fun_7_test.cpp new file mode 100644 index 00000000000..60104525e3a --- /dev/null +++ b/test/unit/math/prim/fun_7_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/fun_8_test.cpp b/test/unit/math/prim/fun_8_test.cpp new file mode 100644 index 00000000000..5c30241ec69 --- /dev/null +++ b/test/unit/math/prim/fun_8_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/fun_9_test.cpp b/test/unit/math/prim/fun_9_test.cpp new file mode 100644 index 00000000000..ea579ee1654 --- /dev/null +++ b/test/unit/math/prim/fun_9_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/functor_1_test.cpp b/test/unit/math/prim/functor_1_test.cpp new file mode 100644 index 00000000000..eaa2d3990fd --- /dev/null +++ b/test/unit/math/prim/functor_1_test.cpp @@ -0,0 +1,12 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/meta/StdVectorBuilder_test.cpp b/test/unit/math/prim/meta/StdVectorBuilder_test.cpp index 45707477ec7..cf9d082560d 100644 --- a/test/unit/math/prim/meta/StdVectorBuilder_test.cpp +++ b/test/unit/math/prim/meta/StdVectorBuilder_test.cpp @@ -9,7 +9,7 @@ TEST(MathMetaPrim, StdVectorBuilder_false_false_scalar) { double a_double(1); - StdVectorBuilder dvv1(size(a_double)); + StdVectorBuilder dvv1(stan::math::size(a_double)); EXPECT_THROW(dvv1[0], std::logic_error); EXPECT_THROW(dvv1.data(), std::logic_error); } @@ -20,7 +20,7 @@ TEST(MathMetaPrim, StdVectorBuilder_true_false_scalar) { double a_double(1); - StdVectorBuilder dvv1(size(a_double)); + StdVectorBuilder dvv1(stan::math::size(a_double)); EXPECT_FLOAT_EQ(0.0, dvv1[0]); EXPECT_FLOAT_EQ(0.0, dvv1[1]); EXPECT_FLOAT_EQ(0.0, dvv1[100]); @@ -47,7 +47,7 @@ TEST(MathMetaPrim, StdVectorBuilder_false_false_vector) { std::vector a_std_vector(3); - StdVectorBuilder dvv2(size(a_std_vector)); + StdVectorBuilder dvv2(stan::math::size(a_std_vector)); EXPECT_THROW(dvv2[0], std::logic_error); EXPECT_THROW(dvv2.data(), std::logic_error); } @@ -59,7 +59,7 @@ TEST(MathMetaPrim, StdVectorBuilder_true_false_vector) { std::vector a_std_vector(3); - StdVectorBuilder dvv2(size(a_std_vector)); + StdVectorBuilder dvv2(stan::math::size(a_std_vector)); EXPECT_FLOAT_EQ(0.0, dvv2[0]); EXPECT_FLOAT_EQ(0.0, dvv2[1]); EXPECT_FLOAT_EQ(0.0, dvv2[2]); @@ -89,11 +89,11 @@ TEST(MathMetaPrim, StdVectorBuilder_false_false_matrix) { Matrix a_vector(4); Matrix a_row_vector(5); - StdVectorBuilder dvv3(size(a_vector)); + StdVectorBuilder dvv3(stan::math::size(a_vector)); EXPECT_THROW(dvv3[0], std::logic_error); EXPECT_THROW(dvv3.data(), std::logic_error); - StdVectorBuilder dvv4(size(a_row_vector)); + StdVectorBuilder dvv4(stan::math::size(a_row_vector)); EXPECT_THROW(dvv4[0], std::logic_error); EXPECT_THROW(dvv4.data(), std::logic_error); } @@ -107,7 +107,7 @@ TEST(MathMetaPrim, StdVectorBuilder_true_false_matrix) { Matrix a_vector(4); Matrix a_row_vector(5); - StdVectorBuilder dvv3(size(a_vector)); + StdVectorBuilder dvv3(stan::math::size(a_vector)); EXPECT_FLOAT_EQ(0.0, dvv3[0]); EXPECT_FLOAT_EQ(0.0, dvv3[1]); EXPECT_FLOAT_EQ(0.0, dvv3[2]); @@ -115,7 +115,7 @@ TEST(MathMetaPrim, StdVectorBuilder_true_false_matrix) { EXPECT_NO_THROW(data3 = dvv3.data()); EXPECT_FLOAT_EQ(0.0, data3); - StdVectorBuilder dvv4(size(a_row_vector)); + StdVectorBuilder dvv4(stan::math::size(a_row_vector)); EXPECT_FLOAT_EQ(0.0, dvv4[0]); EXPECT_FLOAT_EQ(0.0, dvv4[1]); EXPECT_FLOAT_EQ(0.0, dvv4[2]); diff --git a/test/unit/math/prim/meta/VectorBuilderHelper_test.cpp b/test/unit/math/prim/meta/VectorBuilderHelper_test.cpp index 8c0a105f4fe..4c0711f32c4 100644 --- a/test/unit/math/prim/meta/VectorBuilderHelper_test.cpp +++ b/test/unit/math/prim/meta/VectorBuilderHelper_test.cpp @@ -9,7 +9,7 @@ TEST(MathMetaPrim, VectorBuilderHelper_false_false_scalar) { double a_double(1); - VectorBuilderHelper dvv1(size(a_double)); + VectorBuilderHelper dvv1(stan::math::size(a_double)); EXPECT_THROW(dvv1[0], std::logic_error); EXPECT_THROW(dvv1.data(), std::logic_error); } @@ -20,7 +20,7 @@ TEST(MathMetaPrim, VectorBuilderHelper_true_false_scalar) { double a_double(1); - VectorBuilderHelper dvv1(size(a_double)); + VectorBuilderHelper dvv1(stan::math::size(a_double)); EXPECT_FLOAT_EQ(0.0, dvv1[0]); EXPECT_FLOAT_EQ(0.0, dvv1[1]); EXPECT_FLOAT_EQ(0.0, dvv1[100]); @@ -36,7 +36,7 @@ TEST(MathMetaPrim, VectorBuilderHelper_false_false_vector) { std::vector a_std_vector(3); - VectorBuilderHelper dvv2(size(a_std_vector)); + VectorBuilderHelper dvv2(stan::math::size(a_std_vector)); EXPECT_THROW(dvv2[0], std::logic_error); EXPECT_THROW(dvv2.data(), std::logic_error); } @@ -48,7 +48,7 @@ TEST(MathMetaPrim, VectorBuilderHelper_true_false_vector) { std::vector a_std_vector(3); - VectorBuilderHelper dvv2(size(a_std_vector)); + VectorBuilderHelper dvv2(stan::math::size(a_std_vector)); EXPECT_FLOAT_EQ(0.0, dvv2[0]); EXPECT_FLOAT_EQ(0.0, dvv2[1]); EXPECT_FLOAT_EQ(0.0, dvv2[2]); @@ -66,11 +66,11 @@ TEST(MathMetaPrim, VectorBuilderHelper_false_false_matrix) { Matrix a_vector(4); Matrix a_row_vector(5); - VectorBuilderHelper dvv3(size(a_vector)); + VectorBuilderHelper dvv3(stan::math::size(a_vector)); EXPECT_THROW(dvv3[0], std::logic_error); EXPECT_THROW(dvv3.data(), std::logic_error); - VectorBuilderHelper dvv4(size(a_row_vector)); + VectorBuilderHelper dvv4(stan::math::size(a_row_vector)); EXPECT_THROW(dvv4[0], std::logic_error); EXPECT_THROW(dvv4.data(), std::logic_error); } @@ -84,7 +84,7 @@ TEST(MathMetaPrim, VectorBuilderHelper_true_false_matrix) { Matrix a_vector(4); Matrix a_row_vector(5); - VectorBuilderHelper dvv3(size(a_vector)); + VectorBuilderHelper dvv3(stan::math::size(a_vector)); EXPECT_FLOAT_EQ(0.0, dvv3[0]); EXPECT_FLOAT_EQ(0.0, dvv3[1]); EXPECT_FLOAT_EQ(0.0, dvv3[2]); @@ -92,7 +92,7 @@ TEST(MathMetaPrim, VectorBuilderHelper_true_false_matrix) { EXPECT_NO_THROW(data3 = dvv3.data()); EXPECT_FLOAT_EQ(0.0, data3); - VectorBuilderHelper dvv4(size(a_row_vector)); + VectorBuilderHelper dvv4(stan::math::size(a_row_vector)); EXPECT_FLOAT_EQ(0.0, dvv4[0]); EXPECT_FLOAT_EQ(0.0, dvv4[1]); EXPECT_FLOAT_EQ(0.0, dvv4[2]); diff --git a/test/unit/math/prim/meta/VectorBuilder_test.cpp b/test/unit/math/prim/meta/VectorBuilder_test.cpp index a1dca9ae971..e48eb3dbc74 100644 --- a/test/unit/math/prim/meta/VectorBuilder_test.cpp +++ b/test/unit/math/prim/meta/VectorBuilder_test.cpp @@ -9,7 +9,7 @@ TEST(MathMetaPrim, VectorBuilder_false_false_scalar) { double a_double(1); - VectorBuilder dvv1(size(a_double)); + VectorBuilder dvv1(stan::math::size(a_double)); EXPECT_THROW(dvv1[0], std::logic_error); EXPECT_THROW(dvv1.data(), std::logic_error); } @@ -20,7 +20,7 @@ TEST(MathMetaPrim, VectorBuilder_true_false_scalar) { double a_double(1); - VectorBuilder dvv1(size(a_double)); + VectorBuilder dvv1(stan::math::size(a_double)); EXPECT_FLOAT_EQ(0.0, dvv1[0]); EXPECT_FLOAT_EQ(0.0, dvv1[1]); EXPECT_FLOAT_EQ(0.0, dvv1[100]); @@ -36,7 +36,7 @@ TEST(MathMetaPrim, VectorBuilder_false_false_vector) { std::vector a_std_vector(3); - VectorBuilder dvv2(size(a_std_vector)); + VectorBuilder dvv2(stan::math::size(a_std_vector)); EXPECT_THROW(dvv2[0], std::logic_error); EXPECT_THROW(dvv2.data(), std::logic_error); } @@ -48,7 +48,7 @@ TEST(MathMetaPrim, VectorBuilder_true_false_vector) { std::vector a_std_vector(3); - VectorBuilder dvv2(size(a_std_vector)); + VectorBuilder dvv2(stan::math::size(a_std_vector)); EXPECT_FLOAT_EQ(0.0, dvv2[0]); EXPECT_FLOAT_EQ(0.0, dvv2[1]); EXPECT_FLOAT_EQ(0.0, dvv2[2]); @@ -66,11 +66,11 @@ TEST(MathMetaPrim, VectorBuilder_false_false_matrix) { Matrix a_vector(4); Matrix a_row_vector(5); - VectorBuilder dvv3(size(a_vector)); + VectorBuilder dvv3(stan::math::size(a_vector)); EXPECT_THROW(dvv3[0], std::logic_error); EXPECT_THROW(dvv3.data(), std::logic_error); - VectorBuilder dvv4(size(a_row_vector)); + VectorBuilder dvv4(stan::math::size(a_row_vector)); EXPECT_THROW(dvv4[0], std::logic_error); EXPECT_THROW(dvv4.data(), std::logic_error); } @@ -84,7 +84,7 @@ TEST(MathMetaPrim, VectorBuilder_true_false_matrix) { Matrix a_vector(4); Matrix a_row_vector(5); - VectorBuilder dvv3(size(a_vector)); + VectorBuilder dvv3(stan::math::size(a_vector)); EXPECT_FLOAT_EQ(0.0, dvv3[0]); EXPECT_FLOAT_EQ(0.0, dvv3[1]); EXPECT_FLOAT_EQ(0.0, dvv3[2]); @@ -92,7 +92,7 @@ TEST(MathMetaPrim, VectorBuilder_true_false_matrix) { EXPECT_NO_THROW(data3 = dvv3.data()); EXPECT_FLOAT_EQ(0.0, data3); - VectorBuilder dvv4(size(a_row_vector)); + VectorBuilder dvv4(stan::math::size(a_row_vector)); EXPECT_FLOAT_EQ(0.0, dvv4[0]); EXPECT_FLOAT_EQ(0.0, dvv4[1]); EXPECT_FLOAT_EQ(0.0, dvv4[2]); diff --git a/test/unit/math/prim/meta_1_test.cpp b/test/unit/math/prim/meta_1_test.cpp new file mode 100644 index 00000000000..bb1a62ed5c5 --- /dev/null +++ b/test/unit/math/prim/meta_1_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/meta_2_test.cpp b/test/unit/math/prim/meta_2_test.cpp new file mode 100644 index 00000000000..06f07e86c99 --- /dev/null +++ b/test/unit/math/prim/meta_2_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/meta_3_test.cpp b/test/unit/math/prim/meta_3_test.cpp new file mode 100644 index 00000000000..8bc567acff2 --- /dev/null +++ b/test/unit/math/prim/meta_3_test.cpp @@ -0,0 +1,5 @@ +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/prob_10_test.cpp b/test/unit/math/prim/prob_10_test.cpp new file mode 100644 index 00000000000..9e969554df8 --- /dev/null +++ b/test/unit/math/prim/prob_10_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/prob_11_test.cpp b/test/unit/math/prim/prob_11_test.cpp new file mode 100644 index 00000000000..41877fc3361 --- /dev/null +++ b/test/unit/math/prim/prob_11_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/prob_12_test.cpp b/test/unit/math/prim/prob_12_test.cpp new file mode 100644 index 00000000000..d7ec9ebcdda --- /dev/null +++ b/test/unit/math/prim/prob_12_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/prob_13_test.cpp b/test/unit/math/prim/prob_13_test.cpp new file mode 100644 index 00000000000..631bf5c03af --- /dev/null +++ b/test/unit/math/prim/prob_13_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/prob_14_test.cpp b/test/unit/math/prim/prob_14_test.cpp new file mode 100644 index 00000000000..daaa9d0d55d --- /dev/null +++ b/test/unit/math/prim/prob_14_test.cpp @@ -0,0 +1,3 @@ +#include +#include +#include diff --git a/test/unit/math/prim/prob_1_test.cpp b/test/unit/math/prim/prob_1_test.cpp new file mode 100644 index 00000000000..5561766bac4 --- /dev/null +++ b/test/unit/math/prim/prob_1_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/prob_2_test.cpp b/test/unit/math/prim/prob_2_test.cpp new file mode 100644 index 00000000000..fb9ba05e329 --- /dev/null +++ b/test/unit/math/prim/prob_2_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/prob_3_test.cpp b/test/unit/math/prim/prob_3_test.cpp new file mode 100644 index 00000000000..3c17e22945f --- /dev/null +++ b/test/unit/math/prim/prob_3_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/prob_4_test.cpp b/test/unit/math/prim/prob_4_test.cpp new file mode 100644 index 00000000000..32063e33442 --- /dev/null +++ b/test/unit/math/prim/prob_4_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/prob_5_test.cpp b/test/unit/math/prim/prob_5_test.cpp new file mode 100644 index 00000000000..d8f952e8a9f --- /dev/null +++ b/test/unit/math/prim/prob_5_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/prob_6_test.cpp b/test/unit/math/prim/prob_6_test.cpp new file mode 100644 index 00000000000..db4f6b6d3aa --- /dev/null +++ b/test/unit/math/prim/prob_6_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/prob_7_test.cpp b/test/unit/math/prim/prob_7_test.cpp new file mode 100644 index 00000000000..6ffa1d55f70 --- /dev/null +++ b/test/unit/math/prim/prob_7_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/prob_8_test.cpp b/test/unit/math/prim/prob_8_test.cpp new file mode 100644 index 00000000000..d829cf49c74 --- /dev/null +++ b/test/unit/math/prim/prob_8_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/prim/prob_9_test.cpp b/test/unit/math/prim/prob_9_test.cpp new file mode 100644 index 00000000000..eb42fb15091 --- /dev/null +++ b/test/unit/math/prim/prob_9_test.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/test/unit/math/rev/meta/VectorBuilderHelper_test.cpp b/test/unit/math/rev/meta/VectorBuilderHelper_test.cpp index ac845bbfe35..af0d0234e78 100644 --- a/test/unit/math/rev/meta/VectorBuilderHelper_test.cpp +++ b/test/unit/math/rev/meta/VectorBuilderHelper_test.cpp @@ -11,7 +11,7 @@ TEST(MetaTraitsRevScal, VectorBuilderHelper_false_true) { var a_var(1); - VectorBuilderHelper dvv1(size(a_var)); + VectorBuilderHelper dvv1(stan::math::size(a_var)); EXPECT_THROW(dvv1[0], std::logic_error); EXPECT_THROW(dvv1.data(), std::logic_error); } @@ -24,7 +24,7 @@ TEST(MetaTraitsRevArr, VectorBuilderHelper_false_true) { std::vector a_std_vector(3); - VectorBuilderHelper dvv2(size(a_std_vector)); + VectorBuilderHelper dvv2(stan::math::size(a_std_vector)); EXPECT_THROW(dvv2[0], std::logic_error); EXPECT_THROW(dvv2.data(), std::logic_error); } @@ -37,14 +37,14 @@ TEST(MetaTraitsRevArr, VectorBuilderHelper_true_true) { var a_var(1); std::vector a_std_vector(3); - VectorBuilderHelper dvv1(size(a_var)); + VectorBuilderHelper dvv1(stan::math::size(a_var)); dvv1[0] = 0.0; EXPECT_FLOAT_EQ(0.0, dvv1[0]); std::vector data1; EXPECT_NO_THROW(data1 = dvv1.data()); - EXPECT_EQ(size(a_var), data1.size()); + EXPECT_EQ(stan::math::size(a_var), data1.size()); - VectorBuilderHelper dvv2(size(a_std_vector)); + VectorBuilderHelper dvv2(stan::math::size(a_std_vector)); dvv2[0] = 0.0; dvv2[1] = 1.0; dvv2[2] = 2.0; @@ -53,7 +53,7 @@ TEST(MetaTraitsRevArr, VectorBuilderHelper_true_true) { EXPECT_FLOAT_EQ(2.0, dvv2[2]); std::vector data2; EXPECT_NO_THROW(data2 = dvv2.data()); - EXPECT_EQ(size(a_std_vector), data2.size()); + EXPECT_EQ(stan::math::size(a_std_vector), data2.size()); } TEST(MetaTraitsRevMat, VectorBuilderHelper_false_true) { @@ -66,11 +66,11 @@ TEST(MetaTraitsRevMat, VectorBuilderHelper_false_true) { Matrix a_vector(4); Matrix a_row_vector(5); - VectorBuilderHelper dvv3(size(a_vector)); + VectorBuilderHelper dvv3(stan::math::size(a_vector)); EXPECT_THROW(dvv3[0], std::logic_error); EXPECT_THROW(dvv3.data(), std::logic_error); - VectorBuilderHelper dvv4(size(a_row_vector)); + VectorBuilderHelper dvv4(stan::math::size(a_row_vector)); EXPECT_THROW(dvv4[0], std::logic_error); EXPECT_THROW(dvv3.data(), std::logic_error); } @@ -85,7 +85,7 @@ TEST(MetaTraitsRevMat, VectorBuilderHelper_true_true) { Matrix a_vector(4); Matrix a_row_vector(5); - VectorBuilderHelper dvv3(size(a_vector)); + VectorBuilderHelper dvv3(stan::math::size(a_vector)); dvv3[0] = 0.0; dvv3[1] = 1.0; dvv3[2] = 2.0; @@ -94,9 +94,9 @@ TEST(MetaTraitsRevMat, VectorBuilderHelper_true_true) { EXPECT_FLOAT_EQ(2.0, dvv3[2]); std::vector data3; EXPECT_NO_THROW(data3 = dvv3.data()); - EXPECT_EQ(size(a_vector), data3.size()); + EXPECT_EQ(stan::math::size(a_vector), data3.size()); - VectorBuilderHelper dvv4(size(a_row_vector)); + VectorBuilderHelper dvv4(stan::math::size(a_row_vector)); dvv4[0] = 0.0; dvv4[1] = 1.0; dvv4[2] = 2.0; @@ -105,5 +105,5 @@ TEST(MetaTraitsRevMat, VectorBuilderHelper_true_true) { EXPECT_FLOAT_EQ(2.0, dvv4[2]); std::vector data4; EXPECT_NO_THROW(data4 = dvv4.data()); - EXPECT_EQ(size(a_row_vector), data4.size()); + EXPECT_EQ(stan::math::size(a_row_vector), data4.size()); } diff --git a/test/unit/math/rev/meta/VectorBuilder_test.cpp b/test/unit/math/rev/meta/VectorBuilder_test.cpp index 481870f24a8..6ac78fc523c 100644 --- a/test/unit/math/rev/meta/VectorBuilder_test.cpp +++ b/test/unit/math/rev/meta/VectorBuilder_test.cpp @@ -13,11 +13,11 @@ TEST(MetaTraitsRevArr, VectorBuilder_false_true) { var a_var(1); std::vector a_std_vector(3); - VectorBuilder > dvv1(size(a_var)); + VectorBuilder > dvv1(stan::math::size(a_var)); EXPECT_THROW(dvv1[0], std::logic_error); EXPECT_THROW(dvv1.data(), std::logic_error); - VectorBuilder > dvv2(size(a_std_vector)); + VectorBuilder > dvv2(stan::math::size(a_std_vector)); EXPECT_THROW(dvv2[0], std::logic_error); EXPECT_THROW(dvv2.data(), std::logic_error); } @@ -31,14 +31,14 @@ TEST(MetaTraitsRevArr, VectorBuilder_true_true) { var a_var(1); std::vector a_std_vector(3); - VectorBuilder > dvv1(size(a_var)); + VectorBuilder > dvv1(stan::math::size(a_var)); dvv1[0] = 0.0; EXPECT_FLOAT_EQ(0.0, dvv1[0]); std::vector data1; EXPECT_NO_THROW(data1 = dvv1.data()); - EXPECT_EQ(size(a_var), data1.size()); + EXPECT_EQ(stan::math::size(a_var), data1.size()); - VectorBuilder > dvv2(size(a_std_vector)); + VectorBuilder > dvv2(stan::math::size(a_std_vector)); dvv2[0] = 0.0; dvv2[1] = 1.0; dvv2[2] = 2.0; @@ -47,7 +47,7 @@ TEST(MetaTraitsRevArr, VectorBuilder_true_true) { EXPECT_FLOAT_EQ(2.0, dvv2[2]); std::vector data2; EXPECT_NO_THROW(data2 = dvv2.data()); - EXPECT_EQ(size(a_std_vector), data2.size()); + EXPECT_EQ(stan::math::size(a_std_vector), data2.size()); } TEST(MetaTraitsRevMat, VectorBuilder_false_true) { @@ -60,7 +60,7 @@ TEST(MetaTraitsRevMat, VectorBuilder_false_true) { Matrix a_vector(4); Matrix a_row_vector(5); - VectorBuilder > dvv3(size(a_vector)); + VectorBuilder > dvv3(stan::math::size(a_vector)); EXPECT_THROW(dvv3[0], std::logic_error); EXPECT_THROW(dvv3.data(), std::logic_error); @@ -80,7 +80,7 @@ TEST(MetaTraitsRevMat, VectorBuilder_true_true) { Matrix a_vector(4); Matrix a_row_vector(5); - VectorBuilder > dvv3(size(a_vector)); + VectorBuilder > dvv3(stan::math::size(a_vector)); dvv3[0] = 0.0; dvv3[1] = 1.0; dvv3[2] = 2.0; @@ -89,7 +89,7 @@ TEST(MetaTraitsRevMat, VectorBuilder_true_true) { EXPECT_FLOAT_EQ(2.0, dvv3[2]); std::vector data3; EXPECT_NO_THROW(data3 = dvv3.data()); - EXPECT_EQ(size(a_vector), data3.size()); + EXPECT_EQ(stan::math::size(a_vector), data3.size()); VectorBuilder > dvv4( stan::math::size(a_row_vector)); @@ -101,5 +101,5 @@ TEST(MetaTraitsRevMat, VectorBuilder_true_true) { EXPECT_FLOAT_EQ(2.0, dvv4[2]); std::vector data4; EXPECT_NO_THROW(data4 = dvv4.data()); - EXPECT_EQ(size(a_row_vector), data4.size()); + EXPECT_EQ(stan::math::size(a_row_vector), data4.size()); } From 7db39ef0a73d654aa71bc16364df3d200b883856 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 28 Mar 2022 20:16:09 +0800 Subject: [PATCH 06/29] Remove stray test files --- test/unit/math/prim/err_1_test.cpp | 15 --------------- test/unit/math/prim/err_2_test.cpp | 15 --------------- test/unit/math/prim/err_3_test.cpp | 15 --------------- test/unit/math/prim/err_4_test.cpp | 15 --------------- test/unit/math/prim/err_5_test.cpp | 9 --------- test/unit/math/prim/fun_10_test.cpp | 15 --------------- test/unit/math/prim/fun_11_test.cpp | 15 --------------- test/unit/math/prim/fun_12_test.cpp | 15 --------------- test/unit/math/prim/fun_13_test.cpp | 15 --------------- test/unit/math/prim/fun_14_test.cpp | 15 --------------- test/unit/math/prim/fun_15_test.cpp | 15 --------------- test/unit/math/prim/fun_16_test.cpp | 15 --------------- test/unit/math/prim/fun_17_test.cpp | 15 --------------- test/unit/math/prim/fun_18_test.cpp | 15 --------------- test/unit/math/prim/fun_19_test.cpp | 15 --------------- test/unit/math/prim/fun_1_test.cpp | 15 --------------- test/unit/math/prim/fun_20_test.cpp | 15 --------------- test/unit/math/prim/fun_21_test.cpp | 9 --------- test/unit/math/prim/fun_2_test.cpp | 15 --------------- test/unit/math/prim/fun_3_test.cpp | 15 --------------- test/unit/math/prim/fun_4_test.cpp | 15 --------------- test/unit/math/prim/fun_5_test.cpp | 15 --------------- test/unit/math/prim/fun_6_test.cpp | 15 --------------- test/unit/math/prim/fun_7_test.cpp | 15 --------------- test/unit/math/prim/fun_8_test.cpp | 15 --------------- test/unit/math/prim/fun_9_test.cpp | 15 --------------- test/unit/math/prim/functor_1_test.cpp | 12 ------------ test/unit/math/prim/meta_1_test.cpp | 15 --------------- test/unit/math/prim/meta_2_test.cpp | 15 --------------- test/unit/math/prim/meta_3_test.cpp | 5 ----- test/unit/math/prim/prob_10_test.cpp | 15 --------------- test/unit/math/prim/prob_11_test.cpp | 15 --------------- test/unit/math/prim/prob_12_test.cpp | 15 --------------- test/unit/math/prim/prob_13_test.cpp | 15 --------------- test/unit/math/prim/prob_14_test.cpp | 3 --- test/unit/math/prim/prob_1_test.cpp | 15 --------------- test/unit/math/prim/prob_2_test.cpp | 15 --------------- test/unit/math/prim/prob_3_test.cpp | 15 --------------- test/unit/math/prim/prob_4_test.cpp | 15 --------------- test/unit/math/prim/prob_5_test.cpp | 15 --------------- test/unit/math/prim/prob_6_test.cpp | 15 --------------- test/unit/math/prim/prob_7_test.cpp | 15 --------------- test/unit/math/prim/prob_8_test.cpp | 15 --------------- test/unit/math/prim/prob_9_test.cpp | 15 --------------- 44 files changed, 623 deletions(-) delete mode 100644 test/unit/math/prim/err_1_test.cpp delete mode 100644 test/unit/math/prim/err_2_test.cpp delete mode 100644 test/unit/math/prim/err_3_test.cpp delete mode 100644 test/unit/math/prim/err_4_test.cpp delete mode 100644 test/unit/math/prim/err_5_test.cpp delete mode 100644 test/unit/math/prim/fun_10_test.cpp delete mode 100644 test/unit/math/prim/fun_11_test.cpp delete mode 100644 test/unit/math/prim/fun_12_test.cpp delete mode 100644 test/unit/math/prim/fun_13_test.cpp delete mode 100644 test/unit/math/prim/fun_14_test.cpp delete mode 100644 test/unit/math/prim/fun_15_test.cpp delete mode 100644 test/unit/math/prim/fun_16_test.cpp delete mode 100644 test/unit/math/prim/fun_17_test.cpp delete mode 100644 test/unit/math/prim/fun_18_test.cpp delete mode 100644 test/unit/math/prim/fun_19_test.cpp delete mode 100644 test/unit/math/prim/fun_1_test.cpp delete mode 100644 test/unit/math/prim/fun_20_test.cpp delete mode 100644 test/unit/math/prim/fun_21_test.cpp delete mode 100644 test/unit/math/prim/fun_2_test.cpp delete mode 100644 test/unit/math/prim/fun_3_test.cpp delete mode 100644 test/unit/math/prim/fun_4_test.cpp delete mode 100644 test/unit/math/prim/fun_5_test.cpp delete mode 100644 test/unit/math/prim/fun_6_test.cpp delete mode 100644 test/unit/math/prim/fun_7_test.cpp delete mode 100644 test/unit/math/prim/fun_8_test.cpp delete mode 100644 test/unit/math/prim/fun_9_test.cpp delete mode 100644 test/unit/math/prim/functor_1_test.cpp delete mode 100644 test/unit/math/prim/meta_1_test.cpp delete mode 100644 test/unit/math/prim/meta_2_test.cpp delete mode 100644 test/unit/math/prim/meta_3_test.cpp delete mode 100644 test/unit/math/prim/prob_10_test.cpp delete mode 100644 test/unit/math/prim/prob_11_test.cpp delete mode 100644 test/unit/math/prim/prob_12_test.cpp delete mode 100644 test/unit/math/prim/prob_13_test.cpp delete mode 100644 test/unit/math/prim/prob_14_test.cpp delete mode 100644 test/unit/math/prim/prob_1_test.cpp delete mode 100644 test/unit/math/prim/prob_2_test.cpp delete mode 100644 test/unit/math/prim/prob_3_test.cpp delete mode 100644 test/unit/math/prim/prob_4_test.cpp delete mode 100644 test/unit/math/prim/prob_5_test.cpp delete mode 100644 test/unit/math/prim/prob_6_test.cpp delete mode 100644 test/unit/math/prim/prob_7_test.cpp delete mode 100644 test/unit/math/prim/prob_8_test.cpp delete mode 100644 test/unit/math/prim/prob_9_test.cpp diff --git a/test/unit/math/prim/err_1_test.cpp b/test/unit/math/prim/err_1_test.cpp deleted file mode 100644 index 0438e759f61..00000000000 --- a/test/unit/math/prim/err_1_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/err_2_test.cpp b/test/unit/math/prim/err_2_test.cpp deleted file mode 100644 index 37f8b8a8014..00000000000 --- a/test/unit/math/prim/err_2_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/err_3_test.cpp b/test/unit/math/prim/err_3_test.cpp deleted file mode 100644 index 513651d52e2..00000000000 --- a/test/unit/math/prim/err_3_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/err_4_test.cpp b/test/unit/math/prim/err_4_test.cpp deleted file mode 100644 index 3e5535f918e..00000000000 --- a/test/unit/math/prim/err_4_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/err_5_test.cpp b/test/unit/math/prim/err_5_test.cpp deleted file mode 100644 index 958245a3a49..00000000000 --- a/test/unit/math/prim/err_5_test.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/fun_10_test.cpp b/test/unit/math/prim/fun_10_test.cpp deleted file mode 100644 index 19dd27c1d8d..00000000000 --- a/test/unit/math/prim/fun_10_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/fun_11_test.cpp b/test/unit/math/prim/fun_11_test.cpp deleted file mode 100644 index d10c8253a27..00000000000 --- a/test/unit/math/prim/fun_11_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/fun_12_test.cpp b/test/unit/math/prim/fun_12_test.cpp deleted file mode 100644 index 6c620fb9701..00000000000 --- a/test/unit/math/prim/fun_12_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/fun_13_test.cpp b/test/unit/math/prim/fun_13_test.cpp deleted file mode 100644 index bbb28f8214b..00000000000 --- a/test/unit/math/prim/fun_13_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/fun_14_test.cpp b/test/unit/math/prim/fun_14_test.cpp deleted file mode 100644 index 124b4f8e3d1..00000000000 --- a/test/unit/math/prim/fun_14_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/fun_15_test.cpp b/test/unit/math/prim/fun_15_test.cpp deleted file mode 100644 index 4937f60f6c0..00000000000 --- a/test/unit/math/prim/fun_15_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/fun_16_test.cpp b/test/unit/math/prim/fun_16_test.cpp deleted file mode 100644 index 02eda17846d..00000000000 --- a/test/unit/math/prim/fun_16_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/fun_17_test.cpp b/test/unit/math/prim/fun_17_test.cpp deleted file mode 100644 index b091627f8ef..00000000000 --- a/test/unit/math/prim/fun_17_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/fun_18_test.cpp b/test/unit/math/prim/fun_18_test.cpp deleted file mode 100644 index d7a12be8012..00000000000 --- a/test/unit/math/prim/fun_18_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/fun_19_test.cpp b/test/unit/math/prim/fun_19_test.cpp deleted file mode 100644 index 537754934f5..00000000000 --- a/test/unit/math/prim/fun_19_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/fun_1_test.cpp b/test/unit/math/prim/fun_1_test.cpp deleted file mode 100644 index ec6954c9421..00000000000 --- a/test/unit/math/prim/fun_1_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/fun_20_test.cpp b/test/unit/math/prim/fun_20_test.cpp deleted file mode 100644 index 8c512ba94ea..00000000000 --- a/test/unit/math/prim/fun_20_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/fun_21_test.cpp b/test/unit/math/prim/fun_21_test.cpp deleted file mode 100644 index 14873034db4..00000000000 --- a/test/unit/math/prim/fun_21_test.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/fun_2_test.cpp b/test/unit/math/prim/fun_2_test.cpp deleted file mode 100644 index 071626160de..00000000000 --- a/test/unit/math/prim/fun_2_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/fun_3_test.cpp b/test/unit/math/prim/fun_3_test.cpp deleted file mode 100644 index 6bb7d50447e..00000000000 --- a/test/unit/math/prim/fun_3_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/fun_4_test.cpp b/test/unit/math/prim/fun_4_test.cpp deleted file mode 100644 index 933ce960bc9..00000000000 --- a/test/unit/math/prim/fun_4_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/fun_5_test.cpp b/test/unit/math/prim/fun_5_test.cpp deleted file mode 100644 index 25a27a4cd42..00000000000 --- a/test/unit/math/prim/fun_5_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/fun_6_test.cpp b/test/unit/math/prim/fun_6_test.cpp deleted file mode 100644 index dbedbf38c7d..00000000000 --- a/test/unit/math/prim/fun_6_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/fun_7_test.cpp b/test/unit/math/prim/fun_7_test.cpp deleted file mode 100644 index 60104525e3a..00000000000 --- a/test/unit/math/prim/fun_7_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/fun_8_test.cpp b/test/unit/math/prim/fun_8_test.cpp deleted file mode 100644 index 5c30241ec69..00000000000 --- a/test/unit/math/prim/fun_8_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/fun_9_test.cpp b/test/unit/math/prim/fun_9_test.cpp deleted file mode 100644 index ea579ee1654..00000000000 --- a/test/unit/math/prim/fun_9_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/functor_1_test.cpp b/test/unit/math/prim/functor_1_test.cpp deleted file mode 100644 index eaa2d3990fd..00000000000 --- a/test/unit/math/prim/functor_1_test.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/meta_1_test.cpp b/test/unit/math/prim/meta_1_test.cpp deleted file mode 100644 index bb1a62ed5c5..00000000000 --- a/test/unit/math/prim/meta_1_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/meta_2_test.cpp b/test/unit/math/prim/meta_2_test.cpp deleted file mode 100644 index 06f07e86c99..00000000000 --- a/test/unit/math/prim/meta_2_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/meta_3_test.cpp b/test/unit/math/prim/meta_3_test.cpp deleted file mode 100644 index 8bc567acff2..00000000000 --- a/test/unit/math/prim/meta_3_test.cpp +++ /dev/null @@ -1,5 +0,0 @@ -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/prob_10_test.cpp b/test/unit/math/prim/prob_10_test.cpp deleted file mode 100644 index 9e969554df8..00000000000 --- a/test/unit/math/prim/prob_10_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/prob_11_test.cpp b/test/unit/math/prim/prob_11_test.cpp deleted file mode 100644 index 41877fc3361..00000000000 --- a/test/unit/math/prim/prob_11_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/prob_12_test.cpp b/test/unit/math/prim/prob_12_test.cpp deleted file mode 100644 index d7ec9ebcdda..00000000000 --- a/test/unit/math/prim/prob_12_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/prob_13_test.cpp b/test/unit/math/prim/prob_13_test.cpp deleted file mode 100644 index 631bf5c03af..00000000000 --- a/test/unit/math/prim/prob_13_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/prob_14_test.cpp b/test/unit/math/prim/prob_14_test.cpp deleted file mode 100644 index daaa9d0d55d..00000000000 --- a/test/unit/math/prim/prob_14_test.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include -#include -#include diff --git a/test/unit/math/prim/prob_1_test.cpp b/test/unit/math/prim/prob_1_test.cpp deleted file mode 100644 index 5561766bac4..00000000000 --- a/test/unit/math/prim/prob_1_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/prob_2_test.cpp b/test/unit/math/prim/prob_2_test.cpp deleted file mode 100644 index fb9ba05e329..00000000000 --- a/test/unit/math/prim/prob_2_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/prob_3_test.cpp b/test/unit/math/prim/prob_3_test.cpp deleted file mode 100644 index 3c17e22945f..00000000000 --- a/test/unit/math/prim/prob_3_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/prob_4_test.cpp b/test/unit/math/prim/prob_4_test.cpp deleted file mode 100644 index 32063e33442..00000000000 --- a/test/unit/math/prim/prob_4_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/prob_5_test.cpp b/test/unit/math/prim/prob_5_test.cpp deleted file mode 100644 index d8f952e8a9f..00000000000 --- a/test/unit/math/prim/prob_5_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/prob_6_test.cpp b/test/unit/math/prim/prob_6_test.cpp deleted file mode 100644 index db4f6b6d3aa..00000000000 --- a/test/unit/math/prim/prob_6_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/prob_7_test.cpp b/test/unit/math/prim/prob_7_test.cpp deleted file mode 100644 index 6ffa1d55f70..00000000000 --- a/test/unit/math/prim/prob_7_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/prob_8_test.cpp b/test/unit/math/prim/prob_8_test.cpp deleted file mode 100644 index d829cf49c74..00000000000 --- a/test/unit/math/prim/prob_8_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/test/unit/math/prim/prob_9_test.cpp b/test/unit/math/prim/prob_9_test.cpp deleted file mode 100644 index eb42fb15091..00000000000 --- a/test/unit/math/prim/prob_9_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include From 8e0cc7086ec2be5a39860866e810e33b9b1fefbb Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 28 Mar 2022 20:59:17 +0800 Subject: [PATCH 07/29] cpplint and includes --- stan/math/opencl/prim/bernoulli_logit_glm_lpmf.hpp | 3 ++- .../math/opencl/prim/neg_binomial_2_log_glm_lpmf.hpp | 3 ++- stan/math/opencl/prim/normal_id_glm_lpdf.hpp | 3 ++- stan/math/opencl/prim/ordered_logistic_lpmf.hpp | 6 +++--- stan/math/opencl/prim/poisson_log_glm_lpmf.hpp | 3 ++- stan/math/prim/functor/coupled_ode_system.hpp | 5 +++-- stan/math/prim/prob/binomial_logit_lpmf.hpp | 3 ++- stan/math/prim/prob/inv_chi_square_lpdf.hpp | 3 ++- stan/math/prim/prob/von_mises_lpdf.hpp | 3 ++- stan/math/rev/functor/coupled_ode_system.hpp | 9 +++++---- stan/math/rev/functor/cvodes_integrator.hpp | 10 ++++++---- .../unit/math/prim/meta/VectorBuilderHelper_test.cpp | 6 ++++-- test/unit/math/prim/meta/VectorBuilder_test.cpp | 6 ++++-- test/unit/math/rev/meta/VectorBuilder_test.cpp | 12 ++++++++---- 14 files changed, 47 insertions(+), 28 deletions(-) diff --git a/stan/math/opencl/prim/bernoulli_logit_glm_lpmf.hpp b/stan/math/opencl/prim/bernoulli_logit_glm_lpmf.hpp index 544c48fffaf..9de5422b293 100644 --- a/stan/math/opencl/prim/bernoulli_logit_glm_lpmf.hpp +++ b/stan/math/opencl/prim/bernoulli_logit_glm_lpmf.hpp @@ -66,7 +66,8 @@ return_type_t bernoulli_logit_glm_lpmf( const size_t M = x.cols(); if (is_y_vector) { - check_size_match(function, "Rows of ", "x", N, "rows of ", "y", math::size(y)); + check_size_match(function, "Rows of ", "x", N, "rows of ", "y", + math::size(y)); } check_size_match(function, "Columns of ", "x_cl", M, "size of ", "beta", math::size(beta)); diff --git a/stan/math/opencl/prim/neg_binomial_2_log_glm_lpmf.hpp b/stan/math/opencl/prim/neg_binomial_2_log_glm_lpmf.hpp index ce2a99d53e0..1bfec8258b6 100644 --- a/stan/math/opencl/prim/neg_binomial_2_log_glm_lpmf.hpp +++ b/stan/math/opencl/prim/neg_binomial_2_log_glm_lpmf.hpp @@ -82,7 +82,8 @@ neg_binomial_2_log_glm_lpmf(const T_y_cl& y, const T_x_cl& x, const size_t M = x.cols(); if (is_y_vector) { - check_size_match(function, "Rows of ", "x", N, "rows of ", "y", math::size(y)); + check_size_match(function, "Rows of ", "x", N, "rows of ", "y", + math::size(y)); } check_size_match(function, "Columns of ", "x", M, "size of ", "beta", math::size(beta)); diff --git a/stan/math/opencl/prim/normal_id_glm_lpdf.hpp b/stan/math/opencl/prim/normal_id_glm_lpdf.hpp index 03f96893350..b999c25e535 100644 --- a/stan/math/opencl/prim/normal_id_glm_lpdf.hpp +++ b/stan/math/opencl/prim/normal_id_glm_lpdf.hpp @@ -74,7 +74,8 @@ normal_id_glm_lpdf(const T_y_cl& y, const T_x_cl& x, const T_alpha_cl& alpha, const size_t M = x.cols(); if (is_y_vector) { - check_size_match(function, "Rows of ", "x", N, "rows of ", "y", math::size(y)); + check_size_match(function, "Rows of ", "x", N, "rows of ", "y", + math::size(y)); } check_size_match(function, "Columns of ", "x_cl", M, "size of ", "beta", math::size(beta)); diff --git a/stan/math/opencl/prim/ordered_logistic_lpmf.hpp b/stan/math/opencl/prim/ordered_logistic_lpmf.hpp index 713a2386d2f..9e248340335 100644 --- a/stan/math/opencl/prim/ordered_logistic_lpmf.hpp +++ b/stan/math/opencl/prim/ordered_logistic_lpmf.hpp @@ -72,9 +72,9 @@ inline return_type_t ordered_logistic_lpmf( constexpr bool is_y_vector = !is_stan_scalar::value; static const char* function = "ordered_logistic_lpmf(OpenCL)"; - if (math::size(y) != 1) { - check_size_match(function, "Size of ", "y", math::size(y), "Size of", "lambda", - math::size(lambda)); + if (size(y) != 1) { + check_size_match(function, "Size of ", "y", math::size(y), "Size of", + "lambda", math::size(lambda)); } int N_instances = max_size(y, lambda); diff --git a/stan/math/opencl/prim/poisson_log_glm_lpmf.hpp b/stan/math/opencl/prim/poisson_log_glm_lpmf.hpp index 807eda3d175..c6b730e7644 100644 --- a/stan/math/opencl/prim/poisson_log_glm_lpmf.hpp +++ b/stan/math/opencl/prim/poisson_log_glm_lpmf.hpp @@ -66,7 +66,8 @@ return_type_t poisson_log_glm_lpmf( const size_t M = x.cols(); if (is_y_vector) { - check_size_match(function, "Rows of ", "x", N, "rows of ", "y", math::size(y)); + check_size_match(function, "Rows of ", "x", N, "rows of ", "y", + math::size(y)); } check_size_match(function, "Columns of ", "x_cl", M, "size of ", "beta", math::size(beta)); diff --git a/stan/math/prim/functor/coupled_ode_system.hpp b/stan/math/prim/functor/coupled_ode_system.hpp index f49d8432bd9..133b800de68 100644 --- a/stan/math/prim/functor/coupled_ode_system.hpp +++ b/stan/math/prim/functor/coupled_ode_system.hpp @@ -68,7 +68,8 @@ struct coupled_ode_system_impl { dz_dt.resize(y.size()); Eigen::VectorXd f_y_t - = math::apply([&](const Args&... args) { return f_(t, y, msgs_, args...); }, + = math::apply([&](const Args&... args) { + return f_(t, y, msgs_, args...); }, args_tuple_); check_size_match("coupled_ode_system", "dy_dt", f_y_t.size(), "states", @@ -91,7 +92,7 @@ struct coupled_ode_system_impl { * @return the initial condition of the coupled system */ std::vector initial_state() const { - std::vector initial(math::size(), 0.0); + std::vector initial(size(), 0.0); for (size_t i = 0; i < N_; i++) { initial[i] = value_of(y0_(i)); diff --git a/stan/math/prim/prob/binomial_logit_lpmf.hpp b/stan/math/prim/prob/binomial_logit_lpmf.hpp index 6c784c714da..248e1ea794a 100644 --- a/stan/math/prim/prob/binomial_logit_lpmf.hpp +++ b/stan/math/prim/prob/binomial_logit_lpmf.hpp @@ -90,7 +90,8 @@ return_type_t binomial_logit_lpmf(const T_n& n, const T_N& N, T_partials_return sum_n = sum(n_val) * maximum_size / math::size(n); ops_partials.edge1_.partials_[0] = forward_as( sum_n * inv_logit_neg_alpha - - (sum(N_val) * maximum_size / math::size(N) - sum_n) * inv_logit_alpha); + - (sum(N_val) * maximum_size / math::size(N) - sum_n) + * inv_logit_alpha); } } diff --git a/stan/math/prim/prob/inv_chi_square_lpdf.hpp b/stan/math/prim/prob/inv_chi_square_lpdf.hpp index d55838677e0..d86325352b0 100644 --- a/stan/math/prim/prob/inv_chi_square_lpdf.hpp +++ b/stan/math/prim/prob/inv_chi_square_lpdf.hpp @@ -82,7 +82,8 @@ return_type_t inv_chi_square_lpdf(const T_y& y, const T_dof& nu) { size_t N = max_size(y, nu); T_partials_return logp = -sum((half_nu + 1.0) * log_y); if (include_summand::value) { - logp -= (sum(nu_val) * HALF_LOG_TWO + sum(lgamma(half_nu))) * N / math::size(nu); + logp -= (sum(nu_val) * HALF_LOG_TWO + sum(lgamma(half_nu))) * N + / math::size(nu); } if (include_summand::value) { const auto& inv_y = to_ref_if::value>(inv(y_val)); diff --git a/stan/math/prim/prob/von_mises_lpdf.hpp b/stan/math/prim/prob/von_mises_lpdf.hpp index 33f99552087..881b53a591e 100644 --- a/stan/math/prim/prob/von_mises_lpdf.hpp +++ b/stan/math/prim/prob/von_mises_lpdf.hpp @@ -63,7 +63,8 @@ return_type_t von_mises_lpdf(T_y const& y, T_loc const& mu, logp -= LOG_TWO_PI * N; } if (include_summand::value) { - logp -= sum(log_modified_bessel_first_kind(0, kappa_val)) * N / math::size(kappa); + logp -= sum(log_modified_bessel_first_kind(0, kappa_val)) * N + / math::size(kappa); } if (!is_constant_all::value) { diff --git a/stan/math/rev/functor/coupled_ode_system.hpp b/stan/math/rev/functor/coupled_ode_system.hpp index f1762c25aa7..88a8b77a240 100644 --- a/stan/math/rev/functor/coupled_ode_system.hpp +++ b/stan/math/rev/functor/coupled_ode_system.hpp @@ -117,7 +117,7 @@ struct coupled_ode_system_impl { double t) { using std::vector; - dz_dt.resize(math::size()); + dz_dt.resize(size()); // Run nested autodiff in this scope nested_rev_autodiff nested; @@ -127,8 +127,9 @@ struct coupled_ode_system_impl { y_vars.coeffRef(n) = z[n]; Eigen::Matrix f_y_t_vars - = math::apply([&](auto&&... args) { return f_(t, y_vars, msgs_, args...); }, - local_args_tuple_); + = math::apply([&](auto&&... args) { + return f_(t, y_vars, msgs_, args...); }, + local_args_tuple_); check_size_match("coupled_ode_system", "dy_dt", f_y_t_vars.size(), "states", N_); @@ -211,7 +212,7 @@ struct coupled_ode_system_impl { * parameters at the initial time-point, which is zero. */ std::vector initial_state() const { - std::vector initial(math::size(), 0.0); + std::vector initial(size(), 0.0); for (size_t i = 0; i < N_; i++) { initial[i] = value_of(y0_(i)); } diff --git a/stan/math/rev/functor/cvodes_integrator.hpp b/stan/math/rev/functor/cvodes_integrator.hpp index 4d0c959cc64..3d77adbb36f 100644 --- a/stan/math/rev/functor/cvodes_integrator.hpp +++ b/stan/math/rev/functor/cvodes_integrator.hpp @@ -106,8 +106,9 @@ class cvodes_integrator { const Eigen::VectorXd y_vec = Eigen::Map(y, N_); Eigen::VectorXd dy_dt_vec - = math::apply([&](auto&&... args) { return f_(t, y_vec, msgs_, args...); }, - value_of_args_tuple_); + = math::apply([&](auto&&... args) { + return f_(t, y_vec, msgs_, args...); }, + value_of_args_tuple_); check_size_match("cvodes_integrator", "dy_dt", dy_dt_vec.size(), "states", N_); @@ -124,8 +125,9 @@ class cvodes_integrator { Eigen::MatrixXd Jfy; auto f_wrapped = [&](const Eigen::Matrix& y) { - return math::apply([&](auto&&... args) { return f_(t, y, msgs_, args...); }, - value_of_args_tuple_); + return math::apply([&](auto&&... args) { + return f_(t, y, msgs_, args...); }, + value_of_args_tuple_); }; jacobian(f_wrapped, Eigen::Map(y, N_), fy, Jfy); diff --git a/test/unit/math/prim/meta/VectorBuilderHelper_test.cpp b/test/unit/math/prim/meta/VectorBuilderHelper_test.cpp index 4c0711f32c4..7c6b9fb29d9 100644 --- a/test/unit/math/prim/meta/VectorBuilderHelper_test.cpp +++ b/test/unit/math/prim/meta/VectorBuilderHelper_test.cpp @@ -36,7 +36,8 @@ TEST(MathMetaPrim, VectorBuilderHelper_false_false_vector) { std::vector a_std_vector(3); - VectorBuilderHelper dvv2(stan::math::size(a_std_vector)); + VectorBuilderHelper + dvv2(stan::math::size(a_std_vector)); EXPECT_THROW(dvv2[0], std::logic_error); EXPECT_THROW(dvv2.data(), std::logic_error); } @@ -70,7 +71,8 @@ TEST(MathMetaPrim, VectorBuilderHelper_false_false_matrix) { EXPECT_THROW(dvv3[0], std::logic_error); EXPECT_THROW(dvv3.data(), std::logic_error); - VectorBuilderHelper dvv4(stan::math::size(a_row_vector)); + VectorBuilderHelper + dvv4(stan::math::size(a_row_vector)); EXPECT_THROW(dvv4[0], std::logic_error); EXPECT_THROW(dvv4.data(), std::logic_error); } diff --git a/test/unit/math/prim/meta/VectorBuilder_test.cpp b/test/unit/math/prim/meta/VectorBuilder_test.cpp index e48eb3dbc74..9a851c84b8e 100644 --- a/test/unit/math/prim/meta/VectorBuilder_test.cpp +++ b/test/unit/math/prim/meta/VectorBuilder_test.cpp @@ -36,7 +36,8 @@ TEST(MathMetaPrim, VectorBuilder_false_false_vector) { std::vector a_std_vector(3); - VectorBuilder dvv2(stan::math::size(a_std_vector)); + VectorBuilder + dvv2(stan::math::size(a_std_vector)); EXPECT_THROW(dvv2[0], std::logic_error); EXPECT_THROW(dvv2.data(), std::logic_error); } @@ -70,7 +71,8 @@ TEST(MathMetaPrim, VectorBuilder_false_false_matrix) { EXPECT_THROW(dvv3[0], std::logic_error); EXPECT_THROW(dvv3.data(), std::logic_error); - VectorBuilder dvv4(stan::math::size(a_row_vector)); + VectorBuilder + dvv4(stan::math::size(a_row_vector)); EXPECT_THROW(dvv4[0], std::logic_error); EXPECT_THROW(dvv4.data(), std::logic_error); } diff --git a/test/unit/math/rev/meta/VectorBuilder_test.cpp b/test/unit/math/rev/meta/VectorBuilder_test.cpp index 6ac78fc523c..ee190e95bb1 100644 --- a/test/unit/math/rev/meta/VectorBuilder_test.cpp +++ b/test/unit/math/rev/meta/VectorBuilder_test.cpp @@ -17,7 +17,8 @@ TEST(MetaTraitsRevArr, VectorBuilder_false_true) { EXPECT_THROW(dvv1[0], std::logic_error); EXPECT_THROW(dvv1.data(), std::logic_error); - VectorBuilder > dvv2(stan::math::size(a_std_vector)); + VectorBuilder > + dvv2(stan::math::size(a_std_vector)); EXPECT_THROW(dvv2[0], std::logic_error); EXPECT_THROW(dvv2.data(), std::logic_error); } @@ -38,7 +39,8 @@ TEST(MetaTraitsRevArr, VectorBuilder_true_true) { EXPECT_NO_THROW(data1 = dvv1.data()); EXPECT_EQ(stan::math::size(a_var), data1.size()); - VectorBuilder > dvv2(stan::math::size(a_std_vector)); + VectorBuilder > + dvv2(stan::math::size(a_std_vector)); dvv2[0] = 0.0; dvv2[1] = 1.0; dvv2[2] = 2.0; @@ -60,7 +62,8 @@ TEST(MetaTraitsRevMat, VectorBuilder_false_true) { Matrix a_vector(4); Matrix a_row_vector(5); - VectorBuilder > dvv3(stan::math::size(a_vector)); + VectorBuilder > + dvv3(stan::math::size(a_vector)); EXPECT_THROW(dvv3[0], std::logic_error); EXPECT_THROW(dvv3.data(), std::logic_error); @@ -80,7 +83,8 @@ TEST(MetaTraitsRevMat, VectorBuilder_true_true) { Matrix a_vector(4); Matrix a_row_vector(5); - VectorBuilder > dvv3(stan::math::size(a_vector)); + VectorBuilder > + dvv3(stan::math::size(a_vector)); dvv3[0] = 0.0; dvv3[1] = 1.0; dvv3[2] = 2.0; From 92e4df6ba55a381f8ab60f7a1ecccfbe65ce6a78 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 28 Mar 2022 21:35:55 +0800 Subject: [PATCH 08/29] Opencl --- stan/math/opencl/matrix_cl.hpp | 14 +++++++------- stan/math/opencl/prim/size.hpp | 2 +- stan/math/opencl/zeros_strict_tri.hpp | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/stan/math/opencl/matrix_cl.hpp b/stan/math/opencl/matrix_cl.hpp index af53f4f0805..6c5470e055a 100644 --- a/stan/math/opencl/matrix_cl.hpp +++ b/stan/math/opencl/matrix_cl.hpp @@ -283,7 +283,7 @@ class matrix_cl : public matrix_cl_base { matrix_cl(const int rows, const int cols, matrix_cl_view partial_view = matrix_cl_view::Entire) : rows_(rows), cols_(cols), view_(partial_view) { - if (math::size() == 0) { + if (this->size() == 0) { return; } cl::Context& ctx = opencl_context.context(); @@ -321,7 +321,7 @@ class matrix_cl : public matrix_cl_base { matrix_cl_view partial_view = matrix_cl_view::Entire) : rows_(A.rows()), cols_(A.cols()), view_(partial_view) { using Mat_type = std::decay_t>; - if (math::size() == 0) { + if (this->size() == 0) { return; } initialize_buffer_no_heap_if< @@ -457,7 +457,7 @@ class matrix_cl : public matrix_cl_base { return *this; } this->wait_for_read_write_events(); - if (math::size() != a.size()) { + if (this->size() != a.size()) { buffer_cl_ = cl::Buffer(opencl_context.context(), CL_MEM_READ_WRITE, sizeof(T) * a.size()); } @@ -518,7 +518,7 @@ class matrix_cl : public matrix_cl_base { template cl::Event initialize_buffer(const T* A) { cl::Event transfer_event; - if (math::size() == 0) { + if (this->size() == 0) { return transfer_event; } cl::Context& ctx = opencl_context.context(); @@ -538,7 +538,7 @@ class matrix_cl : public matrix_cl_base { template cl::Event initialize_buffer(T* A) { cl::Event transfer_event; - if (math::size() == 0) { + if (this->size() == 0) { return transfer_event; } cl::Context& ctx = opencl_context.context(); @@ -577,7 +577,7 @@ class matrix_cl : public matrix_cl_base { */ template * = nullptr> void initialize_buffer_no_heap_if(U&& obj) { - if (math::size() == 0) { + if (this->size() == 0) { return; } initialize_buffer(obj.data()); @@ -587,7 +587,7 @@ class matrix_cl : public matrix_cl_base { template * = nullptr> void initialize_buffer_no_heap_if(U&& obj) { using U_val = std::decay_t>; - if (math::size() == 0) { + if (this->size() == 0) { return; } auto* obj_heap = new U_val(std::move(obj)); diff --git a/stan/math/opencl/prim/size.hpp b/stan/math/opencl/prim/size.hpp index ef82fc6c49b..37d037a2943 100644 --- a/stan/math/opencl/prim/size.hpp +++ b/stan/math/opencl/prim/size.hpp @@ -15,7 +15,7 @@ namespace math { */ template * = nullptr> -size_t math::size(const T& m) { +size_t size(const T& m) { return m.rows() * m.cols(); } diff --git a/stan/math/opencl/zeros_strict_tri.hpp b/stan/math/opencl/zeros_strict_tri.hpp index 983b0448ac4..3ff0b92842a 100644 --- a/stan/math/opencl/zeros_strict_tri.hpp +++ b/stan/math/opencl/zeros_strict_tri.hpp @@ -40,7 +40,7 @@ inline void matrix_cl::zeros_strict_tri() try { "zeros_strict_tri", "matrix_view", "matrix_cl_view::Diagonal is not a valid template parameter value", ""); } - if (math::size() == 0) { + if (this->size() == 0) { return; } this->view_ = both(this->view_, invert(matrix_view)); From fd69a703d2c97f3165753f57829e00298f873d73 Mon Sep 17 00:00:00 2001 From: Stan BuildBot Date: Mon, 28 Mar 2022 09:42:00 -0400 Subject: [PATCH 09/29] [Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1 --- stan/math/prim/functor/coupled_ode_system.hpp | 7 +++---- stan/math/prim/prob/binomial_logit_lpmf.hpp | 2 +- stan/math/prim/prob/inv_chi_square_lpdf.hpp | 2 +- stan/math/prim/prob/von_mises_lpdf.hpp | 2 +- stan/math/rev/functor/algebra_solver_newton.hpp | 2 +- stan/math/rev/functor/coupled_ode_system.hpp | 7 +++---- stan/math/rev/functor/cvodes_integrator.hpp | 13 ++++++------- .../math/prim/meta/VectorBuilderHelper_test.cpp | 8 ++++---- test/unit/math/prim/meta/VectorBuilder_test.cpp | 6 ++---- test/unit/math/rev/meta/VectorBuilder_test.cpp | 16 ++++++++-------- 10 files changed, 30 insertions(+), 35 deletions(-) diff --git a/stan/math/prim/functor/coupled_ode_system.hpp b/stan/math/prim/functor/coupled_ode_system.hpp index 133b800de68..5298b53a570 100644 --- a/stan/math/prim/functor/coupled_ode_system.hpp +++ b/stan/math/prim/functor/coupled_ode_system.hpp @@ -67,10 +67,9 @@ struct coupled_ode_system_impl { dz_dt.resize(y.size()); - Eigen::VectorXd f_y_t - = math::apply([&](const Args&... args) { - return f_(t, y, msgs_, args...); }, - args_tuple_); + Eigen::VectorXd f_y_t = math::apply( + [&](const Args&... args) { return f_(t, y, msgs_, args...); }, + args_tuple_); check_size_match("coupled_ode_system", "dy_dt", f_y_t.size(), "states", y.size()); diff --git a/stan/math/prim/prob/binomial_logit_lpmf.hpp b/stan/math/prim/prob/binomial_logit_lpmf.hpp index 248e1ea794a..08e42e2873a 100644 --- a/stan/math/prim/prob/binomial_logit_lpmf.hpp +++ b/stan/math/prim/prob/binomial_logit_lpmf.hpp @@ -91,7 +91,7 @@ return_type_t binomial_logit_lpmf(const T_n& n, const T_N& N, ops_partials.edge1_.partials_[0] = forward_as( sum_n * inv_logit_neg_alpha - (sum(N_val) * maximum_size / math::size(N) - sum_n) - * inv_logit_alpha); + * inv_logit_alpha); } } diff --git a/stan/math/prim/prob/inv_chi_square_lpdf.hpp b/stan/math/prim/prob/inv_chi_square_lpdf.hpp index d86325352b0..d47c4355017 100644 --- a/stan/math/prim/prob/inv_chi_square_lpdf.hpp +++ b/stan/math/prim/prob/inv_chi_square_lpdf.hpp @@ -83,7 +83,7 @@ return_type_t inv_chi_square_lpdf(const T_y& y, const T_dof& nu) { T_partials_return logp = -sum((half_nu + 1.0) * log_y); if (include_summand::value) { logp -= (sum(nu_val) * HALF_LOG_TWO + sum(lgamma(half_nu))) * N - / math::size(nu); + / math::size(nu); } if (include_summand::value) { const auto& inv_y = to_ref_if::value>(inv(y_val)); diff --git a/stan/math/prim/prob/von_mises_lpdf.hpp b/stan/math/prim/prob/von_mises_lpdf.hpp index 881b53a591e..dcaef3036b1 100644 --- a/stan/math/prim/prob/von_mises_lpdf.hpp +++ b/stan/math/prim/prob/von_mises_lpdf.hpp @@ -64,7 +64,7 @@ return_type_t von_mises_lpdf(T_y const& y, T_loc const& mu, } if (include_summand::value) { logp -= sum(log_modified_bessel_first_kind(0, kappa_val)) * N - / math::size(kappa); + / math::size(kappa); } if (!is_constant_all::value) { diff --git a/stan/math/rev/functor/algebra_solver_newton.hpp b/stan/math/rev/functor/algebra_solver_newton.hpp index abf9b074216..04b426b212d 100644 --- a/stan/math/rev/functor/algebra_solver_newton.hpp +++ b/stan/math/rev/functor/algebra_solver_newton.hpp @@ -168,7 +168,7 @@ Eigen::Matrix algebra_solver_newton_impl( auto f_wrt_x = [&](const auto& x) { return math::apply([&](const auto&... args) { return f(x, msgs, args...); }, - args_vals_tuple); + args_vals_tuple); }; Eigen::MatrixXd Jf_x; diff --git a/stan/math/rev/functor/coupled_ode_system.hpp b/stan/math/rev/functor/coupled_ode_system.hpp index 88a8b77a240..220dda25a4c 100644 --- a/stan/math/rev/functor/coupled_ode_system.hpp +++ b/stan/math/rev/functor/coupled_ode_system.hpp @@ -126,10 +126,9 @@ struct coupled_ode_system_impl { for (size_t n = 0; n < N_; ++n) y_vars.coeffRef(n) = z[n]; - Eigen::Matrix f_y_t_vars - = math::apply([&](auto&&... args) { - return f_(t, y_vars, msgs_, args...); }, - local_args_tuple_); + Eigen::Matrix f_y_t_vars = math::apply( + [&](auto&&... args) { return f_(t, y_vars, msgs_, args...); }, + local_args_tuple_); check_size_match("coupled_ode_system", "dy_dt", f_y_t_vars.size(), "states", N_); diff --git a/stan/math/rev/functor/cvodes_integrator.hpp b/stan/math/rev/functor/cvodes_integrator.hpp index 3d77adbb36f..b36bae594e0 100644 --- a/stan/math/rev/functor/cvodes_integrator.hpp +++ b/stan/math/rev/functor/cvodes_integrator.hpp @@ -105,10 +105,9 @@ class cvodes_integrator { inline void rhs(double t, const double y[], double dy_dt[]) const { const Eigen::VectorXd y_vec = Eigen::Map(y, N_); - Eigen::VectorXd dy_dt_vec - = math::apply([&](auto&&... args) { - return f_(t, y_vec, msgs_, args...); }, - value_of_args_tuple_); + Eigen::VectorXd dy_dt_vec = math::apply( + [&](auto&&... args) { return f_(t, y_vec, msgs_, args...); }, + value_of_args_tuple_); check_size_match("cvodes_integrator", "dy_dt", dy_dt_vec.size(), "states", N_); @@ -125,9 +124,9 @@ class cvodes_integrator { Eigen::MatrixXd Jfy; auto f_wrapped = [&](const Eigen::Matrix& y) { - return math::apply([&](auto&&... args) { - return f_(t, y, msgs_, args...); }, - value_of_args_tuple_); + return math::apply( + [&](auto&&... args) { return f_(t, y, msgs_, args...); }, + value_of_args_tuple_); }; jacobian(f_wrapped, Eigen::Map(y, N_), fy, Jfy); diff --git a/test/unit/math/prim/meta/VectorBuilderHelper_test.cpp b/test/unit/math/prim/meta/VectorBuilderHelper_test.cpp index 7c6b9fb29d9..a8be33072b4 100644 --- a/test/unit/math/prim/meta/VectorBuilderHelper_test.cpp +++ b/test/unit/math/prim/meta/VectorBuilderHelper_test.cpp @@ -36,8 +36,8 @@ TEST(MathMetaPrim, VectorBuilderHelper_false_false_vector) { std::vector a_std_vector(3); - VectorBuilderHelper - dvv2(stan::math::size(a_std_vector)); + VectorBuilderHelper dvv2( + stan::math::size(a_std_vector)); EXPECT_THROW(dvv2[0], std::logic_error); EXPECT_THROW(dvv2.data(), std::logic_error); } @@ -71,8 +71,8 @@ TEST(MathMetaPrim, VectorBuilderHelper_false_false_matrix) { EXPECT_THROW(dvv3[0], std::logic_error); EXPECT_THROW(dvv3.data(), std::logic_error); - VectorBuilderHelper - dvv4(stan::math::size(a_row_vector)); + VectorBuilderHelper dvv4( + stan::math::size(a_row_vector)); EXPECT_THROW(dvv4[0], std::logic_error); EXPECT_THROW(dvv4.data(), std::logic_error); } diff --git a/test/unit/math/prim/meta/VectorBuilder_test.cpp b/test/unit/math/prim/meta/VectorBuilder_test.cpp index 9a851c84b8e..e48eb3dbc74 100644 --- a/test/unit/math/prim/meta/VectorBuilder_test.cpp +++ b/test/unit/math/prim/meta/VectorBuilder_test.cpp @@ -36,8 +36,7 @@ TEST(MathMetaPrim, VectorBuilder_false_false_vector) { std::vector a_std_vector(3); - VectorBuilder - dvv2(stan::math::size(a_std_vector)); + VectorBuilder dvv2(stan::math::size(a_std_vector)); EXPECT_THROW(dvv2[0], std::logic_error); EXPECT_THROW(dvv2.data(), std::logic_error); } @@ -71,8 +70,7 @@ TEST(MathMetaPrim, VectorBuilder_false_false_matrix) { EXPECT_THROW(dvv3[0], std::logic_error); EXPECT_THROW(dvv3.data(), std::logic_error); - VectorBuilder - dvv4(stan::math::size(a_row_vector)); + VectorBuilder dvv4(stan::math::size(a_row_vector)); EXPECT_THROW(dvv4[0], std::logic_error); EXPECT_THROW(dvv4.data(), std::logic_error); } diff --git a/test/unit/math/rev/meta/VectorBuilder_test.cpp b/test/unit/math/rev/meta/VectorBuilder_test.cpp index ee190e95bb1..edd3df52fdc 100644 --- a/test/unit/math/rev/meta/VectorBuilder_test.cpp +++ b/test/unit/math/rev/meta/VectorBuilder_test.cpp @@ -17,8 +17,8 @@ TEST(MetaTraitsRevArr, VectorBuilder_false_true) { EXPECT_THROW(dvv1[0], std::logic_error); EXPECT_THROW(dvv1.data(), std::logic_error); - VectorBuilder > - dvv2(stan::math::size(a_std_vector)); + VectorBuilder > dvv2( + stan::math::size(a_std_vector)); EXPECT_THROW(dvv2[0], std::logic_error); EXPECT_THROW(dvv2.data(), std::logic_error); } @@ -39,8 +39,8 @@ TEST(MetaTraitsRevArr, VectorBuilder_true_true) { EXPECT_NO_THROW(data1 = dvv1.data()); EXPECT_EQ(stan::math::size(a_var), data1.size()); - VectorBuilder > - dvv2(stan::math::size(a_std_vector)); + VectorBuilder > dvv2( + stan::math::size(a_std_vector)); dvv2[0] = 0.0; dvv2[1] = 1.0; dvv2[2] = 2.0; @@ -62,8 +62,8 @@ TEST(MetaTraitsRevMat, VectorBuilder_false_true) { Matrix a_vector(4); Matrix a_row_vector(5); - VectorBuilder > - dvv3(stan::math::size(a_vector)); + VectorBuilder > dvv3( + stan::math::size(a_vector)); EXPECT_THROW(dvv3[0], std::logic_error); EXPECT_THROW(dvv3.data(), std::logic_error); @@ -83,8 +83,8 @@ TEST(MetaTraitsRevMat, VectorBuilder_true_true) { Matrix a_vector(4); Matrix a_row_vector(5); - VectorBuilder > - dvv3(stan::math::size(a_vector)); + VectorBuilder > dvv3( + stan::math::size(a_vector)); dvv3[0] = 0.0; dvv3[1] = 1.0; dvv3[2] = 2.0; From b162659af6875aba9fd3b02857ee15b8234171c8 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Tue, 29 Mar 2022 05:30:48 +0800 Subject: [PATCH 10/29] Test g++ with threading tests --- Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1c10966c46a..c22281ad7db 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -242,7 +242,7 @@ pipeline { post { always { deleteDir() } } } - stage('Full Unit Tests') { +/* stage('Full Unit Tests') { agent { docker { image 'stanorg/ci:gpu' @@ -266,7 +266,7 @@ pipeline { } } post { always { retry(3) { deleteDir() } } } - } + } */ stage('Always-run tests') { when { @@ -399,7 +399,7 @@ pipeline { steps { script { unstash 'MathSetup' - sh "echo CXX=${CLANG_CXX} -Werror > make/local" + sh "echo CXX=g++ -Werror > make/local" sh "echo STAN_THREADS=true >> make/local" sh "export STAN_NUM_THREADS=4" if (isBranch('develop') || isBranch('master')) { From 2645b2529bdef1f5ef2415d947f703408b84f495 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Tue, 29 Mar 2022 20:56:51 +0800 Subject: [PATCH 11/29] Re-enable unit tests --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c22281ad7db..ac0df3c6abe 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -242,7 +242,7 @@ pipeline { post { always { deleteDir() } } } -/* stage('Full Unit Tests') { + stage('Full Unit Tests') { agent { docker { image 'stanorg/ci:gpu' @@ -266,7 +266,7 @@ pipeline { } } post { always { retry(3) { deleteDir() } } } - } */ + } stage('Always-run tests') { when { From e635eae7db96fc4d184b2138a54ae8d287e8296a Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Tue, 29 Mar 2022 23:42:08 +0800 Subject: [PATCH 12/29] Update mix.hpp --- stan/math/mix.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stan/math/mix.hpp b/stan/math/mix.hpp index 38b6a5e9c0e..f28846b29dd 100644 --- a/stan/math/mix.hpp +++ b/stan/math/mix.hpp @@ -5,15 +5,15 @@ #include #include -#ifdef STAN_OPENCL -#include -#endif - #include #include #include #include +#ifdef STAN_OPENCL +#include +#endif + #include #include #include From e886d8234be477f4699b66c92052a9a334cbd376 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sat, 2 Apr 2022 12:09:03 +0800 Subject: [PATCH 13/29] Use new ci image --- Jenkinsfile | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ac0df3c6abe..d0f36cd1b6a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -117,7 +117,7 @@ pipeline { stage("Clang-format") { agent { docker { - image 'stanorg/ci:gpu' + image 'stanorg/ci:gpu-cpp17' label 'linux' } } @@ -168,7 +168,7 @@ pipeline { stage('Linting & Doc checks') { agent { docker { - image 'stanorg/ci:gpu' + image 'stanorg/ci:gpu-cpp17' label 'linux' } } @@ -203,7 +203,7 @@ pipeline { stage('Verify changes') { agent { docker { - image 'stanorg/ci:gpu' + image 'stanorg/ci:gpu-cpp17' label 'linux' } } @@ -225,7 +225,7 @@ pipeline { stage('Headers check') { agent { docker { - image 'stanorg/ci:gpu' + image 'stanorg/ci:gpu-cpp17' label 'linux' } } @@ -245,7 +245,7 @@ pipeline { stage('Full Unit Tests') { agent { docker { - image 'stanorg/ci:gpu' + image 'stanorg/ci:gpu-cpp17' label 'linux' } } @@ -279,7 +279,7 @@ pipeline { stage('MPI tests') { agent { docker { - image 'stanorg/ci:gpu' + image 'stanorg/ci:gpu-cpp17' label 'linux' } } @@ -299,7 +299,7 @@ pipeline { stage('OpenCL GPU tests') { agent { docker { - image 'stanorg/ci:gpu' + image 'stanorg/ci:gpu-cpp17' label 'v100' args '--gpus 1' } @@ -322,7 +322,7 @@ pipeline { stage('Distribution tests') { agent { docker { - image 'stanorg/ci:gpu' + image 'stanorg/ci:gpu-cpp17' label 'linux' args '--pull always' } @@ -356,7 +356,7 @@ pipeline { stage('Expressions test') { agent { docker { - image 'stanorg/ci:gpu' + image 'stanorg/ci:gpu-cpp17' label 'linux' args '--pull always' } @@ -391,7 +391,7 @@ pipeline { stage('Threading tests') { agent { docker { - image 'stanorg/ci:gpu' + image 'stanorg/ci:gpu-cpp17' label 'linux' args '--pull always' } @@ -399,7 +399,7 @@ pipeline { steps { script { unstash 'MathSetup' - sh "echo CXX=g++ -Werror > make/local" + sh "echo CXX=${CLANG_CXX} -Werror > make/local" sh "echo STAN_THREADS=true >> make/local" sh "export STAN_NUM_THREADS=4" if (isBranch('develop') || isBranch('master')) { @@ -462,7 +462,7 @@ pipeline { stage('Upload doxygen') { agent { docker { - image 'stanorg/ci:gpu' + image 'stanorg/ci:gpu-cpp17' label 'linux' } } From 4b130cc718a6e9fa835eb7c5b5863d58f0837847 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sat, 2 Apr 2022 12:21:16 +0800 Subject: [PATCH 14/29] Update default clang --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index d0f36cd1b6a..6f09a7c6bc0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -88,7 +88,7 @@ pipeline { } environment { STAN_NUM_THREADS = 4 - CLANG_CXX = 'clang++-6.0' + CLANG_CXX = 'clang++-7' GCC = 'g++' MPICXX = 'mpicxx.openmpi' N_TESTS = 150 From 8ee14e7d73d4d05c6fa8315e1387be98759fd0c7 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sat, 2 Apr 2022 12:35:58 +0800 Subject: [PATCH 15/29] Update default clang --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6f09a7c6bc0..191519c5bfc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -88,7 +88,7 @@ pipeline { } environment { STAN_NUM_THREADS = 4 - CLANG_CXX = 'clang++-7' + CLANG_CXX = 'clang++-7.0' GCC = 'g++' MPICXX = 'mpicxx.openmpi' N_TESTS = 150 From 922427ae359928a4b1b52aa597f03ab0432e7b61 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sat, 2 Apr 2022 18:20:51 +0800 Subject: [PATCH 16/29] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 191519c5bfc..6f09a7c6bc0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -88,7 +88,7 @@ pipeline { } environment { STAN_NUM_THREADS = 4 - CLANG_CXX = 'clang++-7.0' + CLANG_CXX = 'clang++-7' GCC = 'g++' MPICXX = 'mpicxx.openmpi' N_TESTS = 150 From 5a0fc01ae507a2c7e630a83a790f53abc67eeca4 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 4 Apr 2022 15:20:26 +0800 Subject: [PATCH 17/29] Trigger CI From ef4fcd141da39da38c7378cb9fb46fa71f01c3c2 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 4 Apr 2022 15:30:43 +0800 Subject: [PATCH 18/29] Force pull image --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 6f09a7c6bc0..474eb8c390a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -227,6 +227,7 @@ pipeline { docker { image 'stanorg/ci:gpu-cpp17' label 'linux' + args '--pull' } } when { From b0798edfaf297bc26a59d65315f9c55bfa1121ab Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 4 Apr 2022 17:01:16 +0800 Subject: [PATCH 19/29] Update Jenkinsfile --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 474eb8c390a..6f09a7c6bc0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -227,7 +227,6 @@ pipeline { docker { image 'stanorg/ci:gpu-cpp17' label 'linux' - args '--pull' } } when { From 3a1b8b382ccb5c48cf870c5db0d7c1c63c1870c8 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 4 Apr 2022 17:11:46 +0800 Subject: [PATCH 20/29] Fix force pull --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 6f09a7c6bc0..16537cddad4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -227,6 +227,7 @@ pipeline { docker { image 'stanorg/ci:gpu-cpp17' label 'linux' + args '--pull always' } } when { From 039e8a91a889713c18b05683387f332ecad9f0ad Mon Sep 17 00:00:00 2001 From: serban-nicusor-toptal Date: Mon, 4 Apr 2022 12:08:25 +0200 Subject: [PATCH 21/29] Force pull docker image, removed --pull always --- Jenkinsfile | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 16537cddad4..079cd6527fc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -222,12 +222,25 @@ pipeline { } } + stage('Pull image VM1') { + agent { label 'triqs' } + steps { + sh "docker pull stanorg/ci:gpu-cpp17" + } + } + + stage('Pull image VM2') { + agent { label 'v100' } + steps { + sh "docker pull stanorg/ci:gpu-cpp17" + } + } + stage('Headers check') { agent { docker { image 'stanorg/ci:gpu-cpp17' label 'linux' - args '--pull always' } } when { @@ -325,7 +338,6 @@ pipeline { docker { image 'stanorg/ci:gpu-cpp17' label 'linux' - args '--pull always' } } steps { @@ -359,7 +371,6 @@ pipeline { docker { image 'stanorg/ci:gpu-cpp17' label 'linux' - args '--pull always' } } steps { @@ -394,7 +405,6 @@ pipeline { docker { image 'stanorg/ci:gpu-cpp17' label 'linux' - args '--pull always' } } steps { From 7843804749c260da388b400780c6e351378251ab Mon Sep 17 00:00:00 2001 From: serban-nicusor-toptal Date: Mon, 4 Apr 2022 12:14:53 +0200 Subject: [PATCH 22/29] Updated label for pulling VM1 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 079cd6527fc..1fa9f723738 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -223,7 +223,7 @@ pipeline { } stage('Pull image VM1') { - agent { label 'triqs' } + agent { label 'docker' } steps { sh "docker pull stanorg/ci:gpu-cpp17" } From 03fd3af933d4b60e2b2cafee5e60ac4dd2690627 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 4 Apr 2022 18:40:08 +0800 Subject: [PATCH 23/29] Update Jenkinsfile --- Jenkinsfile | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1fa9f723738..4f856d3bdfd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -222,20 +222,6 @@ pipeline { } } - stage('Pull image VM1') { - agent { label 'docker' } - steps { - sh "docker pull stanorg/ci:gpu-cpp17" - } - } - - stage('Pull image VM2') { - agent { label 'v100' } - steps { - sh "docker pull stanorg/ci:gpu-cpp17" - } - } - stage('Headers check') { agent { docker { From 1e8a33365f18caaa68bc774720d47176b16663fc Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 4 Apr 2022 19:11:22 +0800 Subject: [PATCH 24/29] Update clang for unit tests --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4f856d3bdfd..4f81427ccee 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -256,7 +256,8 @@ pipeline { } steps { unstash 'MathSetup' - sh "echo CXXFLAGS += -fsanitize=address >> make/local" + sh "echo CXXFLAGS += -fsanitize=address >> make/local" + sh "echo CXX=${CLANG_CXX} -Werror > make/local" script { if (isUnix()) { runTests("test/unit", false) From a5dc3c4433b686aafb8b415e989d30a29de931f8 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 6 Apr 2022 21:46:11 +0800 Subject: [PATCH 25/29] Trigger CI From fd0aa5aa7d41be5b8578006fc606a73ceda625d5 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sun, 10 Apr 2022 14:26:19 +0800 Subject: [PATCH 26/29] Update github action for c++17 --- .github/workflows/main.yml | 50 +++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 28 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 704b5d2ddb4..ac43597c871 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: Windows RTools 3.5 +name: Windows RTools 4.0 on: pull_request: @@ -22,19 +22,17 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/develop'" - + - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: python-version: '2.x' - - name: Download RTools - run: Invoke-WebRequest -Uri https://cran.rstudio.com/bin/windows/Rtools/Rtools35.exe -OutFile ./R35.exe - - name: Install RTools - shell: powershell - run: Start-Process -FilePath ./R35.exe -ArgumentList /VERYSILENT -NoNewWindow -Wait - - name: PATH Setup - shell: powershell - run: echo "C:/Rtools/bin;C:/Rtools/mingw_64/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 + - uses: r-lib/actions/setup-r@v1 + with: + r-version: 'release' + - name: Set path for RTools 4.0 + if: runner.os == 'Windows' + run: echo "C:/rtools40/usr/bin;C:/rtools40/mingw64/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 - name: Print g++ & make version and path shell: powershell run: | @@ -56,7 +54,7 @@ jobs: python.exe runTests.py -j2 test/unit/math/prim python.exe runTests.py -j2 test/unit/math/rev python.exe runTests.py -j2 test/unit/math/memory - + - name: Upload gtest_output xml uses: actions/upload-artifact@v2 if: failure() @@ -72,14 +70,12 @@ jobs: - uses: actions/setup-python@v2 with: python-version: '2.x' - - name: Download RTools - run: Invoke-WebRequest -Uri https://cran.rstudio.com/bin/windows/Rtools/Rtools35.exe -OutFile ./R35.exe - - name: Install RTools - shell: powershell - run: Start-Process -FilePath ./R35.exe -ArgumentList /VERYSILENT -NoNewWindow -Wait - - name: PATH Setup - shell: powershell - run: echo "C:/Rtools/bin;C:/Rtools/mingw_64/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 + - uses: r-lib/actions/setup-r@v1 + with: + r-version: 'release' + - name: Set path for RTools 4.0 + if: runner.os == 'Windows' + run: echo "C:/rtools40/usr/bin;C:/rtools40/mingw64/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 - name: Print g++ & make version and path shell: powershell run: | @@ -121,14 +117,12 @@ jobs: - uses: actions/setup-python@v2 with: python-version: '2.x' - - name: Download RTools - run: Invoke-WebRequest -Uri https://cran.rstudio.com/bin/windows/Rtools/Rtools35.exe -OutFile ./R35.exe - - name: Install RTools - shell: powershell - run: Start-Process -FilePath ./R35.exe -ArgumentList /VERYSILENT -NoNewWindow -Wait - - name: PATH Setup - shell: powershell - run: echo "C:/Rtools/bin;C:/Rtools/mingw_64/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 + - uses: r-lib/actions/setup-r@v1 + with: + r-version: 'release' + - name: Set path for RTools 4.0 + if: runner.os == 'Windows' + run: echo "C:/rtools40/usr/bin;C:/rtools40/mingw64/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 - name: Print g++ & make version and path shell: powershell run: | @@ -149,7 +143,7 @@ jobs: shell: powershell run: | python.exe runTests.py test/unit/math/mix/fun - + - name: Upload gtest_output xml uses: actions/upload-artifact@v2 if: failure() From 2015377eca6009af788615bc1f1325669da6f15c Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sun, 10 Apr 2022 14:44:15 +0800 Subject: [PATCH 27/29] Opencl size header --- stan/math/opencl/prim/num_elements.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/stan/math/opencl/prim/num_elements.hpp b/stan/math/opencl/prim/num_elements.hpp index 37e576382a4..aedae05f616 100644 --- a/stan/math/opencl/prim/num_elements.hpp +++ b/stan/math/opencl/prim/num_elements.hpp @@ -3,6 +3,7 @@ #ifdef STAN_OPENCL #include +#include namespace stan { namespace math { From 67bb1c13a7faab66cacf2b74893c42563a01a801 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Fri, 17 Jun 2022 12:04:42 +0300 Subject: [PATCH 28/29] Revert CI changes --- .github/workflows/main.yml | 2 +- Jenkinsfile | 33 ++++++++++++++++++--------------- make/compiler_flags | 2 +- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0ccf0ac7316..73307372f82 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -158,4 +158,4 @@ jobs: if: failure() with: name: gtest_outputs_xml - path: '**/*_test.xml' \ No newline at end of file + path: '**/*_test.xml' diff --git a/Jenkinsfile b/Jenkinsfile index f3d438552fd..890677505fe 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -87,7 +87,7 @@ pipeline { } environment { STAN_NUM_THREADS = 4 - CLANG_CXX = 'clang++-7' + CLANG_CXX = 'clang++-6.0' GCC = 'g++' MPICXX = 'mpicxx.openmpi' N_TESTS = 150 @@ -116,7 +116,7 @@ pipeline { stage("Clang-format") { agent { docker { - image 'stanorg/ci:gpu-cpp17' + image 'stanorg/ci:gpu' label 'linux' } } @@ -167,7 +167,7 @@ pipeline { stage('Linting & Doc checks') { agent { docker { - image 'stanorg/ci:gpu-cpp17' + image 'stanorg/ci:gpu' label 'linux' } } @@ -202,7 +202,7 @@ pipeline { stage('Verify changes') { agent { docker { - image 'stanorg/ci:gpu-cpp17' + image 'stanorg/ci:gpu' label 'linux' } } @@ -224,7 +224,7 @@ pipeline { stage('Headers check') { agent { docker { - image 'stanorg/ci:gpu-cpp17' + image 'stanorg/ci:gpu' label 'linux' } } @@ -252,7 +252,7 @@ pipeline { stage('Rev/Fwd Unit Tests') { agent { docker { - image 'stanorg/ci:gpu-cpp17' + image 'stanorg/ci:gpu' label 'linux' args '--cap-add SYS_PTRACE' } @@ -275,7 +275,7 @@ pipeline { stage('Mix Unit Tests') { agent { docker { - image 'stanorg/ci:gpu-cpp17' + image 'stanorg/ci:gpu' label 'linux' args '--cap-add SYS_PTRACE' } @@ -297,7 +297,7 @@ pipeline { stage('Prim Unit Tests') { agent { docker { - image 'stanorg/ci:gpu-cpp17' + image 'stanorg/ci:gpu' label 'linux' args '--cap-add SYS_PTRACE' } @@ -313,7 +313,7 @@ pipeline { script { runTests("test/unit/*_test.cpp", false) runTests("test/unit/math/*_test.cpp", false) - runTests("test/unit/math/prim", false) + runTests("test/unit/math/prim", false) runTests("test/unit/math/memory", false) } } @@ -332,7 +332,7 @@ pipeline { stage('MPI tests') { agent { docker { - image 'stanorg/ci:gpu-cpp17' + image 'stanorg/ci:gpu' label 'linux' } } @@ -352,7 +352,7 @@ pipeline { stage('OpenCL GPU tests') { agent { docker { - image 'stanorg/ci:gpu-cpp17' + image 'stanorg/ci:gpu' label 'v100' args '--gpus 1' } @@ -375,8 +375,9 @@ pipeline { stage('Distribution tests') { agent { docker { - image 'stanorg/ci:gpu-cpp17' + image 'stanorg/ci:gpu' label 'linux' + args '--pull always' } } steps { @@ -408,8 +409,9 @@ pipeline { stage('Expressions test') { agent { docker { - image 'stanorg/ci:gpu-cpp17' + image 'stanorg/ci:gpu' label 'linux' + args '--pull always' } } steps { @@ -443,8 +445,9 @@ pipeline { stage('Threading tests') { agent { docker { - image 'stanorg/ci:gpu-cpp17' + image 'stanorg/ci:gpu' label 'linux' + args '--pull always' } } steps { @@ -492,7 +495,7 @@ pipeline { stage('Upload doxygen') { agent { docker { - image 'stanorg/ci:gpu-cpp17' + image 'stanorg/ci:gpu' label 'linux' } } diff --git a/make/compiler_flags b/make/compiler_flags index 830bb6b22e5..b59b75b7f82 100644 --- a/make/compiler_flags +++ b/make/compiler_flags @@ -116,7 +116,7 @@ CPPFLAGS_SUNDIALS ?= -DNO_FPRINTF_OUTPUT $(CPPFLAGS_OPTIM_SUNDIALS) $(CXXFLAGS_F ## setup compiler flags -CXXFLAGS_LANG ?= -std=c++17 +CXXFLAGS_LANG ?= -std=c++1y #CXXFLAGS_BOOST ?= CXXFLAGS_SUNDIALS ?= -pipe $(CXXFLAGS_OPTIM_SUNDIALS) $(CPPFLAGS_FLTO_SUNDIALS) #CXXFLAGS_GTEST From 78515b6e869079a1a75d11a0f69540ceff72cb81 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Fri, 17 Jun 2022 13:23:20 +0300 Subject: [PATCH 29/29] Un-revert Jenkinsfile change --- Jenkinsfile | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 890677505fe..f3d438552fd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -87,7 +87,7 @@ pipeline { } environment { STAN_NUM_THREADS = 4 - CLANG_CXX = 'clang++-6.0' + CLANG_CXX = 'clang++-7' GCC = 'g++' MPICXX = 'mpicxx.openmpi' N_TESTS = 150 @@ -116,7 +116,7 @@ pipeline { stage("Clang-format") { agent { docker { - image 'stanorg/ci:gpu' + image 'stanorg/ci:gpu-cpp17' label 'linux' } } @@ -167,7 +167,7 @@ pipeline { stage('Linting & Doc checks') { agent { docker { - image 'stanorg/ci:gpu' + image 'stanorg/ci:gpu-cpp17' label 'linux' } } @@ -202,7 +202,7 @@ pipeline { stage('Verify changes') { agent { docker { - image 'stanorg/ci:gpu' + image 'stanorg/ci:gpu-cpp17' label 'linux' } } @@ -224,7 +224,7 @@ pipeline { stage('Headers check') { agent { docker { - image 'stanorg/ci:gpu' + image 'stanorg/ci:gpu-cpp17' label 'linux' } } @@ -252,7 +252,7 @@ pipeline { stage('Rev/Fwd Unit Tests') { agent { docker { - image 'stanorg/ci:gpu' + image 'stanorg/ci:gpu-cpp17' label 'linux' args '--cap-add SYS_PTRACE' } @@ -275,7 +275,7 @@ pipeline { stage('Mix Unit Tests') { agent { docker { - image 'stanorg/ci:gpu' + image 'stanorg/ci:gpu-cpp17' label 'linux' args '--cap-add SYS_PTRACE' } @@ -297,7 +297,7 @@ pipeline { stage('Prim Unit Tests') { agent { docker { - image 'stanorg/ci:gpu' + image 'stanorg/ci:gpu-cpp17' label 'linux' args '--cap-add SYS_PTRACE' } @@ -313,7 +313,7 @@ pipeline { script { runTests("test/unit/*_test.cpp", false) runTests("test/unit/math/*_test.cpp", false) - runTests("test/unit/math/prim", false) + runTests("test/unit/math/prim", false) runTests("test/unit/math/memory", false) } } @@ -332,7 +332,7 @@ pipeline { stage('MPI tests') { agent { docker { - image 'stanorg/ci:gpu' + image 'stanorg/ci:gpu-cpp17' label 'linux' } } @@ -352,7 +352,7 @@ pipeline { stage('OpenCL GPU tests') { agent { docker { - image 'stanorg/ci:gpu' + image 'stanorg/ci:gpu-cpp17' label 'v100' args '--gpus 1' } @@ -375,9 +375,8 @@ pipeline { stage('Distribution tests') { agent { docker { - image 'stanorg/ci:gpu' + image 'stanorg/ci:gpu-cpp17' label 'linux' - args '--pull always' } } steps { @@ -409,9 +408,8 @@ pipeline { stage('Expressions test') { agent { docker { - image 'stanorg/ci:gpu' + image 'stanorg/ci:gpu-cpp17' label 'linux' - args '--pull always' } } steps { @@ -445,9 +443,8 @@ pipeline { stage('Threading tests') { agent { docker { - image 'stanorg/ci:gpu' + image 'stanorg/ci:gpu-cpp17' label 'linux' - args '--pull always' } } steps { @@ -495,7 +492,7 @@ pipeline { stage('Upload doxygen') { agent { docker { - image 'stanorg/ci:gpu' + image 'stanorg/ci:gpu-cpp17' label 'linux' } }