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 <cstdlib>
7#include <vector>
8
9namespace stan {
10namespace math {
11
16template <typename T, require_stan_scalar_t<T>* = nullptr>
17inline size_t size(const T& /*x*/) {
18 return 1U;
19}
20
27template <typename T, require_container_t<T>* = nullptr>
28inline size_t size(const T& m) {
29 return m.size();
30}
31
32template <typename T, require_var_matrix_t<T>* = nullptr>
33inline size_t size(const T& m) {
34 return m.size();
35}
36
37} // namespace math
38} // namespace stan
39#endif
size_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:18
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Definition fvar.hpp:9