[ADMB Users] gradstack buffer size error

dave fournier davef at otter-rsch.com
Wed Feb 2 09:07:53 PST 2011


the function to turn the option into a long long int could look like

int get_option_number(const char * option_name,const char * error_message,
   long long int& option_value)
{
   int on1;
   int nopt;
   if ( (on1=option_match(ad_comm::argc,ad_comm::argv,option_name,nopt))>-1)
   {
     if (!nopt)
     {
       if (ad_printf)
         (*ad_printf)("%s\n",error_message);
       else
         cerr << error_message << endl;
       on1=-1;
     }
     else
     {
       option_value=atoll(ad_comm::argv[on1+1]);
     }
   }
   return on1;
}

The other functions like this are in xmodelm3.cpp

The code to set the option is

long long int ssz;

  nopt=get_option_number("-gbs",
       "-gbs option needs positive integer -- ignored",ssz);
     if (nopt>-1 && ssz>0) {
       gradient_structure::set_GRADSTACK_BUFFER_SIZE
         (ssz/sizeof(grad_stack_entry));
     }

So the stuff in gradient_structure will need to be changed to hold a 
long long int














More information about the Users mailing list