size.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_MAT_FUN_SIZE_HPP
2 #define STAN_MATH_PRIM_MAT_FUN_SIZE_HPP
3 
4 #include <vector>
5 
6 namespace stan {
7 namespace math {
8 
9 /**
10  * Return the size of the specified standard vector.
11  *
12  * @tparam T Type of elements.
13  * @param[in] x Input vector.
14  * @return Size of input vector.
15  */
16 template <typename T>
17 inline int size(const std::vector<T>& x) {
18  return static_cast<int>(x.size());
19 }
20 
21 } // namespace math
22 } // namespace stan
23 #endif
int size(const std::vector< T > &x)
Definition: size.hpp:17