[ADMB Users] FW: [Developers] FW: ADMB-RE
Richard Bian
r.bian at niwa.co.nz
Mon Oct 24 12:47:46 PDT 2011
Then it would be better if ADMB disables dvariable y=x; because it may take hours for a user to find out it was kept as dvariable y=x; in ordinary ADMB, but translated to df1b2variable& y=x; in ADMB-RE or explains the difference in the manual.
Thanks,
Richard
>>> John Sibert <sibert at hawaii.edu> 25/10/2011 6:24 a.m. >>>
If you want x and y to be different objects, you can write
df1b2variable x;
x = y;
There is information on the www about deep and shallow copies. For
instance
http://www.learncpp.com/cpp-tutorial/912-shallow-vs-deep-copying/ has
more than you probably want to know.
On 10/24/2011 06:42 AM, Mark Maunder wrote:
>
> For your info
>
> *From:*dave fournier [mailto:davef at otter-rsch.com]
> *Sent:* Sunday, October 23, 2011 4:46 PM
> *To:* Mark Maunder
> *Cc:* developers at admb-project.org
> *Subject:* Re: [Developers] FW: ADMB-RE
>
> On 11-10-23 04:07 PM, Mark Maunder wrote:
>
>
> When I developed ADMB Griewank wanted me to make the copy constructor for
> dvariables to be a deep copy. This introduced all kinds of technical
> difficulties
> (hence the exestence of prevariables). It did not seem to have any
> real advantage.
> So for df1b2variables I went back to shallow copies. The only thing
> you need to
> lnow is that as you discovered
>
> df1b2variable x =y;
>
> means that x and y are the same. This is already the case for
> dvar_vectors.
>
> See below
>
> *From:*Richard Bian [mailto:r.bian at niwa.co.nz]
> *Sent:* Sunday, October 23, 2011 2:49 PM
> *To:* Mark Maunder
> *Subject:* ADMB-RE
>
> Hi Mark,
>
> When I code my model, I noticed something interesting in ADMB-RE.
> Assuming x is a dvariable, if I declare another dvariable y this way,
> dvariable y=x; then when I change y, x will be changed in the RE
> round, but not in ordinary ADMB round. I guess when ADMB-RE converts
> the tpl to cpp in the df1b2_parameters functions, it declares y as x's
> reference rather than an normal variable. I didn't see this mentioned
> in the manual, so I think I'd let you know about this.
>
> Regards,
>
> Richard
>
> Richard Bian
> National Institute of Water & Atmospheric Research
> 41 Market Place
> Auckland Central 1010, New Zealand
> Tel: +64 9 375 2054 Fax: +64 9 375 2051
>
> Please consider the environment before printing this email.
>
> NIWA is the trading name of the National Institute of Water &
> Atmospheric Research Ltd.
>
>
>
> _______________________________________________
> Developers mailing list
> Developers at admb-project.org <mailto:Developers at admb-project.org>
> http://lists.admb-project.org/mailman/listinfo/developers
>
>
> _______________________________________________
> Users mailing list
> Users at admb-project.org
> http://lists.admb-project.org/mailman/listinfo/users
--
John Sibert
Emeritus Researcher, SOEST
University of Hawaii at Manoa
Visit the ADMB project http://admb-project.org/
Please consider the environment before printing this email.
NIWA is the trading name of the National Institute of Water & Atmospheric Research Ltd.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.admb-project.org/pipermail/users/attachments/20111024/5bb9b0ad/attachment.html>
More information about the Users
mailing list