@@ -56,7 +56,7 @@ template <
56
56
T_y, T_loc, T_covar>* = nullptr >
57
57
return_type_t <T_y, T_dof, T_loc, T_covar> multi_student_t_cholesky_lpdf (
58
58
const T_y& y, const T_dof& nu, const T_loc& mu, const T_covar& L) {
59
- static const char * function = " multi_student_t_cholesky" ;
59
+ static constexpr const char * function = " multi_student_t_cholesky" ;
60
60
using T_covar_elem = typename scalar_type<T_covar>::type;
61
61
using lp_type = return_type_t <T_y, T_dof, T_loc, T_covar>;
62
62
using Eigen::Matrix;
@@ -97,10 +97,14 @@ return_type_t<T_y, T_dof, T_loc, T_covar> multi_student_t_cholesky_lpdf(
97
97
const int size_mu = mu_vec[0 ].size ();
98
98
const int num_dims = L.rows ();
99
99
100
+ if (unlikely (num_dims == 0 )) {
101
+ return T_return (0 );
102
+ }
103
+
100
104
for (size_t i = 1 , size_mvt_y = num_y; i < size_mvt_y; i++) {
101
105
check_size_match (
102
106
function, " Size of one of the vectors of the random variable" ,
103
- y_vec[i].size (), " Size of the first vector of the random variable" ,
107
+ y_vec[i].size (), " Size of another vector of the random variable" ,
104
108
y_vec[i - 1 ].size ());
105
109
}
106
110
@@ -128,10 +132,6 @@ return_type_t<T_y, T_dof, T_loc, T_covar> multi_student_t_cholesky_lpdf(
128
132
check_not_nan (function, " Random variable" , y_vec[i]);
129
133
}
130
134
131
- if (unlikely (num_dims == 0 )) {
132
- return T_return (0 );
133
- }
134
-
135
135
auto ops_partials = make_partials_propagator (y_ref, nu_ref, mu_ref, L_ref);
136
136
137
137
T_partials_return lp (0 );
0 commit comments