Static Public Member Functions | List of all members
stan::math::internal::bounded< T_y, T_low, T_high, y_is_vec > Struct Template Reference

#include "stan/math/prim/scal/err/check_bounded.hpp"

Static Public Member Functions

static void check (const char *function, const char *name, const T_y &y, const T_low &low, const T_high &high)
 

Detailed Description

template<typename T_y, typename T_low, typename T_high, bool y_is_vec>
struct stan::math::internal::bounded< T_y, T_low, T_high, y_is_vec >

Definition at line 24 of file check_bounded.hpp.

Member Function Documentation

template<typename T_y, typename T_low, typename T_high, bool y_is_vec>
static void stan::math::internal::bounded< T_y, T_low, T_high, y_is_vec >::check ( const char *  function,
const char *  name,
const T_y &  y,
const T_low &  low,
const T_high &  high 
)
inlinestatic

Definition at line 25 of file check_bounded.hpp.

References stan::math::domain_error(), stan::max_size(), lem_server::msg, and getGoodRuns4SAM::n.

Referenced by stan::math::check_bounded().

26  {
27  using stan::max_size;
28 
29  scalar_seq_view<T_low> low_vec(low);
30  scalar_seq_view<T_high> high_vec(high);
31  for (size_t n = 0; n < max_size(low, high); n++) {
32  if (!(low_vec[n] <= y && y <= high_vec[n])) {
33  std::stringstream msg;
34  msg << ", but must be in the interval ";
35  msg << "[" << low_vec[n] << ", " << high_vec[n] << "]";
36  std::string msg_str(msg.str());
37  domain_error(function, name, y, "is ", msg_str.c_str());
38  }
39  }
40  }
const XML_Char * name
Definition: expat.h:151
size_t max_size(const T1 &x1, const T2 &x2)
Definition: max_size.hpp:9
void domain_error(const char *function, const char *name, const T &y, const char *msg1, const char *msg2)
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154

The documentation for this struct was generated from the following file: