Stan Math Library
4.9.0
Automatic Differentiation
Loading...
Searching...
No Matches
compound_assignments.hpp
Go to the documentation of this file.
1
#ifndef STAN_MATH_OPENCL_KERNEL_GENERATOR_COMPOUND_ASSIGNMENTS_HPP
2
#define STAN_MATH_OPENCL_KERNEL_GENERATOR_COMPOUND_ASSIGNMENTS_HPP
3
4
#include <
stan/math/prim/meta.hpp
>
5
6
namespace
stan
{
7
namespace
math {
8
14
#define ADD_KG_COMPOUND_ASSIGMENT_OPERATOR(independent, compound) \
15
template <typename T1, typename T2, \
16
require_kernel_expression_lhs_t<T1>* = nullptr, \
17
require_all_kernel_expressions_t<T2>* = nullptr> \
18
T1 operator compound(T1&& a, T2&& b) { \
19
return a = a independent b; \
20
}
21
22
ADD_KG_COMPOUND_ASSIGMENT_OPERATOR
(+, +=)
23
ADD_KG_COMPOUND_ASSIGMENT_OPERATOR
(-, -=)
24
ADD_KG_COMPOUND_ASSIGMENT_OPERATOR
(*, *=)
25
26
#undef ADD_KG_COMPOUND_ASSIGMENT_OPERATOR
27
28
}
// namespace math
29
}
// namespace stan
30
31
#endif
// COMPOUND_ASSIGNMENTS_HPP
ADD_KG_COMPOUND_ASSIGMENT_OPERATOR
#define ADD_KG_COMPOUND_ASSIGMENT_OPERATOR(independent, compound)
Adds a compound assignment operator for kernel generator expressions.
Definition
compound_assignments.hpp:14
stan
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Definition
unit_vector_constrain.hpp:15
meta.hpp
stan
math
opencl
kernel_generator
compound_assignments.hpp
[
Stan Home Page
]
© 2011–2019, Stan Development Team.