Stan Math Library  2.20.0
reverse mode automatic differentiation
is_less_or_equal.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_SCAL_ERR_IS_LESS_OR_EQUAL_HPP
2 #define STAN_MATH_PRIM_SCAL_ERR_IS_LESS_OR_EQUAL_HPP
3 
5 
6 namespace stan {
7 namespace math {
8 
21 template <typename T_y, typename T_high>
22 inline bool is_less_or_equal(const T_y& y, const T_high& high) {
23  scalar_seq_view<T_high> high_vec(high);
24  for (size_t n = 0; n < stan::length(high); n++) {
25  if (!(stan::get(y, n) <= high_vec[n]))
26  return false;
27  }
28  return true;
29 }
30 
31 } // namespace math
32 } // namespace stan
33 #endif
scalar_seq_view provides a uniform sequence-like wrapper around either a scalar or a sequence of scal...
size_t length(const std::vector< T > &x)
Returns the length of the provided std::vector.
Definition: length.hpp:16
T get(const std::vector< T > &x, size_t n)
Returns the n-th element of the provided std::vector.
Definition: get.hpp:16
bool is_less_or_equal(const T_y &y, const T_high &high)
Return true if y is less or equal to high.

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