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

| Stan Math Library 2.10.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

domain_error.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_SCAL_ERR_DOMAIN_ERROR_HPP
2 #define STAN_MATH_PRIM_SCAL_ERR_DOMAIN_ERROR_HPP
3
4 #include <typeinfo>
5 #include <string>
6 #include <sstream>
7 #include <stdexcept>
8
9 namespace stan {
10 namespace math {
11
31 template <typename T>
32 inline void domain_error(const char* function,
33 const char* name,
34 const T& y,
35 const char* msg1,
36 const char* msg2) {
37 std::ostringstream message;
38
39 message << function << ": "
40 << name << " "
41 << msg1
42 << y
43 << msg2;
44
45 throw std::domain_error(message.str());
46 }
47
66 template <typename T>
67 inline void domain_error(const char* function,
68 const char* name,
69 const T& y,
70 const char* msg1) {
71 domain_error(function, name, y, msg1, "");
72 }
73
74 }
75 }
76 #endif
stan
Definition: log_sum_exp.hpp:8
stan::math::domain_error
void domain_error(const char *function, const char *name, const T &y, const char *msg1, const char *msg2)
Throw a domain error with a consistently formatted message.
Definition: domain_error.hpp:32
stan::math::domain_error
void domain_error(const char *function, const char *name, const T &y, const char *msg1)
Throw a domain error with a consistently formatted message.
Definition: domain_error.hpp:67

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