|
StochHMM
v0.34
Flexible Hidden Markov Model C++ Library and Application
|
Parse, Store, and access commandline options data. More...
#include <options.h>
Public Member Functions | |
| options () | |
| void | set_parameters (opt_parameters *, int, const char *) |
| void | parse_commandline (int, const char **) |
| bool | getopt (const char *, int &) |
| bool | getopt (const char *, double &) |
| bool | getopt (const char *, std::string &) |
| bool | isFlagSet (const char *, const char *) |
| bool | isSet (const char *) |
| std::string & | sopt (const char *) |
| int & | iopt (const char *) |
| double & | dopt (const char *) |
Private Attributes | |
| std::map< std::string, opt_data * > | opts |
| std::map< std::string, std::string > | alternatives |
| const char * | usage |
| StochHMM::options::options | ( | ) |
Definition at line 473 of file options.cpp.
| double & StochHMM::options::dopt | ( | const char * | param | ) |
Get double value for option *If option is not an OPT_DOUBLE, this will produce an error
| param | parameter name |
Definition at line 457 of file options.cpp.
References StochHMM::OPT_DOUBLE, and opts.
Referenced by print_limited_posterior().
| bool StochHMM::options::getopt | ( | const char * | param, |
| int & | value | ||
| ) |
Get the integer value for option
| [in] | param | the option name |
| [out] | value | integer is to be returned to |
Definition at line 303 of file options.cpp.
References StochHMM::OPT_INT, and opts.
Referenced by main().
| bool StochHMM::options::getopt | ( | const char * | param, |
| double & | value | ||
| ) |
Get double type option values
| [in] | param | the option name |
| [out] | value | double is to be returned to |
Definition at line 326 of file options.cpp.
References StochHMM::OPT_DOUBLE, and opts.
| bool StochHMM::options::getopt | ( | const char * | param, |
| std::string & | value | ||
| ) |
Get string type options values
| [in] | param | the option name |
| [out] | value | std::string is to be returned to |
Definition at line 349 of file options.cpp.
References StochHMM::OPT_STRING, and opts.
| int & StochHMM::options::iopt | ( | const char * | param | ) |
Get integer value for option *If option is not an OPT_INT, this will produce an error
| param | parameter name |
Definition at line 437 of file options.cpp.
References StochHMM::OPT_INT, and opts.
Referenced by perform_nbest_decoding(), and perform_stochastic_decoding().
| bool StochHMM::options::isFlagSet | ( | const char * | param, |
| const char * | sec | ||
| ) |
Check primary and secondary options and returns value of bool flag
| param | primary option name |
| sec | secondary option name |
Definition at line 372 of file options.cpp.
References StochHMM::OPT_FLAG, and opts.
Referenced by import_model(), main(), and perform_stochastic_decoding().
| bool StochHMM::options::isSet | ( | const char * | param | ) |
Returns whether an option is set *Used also for OPT_NONE option types
| param | parameter name |
Definition at line 402 of file options.cpp.
References opts.
Referenced by import_model(), import_sequence(), main(), perform_posterior(), perform_stochastic_decoding(), and print_output().
| void StochHMM::options::parse_commandline | ( | int | , |
| const char ** | |||
| ) |
Parse the commandline arguments and save them in the options clas
| argc | Number of commandline arguments; |
| argv | Commandline argurments |
Definition at line 161 of file options.cpp.
References alternatives, StochHMM::OPT_DOUBLE, StochHMM::OPT_FLAG, StochHMM::OPT_INT, StochHMM::OPT_NONE, StochHMM::OPT_STRING, opts, and usage.
Referenced by main().
| void StochHMM::options::set_parameters | ( | opt_parameters * | param, |
| int | size, | ||
| const char * | usageStatement | ||
| ) |
Setup options to handle the parameters and options defined by the user
| param | pointer to opt_parameters(user defined options and defaults) |
| size | # of parameters that have been defined |
| usageStatement | User defined usage statement for the program |
Definition at line 34 of file options.cpp.
References StochHMM::opt_parameters::allowable, alternatives, StochHMM::opt_parameters::commandline_tag, StochHMM::opt_data::d, StochHMM::opt_data::data, StochHMM::opt_data::default_value, StochHMM::opt_data::flags, StochHMM::opt_data::i, MAX_ALLOWABLE, StochHMM::OPT_DOUBLE, StochHMM::OPT_FLAG, StochHMM::OPT_INT, StochHMM::OPT_STRING, opts, StochHMM::opt_parameters::preset, StochHMM::opt_parameters::required, StochHMM::opt_data::required, StochHMM::opt_data::restricted, StochHMM::opt_data::set, StochHMM::opt_data::str, StochHMM::opt_parameters::type, StochHMM::opt_data::type, and usage.
Referenced by main().
| std::string & StochHMM::options::sopt | ( | const char * | param | ) |
Get string value for option *If option is not an OPT_STRING, this will produce an error
| param | parameter name |
Definition at line 416 of file options.cpp.
References StochHMM::OPT_STRING, and opts.
Referenced by import_model(), and import_sequence().
|
private |
Definition at line 126 of file options.h.
Referenced by parse_commandline(), and set_parameters().
|
private |
Definition at line 125 of file options.h.
Referenced by dopt(), getopt(), iopt(), isFlagSet(), isSet(), parse_commandline(), set_parameters(), and sopt().
|
private |
Definition at line 127 of file options.h.
Referenced by parse_commandline(), and set_parameters().
1.8.1