Stan Math Library
4.9.0
Automatic Differentiation
Loading...
Searching...
No Matches
assignment_ops.hpp
Go to the documentation of this file.
1
#ifndef STAN_MATH_OPENCL_KERNEL_GENERATOR_ASSIGNMENT_OPS
2
#define STAN_MATH_OPENCL_KERNEL_GENERATOR_ASSIGNMENT_OPS
3
#ifdef STAN_OPENCL
4
#include <
stan/math/prim/meta/is_detected.hpp
>
5
6
namespace
stan
{
7
namespace
math {
8
12
enum class
assign_op_cl
{
13
equals
,
14
plus_equals
,
15
minus_equals
,
16
divide_equals
,
17
multiply_equals
18
};
19
20
namespace
internal {
25
template
<assign_op_cl assign_op>
26
struct
assignment_op_str_impl
;
27
28
template
<>
29
struct
assignment_op_str_impl
<
assign_op_cl
::
equals
> {
30
static
constexpr
const
char
* value =
" = "
;
31
};
32
33
template
<>
34
struct
assignment_op_str_impl
<
assign_op_cl
::
plus_equals
> {
35
static
constexpr
const
char
* value =
" += "
;
36
};
37
38
template
<>
39
struct
assignment_op_str_impl
<
assign_op_cl
::
minus_equals
> {
40
static
constexpr
const
char
* value =
" -= "
;
41
};
42
43
template
<>
44
struct
assignment_op_str_impl
<
assign_op_cl
::
divide_equals
> {
45
static
constexpr
const
char
* value =
" /= "
;
46
};
47
48
template
<>
49
struct
assignment_op_str_impl
<
assign_op_cl
::
multiply_equals
> {
50
static
constexpr
const
char
* value =
" *= "
;
51
};
52
53
template
<
typename
,
typename
=
void
>
54
struct
assignment_op_str
:
assignment_op_str_impl
<assign_op_cl::equals> {};
55
56
template
<
typename
T>
57
struct
assignment_op_str
<T,
void_t
<decltype(T::
assignment_op
)>>
58
:
assignment_op_str_impl
<T::assignment_op> {};
59
60
}
// namespace internal
61
66
template
<
typename
T>
67
inline
constexpr
const
char
*
assignment_op
() noexcept {
68
return
internal::assignment_op_str<std::decay_t<T>
>::value;
69
}
70
71
}
// namespace math
72
}
// namespace stan
73
#endif
74
#endif
is_detected.hpp
stan::math::assignment_op
constexpr const char * assignment_op() noexcept
Definition
assignment_ops.hpp:67
stan::math::assign_op_cl
assign_op_cl
Ops that decide the type of assignment for LHS operations.
Definition
assignment_ops.hpp:12
stan::math::assign_op_cl::plus_equals
@ plus_equals
stan::math::assign_op_cl::equals
@ equals
stan::math::assign_op_cl::minus_equals
@ minus_equals
stan::math::assign_op_cl::multiply_equals
@ multiply_equals
stan::math::assign_op_cl::divide_equals
@ divide_equals
stan::void_t
typename make_void< Ts... >::type void_t
Utility metafunction that maps a sequence of any types to the type void This metafunction is used in ...
Definition
void_t.hpp:21
stan
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Definition
unit_vector_constrain.hpp:15
stan::math::internal::assignment_op_str_impl
Definition
assignment_ops.hpp:26
stan::math::internal::assignment_op_str
Definition
assignment_ops.hpp:54
stan
math
opencl
kernel_generator
assignment_ops.hpp
[
Stan Home Page
]
© 2011–2019, Stan Development Team.