|
ʻOhana
Population structure, admixture history, and selection using learning methods.
|
7 #ifndef JADE_OPTIONS_HPP__
8 #define JADE_OPTIONS_HPP__
10 #include "jade.args.hpp"
17 template <
typename TValue>
26 std::numeric_limits<value_type>::quiet_NaN();
30 std::numeric_limits<size_t>::max();
34 std::numeric_limits<double>::quiet_NaN();
41 : _ain (a.read<std::string>(
"--ain",
"-ai"))
42 , _cin (a.read<std::string>(
"--cin",
"-ci"))
43 , _cout (a.read<std::string>(
"--cout",
"-co"))
44 , _epsilon (a.read(
"--epsilon",
"-e",
no_epsilon))
45 , _f_epsilon (a.read(
"--f-epsilon",
"-fe",
value_type(1.0e-6)))
46 , _max_iterations (a.read(
"--max-iterations",
"-mi",
no_iterations))
47 , _max_time (a.read(
"--max-time",
"-mt",
no_time))
48 , _tin (a.read<std::string>(
"--tin",
"-ti"))
49 , _tout (a.read<std::string>(
"--tout",
"-to"))
53 <<
"invalid value for --epsilon option: " << _epsilon;
59 <<
"invalid value for --f-epsilon option: "
65 <<
"invalid value for --max-time option: " << _max_time;
69 <<
"invalid number of iterations for --max-iterations "
70 <<
"option: " << _max_iterations;
73 throw error(
"invalid specification of --tout option "
74 "without --tin option");
79 throw error(
"only one of --ain, --cin, and --tin options may "
86 inline const std::string &
get_ain()
const
95 inline const std::string &
get_cin()
const
133 return _max_iterations;
168 return !_ain.empty();
176 return !_cin.empty();
184 return !_cout.empty();
192 return !std::isnan(_epsilon);
208 return !std::isnan(_max_time);
216 return !_tin.empty();
224 return !_tout.empty();
233 size_t _max_iterations;
240 #endif // JADE_OPTIONS_HPP__
basic_options(args &a)
Initializes a new instance of the class.
bool is_max_iterations_specified() const
bool is_cout_specified() const
bool is_epsilon_specified() const
double get_max_time() const
const std::string & get_tout() const
static constexpr auto no_epsilon
The value assigned for no –epsilon option.
bool is_max_time_specified() const
size_t get_max_iterations() const
bool is_tin_specified() const
bool is_tout_specified() const
bool is_ain_specified() const
value_type get_epsilon() const
static constexpr auto no_time
The value assigned with no –max-time option.
static constexpr auto no_iterations
The value assigned with no –max-iterations option.
const std::string & get_tin() const
const std::string & get_ain() const
A template for a class that helps process command-line arguments.
bool is_cin_specified() const
const std::string & get_cin() const
A template for a class representing an exception thrown from this namespace.
value_type get_f_epsilon() const
TValue value_type
The value type.
const std::string & get_cout() const