Automatic Differentiation
 
Loading...
Searching...
No Matches
is_less_or_equal.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_ERR_IS_LESS_OR_EQUAL_HPP
2#define STAN_MATH_PRIM_ERR_IS_LESS_OR_EQUAL_HPP
3
9
10namespace stan {
11namespace math {
12
25template <typename T_y, typename T_high>
26inline bool is_less_or_equal(const T_y& y, const T_high& high) {
27 scalar_seq_view<T_high> high_vec(high);
28 const auto& y_ref = to_ref(y);
29 for (size_t n = 0; n < stan::math::size(high); n++) {
30 if (!(stan::get(y_ref, n) <= high_vec[n])) {
31 return false;
32 }
33 }
34 return true;
35}
36
37} // namespace math
38} // namespace stan
39#endif
scalar_seq_view provides a uniform sequence-like wrapper around either a scalar or a sequence of scal...
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
T get(const T &x, size_t n)
Returns the provided element.
Definition get.hpp:23
ref_type_t< T && > to_ref(T &&a)
This evaluates expensive Eigen expressions.
Definition to_ref.hpp:17
bool is_less_or_equal(const T_y &y, const T_high &high)
Return true if y is less or equal to high.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Definition fvar.hpp:9