[ADMB Users] How to use vector elements in PARAMETER_SECTION

Steve Teo - NOAA Federal steve.teo at noaa.gov
Tue Apr 2 16:08:25 PDT 2013


Beginner with ADMB here.  I am trying to read in a vector, which I then use
to set up the bounds in my parameter section.  The code runs if I
initialize the elements as numbers before I use them.  But it chokes if I
directly reference the vector element.  See below for example code.

Is there an elegant way of doing this without having to initialize lots of
numbers just to set up the bounds?

  init_vector x_input(1,2)

  number x_lb
  number x_ub
  !!x_lb = x_input[1];
  !!x_ub = x_input[2];

  init_bounded_number x(x_lb,x_ub) // works
  init_bounded_number x(x_input[1], x_input[2]) // does NOT work


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.admb-project.org/pipermail/users/attachments/20130402/88f42889/attachment.html>

More information about the Users mailing list