Skip to content

Commit a69f1d9

Browse files
committed
Revert "make non-const operator[] method for scalar_seq_view"
This reverts commit bf6e4fd.
1 parent bf6e4fd commit a69f1d9

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

stan/math/prim/fun/scalar_seq_view.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ class scalar_seq_view<C, require_eigen_vector_t<C>> {
3030
* @return the element at the specified position in the container
3131
*/
3232
inline auto operator[](size_t i) const { return c_.coeff(i); }
33-
inline auto& operator[](size_t i) { return c_.coeffRef(i); }
3433

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

stan/math/prim/prob/exp_mod_normal_lccdf.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ return_type_t<T_y, T_loc, T_scale, T_inv_scale> exp_mod_normal_lccdf(
6666

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

stan/math/prim/prob/gamma_lpdf.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ return_type_t<T_y, T_shape, T_inv_scale> gamma_lpdf(const T_y& y,
8484

8585
scalar_seq_view<decltype(y_val)> y_vec(y_val);
8686
for (size_t n = 0; n < stan::math::size(y); n++) {
87-
if (y_vec.val(n) < 0) {
87+
if (y_vec[n] < 0) {
8888
return LOG_ZERO;
8989
}
9090
}

0 commit comments

Comments
 (0)