Automatic Differentiation
 
Loading...
Searching...
No Matches
size.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_SIZE_HPP
2#define STAN_MATH_PRIM_FUN_SIZE_HPP
3
6#include <cstdint>
7#include <vector>
8
9namespace stan {
10namespace math {
11
16template <typename T, require_stan_scalar_t<T>* = nullptr>
17inline int64_t size(const T& /*x*/) {
18 return 1;
19}
20
27template <typename T, require_container_t<T>* = nullptr>
28inline int64_t size(const T& m) {
29 return m.size();
30}
31
32template <typename T, require_var_matrix_t<T>* = nullptr>
33inline int64_t size(const T& m) {
34 return m.size();
35}
36
37} // namespace math
38} // namespace stan
39#endif
int64_t size(const T &m)
Returns the size (number of the elements) of a matrix_cl or var_value<matrix_cl<T>>.
Definition size.hpp:19
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...