<commit_before>#ifndef STAN__MATH__ERROR_HANDLING_CHECK_LESS_HPP
#define STAN__MATH__ERROR_HANDLING_CHECK_LESS_HPP

#include <stan/math/error_handling/dom_err.hpp>
#include <stan/math/error_handling/dom_err_vec.hpp>

namespace stan {
  namespace math {

    namespace {
      template <typename T_y, typename T_high, typename T_result, bool is_vec>
      struct less {
        static bool check(const char* function,
                          const T_y& y,
                          const T_high& high,
                          const char* name,  
                          T_result* result) {
          using stan::length;
          VectorView<const T_high> high_vec(high);
          for (size_t n = 0; n < length(high); n++) {
            if (!(y < high_vec[n]))
              return dom_err(function,y,name,
                             " is %1%, but must be less than ",
                             high_vec[n],result);
          }
          return true;
        }
      };
    
      template <typename T_y, typename T_high, typename T_result>
      struct less<T_y, T_high, T_result, true> {
        static bool check(const char* function,
                          const T_y& y,
                          const T_high& high,
                          const char* name,
                          T_result* result) {
          using stan::length;
          VectorView<const T_high> high_vec(high);
          for (size_t n = 0; n < length(y); n++) {
            if (!(stan::get(y,n) < high_vec[n]))
              return dom_err_vec(n,function,y,name,
                                 " is %1%, but must be less than ",
                                 high_vec[n],result);
          }
          return true;
        }
      };
    }
    template <typename T_y, typename T_high, typename T_result>
    inline bool check_less(const char* function,
                           const T_y& y,
                           const T_high& high,
                           const char* name,  
                           T_result* result) {
      return less<T_y,T_high,T_result,is_vector_like<T_y>::value>
        ::check(function,y,high,name,result);
    }
  }
}
#endif<commit_msg>added doc in code for check_less<commit_after>#ifndef STAN__MATH__ERROR_HANDLING_CHECK_LESS_HPP
#define STAN__MATH__ERROR_HANDLING_CHECK_LESS_HPP

#include <stan/math/error_handling/dom_err.hpp>
#include <stan/math/error_handling/dom_err_vec.hpp>

namespace stan {
  namespace math {

    namespace {
      template <typename T_y, typename T_high, typename T_result, bool is_vec>
      struct less {
        static bool check(const char* function,
                          const T_y& y,
                          const T_high& high,
                          const char* name,  
                          T_result* result) {
          using stan::length;
          VectorView<const T_high> high_vec(high);
          for (size_t n = 0; n < length(high); n++) {
            if (!(y < high_vec[n]))
              return dom_err(function,y,name,
                             " is %1%, but must be less than ",
                             high_vec[n],result);
          }
          return true;
        }
      };
    
      template <typename T_y, typename T_high, typename T_result>
      struct less<T_y, T_high, T_result, true> {
        static bool check(const char* function,
                          const T_y& y,
                          const T_high& high,
                          const char* name,
                          T_result* result) {
          using stan::length;
          VectorView<const T_high> high_vec(high);
          for (size_t n = 0; n < length(y); n++) {
            if (!(stan::get(y,n) < high_vec[n]))
              return dom_err_vec(n,function,y,name,
                                 " is %1%, but must be less than ",
                                 high_vec[n],result);
          }
          return true;
        }
      };
    }

    // throws if any element of y or high is nan
    template <typename T_y, typename T_high, typename T_result>
    inline bool check_less(const char* function,
                           const T_y& y,
                           const T_high& high,
                           const char* name,  
                           T_result* result) {
      return less<T_y,T_high,T_result,is_vector_like<T_y>::value>
        ::check(function,y,high,name,result);
    }
  }
}
#endif
{'fraction_non_alphanumeric': 0.09138204026238407, 'fraction_numerical': 0.0018095453517303778, 'mean_word_length': 1.4350220264317182, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6878099', 'n_tokens_mistral': 1298, 'n_tokens_neox': 1276, 'n_words': 312}