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
8
9namespace stan {
10namespace math {
11
22template <typename T>
23inline 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
Represents an arithmetic matrix on the OpenCL device.
Definition matrix_cl.hpp:47
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.
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.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...