Skip to content

Commit d8d203d

Browse files
committed
Review requests
1 parent 6dbf9c3 commit d8d203d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

stan/math/prim/prob/multi_student_t_cholesky_lpdf.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ template <
5656
T_y, T_loc, T_covar>* = nullptr>
5757
return_type_t<T_y, T_dof, T_loc, T_covar> multi_student_t_cholesky_lpdf(
5858
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";
6060
using T_covar_elem = typename scalar_type<T_covar>::type;
6161
using lp_type = return_type_t<T_y, T_dof, T_loc, T_covar>;
6262
using Eigen::Matrix;
@@ -97,10 +97,14 @@ return_type_t<T_y, T_dof, T_loc, T_covar> multi_student_t_cholesky_lpdf(
9797
const int size_mu = mu_vec[0].size();
9898
const int num_dims = L.rows();
9999

100+
if (unlikely(num_dims == 0)) {
101+
return T_return(0);
102+
}
103+
100104
for (size_t i = 1, size_mvt_y = num_y; i < size_mvt_y; i++) {
101105
check_size_match(
102106
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",
104108
y_vec[i - 1].size());
105109
}
106110

@@ -128,10 +132,6 @@ return_type_t<T_y, T_dof, T_loc, T_covar> multi_student_t_cholesky_lpdf(
128132
check_not_nan(function, "Random variable", y_vec[i]);
129133
}
130134

131-
if (unlikely(num_dims == 0)) {
132-
return T_return(0);
133-
}
134-
135135
auto ops_partials = make_partials_propagator(y_ref, nu_ref, mu_ref, L_ref);
136136

137137
T_partials_return lp(0);

0 commit comments

Comments
 (0)