Stan Math Library: stan/math/prim/scal/err/invalid_argument.hpp Source File

| Stan Math Library 2.10.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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
4 #include <typeinfo>
5 #include <string>
6 #include <sstream>
7 #include <stdexcept>
8
9 namespace stan {
10 namespace math {
11
30 template <typename T>
31 inline void invalid_argument(const char* function,
32 const char* name,
33 const T& y,
34 const char* msg1,
35 const char* msg2) {
36 std::ostringstream message;
37
38 message << function << ": "
39 << name << " "
40 << msg1
41 << y
42 << msg2;
43
44 throw std::invalid_argument(message.str());
45 }
46
65 template <typename T>
66 inline void invalid_argument(const char* function,
67 const char* name,
68 const T& y,
69 const char* msg1) {
70 invalid_argument(function, name, y, msg1, "");
71 }
72
73 }
74 }
75 #endif
stan::math::invalid_argument
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.
Definition: invalid_argument.hpp:66
stan
Definition: log_sum_exp.hpp:8
stan::math::invalid_argument
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.
Definition: invalid_argument.hpp:31

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