1#ifndef STAN_MATH_PRIM_FUN_SCALAR_SEQ_VIEW_HPP
2#define STAN_MATH_PRIM_FUN_SCALAR_SEQ_VIEW_HPP
17template <
typename C,
typename =
void>
32 inline auto operator[](
size_t i)
const {
return c_.coeff(i); }
34 inline auto size() const noexcept {
return c_.size(); }
39 template <
typename T = C, require_st_arithmetic<T>* =
nullptr>
40 inline decltype(
auto)
val(
size_t i)
const {
41 return c_.coeffRef(i);
44 template <
typename T = C, require_st_autodiff<T>* =
nullptr>
45 inline decltype(
auto)
val(
size_t i)
const {
46 return c_.coeffRef(i).val();
65 inline auto operator[](
size_t i)
const {
return c_.coeff(i); }
66 inline const auto*
data() const noexcept {
return c_.vi_; }
67 inline auto*
data() noexcept {
return c_.vi_; }
69 inline auto size() const noexcept {
return c_.size(); }
71 template <
typename T = C, require_st_autodiff<T>* =
nullptr>
72 inline auto val(
size_t i)
const {
73 return c_.val().coeff(i);
76 template <
typename T = C, require_st_autodiff<T>* =
nullptr>
77 inline auto&
val(
size_t i) {
78 return c_.val().coeffRef(i);
98 inline auto size() const noexcept {
return c_.size(); }
99 inline const auto*
data() const noexcept {
return c_.data(); }
101 template <
typename T = C, require_st_arithmetic<T>* =
nullptr>
102 inline decltype(
auto)
val(
size_t i)
const {
106 template <
typename T = C, require_st_autodiff<T>* =
nullptr>
107 inline decltype(
auto)
val(
size_t i)
const {
118 template <
typename T,
128 inline auto size() const noexcept {
129 static_assert(1,
"Cannot Return Size of scalar_seq_view with pointer type");
131 inline const auto*
data() const noexcept {
return &c_[0]; }
133 template <
typename T = C, require_st_arithmetic<T>* =
nullptr>
134 inline decltype(
auto)
val(
size_t i)
const {
138 template <
typename T = C, require_st_autodiff<T>* =
nullptr>
139 inline decltype(
auto)
val(
size_t i)
const {
157 inline decltype(
auto)
operator[](
int )
const noexcept {
return t_; }
159 template <
typename T = C, require_st_arithmetic<T>* =
nullptr>
160 inline decltype(
auto)
val(
int )
const noexcept {
164 template <
typename T = C, require_st_autodiff<T>* =
nullptr>
165 inline decltype(
auto)
val(
int )
const noexcept {
169 static constexpr auto size() {
return 1; }
170 inline const auto*
data() const noexcept {
return &t_; }
171 inline auto*
data() noexcept {
return &t_; }
auto size() const noexcept
auto operator[](size_t i) const
Segfaults if out of bounds.
value_type_t< C > * data() noexcept
const value_type_t< C > * data() const noexcept
decltype(auto) val(size_t i) const
static constexpr auto size()
const auto * data() const noexcept
decltype(auto) val(int) const noexcept
scalar_seq_view(const C &t) noexcept
auto size() const noexcept
const auto * data() const noexcept
decltype(auto) val(size_t i) const
auto operator[](size_t i) const
Segfaults if out of bounds.
auto size() const noexcept
scalar_seq_view(const T &c)
auto operator[](size_t i) const
Segfaults if out of bounds.
const auto * data() const noexcept
decltype(auto) val(size_t i) const
auto operator[](size_t i) const
Segfaults if out of bounds.
const auto * data() const noexcept
auto size() const noexcept
scalar_seq_view provides a uniform sequence-like wrapper around either a scalar or a sequence of scal...
require_t< is_eigen_vector< std::decay_t< T > > > require_eigen_vector_t
Require type satisfies is_eigen_vector.
require_t< std::is_same< std::decay_t< T >, std::decay_t< S > > > require_same_t
Require types T and S satisfies std::is_same.
require_t< is_stan_scalar< std::decay_t< T > > > require_stan_scalar_t
Require type satisfies is_stan_scalar.
require_t< is_std_vector< std::decay_t< T > > > require_std_vector_t
Require type satisfies is_std_vector.
typename value_type< T >::type value_type_t
Helper function for accessing underlying type.
require_t< is_var_matrix< std::decay_t< T > > > require_var_matrix_t
Require type satisfies is_var_matrix.
typename plain_type< T >::type plain_type_t
typename ref_type_if< true, T >::type ref_type_t
std::enable_if_t< Check::value > require_t
If condition is true, template is enabled.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...