Stan
1.3
probability, sampling & optimization
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerator
Friends
Macros
Pages
src
stan
math
error_handling
dom_err_vec.hpp
Go to the documentation of this file.
1
#ifndef __STAN__MATH__ERROR_HANDLING__DOM_ERR_VEC_HPP__
2
#define __STAN__MATH__ERROR_HANDLING__DOM_ERR_VEC_HPP__
3
4
#include <sstream>
5
#include <
stan/meta/traits.hpp
>
6
#include <
stan/math/error_handling/raise_domain_error.hpp
>
7
8
namespace
stan {
9
namespace
math {
10
11
template
<
typename
T_y,
12
typename
T_result,
13
typename
T_msg2,
14
class
Policy>
15
inline
bool
dom_err_vec
(
size_t
i,
16
const
char
*
function
,
17
const
T_y& y,
18
const
char
* name,
19
const
char
* error_msg,
20
T_msg2 error_msg2,
21
T_result* result,
22
const
Policy&) {
23
using
stan::math::policies::raise_domain_error
;
24
std::ostringstream msg_o;
25
msg_o << name <<
"["
<< i <<
"] "
<< error_msg << error_msg2;
26
T_result tmp
27
=
raise_domain_error
<T_result,
28
typename
T_y::value_type
>(
function
,
29
msg_o.str().c_str(),
30
stan::get
(y,i),
31
Policy());
32
if
(result != 0)
33
*result = tmp;
34
return
false
;
35
}
36
37
38
}
39
}
40
#endif
[
Stan Home Page
]
© 2011–2013, Stan Development Team.