Stan
2.10.0
probability, sampling & optimization
Main Page
Namespaces
Classes
Files
File List
File Members
src
stan
services
arguments
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
4
#include <
stan/services/arguments/singleton_argument.hpp
>
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;
23
_value
=
_default_value
;
24
}
25
26
bool
is_valid
(
double
value
) {
return
value >= 0; }
27
};
28
29
}
// services
30
}
// stan
31
32
#endif
stan::services::arg_tolerance::arg_tolerance
arg_tolerance(const char *name, const char *desc, double def)
Definition:
arg_tolerance.hpp:13
stan
Probability, optimization and sampling library.
Definition:
base_interrupt.hpp:4
stan::services::singleton_argument::_validity
std::string _validity
Definition:
singleton_argument.hpp:144
stan::services::valued_argument::_default
std::string _default
Definition:
valued_argument.hpp:42
stan::services::arg_tolerance
Definition:
arg_tolerance.hpp:11
stan::services::argument::_description
std::string _description
Definition:
argument.hpp:84
stan::services::argument::_name
std::string _name
Definition:
argument.hpp:83
stan::services::singleton_argument::value
T value()
Definition:
singleton_argument.hpp:121
stan::services::singleton_argument::_value
T _value
Definition:
singleton_argument.hpp:147
stan::services::singleton_argument::_constrained
bool _constrained
Definition:
singleton_argument.hpp:150
stan::services::arg_tolerance::is_valid
bool is_valid(double value)
Definition:
arg_tolerance.hpp:26
stan::services::singleton_argument::_bad_value
T _bad_value
Definition:
singleton_argument.hpp:153
stan::services::singleton_argument::_default_value
T _default_value
Definition:
singleton_argument.hpp:148
stan::services::singleton_argument
Definition:
singleton_argument.hpp:45
singleton_argument.hpp
stan::services::argument::name
std::string name() const
Definition:
argument.hpp:26
stan::services::singleton_argument::_good_value
T _good_value
Definition:
singleton_argument.hpp:152
[
Stan Home Page
]
© 2011–2016, Stan Development Team.