[ADMB Users] How to use vector elements in PARAMETER_SECTION
Steve Teo - NOAA Federal
steve.teo at noaa.gov
Tue Apr 2 16:40:03 PDT 2013
That's not it. I am not trying to declare the dimensions of a vector. I
am just trying to set up the bounds of a bounded parameter in the
PARM_SECTION. I know that if I declare a double first and then use that
double in the PARM_SECTION to set bounds, it works. But that is ugly
coding (6 lines and 3 variable names extra per parm). So I am wondering if
there is an elegant way of calling an element in the vector directly when
setting up the bounds and phases. If there is not, that's fine - just
wanted to know. Thanks.
On Tue, Apr 2, 2013 at 4:14 PM, Martell, Steven
<s.martell at fisheries.ubc.ca>wrote:
> You need to use vectors to declare the dimensions of a vector. your trying
> to use double precision numbers to delcare the dimensions:
> init_ivector x_input(1,2)
> int x_lb
> !! x_lb=x_input(1);
> init_bounded_number x(x_input(1),x_input(2))..
> On 2013-04-02, at 3:08 PM, Steve Teo - NOAA Federal <steve.teo at noaa.gov>
> > Hi,
> > 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?
> > DATA_SECTION
> > init_vector x_input(1,2)
> > number x_lb
> > number x_ub
> > !!x_lb = x_input;
> > !!x_ub = x_input;
> > PARAMETER_SECTION
> > init_bounded_number x(x_lb,x_ub) // works
> > init_bounded_number x(x_input, x_input) // does NOT work
> > Thanks.
> > Steve
> > _______________________________________________
> > Users mailing list
> > Users at admb-project.org
> > http://lists.admb-project.org/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Users