Stan  2.10.0
probability, sampling & optimization
arg_tolerance.hpp
Go to the documentation of this file.
1 #ifndef STAN_SERVICES_ARGUMENTS_ARG_TOLERANCE_HPP
2 #define STAN_SERVICES_ARGUMENTS_ARG_TOLERANCE_HPP
3 
5 #include <boost/lexical_cast.hpp>
6 #include <string>
7 
8 namespace stan {
9  namespace services {
10 
11  class arg_tolerance : public real_argument {
12  public:
13  arg_tolerance(const char *name, const char *desc, double def)
14  : real_argument() {
15  _name = name;
16  _description = desc;
17  _validity = "0 <= tol";
18  _default = boost::lexical_cast<std::string>(def);
19  _default_value = def;
20  _constrained = true;
21  _good_value = 1.0;
22  _bad_value = -1.0;
24  }
25 
26  bool is_valid(double value) { return value >= 0; }
27  };
28 
29  } // services
30 } // stan
31 
32 #endif
arg_tolerance(const char *name, const char *desc, double def)
Probability, optimization and sampling library.
std::string _description
Definition: argument.hpp:84
std::string name() const
Definition: argument.hpp:26

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