@@ -81,24 +81,24 @@ neg_binomial_2_log_glm_lpmf(const T_y_cl& y, const T_x_cl& x,
8181 const size_t N = x.rows ();
8282 const size_t M = x.cols ();
8383
84- if (is_y_vector) {
84+ if constexpr (is_y_vector) {
8585 check_size_match (function, " Rows of " , " x" , N, " rows of " , " y" ,
8686 math::size (y));
8787 }
8888 check_size_match (function, " Columns of " , " x" , M, " size of " , " beta" ,
8989 math::size (beta));
90- if (is_phi_vector) {
90+ if constexpr (is_phi_vector) {
9191 check_size_match (function, " Rows of " , " x" , N, " size of " , " phi" ,
9292 math::size (phi));
9393 }
94- if (is_alpha_vector) {
94+ if constexpr (is_alpha_vector) {
9595 check_size_match (function, " Rows of " , " x" , N, " size of " , " alpha" ,
9696 math::size (alpha));
9797 }
9898 if (N == 0 ) {
9999 return 0 ;
100100 }
101- if (!include_summand<propto, T_x_cl, T_alpha_cl, T_beta_cl,
101+ if constexpr (!include_summand<propto, T_x_cl, T_alpha_cl, T_beta_cl,
102102 T_phi_cl>::value) {
103103 return 0 ;
104104 }
@@ -200,7 +200,7 @@ neg_binomial_2_log_glm_lpmf(const T_y_cl& y, const T_x_cl& x,
200200 }
201201 }
202202 if constexpr (is_autodiff_v<T_alpha_cl>) {
203- if (is_alpha_vector) {
203+ if constexpr (is_alpha_vector) {
204204 partials<1 >(ops_partials) = std::move (theta_derivative_cl);
205205 } else {
206206 forward_as<internal::broadcast_array<double >>(
@@ -209,7 +209,7 @@ neg_binomial_2_log_glm_lpmf(const T_y_cl& y, const T_x_cl& x,
209209 }
210210 }
211211 if constexpr (is_autodiff_v<T_phi_cl>) {
212- if (is_phi_vector) {
212+ if constexpr (is_phi_vector) {
213213 partials<3 >(ops_partials) = std::move (phi_derivative_cl);
214214 } else {
215215 forward_as<internal::broadcast_array<double >>(
0 commit comments