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

◆ check_range() [2/3]

void stan::math::check_range ( const char *  function,
const char *  name,
int  max,
int  index,
const char *  error_msg 
)
inline

Check if specified index is within range.

This check is 1-indexed by default. This behavior can be changed by setting stan::error_index::value.

Parameters
functionFunction name (for error messages)
nameVariable name (for error messages)
maxMaximum size of the variable
indexIndex to check
error_msgAdditional error message (for error messages)
Exceptions
<code>std::out_of_range</code>if the index is not in range

Definition at line 49 of file check_range.hpp.