Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 2 additions & 1 deletion stan/math/prim/fun/scalar_seq_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class scalar_seq_view<C, require_eigen_vector_t<C>> {
* @param i index
* @return the element at the specified position in the container
*/
inline auto operator[](size_t i) const { return c_.coeffRef(i); }
inline auto operator[](size_t i) const { return c_.coeff(i); }
inline auto& operator[](size_t i) { return c_.coeffRef(i); }

inline auto size() const noexcept { return c_.size(); }

Expand Down
4 changes: 2 additions & 2 deletions stan/math/prim/prob/exp_mod_normal_lccdf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ return_type_t<T_y, T_loc, T_scale, T_inv_scale> exp_mod_normal_lccdf(

scalar_seq_view<decltype(y_val)> y_vec(y_val);
for (size_t n = 0, size_y = stan::math::size(y); n < size_y; n++) {
if (is_inf(y_vec[n])) {
return ops_partials.build(y_vec[n] > 0 ? negative_infinity() : 0);
if (is_inf(y_vec.val(n))) {
return ops_partials.build(y_vec.val(n) > 0 ? negative_infinity() : 0);
}
}

Expand Down
2 changes: 1 addition & 1 deletion stan/math/prim/prob/gamma_lpdf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ return_type_t<T_y, T_shape, T_inv_scale> gamma_lpdf(const T_y& y,

scalar_seq_view<decltype(y_val)> y_vec(y_val);
for (size_t n = 0; n < stan::math::size(y); n++) {
if (y_vec[n] < 0) {
if (y_vec.val(n) < 0) {
return LOG_ZERO;
}
}
Expand Down