1#ifndef STAN_MATH_PRIM_FUN_TAIL_HPP
2#define STAN_MATH_PRIM_FUN_TAIL_HPP
22template <
typename T, require_vector_t<T>* =
nullptr>
23inline auto tail(
const T& v,
size_t n) {
41std::vector<T>
tail(
const std::vector<T>& sv,
size_t n) {
45 std::vector<T> s(sv.end() - n, sv.end());
void check_vector_index(const char *function, const char *name, const T &y, size_t i)
Check if the specified index is a valid element of the row or column vector This check is 1-indexed b...
auto tail(T_x &&x, size_t n)
Return the specified number of elements as a vector or row vector (same as input) from the back of th...
void check_std_vector_index(const char *function, const char *name, const std::vector< T > &y, int i)
Check if the specified index is valid in std vector This check is 1-indexed by default.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...