ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
optmatch.cpp File Reference

(Last Changed on January 19, 2016 for git-revision e58a5081c5de7bb48f5a9459dcaa12ea108e870a.)

option_match utilities used for parsing command line arguments. More...

#include <adstring.hpp>

Go to the source code of this file.

Functions

int option_match (int argc, char *argv[], const char *option)
 Checks if the program has been invoked with a particular command line argument ("string"). More...
 
int option_match (char *_s, const char *option)
 Search for option in _s. More...
 
int option_match (char *_s, const char *option, int &nopt)
 Search for option in _s and returns number of option args in _nopt. More...
 
int option_match (int argc, char *argv[], const char *option, int &nopt)
 Checks if the program has been invoked with a particular command line argument ("string"). More...
 

Detailed Description

option_match utilities used for parsing command line arguments.

Definition in file optmatch.cpp.

Function Documentation

int option_match ( int  argc,
char *  argv[],
const char *  option 
)

Checks if the program has been invoked with a particular command line argument ("string").

Parameters
argcNumber of command line arguments (as in all C programs)
argvArray (of length argc) of command line arguments (as in all C programs)
optionShould be one of the possible command line arguments to an ADMB program.
Returns
An index into "argv" where the match with "string" is obtained. In case of no match, the value "-1" is returned.

Definition at line 25 of file optmatch.cpp.

Referenced by ad_comm::ad_comm(), ad_comm::allocate(), allocate_dvariable_space(), function_minimizer::computations(), function_minimizer::computations1(), DF_FILE::DF_FILE(), dlist::dlist(), do_dll_housekeeping(), laplace_approximation_calculator::do_newton_raphson_banded(), get_f1b2buffer_size(), get_option_number(), grad_stack::grad_stack(), gradient_structure::gradient_structure(), function_minimizer::hess_inv(), function_minimizer::hess_routine_noparallel_random_effects(), function_minimizer::hess_step(), function_minimizer::hybrid_mcmc_routine(), laplace_approximation_calculator::laplace_approximation_calculator(), function_minimizer::likeprof_routine(), function_minimizer::limited_memory_quasi_newton(), function_minimizer::limited_memory_quasi_newton_block(), function_minimizer::mcmc_computations(), function_minimizer::mcmc_routine(), function_minimizer::minimize(), function_minimizer::nuts_mcmc_routine(), laplace_approximation_calculator::operator()(), option_match(), function_minimizer::prof_minimize_re(), function_minimizer::pvm_master_mcmc_computations(), function_minimizer::quasi_newton_block(), function_minimizer::random_effects_maximization(), function_minimizer::rwm_mcmc_routine(), function_minimizer::shmc_mcmc_routine(), DF_FILE::~DF_FILE(), fixed_smartlist::~fixed_smartlist(), fixed_smartlist2::~fixed_smartlist2(), grad_stack::~grad_stack(), and test_smartlist::~test_smartlist().

int option_match ( char *  _s,
const char *  option 
)

Search for option in _s.

Returns
If found return index (starts at 1), else return -1.

Definition at line 46 of file optmatch.cpp.

int option_match ( char *  _s,
const char *  option,
int &  nopt 
)

Search for option in _s and returns number of option args in _nopt.

Returns
If found return index (starts at 1), else return -1.

Definition at line 72 of file optmatch.cpp.

int option_match ( int  argc,
char *  argv[],
const char *  option,
int &  nopt 
)

Checks if the program has been invoked with a particular command line argument ("string").

If so, counts the number of arguments ("nopt") to this command line option. For example if the program has been invoked with the command line option "-ind FILE", then nopt=1.

Parameters
argcNumber of command line arguments (as in all C programs)
argvArray (of length argc) of command line arguments (as in all C programs)
optionShould be one of the possible command line arguments to an ADMB program.
noptOn return holds the number arguments/options associated with "string".
Returns
An index into "argv" where the match with "string" is obtained. In case of no match, the value "-1" is returned.

Definition at line 118 of file optmatch.cpp.