All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
domain_error_vec.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_PRIM_SCAL_ERR_DOMAIN_ERROR_VEC_HPP
#define STAN_MATH_PRIM_SCAL_ERR_DOMAIN_ERROR_VEC_HPP
#include <stan/math/prim/scal/err/domain_error.hpp>
#include <stan/math/prim/scal/meta/value_type.hpp>
#include <stan/math/prim/scal/meta/error_index.hpp>
#include <stan/math/prim/scal/meta/get.hpp>
#include <sstream>
#include <string>
namespace stan {
namespace math {
template <typename T>
inline void domain_error_vec(const char* function,
const char* name,
const T& y,
const size_t i,
const char* msg1,
const char* msg2) {
std::ostringstream vec_name_stream;
vec_name_stream << name
<< "[" << stan::error_index::value + i << "]";
std::string vec_name(vec_name_stream.str());
domain_error(function, vec_name.c_str(), stan::get(y, i), msg1, msg2);
}
template <typename T>
inline void domain_error_vec(const char* function,
const char* name,
const T& y,
const size_t i,
const char* msg) {
domain_error_vec(function, name, y, i, msg, "");
}
}
}
#endif
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:38
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:32
value_type.hpp
domain_error.hpp
error_index.hpp

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