Stan  1.3
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Pages
validate_greater_or_equal.hpp
Go to the documentation of this file.
1 #ifndef __STAN__MATH__MATRIX__VALIDATE_GREATER_OR_EQUAL_HPP__
2 #define __STAN__MATH__MATRIX__VALIDATE_GREATER_OR_EQUAL_HPP__
3 
4 #include <sstream>
5 #include <stdexcept>
6 
7 namespace stan {
8  namespace math {
9 
10  template <typename T1, typename T2>
11  inline
12  void validate_greater_or_equal(const T1& x, const T2& y,
13  const char* x_name, const char* y_name,
14  const char* fun_name) {
15  if (x >= y) return;
16  std::stringstream ss;
17  ss << "require " << x_name << " >= " << y_name
18  << " in " << fun_name
19  << "; found " << x_name << "=" << x
20  << ", " << y_name << "=" << y;
21  throw std::domain_error(ss.str());
22  }
23 
24  }
25 }
26 #endif

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