11 #if ( (defined(_WINDOWS) || defined(_Windows)) && !defined(BORBUGS))
24 void write_banner_stuff(
void);
30 class admb_javapointers;
34 const std::chrono::time_point<std::chrono::system_clock>& from,
35 const std::chrono::time_point<std::chrono::system_clock>& to);
37 extern std::chrono::time_point<std::chrono::system_clock>
start_time;
64 int argument =
atoi(argv[on+1]);
65 if (argument >= 0 && argument <= 2)
71 cerr <<
"Warning: Invaild argument for option -display (See -help).\n\n";
76 cerr <<
"Warning: Option -display needs a number argument (See -help).\n\n";
121 std::string fullpath(argv[0]);
123 auto idx1 = fullpath.rfind(
"\\");
124 auto idx2 = fullpath.rfind(
".");
125 auto total = idx2 - idx1 - 1;
126 std::string model_name = fullpath.substr(idx1 + 1, total);
128 auto idx1 = fullpath.rfind(
"/");
129 if (idx1 > 0) ++idx1;
130 std::string model_name = fullpath.substr(idx1);
132 cout <<
"\nFinished running model '" << model_name <<
"' after "
144 #if defined(USE_ADPVM)
156 cerr <<
"Illegal value for ad_comm::pvm_manager->mode"
161 #endif // #if defined(USE_ADPVM)
180 cerr <<
"Wrong number of options to -mafxn -- must be 1"
181 " you have " << nopt <<
endl;
198 cerr <<
"Wrong number of options to -crit -- must be 1"
199 " you have " << nopt <<
endl;
260 if (on==-1 && on1==-1)
269 #if defined(USE_ADPVM)
304 #if defined(USE_ADPVM)
316 cerr <<
"error illega value for pvm_manager->mode" <<
endl;
342 #if defined(USE_ADPVM)
354 cerr <<
"error illega value for pvm_manager->mode" <<
endl;
371 nsob=
atoi(argv[on+1]);
374 cerr <<
" Invalid option following command line option -sob"
404 #if defined (AD_DEMO)
405 void write_banner_stuff(
void)
409 char banner0[56]={
"*****************************************************"};
410 char banner1[56]={
"This is the open source version of AD Model Builder"};
411 char banner1a[58]={
"You can freely use AD Model Builder"};
412 char banner2[30]={
"http://www.admb-project.org/"};
413 char banner3[55]={
"http://www.admb-project.org/"};
414 char banner4[60]={
"users@admb-project.org http://www.admb-project.org/"};
415 (*ad_printf)(
"\n%s\n", banner0);
416 (*ad_printf)(
"%s\n", banner1);
417 (*ad_printf)(
"%s\n", banner1a);
418 (*ad_printf)(
"%s\n", banner2);
419 (*ad_printf)(
"%s\n", banner3);
420 (*ad_printf)(
"%s\n", banner4);
422 (*ad_printf)(
"%s\n", banner0);
423 (*ad_printf)(
"%s\n\n", banner0);
436 for (
int i=5;i<=1000;i++)
438 rng.reinitialize(908);
439 v(1,i).fill_randn(rng);
440 for (
int j=2;j<=i;j++)
442 v(j)=0.9*v(j-1)+0.435889*v(j);
501 cerr <<
" Invalid option following command line option -mcmc -- "
513 cerr <<
"Invalid argument to option -mcmult" <<
endl;
528 cerr <<
" Invalid option following command line option -mcseed -- "
597 #if defined(USE_ADPVM)
619 cerr <<
" Invalid option following command line option -mcmc -- "
631 cerr <<
"Invalid argument to option -mcmult" <<
endl;
643 cerr <<
" Invalid option following command line option -mcseed -- "
bool hess_inv()
Symmetrize and invert the hessian.
void computations1(int argc, char *argv[])
laplace_approximation_calculator * lapprox
dcompressed_triplet * sparse_triplet2
static adpvm_manager * pvm_manager
Description not yet available.
void shmc_mcmc_routine(int, int, double, int)
imatrix & get_coords(void)
void nuts_mcmc_routine(int, int, double, int)
The function implements the MCMC algorithm NUTS, which is a self-tuning variant of Hamiltonian Monte ...
int allocated(const ivector &v)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Vector of double precision numbers.
int indexmin() const
Get minimum valid index.
virtual void other_calculations(void)
void allocate(int ncl, int ncu)
Allocate memory for a dvector.
virtual void set_runtime_maxfn(const char *)
static int sparse_hessian_flag
void test_mcmc_options_window(void)
void rwm_mcmc_routine(int, int, double, int)
void hybrid_mcmc_routine(int, int, double, int)
Description not yet available.
virtual void set_runtime(void)
void ADSleep(unsigned int t)
Description not yet available.
static adstring adprogram_name
static void send_all_to_slaves(void)
std::chrono::time_point< std::chrono::system_clock > start_time
void likeprof_routine(double global_min)
admb_javapointers * adjm_ptr
int atoi(adstring &s)
Returns a integer converted from input s.
std::string get_elapsed_time(const std::chrono::time_point< std::chrono::system_clock > &from, const std::chrono::time_point< std::chrono::system_clock > &to)
void ad_open_mcmchist_window(void)
void pvm_master_mcmc_computations(void)
void pvm_master_mcmc_routine(int nmcmc, int iseed0, double dscale, int restart_flag)
void pvm_slave_mcmc_routine(void)
void ad_open_mcmc_options_window(void)
Description not yet available.
void ad_update_mcmc_report(dmatrix &m, int i, int j, int ff=0)
prnstream & endl(prnstream &)
static dvector maximum_function_evaluations
static int max_number_phases
Description not yet available.
int indexmax() const
Get maximum valid index.
static void get_stddev_number_offset(void)
virtual void final_calcs(void)
static int have_constraints
static objective_function_value * pobjfun
Description not yet available.
Description not yet available.
void mcmc_computations(void)
void pvm_slave_mcmc_computations(void)
int option_match(int argc, char *argv[], const char *string)
Checks if the program has been invoked with a particular command line argument ("string").
void pvm_slave_likeprof_routine(void)
static int Hybrid_bounded_flag
void hess_step()
hess_step is used for HMC. See details in function_minimizer::hess_step.
Description not yet available.
static int test_trust_flag
void mcmc_routine(int, int, double, int)
Monte Carlo Markov Chain minimization routine Approximate the target distribution by performing a ran...
static void get_all_from_master(void)
dvector value(const df1_one_vector &v)
virtual void constraints_minimize(void)
void mcmc_eval(void)
Description not yet available.
void depvars_routine(void)
Calculate the derivatives of dependent variables with respect to the independent variables.
void tracing_message(int traceflag, const char *s)
Description not yet available.
static dvector convergence_criteria
static int first_hessian_flag
int ad_printf(FILE *stream, const char *format, Args...args)
virtual void set_runtime_crit(const char *)
void deallocate(void)
Called by destructor to deallocate memory for a dvector object.
virtual void minimize(void)
static int num_likeprof_params
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.