diff --git a/src/linad99/boundfun.cpp b/src/linad99/boundfun.cpp index 7b338643d..94b17e127 100644 --- a/src/linad99/boundfun.cpp +++ b/src/linad99/boundfun.cpp @@ -67,9 +67,9 @@ double dftinv(double x, double fmin, double fmax) { if (x <= fmin) { - ad_printf("variable out of bounds in dftinv\nvariable = %lg", x); - ad_printf("lower bound = %lg", fmin); - ad_printf("upper bound = %lg\n", fmax); + printf("variable out of bounds in dftinv\nvariable = %lg", x); + printf("lower bound = %lg", fmin); + printf("upper bound = %lg\n", fmax); x=dmin(fmin+.001,fmin+.01*(fmax-fmin)); } @@ -392,17 +392,17 @@ double boundpin(double x, double fmin, double fmax) { if (x < fmin) { - ad_printf("variable out of bounds in boundpin: variable = %lg", x); - ad_printf("; min = %lg", fmin); - ad_printf("; max = %lg\n", fmax); + printf("variable out of bounds in boundpin: variable = %lg", x); + printf("; min = %lg", fmin); + printf("; max = %lg\n", fmax); x=dmin(fmin+.001,fmin+.01*(fmax-fmin)); } if (x > fmax) { - ad_printf("variable out of bounds in boundpin: variable = %lg", x); - ad_printf("; min = %lg", fmin); - ad_printf("; max = %lg\n", fmax); + printf("variable out of bounds in boundpin: variable = %lg", x); + printf("; min = %lg", fmin); + printf("; max = %lg\n", fmax); x=dmax(fmax-.001,fmax-.01*(fmax-fmin)); } @@ -451,18 +451,18 @@ double boundpin(const prevariable& xx, double fmin, double fmax) if (x < fmin) { - ad_printf("variable out of bounds in boundpin: variable = %lg", x); - ad_printf("; min = %lg", fmin); - ad_printf("; max = %lg\n", fmax); + printf("variable out of bounds in boundpin: variable = %lg", x); + printf("; min = %lg", fmin); + printf("; max = %lg\n", fmax); x=dmin(fmin+.001,fmin+.01*(fmax-fmin)); } if (x > fmax) { - ad_printf("variable out of bounds in boundpin: variable = %lg", x); - ad_printf("; min = %lg", fmin); - ad_printf("; max = %lg\n", fmax); + printf("variable out of bounds in boundpin: variable = %lg", x); + printf("; min = %lg", fmin); + printf("; max = %lg\n", fmax); x=dmax(fmax-.001,fmax-.01*(fmax-fmin)); } diff --git a/src/linad99/conjprod.cpp b/src/linad99/conjprod.cpp index ce27cd01e..6319989a7 100644 --- a/src/linad99/conjprod.cpp +++ b/src/linad99/conjprod.cpp @@ -198,10 +198,10 @@ void fmmc::fmin(const double& fret, const dvector& _p, const dvector& _gg) { if (iprint>0) { - ad_printf("Gradient magnitude criterion satisfied\n"); - ad_printf("%d variables; iteration %ld; function evaluation %ld\n", + printf("Gradient magnitude criterion satisfied\n"); + printf("%d variables; iteration %ld; function evaluation %ld\n", n, iter, ifn); - ad_printf("Function value %le; maximum gradient component mag %le\n", + printf("Function value %le; maximum gradient component mag %le\n", fret, max(fabs(gg)) ); fmmdisp(p, gg, n, this->scroll_flag); //fmc); } @@ -254,10 +254,10 @@ void fmmc::fmin(const double& fret, const dvector& _p, const dvector& _gg) #if !defined (__WAT32__) && !defined (_MSC_VER) if (!scroll_flag) clrscr(); #endif - ad_printf("Initial statistics: "); - ad_printf("%d variables; iteration %ld; function evaluation %ld\n", + printf("Initial statistics: "); + printf("%d variables; iteration %ld; function evaluation %ld\n", n, iter, ifn); - ad_printf("Function value %le; maximum gradient component mag %le\n", + printf("Function value %le; maximum gradient component mag %le\n", fbest, max(fabs(*gbest)) ); fmmdisp(*xbest, *gbest, n, this->scroll_flag); //fmc); } @@ -303,11 +303,11 @@ void fmmc::fmin(const double& fret, const dvector& _p, const dvector& _gg) { if (iprint>0) { - ad_printf("User initiated interrupt\n"); - ad_printf(" - final statistics:\n"); - ad_printf("%d variables; iteration %ld; function evaluation %ld\n", + printf("User initiated interrupt\n"); + printf(" - final statistics:\n"); + printf("%d variables; iteration %ld; function evaluation %ld\n", n, iter, ifn); - ad_printf("Function value %le; maximum gradient component mag %le\n", + printf("Function value %le; maximum gradient component mag %le\n", fbest, max(fabs(*gbest)) ); fmmdisp(*xbest, *gbest, n, this->scroll_flag); //fmc); } @@ -359,9 +359,9 @@ void fmmc::fmin(const double& fret, const dvector& _p, const dvector& _gg) { if (iprint>0) { - ad_printf("%d variables; iteration %ld; function evaluation %ld\n", + printf("%d variables; iteration %ld; function evaluation %ld\n", n, iter, ifn); - ad_printf("Function value %le; maximum gradient component mag %le\n", + printf("Function value %le; maximum gradient component mag %le\n", fbest, max(fabs(*gbest)) ); fmmdisp(*xbest, *gbest, n, this->scroll_flag); //fmc); } @@ -411,10 +411,10 @@ void fmmc::fmin(const double& fret, const dvector& _p, const dvector& _gg) { if (iprint>0) { - ad_printf("Maximum number of function evaluations exceeded\n"); - ad_printf("%d variables; iteration %ld; function evaluation %ld\n", + printf("Maximum number of function evaluations exceeded\n"); + printf("%d variables; iteration %ld; function evaluation %ld\n", n, iter, ifn); - ad_printf("Function value %le; maximum gradient component mag %le\n", + printf("Function value %le; maximum gradient component mag %le\n", fbest, max(fabs(*gbest)) ); fmmdisp(*xbest, *gbest, n, this->scroll_flag); //fmc); } @@ -431,10 +431,10 @@ void fmmc::fmin(const double& fret, const dvector& _p, const dvector& _gg) #if !defined (__WAT32__) && !defined (_MSC_VER) if (!scroll_flag) clrscr(); #endif - ad_printf("Intermediate statistics: "); - ad_printf("%d variables; iteration %ld; function evaluation %ld\n", + printf("Intermediate statistics: "); + printf("%d variables; iteration %ld; function evaluation %ld\n", n, iter, ifn); - ad_printf("Function value %le; maximum gradient component mag %le\n", + printf("Function value %le; maximum gradient component mag %le\n", fbest, max(fabs(*gbest)) ); fmmdisp(*xbest, *gbest, n, this->scroll_flag); //fmc); } @@ -1067,7 +1067,7 @@ void derch(const double& _f, const dvector& _x, const dvector& _gg, int n, f = fsave; x(i)=xsave; g2=(f1-f2)/(2.*s); - ad_printf(" %12.5e %12.5e %12.5e %12.5e ; %5d \n", + printf(" %12.5e %12.5e %12.5e %12.5e ; %5d \n", x(i), f, g(i), g2, i); } // for loop } // while (j > 0) diff --git a/src/linad99/derch.cpp b/src/linad99/derch.cpp index cad33ac61..fc5a9ed34 100644 --- a/src/linad99/derch.cpp +++ b/src/linad99/derch.cpp @@ -222,7 +222,7 @@ void derch(const double& _f, const independent_variables & _x, << " " << setw(12) << perr << endl; } - ad_printf(" %12.5e %12.5e %12.5e %12.5e ; %5d \n", + printf(" %12.5e %12.5e %12.5e %12.5e ; %5d \n", x(i), f, g(i), g2, i); fflush(stdout); } diff --git a/src/linad99/df_file.cpp b/src/linad99/df_file.cpp index a9d13c0f3..bd8d31fcf 100644 --- a/src/linad99/df_file.cpp +++ b/src/linad99/df_file.cpp @@ -247,7 +247,7 @@ DF_FILE::DF_FILE(const size_t nbytes, const unsigned int id) #endif if (file_ptr == -1) { - ad_printf("Error opening temporary gradient" + printf("Error opening temporary gradient" " file %s\n", cmpdif_file_name ); ad_exit(1); } diff --git a/src/linad99/fmmtr1.cpp b/src/linad99/fmmtr1.cpp index 16f1438dc..81eabb762 100644 --- a/src/linad99/fmmtr1.cpp +++ b/src/linad99/fmmtr1.cpp @@ -228,9 +228,9 @@ void fmmt1::fmin(const double& _f, const dvector & _x, const dvector& _g) label7003: if (iprint!=0) { - ad_printf("%d variables; iteration %ld; function evaluation %ld\n", + printf("%d variables; iteration %ld; function evaluation %ld\n", n, itn, ifn); - ad_printf("Function value %12.4le; maximum gradient component mag %12.4le\n", + printf("Function value %12.4le; maximum gradient component mag %12.4le\n", f, gmax); } /*label7002:*/ @@ -365,7 +365,7 @@ label21 : { if (iprint>0) { - ad_printf(" ic > imax in fminim is answer attained ?\n" ); + printf(" ic > imax in fminim is answer attained ?\n" ); fmmdisp(x, g, n, this->scroll_flag,noprintx); } ihflag=1; @@ -475,13 +475,13 @@ label21 : if (iprint>0) { if (ihang == 1) - ad_printf("Function minimizer not making progress ... is minimum attained?\n"); + printf("Function minimizer not making progress ... is minimum attained?\n"); } if(iexit == 2) { if (iprint>0) { - ad_printf("*** grad transpose times delta x greater >= 0\n" + printf("*** grad transpose times delta x greater >= 0\n" " --- convergence critera may be too strict\n"); ireturn=-1; } @@ -493,21 +493,21 @@ label21 : { if (iprint>0) { - ad_printf("Maximum number of function evaluations exceeded"); + printf("Maximum number of function evaluations exceeded"); } } if (iprint>0) { if (quit_flag == 'Q' && use_control_c) - ad_printf("User initiated interrupt"); + printf("User initiated interrupt"); } if(iprint == 0) goto label777; - ad_printf(" - final statistics:\n"); - ad_printf("%d variables; iteration %ld; function evaluation %ld\n", + printf(" - final statistics:\n"); + printf("%d variables; iteration %ld; function evaluation %ld\n", n, itn, ifn); - ad_printf("Function value %12.4le; maximum gradient component mag %12.4le\n", + printf("Function value %12.4le; maximum gradient component mag %12.4le\n", f, gmax); - ad_printf("Exit code = %ld; converg criter %12.4le\n",iexit,crit); + printf("Exit code = %ld; converg criter %12.4le\n",iexit,crit); fmmdisp(x, g, n, this->scroll_flag,noprintx); label777: @@ -528,7 +528,7 @@ label21 : # if defined (_MSC_VER) && !defined (__WAT32__) if (!scroll_flag) clrscr(); #endif - ad_printf("Initial statistics: "); + printf("Initial statistics: "); } goto label7003; label7010: @@ -537,14 +537,14 @@ label21 : # if defined (_MSC_VER) && !defined (__WAT32__) if (!scroll_flag) clrscr(); #endif - ad_printf("Intermediate statistics: "); + printf("Intermediate statistics: "); } llog=0; goto label7003; label7020: if (iprint>0) { - ad_printf("*** hessian not positive definite\n"); + printf("*** hessian not positive definite\n"); } #ifdef __ZTC__ if (ireturn <= 0) diff --git a/src/linad99/fvar.hpp b/src/linad99/fvar.hpp index 2aa66eb5d..f9f917837 100644 --- a/src/linad99/fvar.hpp +++ b/src/linad99/fvar.hpp @@ -9488,6 +9488,7 @@ dmatrix make_dmatrix(dcompressed_triplet & M); int norm2(const ivector &); int sumsq(const ivector & v); +/* template int ad_printf( FILE* stream, const char* format, Args ... args ) { @@ -9496,13 +9497,9 @@ int ad_printf( FILE* stream, const char* format, Args ... args ) template int ad_printf( const char* format, Args ... args ) { - /* - int result = printf(format, args...); - fflush(stdout); - return result; - */ return printf(format, args...); } +*/ std::ostream& get_output_stream(); dvariable dtweedie(const double y, dvariable& mu, dvariable& phi, dvariable& p, const bool use_log); diff --git a/src/linad99/fvar_arr.cpp b/src/linad99/fvar_arr.cpp index ef8831596..dd1ee8058 100644 --- a/src/linad99/fvar_arr.cpp +++ b/src/linad99/fvar_arr.cpp @@ -167,13 +167,13 @@ void gradient_structure::make_indvar_list(const dvar_vector& t) unsigned int size = (unsigned int)(max - min + 1); if (size > gradient_structure::MAX_NVAR_OFFSET) { - ad_printf("Current maximum number of independent variables is %d\n", + printf("Current maximum number of independent variables is %d\n", gradient_structure::MAX_NVAR_OFFSET); - ad_printf(" You need to increase the global variable " + printf(" You need to increase the global variable " "MAX_NVAR_OFFSET to %d\n", size); - ad_printf(" This can be done by putting the line\n" + printf(" This can be done by putting the line\n" " gradient_structure::set_MAX_NVAR_OFFSET(%d);\n", size); - ad_printf(" before the declaration of the gradient_structure object.\n" + printf(" before the declaration of the gradient_structure object.\n" " or the command line option -mno %d\n", size); /* cerr << "Current maximum number of independent variables is " diff --git a/src/linad99/gradstak.cpp b/src/linad99/gradstak.cpp index a3aee6950..d2be7c4ea 100644 --- a/src/linad99/gradstak.cpp +++ b/src/linad99/gradstak.cpp @@ -471,7 +471,7 @@ void grad_stack::create_gradfile() if (_GRADFILE_PTR1 == -1) { - ad_printf("Error opening temporary gradient file" + printf("Error opening temporary gradient file" " %s\n",gradfile_name1); ad_exit(1); } diff --git a/src/linad99/gradstrc.cpp b/src/linad99/gradstrc.cpp index 0ab668f8d..e15e89130 100644 --- a/src/linad99/gradstrc.cpp +++ b/src/linad99/gradstrc.cpp @@ -54,8 +54,8 @@ extern "C"{ void spdll_exit(int ierr) { - ad_printf(" Exception -- error code %d\n",ierr); - ad_printf(" Pause"); + printf(" Exception -- error code %d\n",ierr); + printf(" Pause"); //adwait(4.0); #if defined(USE_EXCEPTIONS) throw spdll_exception(ierr); diff --git a/src/linad99/newfmin.cpp b/src/linad99/newfmin.cpp index c80af1e17..676644043 100644 --- a/src/linad99/newfmin.cpp +++ b/src/linad99/newfmin.cpp @@ -68,7 +68,7 @@ BOOL CtrlHandler(DWORD fdwCtrlType) if (ctlc_flag) ad_exit(1); ctlc_flag = 1; - ad_printf("\npress q to quit or c to invoke derivative checker: "); + printf("\npress q to quit or c to invoke derivative checker: "); return true; } return false; @@ -78,7 +78,7 @@ extern "C" void onintr(int k) { signal(SIGINT, exit_handler); ctlc_flag = 1; - ad_printf("\npress q to quit or c to invoke derivative checker" + printf("\npress q to quit or c to invoke derivative checker" " or s to stop optimizing: "); } #endif @@ -522,7 +522,7 @@ void fmm::fmin(const double& _f, const dvector &_x, const dvector& _g) adstring maxparname = get_maxparname(maxpar); if (itn % iprint == 0) { - ad_printf("phase=%2d | nvar=%3d | iter=%3d | nll=%.2e | mag=%.2e | par[%3d]=%s\n", + printf("phase=%2d | nvar=%3d | iter=%3d | nll=%.2e | mag=%.2e | par[%3d]=%s\n", initial_params::current_phase, n, itn, double(f), fabs(double(gmax)), maxpar, (char*)maxparname); } } @@ -826,7 +826,7 @@ label21 : /* Calculating Newton step */ ialph=1; if (ialph) { - ad_printf("\nFunction minimizer: Step size" + printf("\nFunction minimizer: Step size" " too small -- ialph=1"); } return; @@ -953,7 +953,7 @@ if(iexit == 2) { if (iprint>0) { - ad_printf("*** grad transpose times delta x greater >= 0\n" + printf("*** grad transpose times delta x greater >= 0\n" " --- convergence critera may be too strict\n"); ireturn=-1; } @@ -976,7 +976,7 @@ if (scroll_flag == 0) clrscr(); if (iprint>0) { if (quit_flag == 'Q') - ad_printf("User initiated interrupt"); + printf("User initiated interrupt"); } // if last iteration of phase print to screen regardless of // iprint. Note that for RE models it is sometimes set iprint=0 @@ -993,7 +993,7 @@ if (iprint>0) int maxpar = get_maxpar(g); adstring maxparname = get_maxparname(maxpar); if(iprint>0) - ad_printf("phase=%2d | nvar=%3d | iter=%3d | nll=%.2e | mag=%.2e | par[%3d]=%s\n", + printf("phase=%2d | nvar=%3d | iter=%3d | nll=%.2e | mag=%.2e | par[%3d]=%s\n", initial_params::current_phase, n, itn, double(f), fabs(double(gmax)), maxpar, (char*)maxparname); // only print global stuff if in last phase @@ -1003,7 +1003,7 @@ if (iprint>0) << get_elapsed_time(start_time, std::chrono::system_clock::now()) << " with final statistics:\n" ; cout.flush(); - ad_printf(" nll=%f | mag=%.5e | par[%3d]=%s\n\n", double(f), fabs(double(gmax)), maxpar, (char*)maxparname); + printf(" nll=%f | mag=%.5e | par[%3d]=%s\n\n", double(f), fabs(double(gmax)), maxpar, (char*)maxparname); if (initial_params::num_initial_params && function_minimizer::output_flag==1){ check_for_params_on_bounds(std::cout); @@ -1038,7 +1038,7 @@ if(iprint == 0) goto label777; label777: /* Printing final Hessian approximation */ if (ireturn <= 0) #ifdef DIAG - ad_printf("Final values of h in fmin:\n"); + printf("Final values of h in fmin:\n"); //cout << h << "\n"; #endif #ifdef __ZTC__ @@ -1069,7 +1069,7 @@ if(iprint == 0) goto label777; label7020:/* Exis because Hessian is not positive definite */ if (iprint > 0) { - ad_printf("*** hessian not positive definite\n"); + printf("*** hessian not positive definite\n"); } #ifdef __ZTC__ if (ireturn <= 0) diff --git a/src/linad99/scbound.cpp b/src/linad99/scbound.cpp index 9f67b5b49..ad536bb2d 100644 --- a/src/linad99/scbound.cpp +++ b/src/linad99/scbound.cpp @@ -118,18 +118,18 @@ double boundpin(double x, double fmin, double fmax,const double& s) if (x < fmin) { - ad_printf("variable out of bounds in boundpin: variable = %lg", x); - ad_printf("; min = %lg", fmin); - ad_printf("; max = %lg\n", fmax); + printf("variable out of bounds in boundpin: variable = %lg", x); + printf("; min = %lg", fmin); + printf("; max = %lg\n", fmax); x=dmin(fmin+.001,fmin+.01*(fmax-fmin)); } if (x > fmax) { - ad_printf("variable out of bounds in boundpin: variable = %lg", x); - ad_printf("; min = %lg", fmin); - ad_printf("; max = %lg\n", fmax); + printf("variable out of bounds in boundpin: variable = %lg", x); + printf("; min = %lg", fmin); + printf("; max = %lg\n", fmax); x=dmax(fmax-.001,fmax-.01*(fmax-fmin)); } diff --git a/src/linad99/scbound1.cpp b/src/linad99/scbound1.cpp index efc22f804..e70f654fa 100644 --- a/src/linad99/scbound1.cpp +++ b/src/linad99/scbound1.cpp @@ -33,18 +33,18 @@ double boundpin(const prevariable& xx, double fmin, double fmax,const double& s) if (x < fmin) { - ad_printf("variable out of bounds in boundpin: variable = %lg", x); - ad_printf("; min = %lg", fmin); - ad_printf("; max = %lg\n", fmax); + printf("variable out of bounds in boundpin: variable = %lg", x); + printf("; min = %lg", fmin); + printf("; max = %lg\n", fmax); x=dmin(fmin+.001,fmin+.01*(fmax-fmin)); } if (x > fmax) { - ad_printf("variable out of bounds in boundpin: variable = %lg", x); - ad_printf("; min = %lg", fmin); - ad_printf("; max = %lg\n", fmax); + printf("variable out of bounds in boundpin: variable = %lg", x); + printf("; min = %lg", fmin); + printf("; max = %lg\n", fmax); x=dmax(fmax-.001,fmax-.01*(fmax-fmin)); } diff --git a/src/nh99/lmnewton.cpp b/src/nh99/lmnewton.cpp index 31d5067da..b3f9f29a6 100644 --- a/src/nh99/lmnewton.cpp +++ b/src/nh99/lmnewton.cpp @@ -155,26 +155,26 @@ void function_minimizer::limited_memory_quasi_newton( { if (!itn) { - ad_printf("\nInitial statistics: "); + printf("\nInitial statistics: "); } else { - ad_printf("\nIntermediate statistics: "); + printf("\nIntermediate statistics: "); } - ad_printf( + printf( "%d variables; iteration %ld; function evaluation %ld\n", nvar, itn, ifn); if (!itn) { - ad_printf( + printf( "Function value %12.4le; maximum gradient component mag %12.4le\n", f, max(fabs(g))); } else { - ad_printf( + printf( "Function value %12.4le; maximum gradient component mag %12.4le\n", fbest, max(gbest) ); @@ -212,12 +212,12 @@ void function_minimizer::limited_memory_quasi_newton( L50: if (iprint>0) { - ad_printf("\nfinal statistics: "); + printf("\nfinal statistics: "); - ad_printf( + printf( "%d variables; iteration %ld; function evaluation %ld\n", nvar, itn, ifn); - ad_printf( + printf( "Function value %12.4le; maximum gradient component mag %12.4le\n", f, max(g)); fmmdisp(x, g, nvar, 0,noprintx); @@ -311,26 +311,26 @@ void function_minimizer::limited_memory_quasi_newton { if (!itn) { - ad_printf("\nInitial statistics: "); + printf("\nInitial statistics: "); } else { - ad_printf("\nIntermediate statistics: "); + printf("\nIntermediate statistics: "); } - ad_printf( + printf( "%d variables; iteration %ld; function evaluation %ld\n", nvar, itn, ifn); if (!itn) { - ad_printf( + printf( "Function value %12.4le; maximum gradient component mag %12.4le\n", f, max(g)); } else { - ad_printf( + printf( "Function value %12.4le; maximum gradient component mag %12.4le\n", fbest, max(gbest)); } @@ -366,10 +366,10 @@ void function_minimizer::limited_memory_quasi_newton L50: if (iprint>0) { - ad_printf("\nfinal statistics: "); - ad_printf("%d variables; iteration %ld; function evaluation %ld\n", + printf("\nfinal statistics: "); + printf("%d variables; iteration %ld; function evaluation %ld\n", nvar, itn, ifn); - ad_printf( + printf( "Function value %12.4le; maximum gradient component mag %12.4le\n", f, max(g)); fmmdisp(x, g, nvar, 0,noprintx); diff --git a/src/nh99/model7.cpp b/src/nh99/model7.cpp index b113e15fd..b8d5895d8 100644 --- a/src/nh99/model7.cpp +++ b/src/nh99/model7.cpp @@ -158,203 +158,203 @@ ad_comm::ad_comm(int _argc,char * _argv[]) } //(*ad_printf)(" %s", (char*)admb_banner); - ad_printf( "Usage: %s [options]\n\n",(char*)(adprogram_name)); + printf( "Usage: %s [options]\n\n",(char*)(adprogram_name)); - ad_printf( "Options:\n"); - ad_printf( " -ainp FILE change default ascii input parameter " + printf( "Options:\n"); + printf( " -ainp FILE change default ascii input parameter " "filename to FILE\n"); - ad_printf( " -binp FILE change default binary input parameter " + printf( " -binp FILE change default binary input parameter " "filename to FILE\n"); - ad_printf( " -est only do the parameter estimation\n"); - ad_printf( " -noest do not do the parameter estimation " + printf( " -est only do the parameter estimation\n"); + printf( " -noest do not do the parameter estimation " "(optimization)\n"); - ad_printf( " -ind FILE change default input data filename to " + printf( " -ind FILE change default input data filename to " "FILE\n"); - ad_printf( " -lmn N use limited memory quasi newton -- keep " + printf( " -lmn N use limited memory quasi newton -- keep " "N steps\n"); - ad_printf( " -lmn2 N use other limited memory quasi newton -- " + printf( " -lmn2 N use other limited memory quasi newton -- " "keep N steps\n"); - ad_printf( " -ilmn N use other limited memory quasi newton " + printf( " -ilmn N use other limited memory quasi newton " "for random effects models - keep N steps\n"); - ad_printf( " -dd N check derivatives after N function " + printf( " -dd N check derivatives after N function " "evaluations\n"); - ad_printf( " -lprof perform profile likelihood " + printf( " -lprof perform profile likelihood " "calculations\n"); - ad_printf( " -maxph N increase the maximum phase number to " + printf( " -maxph N increase the maximum phase number to " "N\n"); - ad_printf( " -mcdiag use diagonal covariance matrix for mcmc " + printf( " -mcdiag use diagonal covariance matrix for mcmc " "with diagonal values 1\n"); - ad_printf( " -mcmc [N] perform markov chain monte carlo with N " + printf( " -mcmc [N] perform markov chain monte carlo with N " "simulations\n"); - ad_printf( " -mcmult N multiplier N for mcmc default\n"); - ad_printf( " -mcr resume previous mcmc\n"); - ad_printf( " -mcrb N reduce amount of correlation in the " + printf( " -mcmult N multiplier N for mcmc default\n"); + printf( " -mcr resume previous mcmc\n"); + printf( " -mcrb N reduce amount of correlation in the " "covariance matrix 1<=N<=9\n"); - ad_printf( " -mcnoscale don't rescale step size for mcmc " + printf( " -mcnoscale don't rescale step size for mcmc " "depending on acceptance rate\n"); - ad_printf( " -nosdmcmc turn off mcmc histogram calcs to make " + printf( " -nosdmcmc turn off mcmc histogram calcs to make " "mcsave run faster\n"); - ad_printf( " -mcprobe N use probing strategy for mcmc with " + printf( " -mcprobe N use probing strategy for mcmc with " "factor N\n"); - ad_printf( " -mcgrope N Deprecated, same as -mcprobe\n"); - ad_printf( " -mcseed N seed for random number generator for " + printf( " -mcgrope N Deprecated, same as -mcprobe\n"); + printf( " -mcseed N seed for random number generator for " "markov chain monte carlo\n"); - ad_printf( " -mcscale N rescale step size for first N " + printf( " -mcscale N rescale step size for first N " "evaluations\n"); - ad_printf( " -mcsave N save the parameters for every Nth " + printf( " -mcsave N save the parameters for every Nth " "simulation\n"); - ad_printf( " -mceval go through the saved mcmc values from a " + printf( " -mceval go through the saved mcmc values from a " "previous mcsave\n"); - ad_printf( " -nuts MCMC draws with the no-U-turn sampler\n"); - ad_printf( " -rwm MCMC draws with a Metopolis sampler.\n"); - ad_printf( " -mcu use uniformly distributed steps for " + printf( " -nuts MCMC draws with the no-U-turn sampler\n"); + printf( " -rwm MCMC draws with a Metopolis sampler.\n"); + printf( " -mcu use uniformly distributed steps for " "mcmc instead of random normal\n"); - ad_printf( " -crit N1,N2,... set gradient magnitude convergence " + printf( " -crit N1,N2,... set gradient magnitude convergence " "criterion to N\n"); - ad_printf( " -iprint N print out function minimizer report " + printf( " -iprint N print out function minimizer report " "every N iterations (default %i).\n", defaults::iprint); - ad_printf( " -maxfn N1,N2,.. set maximum number opf function eval's " + printf( " -maxfn N1,N2,.. set maximum number opf function eval's " "to N\n"); - ad_printf( " -rs if function minimizer can't make " + printf( " -rs if function minimizer can't make " "progress rescale and try again\n"); //(*ad_printf)( " -sp for DLL running from splus write to " //"command window\n"); - ad_printf( " -nox suppress vector and gradient values in " + printf( " -nox suppress vector and gradient values in " "minimizer screen report\n"); - ad_printf( " -phase N start minimization in phase N\n"); - ad_printf( " -simplex use simplex for minimization -- " + printf( " -phase N start minimization in phase N\n"); + printf( " -simplex use simplex for minimization -- " "deprecated, use -neldmead\n"); - ad_printf( " -neldmead use Nelder-Mead simplex algorithm for " + printf( " -neldmead use Nelder-Mead simplex algorithm for " "minimization\n"); - ad_printf( " -nohess don't do hessian or delta method for std " + printf( " -nohess don't do hessian or delta method for std " "dev\n"); - ad_printf( " -eigvec calculate eigenvectors of the Hessian\n"); - ad_printf( " -sdonly do delta method for std dev estimates " + printf( " -eigvec calculate eigenvectors of the Hessian\n"); + printf( " -sdonly do delta method for std dev estimates " "without redoing hessian\n"); - ad_printf( " -ams N set arrmblsize to N " + printf( " -ams N set arrmblsize to N " "(ARRAY_MEMBLOCK_SIZE)\n"); - ad_printf( " -cbs N set CMPDIF_BUFFER_SIZE to N " + printf( " -cbs N set CMPDIF_BUFFER_SIZE to N " "(ARRAY_MEMBLOCK_SIZE)\n"); - ad_printf( " -mno N set the maximum number of independent " + printf( " -mno N set the maximum number of independent " "variables to N\n"); - ad_printf( " -mdl N set the maximum number of dvariables to " + printf( " -mdl N set the maximum number of dvariables to " "N\n"); - ad_printf( " -gbs N set GRADSTACK_BUFFER_SIZE to N " + printf( " -gbs N set GRADSTACK_BUFFER_SIZE to N " "(ARRAY_MEMBLOCK_SIZE)\n"); - ad_printf( " -hess_step N take N Newton steps with inverse Hessian\n"); - ad_printf( " -hess_step_tol eps set hess_step tolerance to eps\n"); - ad_printf( " -mip N set maximum the number of initial parameters " + printf( " -hess_step N take N Newton steps with inverse Hessian\n"); + printf( " -hess_step_tol eps set hess_step tolerance to eps\n"); + printf( " -mip N set maximum the number of initial parameters " "to a value N that is greater than zero (default is 4000).\n"); #if defined(USE_ADPVM) - ad_printf( " -master run as PVM master program\n"); - ad_printf( " -slave run as PVM slave program\n"); - ad_printf( " -pvmtime record timing information for PVM " + printf( " -master run as PVM master program\n"); + printf( " -slave run as PVM slave program\n"); + printf( " -pvmtime record timing information for PVM " "performance analysis\n"); #endif - ad_printf( " -display N N sets display output with \'0\' for quiet display, " + printf( " -display N N sets display output with \'0\' for quiet display, " "\'1\' for concise display, or \'2\' for legacy display (default is %i).\n", defaults::output); - ad_printf( " -info show how to cite ADMB, license, and " + printf( " -info show how to cite ADMB, license, and " "acknowledgements\n"); - ad_printf( " -version show version information\n"); - ad_printf( " -help show this message\n\n"); + printf( " -version show version information\n"); + printf( " -help show this message\n\n"); //if (function_minimizer::random_effects_flag) //{ - ad_printf( "Random effects options if applicable\n"); - ad_printf( " -nr N maximum number of Newton-Raphson " + printf( "Random effects options if applicable\n"); + printf( " -nr N maximum number of Newton-Raphson " "steps\n"); - ad_printf( " -imaxfn N maximum number of evals in quasi-Newton " + printf( " -imaxfn N maximum number of evals in quasi-Newton " "inner optimization\n"); - ad_printf( " -is N set importance sampling size to N\n"); - ad_printf( " -isf N set importance sampling size funnel " + printf( " -is N set importance sampling size to N\n"); + printf( " -isf N set importance sampling size funnel " "blocks to N\n"); - ad_printf( " -isdiag print importance sampling diagnostics\n"); - ad_printf( " -hybrid do hybrid Monte Carlo version of MCMC\n"); - ad_printf( " -hbf set the hybrid bounded flag for bounded " + printf( " -isdiag print importance sampling diagnostics\n"); + printf( " -hybrid do hybrid Monte Carlo version of MCMC\n"); + printf( " -hbf set the hybrid bounded flag for bounded " "parameters\n"); - ad_printf( " -hyeps mean step size for hybrid Monte Carlo\n"); - ad_printf( " -hynstep number of steps for hybrid Monte " + printf( " -hyeps mean step size for hybrid Monte Carlo\n"); + printf( " -hynstep number of steps for hybrid Monte " "Carlo\n"); - ad_printf( " -noinit do not initialize RE before inner " + printf( " -noinit do not initialize RE before inner " "optimization\n"); - ad_printf( " -ndi N set maximum number of separable calls\n"); - ad_printf( " -ndb N set number of blocks for RE derivatives " + printf( " -ndi N set maximum number of separable calls\n"); + printf( " -ndb N set number of blocks for RE derivatives " "(reduce temp file size)\n"); - ad_printf( " -ddnr use high precision Newton-Raphson, for " + printf( " -ddnr use high precision Newton-Raphson, for " "banded Hessian case only\n"); - ad_printf( " -nrdbg verbose reporting for debugging " + printf( " -nrdbg verbose reporting for debugging " "newton-raphson\n"); # if defined(__MINI_MAX__) - ad_printf( " -mm N do minimax optimization\n"); + printf( " -mm N do minimax optimization\n"); # endif - ad_printf( " -shess use sparse Hessian structure inner " + printf( " -shess use sparse Hessian structure inner " "optimzation\n\n"); - ad_printf("Read online documentation at http://admb-project.org\n"); - ad_printf("Contact for help.\n"); + printf("Read online documentation at http://admb-project.org\n"); + printf("Contact for help.\n"); //} ad_exit(0); } else if (option_match(_argc,_argv,"-info") > -1) { - ad_printf("ADMB Information\n"); - ad_printf("================\n\n"); + printf("ADMB Information\n"); + printf("================\n\n"); - ad_printf("How to Cite ADMB\n"); - ad_printf("----------------\n\n"); + printf("How to Cite ADMB\n"); + printf("----------------\n\n"); - ad_printf("Fournier, D.A., H.J. Skaug, J. Ancheta, J. Ianelli, " + printf("Fournier, D.A., H.J. Skaug, J. Ancheta, J. Ianelli, " "A. Magnusson, M.N. Maunder,\n"); - ad_printf("A. Nielsen, and J. Sibert. 2012. AD Model Builder: using " + printf("A. Nielsen, and J. Sibert. 2012. AD Model Builder: using " "automatic\n"); - ad_printf("differentiation for statistical inference of highly " + printf("differentiation for statistical inference of highly " "parameterized complex\n"); - ad_printf("nonlinear models. Optim. Methods Softw. 27:233-249.\n\n"); + printf("nonlinear models. Optim. Methods Softw. 27:233-249.\n\n"); //(*ad_printf)(" %s", (char*)admb_banner); - ad_printf("License\n"); - ad_printf("-------\n\n"); + printf("License\n"); + printf("-------\n\n"); - ad_printf("Copyright (c) 2008-2021\n"); - ad_printf("ADMB Foundation and Regents of the University of California\n\n"); - ad_printf("ADMB is free software and comes with ABSOLUTELY NO " + printf("Copyright (c) 2008-2021\n"); + printf("ADMB Foundation and Regents of the University of California\n\n"); + printf("ADMB is free software and comes with ABSOLUTELY NO " "WARRANTY.\n"); - ad_printf("You are welcome to redistribute it under certain " + printf("You are welcome to redistribute it under certain " "conditions.\n\n"); - ad_printf("AD Model Builder, or ADMB, was developed by David Fournier " + printf("AD Model Builder, or ADMB, was developed by David Fournier " "of Otter Research\n"); - ad_printf("Ltd, Sidney, BC, Canada. In 2007, scientists from the " + printf("Ltd, Sidney, BC, Canada. In 2007, scientists from the " "University of Hawai'i at\n"); - ad_printf("Manoa Pelagic Fisheries Research Program (John Sibert and " + printf("Manoa Pelagic Fisheries Research Program (John Sibert and " "Anders Nielsen) and\n"); - ad_printf("the Inter-American Tropical Tuna Commission (Mark " + printf("the Inter-American Tropical Tuna Commission (Mark " "Maunder), in consultation with\n"); - ad_printf("scientists from NOAA Fisheries (Richard Methot), created " + printf("scientists from NOAA Fisheries (Richard Methot), created " "the non-profit ADMB\n"); - ad_printf("Foundation (admb-foundation.org) with the goal of " + printf("Foundation (admb-foundation.org) with the goal of " "increasing the number of ADMB\n"); - ad_printf("users by making the software free and open source. In " + printf("users by making the software free and open source. In " "partnership with NOAA\n"); - ad_printf("Fisheries and the National Center for Ecological Analysis " + printf("Fisheries and the National Center for Ecological Analysis " "and Synthesis (NCEAS,\n"); - ad_printf("www.nceas.ucsb.edu), the ADMB Foundation obtained funding " + printf("www.nceas.ucsb.edu), the ADMB Foundation obtained funding " "from the Gordon and\n"); - ad_printf("Betty Moore Foundation (www.moore.org) to acquire the " + printf("Betty Moore Foundation (www.moore.org) to acquire the " "copyright to the ADMB\n"); - ad_printf("software suite, in order to make it broadly and freely " + printf("software suite, in order to make it broadly and freely " "available to the research\n"); - ad_printf("community. In 2008 the copyright was transferred from " + printf("community. In 2008 the copyright was transferred from " "Otter Research Ltd to the\n"); - ad_printf("University of California. The binary files were released " + printf("University of California. The binary files were released " "in November 2008 and\n"); - ad_printf("the source code was released in December 2009. More " + printf("the source code was released in December 2009. More " "information about the ADMB\n"); - ad_printf("Project can be found at admb-project.org.\n\n"); - ad_printf("ADMB was originally developed by David Fournier of Otter " + printf("Project can be found at admb-project.org.\n\n"); + printf("ADMB was originally developed by David Fournier of Otter " "Research Ltd.\n\n"); - ad_printf("It is now maintained by the ADMB Core Team, whose members " + printf("It is now maintained by the ADMB Core Team, whose members " "are listed on\n"); - ad_printf("http://admb-project.org/developers/core-team.\n"); + printf("http://admb-project.org/developers/core-team.\n"); ad_exit(0); } diff --git a/src/nh99/randeff.cpp b/src/nh99/randeff.cpp index f31258757..f3c718b88 100644 --- a/src/nh99/randeff.cpp +++ b/src/nh99/randeff.cpp @@ -153,21 +153,21 @@ dvariable function_minimizer::random_effects_maximization(const dvar_vector& _x) { if (!itn) { - ad_printf("\nInitial statistics: "); + printf("\nInitial statistics: "); } else { - ad_printf("\nIntermediate statistics: "); + printf("\nIntermediate statistics: "); } - ad_printf("%d variables; iteration %ld; function evaluation %ld\n", + printf("%d variables; iteration %ld; function evaluation %ld\n", nvar, itn, ifn); if (!itn) { double xf=value(f); double xg=max(value(g)); - ad_printf( + printf( "Function value %12.4le; maximum gradient component mag %12.4le\n", xf, xg); } @@ -175,7 +175,7 @@ dvariable function_minimizer::random_effects_maximization(const dvar_vector& _x) { double xf=value(fbest); double xg=max(value(gbest)); - ad_printf( + printf( "Function value %12.4le; maximum gradient component mag %12.4le\n", xf, xg); } @@ -219,10 +219,10 @@ dvariable function_minimizer::random_effects_maximization(const dvar_vector& _x) { double xf=value(f); double xg=max(value(g)); - ad_printf("\nfinal statistics: "); - ad_printf("%d variables; iteration %ld; function evaluation %ld\n", + printf("\nfinal statistics: "); + printf("%d variables; iteration %ld; function evaluation %ld\n", nvar, itn, ifn); - ad_printf( + printf( "Function value %12.4le; maximum gradient component mag %12.4le\n", xf, xg); fmmdisp(value(x),value(g), nvar, 0,noprintx); diff --git a/src/nh99/xmodelm3.cpp b/src/nh99/xmodelm3.cpp index 713ad29d4..318dfbf7c 100644 --- a/src/nh99/xmodelm3.cpp +++ b/src/nh99/xmodelm3.cpp @@ -687,7 +687,7 @@ int get_option_number(const char * option_name,const char * error_message, { if (!nopt) { - ad_printf("%s\n",error_message); + printf("%s\n",error_message); // cerr << error_message << endl; on1=-1; } @@ -712,7 +712,7 @@ int get_option_number(const char * option_name,const char * error_message, { if (!nopt) { - ad_printf("%s\n",error_message); + printf("%s\n",error_message); // cerr << error_message << endl; on1=-1; }