Stan Math Library  2.14.0
reverse mode automatic differentiation
invalid_argument_vec.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_SCAL_ERR_INVALID_ARGUMENT_VEC_HPP
2 #define STAN_MATH_PRIM_SCAL_ERR_INVALID_ARGUMENT_VEC_HPP
3 
8 #include <sstream>
9 #include <string>
10 
11 namespace stan {
12  namespace math {
13 
36  template <typename T>
37  inline void invalid_argument_vec(const char* function,
38  const char* name,
39  const T& y,
40  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  invalid_argument(function, vec_name.c_str(),
48  stan::get(y, i), msg1, msg2);
49  }
50 
72  template <typename T>
73  inline void invalid_argument_vec(const char* function,
74  const char* name,
75  const T& y,
76  size_t i,
77  const char* msg) {
78  invalid_argument_vec(function, name, y, i, msg, "");
79  }
80 
81  }
82 }
83 #endif
void invalid_argument_vec(const char *function, const char *name, const T &y, size_t i, const char *msg1, const char *msg2)
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.
T get(const std::vector< T > &x, size_t n)
Definition: get.hpp:10

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