Stan  2.5.0
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
arg_tolerance.hpp
Go to the documentation of this file.
1 #ifndef STAN__GM__ARGUMENTS__TOLERANCE_HPP
2 #define STAN__GM__ARGUMENTS__TOLERANCE_HPP
3 
4 #include <boost/lexical_cast.hpp>
5 
7 
8 namespace stan {
9 
10  namespace gm {
11 
12  class arg_tolerance : public real_argument {
13 
14  public:
15 
16  arg_tolerance(const char *name, const char *desc, double def) : real_argument() {
17  _name = name;
18  _description = desc;
19  _validity = "0 <= tol";
20  _default = boost::lexical_cast<std::string>(def);
21  _default_value = def;
22  _constrained = true;
23  _good_value = 1.0;
24  _bad_value = -1.0;
26  };
27 
28  bool is_valid(double value) { return value >= 0; }
29 
30  };
31 
32  } // gm
33 
34 } // stan
35 
36 #endif
bool is_valid(double value)
std::string _name
Definition: argument.hpp:76
std::string name() const
Definition: argument.hpp:26
arg_tolerance(const char *name, const char *desc, double def)
std::string _description
Definition: argument.hpp:77

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