[ADMB Users] Command line options in scientific notation

Arni Magnusson arnima at hafro.is
Tue Dec 1 15:46:09 PST 2009


It's technically correct that in C++ 1e5 is a floating point number, but 
I'm already receiving thank-yous from users who find the scientific 
notation practical for passing large integers to -mcmc and -mcsave. I 
guess this will diminish the intense moments we've all had, carefully 
counting all the -mcmc zeros several times before hitting return and 
turning off the office light, when running MCMCs overnight.

My "improved command line parser" in its full glory was simply changing

   nmcmc=atoi(ad_comm::argv[on+1]);

to

   nmcmc=(int)atof(ad_comm::argv[on+1]);

for the -mcmc option, and the same thing for the -mcsave option.

---

I have also just submitted a proposed new set of user compilation scripts. 
The current scripts are true to the convention and crash if the user types

   admb mymodel.tpl

because as all seasoned ADMB users know, it's supposed to be

   admb mymodel

without the .tpl extension. The new scripts ignore filename extensions 
altogether, thus eliminating another ADMB quirk. This and the scientific 
-mcmc notation are minor modifications of the user interface, improving 
the DWIM (do what I mean) factor.

This discussion really belongs on developers at admb-project.org, but I guess 
I'm just priming the crowd before the full public source code release, 
when users can look up any small feature in the code and submit proposed 
improvements or new features. Since every ADMB user is a C++ programmer 
(at least in the procedure section), I'm sure we will see many good 
contributions from the user community in the coming year.

Arni



On Tue, 1 Dec 2009, dave fournier wrote:

> Well 1.e+5 is a floating point number and the -mcmc option takes an 
> integer. so it has nothing to do with understanding scientific notation. 
> -crit for example takes a floating point arguement and 1.e-5 works fine. 
> The real problme sems to be that R confuses integres and floating 
> points.



More information about the Users mailing list