1#ifndef STAN_MATH_PRIM_FUN_HEAD_HPP
2#define STAN_MATH_PRIM_FUN_HEAD_HPP
21template <
typename T, require_vector_t<T>* =
nullptr>
22inline auto head(
const T& v,
size_t n) {
40std::vector<T>
head(
const std::vector<T>& sv,
size_t n) {
45 std::vector<T> s(sv.begin(), sv.begin() + n);
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...
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.
auto head(T_x &&x, size_t n)
Return the specified number of elements as a vector or row vector (same as input) from the front of t...
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...