Stan Math Library
5.0.0
Automatic Differentiation
Loading...
Searching...
No Matches
eigen_comparisons.hpp
Go to the documentation of this file.
1
#ifndef STAN_MATH_PRIM_FUN_EIGEN_COMPARISONS_HPP
2
#define STAN_MATH_PRIM_FUN_EIGEN_COMPARISONS_HPP
3
4
#include <
stan/math/prim/meta.hpp
>
5
#include <
stan/math/prim/fun/Eigen.hpp
>
6
#include <
stan/math/prim/fun/value_of.hpp
>
7
8
namespace
stan
{
9
namespace
math {
10
18
#define ADD_MIXED_AUTODIFF_SCALAR_COMPARISON(OPERATOR, OP) \
19
template <typename T_a, typename T_b, \
20
require_any_eigen_t<T_a, T_b>* = nullptr, \
21
require_any_st_autodiff<T_a, T_b>* = nullptr, \
22
require_not_st_same<T_a, T_b>* = nullptr> \
23
auto OPERATOR(const T_a& a, const T_b& b) { \
24
return value_of(a) OP value_of(b); \
25
}
26
27
ADD_MIXED_AUTODIFF_SCALAR_COMPARISON
(
operator
<, <);
28
ADD_MIXED_AUTODIFF_SCALAR_COMPARISON
(
operator
<=, <=);
29
ADD_MIXED_AUTODIFF_SCALAR_COMPARISON
(
operator
>, >);
30
ADD_MIXED_AUTODIFF_SCALAR_COMPARISON
(
operator
>=, >=);
31
ADD_MIXED_AUTODIFF_SCALAR_COMPARISON
(
operator
==, ==);
32
ADD_MIXED_AUTODIFF_SCALAR_COMPARISON
(
operator
!=, !=);
33
34
#undef ADD_MIXED_AUTODIFF_SCALAR_COMPARISON
35
36
}
// namespace math
37
}
// namespace stan
38
39
#endif
Eigen.hpp
ADD_MIXED_AUTODIFF_SCALAR_COMPARISON
#define ADD_MIXED_AUTODIFF_SCALAR_COMPARISON(OPERATOR, OP)
Add support for comparisons involving Eigen types with different scalars, where one of the scalars is...
Definition
eigen_comparisons.hpp:18
stan
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Definition
unit_vector_constrain.hpp:15
value_of.hpp
meta.hpp
stan
math
prim
fun
eigen_comparisons.hpp
[
Stan Home Page
]
© 2011–2019, Stan Development Team.