Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ head() [2/3]

template<typename T , require_vector_t< T > * = nullptr>
auto stan::math::head ( const T &  v,
size_t  n 
)
inline

Return the specified number of elements as a vector or row vector (same as input) from the front of the specified vector or row vector.

Template Parameters
Ttype of the vector
Parameters
vVector input.
nSize of return.
Returns
The first n elements of v.
Exceptions
std::out_of_rangeif n is out of range.

Definition at line 22 of file head.hpp.