Static Public Member Functions | List of all members
stan::math::internal::bounded< T_y, T_low, T_high, true > 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>
struct stan::math::internal::bounded< T_y, T_low, T_high, true >

Definition at line 44 of file check_bounded.hpp.

Member Function Documentation

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

Definition at line 45 of file check_bounded.hpp.

References stan::math::domain_error_vec(), stan::get(), stan::length(), lem_server::msg, and getGoodRuns4SAM::n.

46  {
47  using stan::get;
48  using stan::length;
49 
50  scalar_seq_view<T_low> low_vec(low);
51  scalar_seq_view<T_high> high_vec(high);
52  for (size_t n = 0; n < length(y); n++) {
53  if (!(low_vec[n] <= get(y, n) && get(y, n) <= high_vec[n])) {
54  std::stringstream msg;
55  msg << ", but must be in the interval ";
56  msg << "[" << low_vec[n] << ", " << high_vec[n] << "]";
57  std::string msg_str(msg.str());
58  domain_error_vec(function, name, y, n, "is ", msg_str.c_str());
59  }
60  }
61  }
const XML_Char * name
Definition: expat.h:151
size_t length(const std::vector< T > &x)
Definition: length.hpp:10
void domain_error_vec(const char *function, const char *name, const T &y, size_t i, const char *msg1, const char *msg2)
T get(const std::vector< T > &x, size_t n)
Definition: get.hpp:10
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154

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