Stan Math Library: stan/math/prim/scal/meta/max_size.hpp Source File

| Stan Math Library 2.10.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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
4 #include <stan/math/prim/scal/meta/length.hpp>
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 }
33 #endif
34
stan
Definition: log_sum_exp.hpp:8
stan::length
size_t length(const std::vector< T > &x)
Definition: length.hpp:10
stan::max_size
size_t max_size(const T1 &x1, const T2 &x2)
Definition: max_size.hpp:9
length.hpp

[ Stan Home Page ] © 2011–2016, Stan Development Team.