| Stan Math Library 2.12.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

domain_error_vec.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_SCAL_ERR_DOMAIN_ERROR_VEC_HPP
2 #define STAN_MATH_PRIM_SCAL_ERR_DOMAIN_ERROR_VEC_HPP
3
4 #include <stan/math/prim/scal/err/domain_error.hpp>
5 #include <stan/math/prim/scal/meta/value_type.hpp>
6 #include <stan/math/prim/scal/meta/error_index.hpp>
7 #include <stan/math/prim/scal/meta/get.hpp>
8 #include <sstream>
9 #include <string>
10
11 namespace stan {
12 namespace math {
13
36 template <typename T>
37 inline void domain_error_vec(const char* function,
38 const char* name,
39 const T& y,
40 const size_t i,
41 const char* msg1,
42 const char* msg2) {
43 std::ostringstream vec_name_stream;
44 vec_name_stream << name
45 << "[" << stan::error_index::value + i << "]";
46 std::string vec_name(vec_name_stream.str());
47 domain_error(function, vec_name.c_str(), stan::get(y, i), msg1, msg2);
48 }
49
71 template <typename T>
72 inline void domain_error_vec(const char* function,
73 const char* name,
74 const T& y,
75 const size_t i,
76 const char* msg) {
77 domain_error_vec(function, name, y, i, msg, "");
78 }
79
80 }
81 }
82 #endif
stan
Definition: log_sum_exp.hpp:8
stan::error_index::value
Definition: error_index.hpp:7
get.hpp
stan::math::domain_error_vec
void domain_error_vec(const char *function, const char *name, const T &y, const size_t i, const char *msg1, const char *msg2)
Throw a domain error with a consistently formatted message.
Definition: domain_error_vec.hpp:37
stan::get
T get(const std::vector< T > &x, size_t n)
Definition: get.hpp:10
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:30
value_type.hpp
domain_error.hpp
error_index.hpp

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