1 /** @file treekin_cmdline.h
2  *  @brief The header file for the command line option parser
3  *  generated by GNU Gengetopt version 2.22.6
4  *  http://www.gnu.org/software/gengetopt.
5  *  DO NOT modify this file, since it can be overwritten
6  *  @author GNU Gengetopt by Lorenzo Bettini */
7 
8 #ifndef TREEKIN_CMDLINE_H
9 #define TREEKIN_CMDLINE_H
10 
11 /* If we use autoconf.  */
12 #ifdef HAVE_CONFIG_H
13 #include "config.h"
14 #endif
15 
16 #include <stdio.h> /* for FILE */
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif /* __cplusplus */
21 
22 #ifndef CMDLINE_PARSER_PACKAGE
23 /** @brief the program name (used for printing errors) */
24 #define CMDLINE_PARSER_PACKAGE "treekin"
25 #endif
26 
27 #ifndef CMDLINE_PARSER_PACKAGE_NAME
28 /** @brief the complete program name (used for help and version) */
29 #define CMDLINE_PARSER_PACKAGE_NAME "treekin"
30 #endif
31 
32 #ifndef CMDLINE_PARSER_VERSION
33 /** @brief the program version */
34 #define CMDLINE_PARSER_VERSION VERSION
35 #endif
36 
37 /** @brief Where the command line options are stored */
38 struct gengetopt_args_info
39 {
40   const char *help_help; /**< @brief Print help and exit help description.  */
41   const char *version_help; /**< @brief Print version and exit help description.  */
42   int absorb_arg;	/**< @brief Make a state absorbing.  */
43   char * absorb_orig;	/**< @brief Make a state absorbing original value given at command line.  */
44   const char *absorb_help; /**< @brief Make a state absorbing help description.  */
45   char * method_arg;	/**< @brief Select method to build transition matrix:
46   A ==> Arrhenius-like kinetics
47 
48   I ==> use input as a rate matrix (default='I').  */
49   char * method_orig;	/**< @brief Select method to build transition matrix:
50   A ==> Arrhenius-like kinetics
51 
52   I ==> use input as a rate matrix original value given at command line.  */
53   const char *method_help; /**< @brief Select method to build transition matrix:
54   A ==> Arrhenius-like kinetics
55 
56   I ==> use input as a rate matrix help description.  */
57   char * num_err_arg;	/**< @brief Specify how to treat issues with numerical errors in probability:
58   I ==> Ignore
59   H ==> Halt the program
60   R ==> Rescale the probability (default='H').  */
61   char * num_err_orig;	/**< @brief Specify how to treat issues with numerical errors in probability:
62   I ==> Ignore
63   H ==> Halt the program
64   R ==> Rescale the probability original value given at command line.  */
65   const char *num_err_help; /**< @brief Specify how to treat issues with numerical errors in probability:
66   I ==> Ignore
67   H ==> Halt the program
68   R ==> Rescale the probability help description.  */
69   double t0_arg;	/**< @brief Start time (default='0.1').  */
70   char * t0_orig;	/**< @brief Start time original value given at command line.  */
71   const char *t0_help; /**< @brief Start time help description.  */
72   double t8_arg;	/**< @brief Stop time (default='1E12').  */
73   char * t8_orig;	/**< @brief Stop time original value given at command line.  */
74   const char *t8_help; /**< @brief Stop time help description.  */
75   double Temp_arg;	/**< @brief Temperature in Celsius (default='37.0').  */
76   char * Temp_orig;	/**< @brief Temperature in Celsius original value given at command line.  */
77   const char *Temp_help; /**< @brief Temperature in Celsius help description.  */
78   int nstates_arg;	/**< @brief Read only first <int> states (assume quasi-stationary distribution (derivation of others is = 0)).  */
79   char * nstates_orig;	/**< @brief Read only first <int> states (assume quasi-stationary distribution (derivation of others is = 0)) original value given at command line.  */
80   const char *nstates_help; /**< @brief Read only first <int> states (assume quasi-stationary distribution (derivation of others is = 0)) help description.  */
81   char ** p0_arg;	/**< @brief Set initial population of state <int> to <double>
82   Can be given multiple times
83   (NOTE: sum of <double> must equal 1)
84   (example: \"--p0 2=1.0\" - state 2 has initial population 100 percent).  */
85   char ** p0_orig;	/**< @brief Set initial population of state <int> to <double>
86   Can be given multiple times
87   (NOTE: sum of <double> must equal 1)
88   (example: \"--p0 2=1.0\" - state 2 has initial population 100 percent) original value given at command line.  */
89   unsigned int p0_min; /**< @brief Set initial population of state <int> to <double>
90   Can be given multiple times
91   (NOTE: sum of <double> must equal 1)
92   (example: \"--p0 2=1.0\" - state 2 has initial population 100 percent)'s minimum occurreces */
93   unsigned int p0_max; /**< @brief Set initial population of state <int> to <double>
94   Can be given multiple times
95   (NOTE: sum of <double> must equal 1)
96   (example: \"--p0 2=1.0\" - state 2 has initial population 100 percent)'s maximum occurreces */
97   const char *p0_help; /**< @brief Set initial population of state <int> to <double>
98   Can be given multiple times
99   (NOTE: sum of <double> must equal 1)
100   (example: \"--p0 2=1.0\" - state 2 has initial population 100 percent) help description.  */
101   double tinc_arg;	/**< @brief Time scaling factor (for log time-scale) (default='1.02').  */
102   char * tinc_orig;	/**< @brief Time scaling factor (for log time-scale) original value given at command line.  */
103   const char *tinc_help; /**< @brief Time scaling factor (for log time-scale) help description.  */
104   int degeneracy_flag;	/**< @brief Consider degeneracy in transition rates (default=off).  */
105   const char *degeneracy_help; /**< @brief Consider degeneracy in transition rates help description.  */
106   int exponent_flag;	/**< @brief Use matrix-expontent routines, rather than diagonalization (default=off).  */
107   const char *exponent_help; /**< @brief Use matrix-expontent routines, rather than diagonalization help description.  */
108   int dumpU_flag;	/**< @brief Dump transition matrix U to file mx.txt (and to binary mx.bin - not fixed yet) (default=off).  */
109   const char *dumpU_help; /**< @brief Dump transition matrix U to file mx.txt (and to binary mx.bin - not fixed yet) help description.  */
110   int mathematicamatrix_flag;	/**< @brief Dump transition matrix U to Mathematica-readable file mxMat.txt (default=off).  */
111   const char *mathematicamatrix_help; /**< @brief Dump transition matrix U to Mathematica-readable file mxMat.txt help description.  */
112   int bin_flag;	/**< @brief Assume binary rates input (default=off).  */
113   const char *bin_help; /**< @brief Assume binary rates input help description.  */
114   char * bar_arg;	/**< @brief Read barriers input from file instead of standard input. Required in case \"-m I\" (rates kinetics) AND \"-a\" (absorbing state) is given.  */
115   char * bar_orig;	/**< @brief Read barriers input from file instead of standard input. Required in case \"-m I\" (rates kinetics) AND \"-a\" (absorbing state) is given original value given at command line.  */
116   const char *bar_help; /**< @brief Read barriers input from file instead of standard input. Required in case \"-m I\" (rates kinetics) AND \"-a\" (absorbing state) is given help description.  */
117   char * fpt_arg;	/**< @brief Compute first passage times (FPT). Arguments:
118   all => compute all FPT (slow)
119   <num> - compute FPT to state <num> from all states.  */
120   char * fpt_orig;	/**< @brief Compute first passage times (FPT). Arguments:
121   all => compute all FPT (slow)
122   <num> - compute FPT to state <num> from all states original value given at command line.  */
123   const char *fpt_help; /**< @brief Compute first passage times (FPT). Arguments:
124   all => compute all FPT (slow)
125   <num> - compute FPT to state <num> from all states help description.  */
126   int recoverE_flag;	/**< @brief Recover from pre-ccomputes eigenvalues and eigenvectors (default=off).  */
127   const char *recoverE_help; /**< @brief Recover from pre-ccomputes eigenvalues and eigenvectors help description.  */
128   int dumpE_flag;	/**< @brief Dump eigenvalues and eigenvectors to a binary recovery file and continue with iteration (default=off).  */
129   const char *dumpE_help; /**< @brief Dump eigenvalues and eigenvectors to a binary recovery file and continue with iteration help description.  */
130   int dumpX_flag;	/**< @brief Dump eigenvalues to ASCII file and exit (do not iterate) (default=off).  */
131   const char *dumpX_help; /**< @brief Dump eigenvalues to ASCII file and exit (do not iterate) help description.  */
132   int info_flag;	/**< @brief Show settings (default=off).  */
133   const char *info_help; /**< @brief Show settings help description.  */
134   char * ratesfile_arg;	/**< @brief Read transition rates from file instead of standard input..  */
135   char * ratesfile_orig;	/**< @brief Read transition rates from file instead of standard input. original value given at command line.  */
136   const char *ratesfile_help; /**< @brief Read transition rates from file instead of standard input. help description.  */
137   int verbose_flag;	/**< @brief Verbose output (default=off).  */
138   const char *verbose_help; /**< @brief Verbose output help description.  */
139   int quiet_flag;	/**< @brief Be silent (do not print out the output) (default=off).  */
140   const char *quiet_help; /**< @brief Be silent (do not print out the output) help description.  */
141   char * fptfile_arg;	/**< @brief Filename of FPT file (provided -t option given).  */
142   char * fptfile_orig;	/**< @brief Filename of FPT file (provided -t option given) original value given at command line.  */
143   const char *fptfile_help; /**< @brief Filename of FPT file (provided -t option given) help description.  */
144   char * visualize_arg;	/**< @brief Filename where to print a visualization of rate graph (without file subscript, two files will be generated: .dot and .eps with text and visual representation of graph).  */
145   char * visualize_orig;	/**< @brief Filename where to print a visualization of rate graph (without file subscript, two files will be generated: .dot and .eps with text and visual representation of graph) original value given at command line.  */
146   const char *visualize_help; /**< @brief Filename where to print a visualization of rate graph (without file subscript, two files will be generated: .dot and .eps with text and visual representation of graph) help description.  */
147   int just_shorten_flag;	/**< @brief Do not diagonalize and iterate, just shorten input (meaningfull only with -n X option or -fpt option or --visualize option) (default=off).  */
148   const char *just_shorten_help; /**< @brief Do not diagonalize and iterate, just shorten input (meaningfull only with -n X option or -fpt option or --visualize option) help description.  */
149   int max_decrease_arg;	/**< @brief Maximal decrease in dimension in one step (default='1000000').  */
150   char * max_decrease_orig;	/**< @brief Maximal decrease in dimension in one step original value given at command line.  */
151   const char *max_decrease_help; /**< @brief Maximal decrease in dimension in one step help description.  */
152   double feps_arg;	/**< @brief Machine precision used by LAPACK routines (and matrix aritmetic) -- if set to negative number, the lapack suggested value is used (2*DLAMCH(\"S\") ) (default='1E-15').  */
153   char * feps_orig;	/**< @brief Machine precision used by LAPACK routines (and matrix aritmetic) -- if set to negative number, the lapack suggested value is used (2*DLAMCH(\"S\") ) original value given at command line.  */
154   const char *feps_help; /**< @brief Machine precision used by LAPACK routines (and matrix aritmetic) -- if set to negative number, the lapack suggested value is used (2*DLAMCH(\"S\") ) help description.  */
155   int useplusI_flag;	/**< @brief Use old treekin computation where we add identity matrix to transition matrix. Sometimes less precise (maybe sometimes also more precise), in normal case it should not affect results at all. (default=off).  */
156   const char *useplusI_help; /**< @brief Use old treekin computation where we add identity matrix to transition matrix. Sometimes less precise (maybe sometimes also more precise), in normal case it should not affect results at all. help description.  */
157   double minimal_rate_arg;	/**< @brief Rescale all rates to be higher than the minimal rate using formula  \"rate -> rate^(ln(desired_minimal_rate)/ln(minimal_rate))\", where desired_minimal_rate is from input, minimal_rate is the lowest from all rates in rate matrix..  */
158   char * minimal_rate_orig;	/**< @brief Rescale all rates to be higher than the minimal rate using formula  \"rate -> rate^(ln(desired_minimal_rate)/ln(minimal_rate))\", where desired_minimal_rate is from input, minimal_rate is the lowest from all rates in rate matrix. original value given at command line.  */
159   const char *minimal_rate_help; /**< @brief Rescale all rates to be higher than the minimal rate using formula  \"rate -> rate^(ln(desired_minimal_rate)/ln(minimal_rate))\", where desired_minimal_rate is from input, minimal_rate is the lowest from all rates in rate matrix. help description.  */
160   double hard_rescale_arg;	/**< @brief Rescale all rates by a hard exponent (usually 0.0<HR<1.0). Formula: \"rate -> rate^(hard-rescale)\". Overrides --minimal-rate argument..  */
161   char * hard_rescale_orig;	/**< @brief Rescale all rates by a hard exponent (usually 0.0<HR<1.0). Formula: \"rate -> rate^(hard-rescale)\". Overrides --minimal-rate argument. original value given at command line.  */
162   const char *hard_rescale_help; /**< @brief Rescale all rates by a hard exponent (usually 0.0<HR<1.0). Formula: \"rate -> rate^(hard-rescale)\". Overrides --minimal-rate argument. help description.  */
163   char * equil_file_arg;	/**< @brief Write equilibrium distribution into a file..  */
164   char * equil_file_orig;	/**< @brief Write equilibrium distribution into a file. original value given at command line.  */
165   const char *equil_file_help; /**< @brief Write equilibrium distribution into a file. help description.  */
166   double times_arg;	/**< @brief Multiply rates with a constant number..  */
167   char * times_orig;	/**< @brief Multiply rates with a constant number. original value given at command line.  */
168   const char *times_help; /**< @brief Multiply rates with a constant number. help description.  */
169   int warnings_flag;	/**< @brief Turn all the warnings about underflow on. (default=off).  */
170   const char *warnings_help; /**< @brief Turn all the warnings about underflow on. help description.  */
171   int mlapack_precision_arg;	/**< @brief Number of bits for the eigenvalue method of the mlapack library. A value > 64 is recommended, otherwise the standard lapack method would be faster..  */
172   char * mlapack_precision_orig;	/**< @brief Number of bits for the eigenvalue method of the mlapack library. A value > 64 is recommended, otherwise the standard lapack method would be faster. original value given at command line.  */
173   const char *mlapack_precision_help; /**< @brief Number of bits for the eigenvalue method of the mlapack library. A value > 64 is recommended, otherwise the standard lapack method would be faster. help description.  */
174   char * mlapack_method_arg;	/**< @brief The mlapack precision method. \"LD\", \"QD\", \"DD\", \"DOUBLE\", \"GMP\", \"MPFR\", \"FLOAT128\". You have to set mlapack-precision if \"GMP\", \"MPFR\" is selected! \"LD\" is the standard long double with 80 bit..  */
175   char * mlapack_method_orig;	/**< @brief The mlapack precision method. \"LD\", \"QD\", \"DD\", \"DOUBLE\", \"GMP\", \"MPFR\", \"FLOAT128\". You have to set mlapack-precision if \"GMP\", \"MPFR\" is selected! \"LD\" is the standard long double with 80 bit. original value given at command line.  */
176   const char *mlapack_method_help; /**< @brief The mlapack precision method. \"LD\", \"QD\", \"DD\", \"DOUBLE\", \"GMP\", \"MPFR\", \"FLOAT128\". You have to set mlapack-precision if \"GMP\", \"MPFR\" is selected! \"LD\" is the standard long double with 80 bit. help description.  */
177 
178   unsigned int help_given ;	/**< @brief Whether help was given.  */
179   unsigned int version_given ;	/**< @brief Whether version was given.  */
180   unsigned int absorb_given ;	/**< @brief Whether absorb was given.  */
181   unsigned int method_given ;	/**< @brief Whether method was given.  */
182   unsigned int num_err_given ;	/**< @brief Whether num-err was given.  */
183   unsigned int t0_given ;	/**< @brief Whether t0 was given.  */
184   unsigned int t8_given ;	/**< @brief Whether t8 was given.  */
185   unsigned int Temp_given ;	/**< @brief Whether Temp was given.  */
186   unsigned int nstates_given ;	/**< @brief Whether nstates was given.  */
187   unsigned int p0_given ;	/**< @brief Whether p0 was given.  */
188   unsigned int tinc_given ;	/**< @brief Whether tinc was given.  */
189   unsigned int degeneracy_given ;	/**< @brief Whether degeneracy was given.  */
190   unsigned int exponent_given ;	/**< @brief Whether exponent was given.  */
191   unsigned int dumpU_given ;	/**< @brief Whether dumpU was given.  */
192   unsigned int mathematicamatrix_given ;	/**< @brief Whether mathematicamatrix was given.  */
193   unsigned int bin_given ;	/**< @brief Whether bin was given.  */
194   unsigned int bar_given ;	/**< @brief Whether bar was given.  */
195   unsigned int fpt_given ;	/**< @brief Whether fpt was given.  */
196   unsigned int recoverE_given ;	/**< @brief Whether recoverE was given.  */
197   unsigned int dumpE_given ;	/**< @brief Whether dumpE was given.  */
198   unsigned int dumpX_given ;	/**< @brief Whether dumpX was given.  */
199   unsigned int info_given ;	/**< @brief Whether info was given.  */
200   unsigned int ratesfile_given ;	/**< @brief Whether ratesfile was given.  */
201   unsigned int verbose_given ;	/**< @brief Whether verbose was given.  */
202   unsigned int quiet_given ;	/**< @brief Whether quiet was given.  */
203   unsigned int fptfile_given ;	/**< @brief Whether fptfile was given.  */
204   unsigned int visualize_given ;	/**< @brief Whether visualize was given.  */
205   unsigned int just_shorten_given ;	/**< @brief Whether just-shorten was given.  */
206   unsigned int max_decrease_given ;	/**< @brief Whether max-decrease was given.  */
207   unsigned int feps_given ;	/**< @brief Whether feps was given.  */
208   unsigned int useplusI_given ;	/**< @brief Whether useplusI was given.  */
209   unsigned int minimal_rate_given ;	/**< @brief Whether minimal-rate was given.  */
210   unsigned int hard_rescale_given ;	/**< @brief Whether hard-rescale was given.  */
211   unsigned int equil_file_given ;	/**< @brief Whether equil-file was given.  */
212   unsigned int times_given ;	/**< @brief Whether times was given.  */
213   unsigned int warnings_given ;	/**< @brief Whether warnings was given.  */
214   unsigned int mlapack_precision_given ;	/**< @brief Whether mlapack-precision was given.  */
215   unsigned int mlapack_method_given ;	/**< @brief Whether mlapack-method was given.  */
216 
217   char **inputs ; /**< @brief unamed options (options without names) */
218   unsigned inputs_num ; /**< @brief unamed options number */
219 } ;
220 
221 /** @brief The additional parameters to pass to parser functions */
222 struct cmdline_parser_params
223 {
224   int override; /**< @brief whether to override possibly already present options (default 0) */
225   int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */
226   int check_required; /**< @brief whether to check that all required options were provided (default 1) */
227   int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */
228   int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */
229 } ;
230 
231 /** @brief the purpose string of the program */
232 extern const char *gengetopt_args_info_purpose;
233 /** @brief the usage string of the program */
234 extern const char *gengetopt_args_info_usage;
235 /** @brief the description string of the program */
236 extern const char *gengetopt_args_info_description;
237 /** @brief all the lines making the help output */
238 extern const char *gengetopt_args_info_help[];
239 
240 /**
241  * The command line parser
242  * @param argc the number of command line options
243  * @param argv the command line options
244  * @param args_info the structure where option information will be stored
245  * @return 0 if everything went fine, NON 0 if an error took place
246  */
247 int cmdline_parser (int argc, char **argv,
248   struct gengetopt_args_info *args_info);
249 
250 /**
251  * The command line parser (version with additional parameters - deprecated)
252  * @param argc the number of command line options
253  * @param argv the command line options
254  * @param args_info the structure where option information will be stored
255  * @param override whether to override possibly already present options
256  * @param initialize whether to initialize the option structure my_args_info
257  * @param check_required whether to check that all required options were provided
258  * @return 0 if everything went fine, NON 0 if an error took place
259  * @deprecated use cmdline_parser_ext() instead
260  */
261 int cmdline_parser2 (int argc, char **argv,
262   struct gengetopt_args_info *args_info,
263   int override, int initialize, int check_required);
264 
265 /**
266  * The command line parser (version with additional parameters)
267  * @param argc the number of command line options
268  * @param argv the command line options
269  * @param args_info the structure where option information will be stored
270  * @param params additional parameters for the parser
271  * @return 0 if everything went fine, NON 0 if an error took place
272  */
273 int cmdline_parser_ext (int argc, char **argv,
274   struct gengetopt_args_info *args_info,
275   struct cmdline_parser_params *params);
276 
277 /**
278  * Save the contents of the option struct into an already open FILE stream.
279  * @param outfile the stream where to dump options
280  * @param args_info the option struct to dump
281  * @return 0 if everything went fine, NON 0 if an error took place
282  */
283 int cmdline_parser_dump(FILE *outfile,
284   struct gengetopt_args_info *args_info);
285 
286 /**
287  * Save the contents of the option struct into a (text) file.
288  * This file can be read by the config file parser (if generated by gengetopt)
289  * @param filename the file where to save
290  * @param args_info the option struct to save
291  * @return 0 if everything went fine, NON 0 if an error took place
292  */
293 int cmdline_parser_file_save(const char *filename,
294   struct gengetopt_args_info *args_info);
295 
296 /**
297  * Print the help
298  */
299 void cmdline_parser_print_help(void);
300 /**
301  * Print the version
302  */
303 void cmdline_parser_print_version(void);
304 
305 /**
306  * Initializes all the fields a cmdline_parser_params structure
307  * to their default values
308  * @param params the structure to initialize
309  */
310 void cmdline_parser_params_init(struct cmdline_parser_params *params);
311 
312 /**
313  * Allocates dynamically a cmdline_parser_params structure and initializes
314  * all its fields to their default values
315  * @return the created and initialized cmdline_parser_params structure
316  */
317 struct cmdline_parser_params *cmdline_parser_params_create(void);
318 
319 /**
320  * Initializes the passed gengetopt_args_info structure's fields
321  * (also set default values for options that have a default)
322  * @param args_info the structure to initialize
323  */
324 void cmdline_parser_init (struct gengetopt_args_info *args_info);
325 /**
326  * Deallocates the string fields of the gengetopt_args_info structure
327  * (but does not deallocate the structure itself)
328  * @param args_info the structure to deallocate
329  */
330 void cmdline_parser_free (struct gengetopt_args_info *args_info);
331 
332 /**
333  * Checks that all the required options were specified
334  * @param args_info the structure to check
335  * @param prog_name the name of the program that will be used to print
336  *   possible errors
337  * @return
338  */
339 int cmdline_parser_required (struct gengetopt_args_info *args_info,
340   const char *prog_name);
341 
342 extern const char *cmdline_parser_method_values[];  /**< @brief Possible values for method. */
343 extern const char *cmdline_parser_num_err_values[];  /**< @brief Possible values for num-err. */
344 
345 
346 #ifdef __cplusplus
347 }
348 #endif /* __cplusplus */
349 #endif /* TREEKIN_CMDLINE_H */
350