Automatic Differentiation
 
Loading...
Searching...
No Matches
invalid_argument.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_ERR_INVALID_ARGUMENT_HPP
2#define STAN_MATH_PRIM_ERR_INVALID_ARGUMENT_HPP
3
5#include <typeinfo>
6#include <sstream>
7#include <stdexcept>
8
9namespace stan {
10namespace math {
11
26template <typename T>
27inline void invalid_argument(const char* function, const char* name, const T& y,
28 const char* msg1, const char* msg2) {
29 std::ostringstream message;
30 message << function << ": " << name << " " << msg1 << y << msg2;
31 throw std::invalid_argument(message.str());
32}
33
48template <typename T>
49inline void invalid_argument(const char* function, const char* name, const T& y,
50 const char* msg1) {
51 invalid_argument(function, name, y, msg1, "");
52}
53
54} // namespace math
55} // namespace stan
56#endif
void invalid_argument(const char *function, const char *name, const T &y, const char *msg1, const char *msg2)
Throw an invalid_argument exception with a consistently formatted message.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...