Stan Math Library  2.20.0
reverse mode automatic differentiation
invalid_argument.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_SCAL_ERR_INVALID_ARGUMENT_HPP
2 #define STAN_MATH_PRIM_SCAL_ERR_INVALID_ARGUMENT_HPP
3 
5 #include <typeinfo>
6 #include <sstream>
7 #include <stdexcept>
8 
9 namespace stan {
10 namespace math {
11 
26 template <typename T>
27 inline 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 
48 template <typename T>
49 inline 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)
Throw an invalid_argument exception with a consistently formatted message.
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.

     [ Stan Home Page ] © 2011–2018, Stan Development Team.