Loading [MathJax]/extensions/TeX/AMSsymbols.js
Stan Math Library
5.0.0
Automatic Differentiation
▼
Stan Math Library
Overview
▼
Contributor Guides
Developer Guide
Adding New Functions
Adding New Distributions
Common Pitfalls
Using requires for general overloads
Reverse Mode Types
Testing Automatic Differentiation Functions
Testing New Distributions
Add New Functions With Known Gradients
Adding New OpenCL Functions
Windows Development Tips
▼
Internal Docs
►
Probability Distributions
►
OpenCL
►
Compressed Sparse Row matrix format.
►
Type Traits
►
Available requires<> for overloading.
►
Eigen expressions
►
arena_matrix <br>
►
real <br>
►
Parallelism
(External Link) Stan Language Docs
(External Link) Stan Discourse
►
Stan Math Library Docs
►
Class List
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
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.