Automatic Differentiation
 
Loading...
Searching...
No Matches
invalid_argument_vec.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_ERR_INVALID_ARGUMENT_VEC_HPP
2#define STAN_MATH_PRIM_ERR_INVALID_ARGUMENT_VEC_HPP
3
7#include <sstream>
8#include <string>
9
10namespace stan {
11namespace math {
12
32template <typename T>
33inline void invalid_argument_vec(const char* function, const char* name,
34 const T& y, size_t i, const char* msg1,
35 const char* msg2) {
36 std::ostringstream vec_name_stream;
37 vec_name_stream << name << "[" << stan::error_index::value + i << "]";
38 std::string vec_name(vec_name_stream.str());
39 invalid_argument(function, vec_name.c_str(), stan::get(y, i), msg1, msg2);
40}
41
60template <typename T>
61inline void invalid_argument_vec(const char* function, const char* name,
62 const T& y, size_t i, const char* msg) {
63 invalid_argument_vec(function, name, y, i, msg, "");
64}
65
66} // namespace math
67} // namespace stan
68#endif
T get(const T &x, size_t n)
Returns the provided element.
Definition get.hpp:23
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.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Definition fvar.hpp:9