1#ifndef STAN_MATH_OPENCL_TRIANGULAR_HPP
2#define STAN_MATH_OPENCL_TRIANGULAR_HPP
21 using underlying =
typename std::underlying_type<matrix_cl_view>::type;
22 return static_cast<matrix_cl_view>(
static_cast<underlying
>(left_view)
23 |
static_cast<underlying
>(right_view));
34 using underlying =
typename std::underlying_type<matrix_cl_view>::type;
35 return static_cast<matrix_cl_view>(
static_cast<underlying
>(left_view)
36 &
static_cast<underlying
>(right_view));
47 return static_cast<bool>(
both(view, part));
72 using underlying =
typename std::underlying_type<matrix_cl_view>::type;
75 & ~
static_cast<underlying
>(view));
87 if (eigen_type & Eigen::Lower) {
90 if (eigen_type & Eigen::Upper) {
97static constexpr const char* view_kernel_helpers =
STRINGIFY(
105 int either(
int left_view,
int right_view) {
return left_view | right_view; }
113 int both(
int left_view,
int right_view) {
return left_view & right_view; }
auto transpose(Arg &&a)
Transposes a kernel generator expression.
matrix_cl_view from_eigen_uplo_type(Eigen::UpLoType eigen_type)
Creates a view from Eigen::UpLoType.
const matrix_cl_view both(const matrix_cl_view left_view, const matrix_cl_view right_view)
Determines which parts are nonzero in both input views.
const matrix_cl_view invert(const matrix_cl_view view)
Inverts a view.
const matrix_cl_view either(const matrix_cl_view left_view, const matrix_cl_view right_view)
Determines which parts are nonzero in any of the input views.
bool contains_nonzero(const matrix_cl_view view, const matrix_cl_view part)
Check whether a view contains certain nonzero part.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...