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

◆ check_vector_index()

template<typename T , require_any_t< is_vector< T >, is_prim_or_rev_kernel_expression< T > > * = nullptr>
void stan::math::check_vector_index ( const char *  function,
const char *  name,
const T &  y,
size_t  i 
)
inline

Check if the specified index is a valid element of the row or column vector This check is 1-indexed by default.

This behavior can be changed by setting stan::error_index::value.

Template Parameters
TVector type
Parameters
functionFunction name (for error messages)
nameVariable name (for error messages)
yvector to test
irow index to check
Exceptions
<code>std::out_of_range</code>if the index is out of range.

Definition at line 27 of file check_vector_index.hpp.