Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Cleanup unused local typedefs #2505

Merged
merged 2 commits into from
Jun 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion make/tests
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ else
endif

%.hpp-test : %.hpp test/dummy.cpp
$(COMPILE.cpp) $(CXXFLAGS) -O0 -include $^ -o $(DEV_NULL)
$(COMPILE.cpp) $(CXXFLAGS) -O0 -include $^ -o $(DEV_NULL) -Wunused-local-typedefs

test/dummy.cpp:
@mkdir -p test
Expand Down
1 change: 0 additions & 1 deletion stan/math/fwd/fun/mdivide_left.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ template <typename T1, typename T2,
inline Eigen::Matrix<value_type_t<T2>, T1::RowsAtCompileTime,
T2::ColsAtCompileTime>
mdivide_left(const T1& A, const T2& b) {
using T = typename value_type_t<T2>::Scalar;
constexpr int S1 = T1::RowsAtCompileTime;
constexpr int C2 = T2::ColsAtCompileTime;

Expand Down
1 change: 0 additions & 1 deletion stan/math/fwd/fun/mdivide_left_tri_low.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ template <typename T1, typename T2, require_eigen_t<T1>* = nullptr,
inline Eigen::Matrix<value_type_t<T2>, T1::RowsAtCompileTime,
T2::ColsAtCompileTime>
mdivide_left_tri_low(const T1& A, const T2& b) {
using T = typename value_type_t<T2>::Scalar;
constexpr int S1 = T1::RowsAtCompileTime;
constexpr int C2 = T2::ColsAtCompileTime;

Expand Down
2 changes: 0 additions & 2 deletions stan/math/prim/fun/generalized_inverse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ template <typename EigMat, require_eigen_t<EigMat>* = nullptr,
inline Eigen::Matrix<value_type_t<EigMat>, EigMat::ColsAtCompileTime,
EigMat::RowsAtCompileTime>
generalized_inverse(const EigMat& G) {
using value_t = value_type_t<EigMat>;

if (G.size() == 0)
return {};

Expand Down
1 change: 0 additions & 1 deletion stan/math/prim/fun/tail.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ inline auto tail(const T& v, size_t n) {
*/
template <typename T>
std::vector<T> tail(const std::vector<T>& sv, size_t n) {
using idx_t = index_type_t<std::vector<T>>;
if (n != 0) {
check_std_vector_index("tail", "n", sv, n);
}
Expand Down
4 changes: 0 additions & 4 deletions stan/math/prim/prob/bernoulli_logit_glm_lpmf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ return_type_t<T_x, T_alpha, T_beta> bernoulli_logit_glm_lpmf(
using std::exp;
constexpr int T_x_rows = T_x::RowsAtCompileTime;
using T_partials_return = partials_return_t<T_y, T_x, T_alpha, T_beta>;
using T_y_val =
typename std::conditional_t<is_vector<T_y>::value,
Eigen::Matrix<partials_return_t<T_y>, -1, 1>,
partials_return_t<T_y>>;
using T_ytheta_tmp =
typename std::conditional_t<T_x_rows == 1, T_partials_return,
Array<T_partials_return, Dynamic, 1>>;
Expand Down
1 change: 0 additions & 1 deletion stan/math/prim/prob/beta_lpdf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ template <bool propto, typename T_y, typename T_scale_succ,
return_type_t<T_y, T_scale_succ, T_scale_fail> beta_lpdf(
const T_y& y, const T_scale_succ& alpha, const T_scale_fail& beta) {
using T_partials_return = partials_return_t<T_y, T_scale_succ, T_scale_fail>;
using T_partials_matrix = Eigen::Matrix<T_partials_return, Eigen::Dynamic, 1>;
using T_y_ref = ref_type_if_t<!is_constant<T_y>::value, T_y>;
using T_alpha_ref
= ref_type_if_t<!is_constant<T_scale_succ>::value, T_scale_succ>;
Expand Down
2 changes: 0 additions & 2 deletions stan/math/prim/prob/beta_proportion_lpdf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ return_type_t<T_y, T_loc, T_prec> beta_proportion_lpdf(const T_y& y,
const T_loc& mu,
const T_prec& kappa) {
using T_partials_return = partials_return_t<T_y, T_loc, T_prec>;
using T_partials_return_kappa = return_type_t<T_prec>;
using T_partials_array = Eigen::Array<T_partials_return, Eigen::Dynamic, 1>;
using std::log;
using T_y_ref = ref_type_if_t<!is_constant<T_y>::value, T_y>;
using T_mu_ref = ref_type_if_t<!is_constant<T_loc>::value, T_loc>;
Expand Down
1 change: 0 additions & 1 deletion stan/math/prim/prob/cauchy_lpdf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ template <bool propto, typename T_y, typename T_loc, typename T_scale,
return_type_t<T_y, T_loc, T_scale> cauchy_lpdf(const T_y& y, const T_loc& mu,
const T_scale& sigma) {
using T_partials_return = partials_return_t<T_y, T_loc, T_scale>;
using T_partials_array = Eigen::Array<T_partials_return, Eigen::Dynamic, 1>;
using std::log;
using T_y_ref = ref_type_if_t<!is_constant<T_y>::value, T_y>;
using T_mu_ref = ref_type_if_t<!is_constant<T_loc>::value, T_loc>;
Expand Down
1 change: 0 additions & 1 deletion stan/math/prim/prob/dirichlet_lpdf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ template <bool propto, typename T_prob, typename T_prior_size,
return_type_t<T_prob, T_prior_size> dirichlet_lpdf(const T_prob& theta,
const T_prior_size& alpha) {
using T_partials_return = partials_return_t<T_prob, T_prior_size>;
using T_partials_vec = typename Eigen::Matrix<T_partials_return, -1, 1>;
using T_partials_array = typename Eigen::Array<T_partials_return, -1, -1>;
using T_theta_ref = ref_type_t<T_prob>;
using T_alpha_ref = ref_type_t<T_prior_size>;
Expand Down
1 change: 0 additions & 1 deletion stan/math/prim/prob/double_exponential_lpdf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ template <bool propto, typename T_y, typename T_loc, typename T_scale,
return_type_t<T_y, T_loc, T_scale> double_exponential_lpdf(
const T_y& y, const T_loc& mu, const T_scale& sigma) {
using T_partials_return = partials_return_t<T_y, T_loc, T_scale>;
using T_partials_array = Eigen::Array<T_partials_return, Eigen::Dynamic, 1>;
using T_y_ref = ref_type_if_t<!is_constant<T_y>::value, T_y>;
using T_mu_ref = ref_type_if_t<!is_constant<T_loc>::value, T_loc>;
using T_sigma_ref = ref_type_if_t<!is_constant<T_scale>::value, T_scale>;
Expand Down
1 change: 0 additions & 1 deletion stan/math/prim/prob/frechet_cdf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ return_type_t<T_y, T_shape, T_scale> frechet_cdf(const T_y& y,
const T_shape& alpha,
const T_scale& sigma) {
using T_partials_return = partials_return_t<T_y, T_shape, T_scale>;
using T_partials_array = Eigen::Array<T_partials_return, Eigen::Dynamic, 1>;
using T_y_ref = ref_type_t<T_y>;
using T_alpha_ref = ref_type_t<T_shape>;
using T_sigma_ref = ref_type_t<T_scale>;
Expand Down
3 changes: 0 additions & 3 deletions stan/math/prim/prob/multi_normal_cholesky_lpdf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ return_type_t<T_y, T_loc, T_covar> multi_normal_cholesky_lpdf(
using T_partials_return = partials_return_t<T_y, T_loc, T_covar>;
using matrix_partials_t
= Eigen::Matrix<T_partials_return, Eigen::Dynamic, Eigen::Dynamic>;
using vector_partials_t = Eigen::Matrix<T_partials_return, Eigen::Dynamic, 1>;
using row_vector_partials_t
= Eigen::Matrix<T_partials_return, 1, Eigen::Dynamic>;
using T_y_ref = ref_type_t<T_y>;
using T_mu_ref = ref_type_t<T_loc>;
using T_L_ref = ref_type_t<T_covar>;
Expand Down
1 change: 0 additions & 1 deletion stan/math/prim/prob/ordered_logistic_lpmf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ return_type_t<T_loc, T_cut> ordered_logistic_lpmf(const T_y& y,
const T_loc& lambda,
const T_cut& c) {
using T_partials_return = partials_return_t<T_loc, T_cut>;
using T_partials_array = Eigen::Array<T_partials_return, -1, 1>;
using T_cuts_val = partials_return_t<T_cut>;
using T_y_ref = ref_type_t<T_y>;
using T_lambda_ref = ref_type_if_t<!is_constant<T_loc>::value, T_loc>;
Expand Down
4 changes: 0 additions & 4 deletions stan/math/prim/prob/poisson_log_glm_lpmf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ return_type_t<T_x, T_alpha, T_beta> poisson_log_glm_lpmf(const T_y& y,
using std::exp;
constexpr int T_x_rows = T_x::RowsAtCompileTime;
using T_partials_return = partials_return_t<T_y, T_x, T_alpha, T_beta>;
using T_alpha_val = typename std::conditional_t<
is_vector<T_alpha>::value,
Eigen::Array<partials_return_t<T_alpha>, -1, 1>,
partials_return_t<T_alpha>>;
using T_theta_tmp =
typename std::conditional_t<T_x_rows == 1, T_partials_return,
Array<T_partials_return, Dynamic, 1>>;
Expand Down
1 change: 0 additions & 1 deletion stan/math/prim/prob/skew_double_exponential_lpdf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ return_type_t<T_y, T_loc, T_scale, T_skewness> skew_double_exponential_lpdf(
const T_y& y, const T_loc& mu, const T_scale& sigma,
const T_skewness& tau) {
using T_partials_return = partials_return_t<T_y, T_loc, T_scale, T_skewness>;
using T_partials_array = Eigen::Array<T_partials_return, Eigen::Dynamic, 1>;
using T_y_ref = ref_type_if_t<!is_constant<T_y>::value, T_y>;
using T_mu_ref = ref_type_if_t<!is_constant<T_loc>::value, T_loc>;
using T_sigma_ref = ref_type_if_t<!is_constant<T_scale>::value, T_scale>;
Expand Down
1 change: 0 additions & 1 deletion stan/math/rev/fun/cholesky_decompose.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ inline auto unblocked_cholesky_lambda(T1& L_A, T2& L, T3& A) {
template <typename T1, typename T2, typename T3>
inline auto cholesky_lambda(T1& L_A, T2& L, T3& A) {
return [L_A, L, A]() mutable {
using Block_ = Eigen::Block<Eigen::MatrixXd>;
using Eigen::Lower;
using Eigen::StrictlyUpper;
using Eigen::Upper;
Expand Down
1 change: 0 additions & 1 deletion stan/math/rev/fun/cholesky_factor_constrain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ namespace math {
template <typename T, require_var_vector_t<T>* = nullptr>
var_value<Eigen::MatrixXd> cholesky_factor_constrain(const T& x, int M, int N) {
using std::exp;
using T_scalar = value_type_t<T>;
check_greater_or_equal("cholesky_factor_constrain",
"num rows (must be greater or equal to num cols)", M,
N);
Expand Down
1 change: 0 additions & 1 deletion stan/math/rev/fun/generalized_inverse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ inline auto generalized_inverse_lambda(T1& G_arena, T2& inv_G) {
*/
template <typename VarMat, require_rev_matrix_t<VarMat>* = nullptr>
inline auto generalized_inverse(const VarMat& G) {
using value_t = value_type_t<VarMat>;
using ret_type = promote_var_matrix_t<VarMat, VarMat>;

if (G.size() == 0)
Expand Down
2 changes: 0 additions & 2 deletions stan/math/rev/fun/lub_constrain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,6 @@ inline auto lub_constrain(const T& x, const L& lb, const U& ub) {
auto lb_val = value_of(arena_lb).array();
auto ub_val = value_of(arena_ub).array();
check_less("lub_constrain", "lb", lb_val, ub_val);
using plain_x_array = plain_type_t<decltype(arena_x_val.array())>;
auto inv_logit_x = to_arena(inv_logit(arena_x_val.array()));
auto is_lb_inf = to_arena((lb_val == NEGATIVE_INFTY));
auto is_ub_inf = to_arena((ub_val == INFTY));
Expand Down Expand Up @@ -562,7 +561,6 @@ inline auto lub_constrain(const T& x, const L& lb, const U& ub,
auto lb_val = value_of(arena_lb).array();
auto ub_val = value_of(arena_ub).array();
check_less("lub_constrain", "lb", lb_val, ub_val);
using plain_x_array = plain_type_t<decltype(arena_x_val.array())>;
auto inv_logit_x = to_arena(inv_logit(arena_x_val.array()));
auto is_lb_inf = to_arena((lb_val == NEGATIVE_INFTY));
auto is_ub_inf = to_arena((ub_val == INFTY));
Expand Down