Stan Math Library: stan/math/prim/scal/err/invalid_argument_vec.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_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
4 #include <stan/math/prim/scal/err/invalid_argument.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
13 namespace math {
14
37 template <typename T>
38 inline void invalid_argument_vec(const char* function,
39 const char* name,
40 const T& y,
41 const size_t i,
42 const char* msg1,
43 const char* msg2) {
44 std::ostringstream vec_name_stream;
45 vec_name_stream << name
46 << "[" << stan::error_index::value + i << "]";
47 std::string vec_name(vec_name_stream.str());
48 invalid_argument(function, vec_name.c_str(),
49 stan::get(y, i), msg1, msg2);
50 }
51
73 template <typename T>
74 inline void invalid_argument_vec(const char* function,
75 const char* name,
76 const T& y,
77 const size_t i,
78 const char* msg) {
79 invalid_argument_vec(function, name, y, i, msg, "");
80 }
81
82 }
83 }
84 #endif
stan
Definition: log_sum_exp.hpp:8
invalid_argument.hpp
stan::error_index::value
Definition: error_index.hpp:7
get.hpp
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::get
T get(const std::vector< T > &x, size_t n)
Definition: get.hpp:10
value_type.hpp
error_index.hpp
stan::math::invalid_argument_vec
void invalid_argument_vec(const char *function, const char *name, const T &y, const size_t i, const char *msg1, const char *msg2)
Throw an invalid argument exception with a consistently formatted message.
Definition: invalid_argument_vec.hpp:38

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