max_size.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_SCAL_META_MAX_SIZE_HPP
2 #define STAN_MATH_PRIM_SCAL_META_MAX_SIZE_HPP
3 
5 
6 namespace stan {
7 
8 template <typename T1, typename T2>
9 size_t max_size(const T1& x1, const T2& x2) {
10  size_t result = length(x1);
11  result = result > length(x2) ? result : length(x2);
12  return result;
13 }
14 
15 template <typename T1, typename T2, typename T3>
16 size_t max_size(const T1& x1, const T2& x2, const T3& x3) {
17  size_t result = length(x1);
18  result = result > length(x2) ? result : length(x2);
19  result = result > length(x3) ? result : length(x3);
20  return result;
21 }
22 
23 template <typename T1, typename T2, typename T3, typename T4>
24 size_t max_size(const T1& x1, const T2& x2, const T3& x3, const T4& x4) {
25  size_t result = length(x1);
26  result = result > length(x2) ? result : length(x2);
27  result = result > length(x3) ? result : length(x3);
28  result = result > length(x4) ? result : length(x4);
29  return result;
30 }
31 
32 template <typename T1, typename T2, typename T3, typename T4, typename T5>
33 size_t max_size(const T1& x1, const T2& x2, const T3& x3, const T4& x4,
34  const T5& x5) {
35  size_t result = length(x1);
36  result = result > length(x2) ? result : length(x2);
37  result = result > length(x3) ? result : length(x3);
38  result = result > length(x4) ? result : length(x4);
39  result = result > length(x5) ? result : length(x5);
40  return result;
41 }
42 
43 } // namespace stan
44 #endif
Float_t x1[n_points_granero]
Definition: compare.C:5
size_t length(const std::vector< T > &x)
Definition: length.hpp:10
size_t max_size(const T1 &x1, const T2 &x2)
Definition: max_size.hpp:9