diff --git a/inst/include/bvharcommon.h b/inst/include/bvharcommon.h index 733c24d6..8e746c04 100644 --- a/inst/include/bvharcommon.h +++ b/inst/include/bvharcommon.h @@ -49,9 +49,9 @@ using Optional = boost::optional; namespace bvhar { -typedef Eigen::Matrix ColMajorMatrixXd; +using ColMajorMatrixXd = Eigen::Matrix; -typedef Eigen::Matrix VectorXb; +using VectorXb = Eigen::Matrix; template inline Eigen::Matrix vectorize_eigen(const Eigen::MatrixBase& x) { diff --git a/inst/include/bvharmcmc.h b/inst/include/bvharmcmc.h index f1886ea1..031e0717 100644 --- a/inst/include/bvharmcmc.h +++ b/inst/include/bvharmcmc.h @@ -546,8 +546,7 @@ class McmcHorseshoe : public BaseMcmc { ); } horseshoe_latent(latent_local, local_lev, rng); - typedef std::integral_constant is_group; - // if constexpr (isGroup) { + using is_group = std::integral_constant; if (is_group::value) { horseshoe_latent(latent_global, global_lev, rng); global_lev = horseshoe_global_sparsity(latent_global, coef_var.array() * local_lev.array(), coef_vec.head(num_alpha), 1, rng); @@ -655,8 +654,7 @@ class McmcNg : public BaseMcmc { ); } ng_local_sparsity(local_lev, local_shape_fac, coef_vec.head(num_alpha), global_lev * coef_var, rng); - typedef std::integral_constant is_group; - // if constexpr (isGroup) { + using is_group = std::integral_constant; if (is_group::value) { global_lev = ng_global_sparsity(local_lev.array() / coef_var.array(), local_shape_fac, global_shape, global_scl, rng); } @@ -748,14 +746,13 @@ class McmcDl : public BaseMcmc { coef_var ); } - dl_latent(latent_local, global_lev * local_lev.array() * coef_var.array(), coef_vec.head(num_alpha), rng); dl_dir_griddy(dir_concen, grid_size, local_lev, global_lev, rng); dl_local_sparsity(local_lev, dir_concen, coef_vec.head(num_alpha).array() / coef_var.array(), rng); - typedef std::integral_constant is_group; - // if constexpr (isGroup) { + using is_group = std::integral_constant; if (is_group::value) { global_lev = dl_global_sparsity(local_lev.array() * coef_var.array(), dir_concen, coef_vec.head(num_alpha), rng); } + dl_latent(latent_local, global_lev * local_lev.array() * coef_var.array(), coef_vec.head(num_alpha), rng); prior_alpha_prec.head(num_alpha) = 1 / ((global_lev * local_lev.array() * coef_var.array()).square() * latent_local.array()); } void updatePenalty() override {