Stan Math Library
4.9.0
Automatic Differentiation
Loading...
Searching...
No Matches
check_mat_size_one.hpp
Go to the documentation of this file.
1
#ifndef STAN_MATH_OPENCL_ERR_CHECK_MAT_SIZE_ONE_HPP
2
#define STAN_MATH_OPENCL_ERR_CHECK_MAT_SIZE_ONE_HPP
3
#ifdef STAN_OPENCL
4
5
#include <
stan/math/prim/err.hpp
>
6
#include <
stan/math/opencl/matrix_cl_view.hpp
>
7
#include <
stan/math/opencl/matrix_cl.hpp
>
8
9
namespace
stan
{
10
namespace
math {
11
22
template
<
typename
T>
23
inline
void
check_mat_not_size_one
(
const
char
* function,
const
char
* name,
24
const
matrix_cl<T>
& A) {
25
if
(A.
size
() == 1) {
26
invalid_argument
(function, name,
"should not have exactly one element."
,
27
""
);
28
}
29
}
30
31
}
// namespace math
32
}
// namespace stan
33
34
#endif
35
#endif
stan::math::matrix_cl::size
int size() const
Definition
matrix_cl.hpp:68
stan::math::matrix_cl
Represents an arithmetic matrix on the OpenCL device.
Definition
matrix_cl.hpp:47
stan::math::check_mat_not_size_one
void check_mat_not_size_one(const char *function, const char *name, const matrix_cl< T > &A)
Check if the matrix_cl has a single element.
Definition
check_mat_size_one.hpp:23
matrix_cl.hpp
matrix_cl_view.hpp
stan::math::invalid_argument
void invalid_argument(const char *function, const char *name, const T &y, const char *msg1, const char *msg2)
Throw an invalid_argument exception with a consistently formatted message.
Definition
invalid_argument.hpp:27
stan
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Definition
unit_vector_constrain.hpp:15
err.hpp
stan
math
opencl
err
check_mat_size_one.hpp
[
Stan Home Page
]
© 2011–2019, Stan Development Team.