|
ʻ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>
29 std::numeric_limits<value_type>::quiet_NaN();
33 std::numeric_limits<size_t>::max();
37 std::numeric_limits<size_t>::max();
41 std::numeric_limits<double>::quiet_NaN();
48 : _epsilon (a.read(
"--epsilon",
"-e",
no_epsilon))
49 , _f_epsilon (a.read(
"--f-epsilon",
"-fe",
value_type(1.0e-6)))
50 , _fin (a.read<std::string>(
"--fin",
"-fi"))
51 , _fin_force (a.read<std::string>(
"--fin-force",
"-fif"))
52 , _force (a.read<std::string>(
"--force",
"-fg"))
53 , _fout (a.read<std::string>(
"--fout",
"-fo"))
54 , _ksize (a.read(
"--ksize",
"-k",
no_ksize))
56 , _max_time (a.read(
"--max-time",
"-mt",
no_max_time))
57 , _qin (a.read<std::string>(
"--qin",
"-qi"))
58 , _qout (a.read<std::string>(
"--qout",
"-qo"))
59 , _seed (a.read(
"--seed",
"-s", std::random_device()()))
60 , _frb (a.read_flag(
"--frequency-bounds",
"-frb"))
61 , _fixed_f (a.read_flag(
"--fixed-f",
"-ff"))
62 , _fixed_q (a.read_flag(
"--fixed-q",
"-fq"))
63 , _quiet (a.read_flag(
"--quiet",
"-q"))
67 <<
"invalid value for --epsilon option: "
74 <<
"invalid value for --f-epsilon option: "
80 <<
"invalid value for --ksize option: "
85 <<
"invalid value for --max-time option: "
94 <<
"at least one of --ksize, --qin, --fin, or --force must "
95 <<
"be specified in order to determine the number of "
100 throw error() <<
"invalid specification of --fin option "
101 <<
"with --fin-force option";
104 throw error() <<
"invalid specification of --fixed-f option "
105 <<
"without --fin option";
108 throw error() <<
"invalid specification of --fixed-q option "
109 <<
"without --qin option";
112 throw error() <<
"invalid specification of --fixed-q option "
113 <<
"and --force option";
119 <<
"invalid specification of --fin-force "
120 <<
"and --frequency-bounds options";
124 <<
"invalid specification of --fixed-f, --fin, "
125 <<
"and --frequency-bounds options";
197 return _max_iterations;
240 return !std::isnan(_epsilon);
256 return !_fin.empty();
264 return !_fin_force.empty();
288 return !_force.empty();
296 return !_fout.empty();
320 return !std::isnan(_max_time);
328 return !_qin.empty();
336 return !_qout.empty();
351 const std::string _fin;
352 const std::string _fin_force;
353 const std::string _force;
354 const std::string _fout;
356 const size_t _max_iterations;
357 const double _max_time;
358 const std::string _qin;
359 const std::string _qout;
370 #endif // JADE_OPTIONS_HPP__
bool is_ksize_specified() const
basic_options(args &a)
Initializes a new instance of the class.
bool is_max_iterations_specified() const
const std::string & get_fout() const
std::random_device::result_type seed_type
The random number generator seed type.
const std::string & get_qout() const
bool is_fin_force_specified() const
bool is_epsilon_specified() const
double get_max_time() 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
const std::string & get_fin_force() const
static constexpr auto no_max_iterations
The value assigned for no –max-iterations option.
value_type get_epsilon() const
static constexpr auto no_ksize
The value assigned for no –ksize option.
bool is_fout_specified() const
const std::string & get_fin() const
static constexpr auto no_max_time
The value assigned for no –max-time option.
bool is_fin_specified() const
A template for a class that helps process command-line arguments.
bool is_force_specified() const
bool is_qin_specified() const
A template for a class representing an exception thrown from this namespace.
const std::string & get_force() const
const std::string & get_qin() const
value_type get_f_epsilon() const
bool is_qout_specified() const
TValue value_type
The value type.
seed_type get_seed() const