<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.7601.17537"></HEAD>
<BODY style="MARGIN: 4px 4px 1px; FONT: 10pt Segoe UI">
<DIV>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. </DIV>
<DIV> </DIV>
<DIV>Thanks,</DIV>
<DIV>Richard<BR><BR>>>> John Sibert <sibert@hawaii.edu> 25/10/2011 6:24 a.m. >>><BR>If you want x and y to be different objects, you can write<BR><BR>     df1b2variable x;<BR>     x = y;<BR><BR>There is information on the www about deep and shallow copies. For <BR>instance <BR><A href="http://www.learncpp.com/cpp-tutorial/912-shallow-vs-deep-copying/">http://www.learncpp.com/cpp-tutorial/912-shallow-vs-deep-copying/</A> has <BR>more than you probably want to know.<BR><BR>On 10/24/2011 06:42 AM, Mark Maunder wrote:<BR>><BR>> For your info<BR>><BR>> *From:*dave fournier [mailto:davef@otter-rsch.com]<BR>> *Sent:* Sunday, October 23, 2011 4:46 PM<BR>> *To:* Mark Maunder<BR>> *Cc:* developers@admb-project.org<BR>> *Subject:* Re: [Developers] FW: ADMB-RE<BR>><BR>> On 11-10-23 04:07 PM, Mark Maunder wrote:<BR>><BR>><BR>> When I developed ADMB Griewank wanted me to make the copy constructor for<BR>> dvariables to be a deep copy. This introduced all kinds of technical <BR>> difficulties<BR>> (hence the exestence of prevariables). It did not seem to have any <BR>> real advantage.<BR>> So for df1b2variables I went back to shallow copies. The only thing <BR>> you need to<BR>> lnow is that as you discovered<BR>><BR>>     df1b2variable x =y;<BR>><BR>> means that x and y are the same.  This is already the case for <BR>> dvar_vectors.<BR>><BR>> See below<BR>><BR>> *From:*Richard Bian [mailto:r.bian@niwa.co.nz]<BR>> *Sent:* Sunday, October 23, 2011 2:49 PM<BR>> *To:* Mark Maunder<BR>> *Subject:* ADMB-RE<BR>><BR>> Hi Mark,<BR>><BR>> When I code my model, I noticed something interesting in ADMB-RE. <BR>> Assuming x is a dvariable, if I declare another dvariable y this way, <BR>> dvariable y=x; then when I change y, x will be changed in the RE <BR>> round, but not in ordinary ADMB round. I guess when ADMB-RE converts <BR>> the tpl to cpp in the df1b2_parameters functions, it declares y as x's <BR>> reference rather than an normal variable. I didn't see this mentioned <BR>> in the manual, so I think I'd let you know about this.<BR>><BR>> Regards,<BR>><BR>> Richard<BR>><BR>> Richard Bian<BR>> National Institute of Water & Atmospheric Research<BR>> 41 Market Place<BR>> Auckland Central 1010, New Zealand<BR>> Tel: +64 9 375 2054  Fax: +64 9 375 2051<BR>><BR>> Please consider the environment before printing this email.<BR>><BR>> NIWA is the trading name of the National Institute of Water & <BR>> Atmospheric Research Ltd.<BR>><BR>>   <BR>>   <BR>> _______________________________________________<BR>> Developers mailing list<BR>> Developers@admb-project.org  <mailto:Developers@admb-project.org><BR>> <A href="http://lists.admb-project.org/mailman/listinfo/developers">http://lists.admb-project.org/mailman/listinfo/developers</A><BR>><BR>><BR>> _______________________________________________<BR>> Users mailing list<BR>> Users@admb-project.org<BR>> <A href="http://lists.admb-project.org/mailman/listinfo/users">http://lists.admb-project.org/mailman/listinfo/users</A><BR><BR>-- <BR>John Sibert<BR>Emeritus Researcher, SOEST<BR>University of Hawaii at Manoa<BR><BR>Visit the ADMB project <A href="http://admb-project.org/">http://admb-project.org/</A><BR><BR></DIV><BR>

    <div>
      Please consider the environment before printing this email.<br><br>NIWA 
      is the trading name of the National Institute of Water & Atmospheric 
      Research Ltd.
    </div>
  </BODY></HTML>