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

◆ out_of_range()

void stan::math::out_of_range ( const char *  function,
int  max,
int  index,
const char *  msg1 = "",
const char *  msg2 = "" 
)
inline

Throw an out_of_range exception with a consistently formatted message.

This is an abstraction for all Stan functions to use when throwing out of range. This will allow us to change the behavior for all functions at once. The message is: "<function>: index <index> out of range; expecting index to be between " "1 and <max><msg1><msg2>"

Parameters
functionName of the function
maxMax
indexIndex
msg1Message to print. Default is "".
msg2Message to print. Default is "".
Exceptions
std::out_of_rangewith message.

Definition at line 27 of file out_of_range.hpp.