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

◆ invalid_argument_vec() [1/2]

template<typename T >
void stan::math::invalid_argument_vec ( const char *  function,
const char *  name,
const T &  y,
size_t  i,
const char *  msg1,
const char *  msg2 
)
inline

Throw an invalid argument exception with a consistently formatted message.

This is an abstraction for all Stan functions to use when throwing invalid arguments. This will allow us to change the behavior for all functions at once. (We've already changed behavior multiple times up to Stan v2.5.0.) The message is: "<function>: <name>[<i+error_index>] <msg1><y>" where error_index is the value of stan::error_index::value which indicates whether the message should be 0 or 1 indexed.

Template Parameters
TType of variable
Parameters
functionName of the function
nameName of the variable
yVariable
iIndex
msg1Message to print before the variable
msg2Message to print after the variable
Exceptions
std::invalid_argument

Definition at line 33 of file invalid_argument_vec.hpp.