<div dir="ltr">If you redefine all the dvariables in the function signature as prevariables, you may be ok (as long as you don't try passing in a double, which the last error in your error output seems to be indicating). This is because (if I followed things correctly in the online documentation):<div>
<br></div><div>     param_init_number inherits from named_dvariable, which inherits from dvariable, which inherits from prevariable. </div><div><br></div><div>which you can partly see from the "Class Hierarchy" entry regarding prevariable on the online documentation (although param_init_number is missing). It would be a nice feature in the documentation if you could see the class hierarchy tree starting from the most-derived (param_init_number, in this case) to the base class(es).</div>
<div><br></div><div>Buck</div></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr"><font face="courier new, monospace">***************************************************<br>* Dr. William T. Stockhausen                      *<br>
***************************************************<br>* Resource Ecology and Fisheries Management       *<br>* Alaska Fisheries Science Center                 *<br>* National Marine Fisheries Service               *<br>* National Oceanic and Atmospheric Administration *<br>
* 7600 Sand Point Way N.E.                        *<br>* Seattle, Washington 98115-6349                  *<br>***************************************************<br>* email: <a href="mailto:William.Stockhausen@noaa.gov" target="_blank">William.Stockhausen@noaa.gov</a>             *<br>
* voice: 206-526-4241 fax: 206-526-6723           *<br>* web  : <a href="http://www.afsc.noaa.gov" target="_blank">http://www.afsc.noaa.gov</a>                 *<br>***************************************************<br>All models are wrong, some are useful.--G.E.P. Box<br>
Beware of geeks bearing equations.    --W. Buffett<br>***************************************************<br>Disclaimer: The opinions expressed above are personal <br>and do not necessarily reflect official NOAA policy.<br>
</font><br><br></div></div>
<br><br><div class="gmail_quote">On Tue, Aug 12, 2014 at 12:51 PM, Mark Maunder <span dir="ltr"><<a href="mailto:mmaunder@iattc.org" target="_blank">mmaunder@iattc.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">






<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Any comments on the use of templates messing up the various forms of dvariable and the automatic translation between the different forms of dvariable (sorry
 for not using the right terminology). I think the beneficial use of templates for functions in ADMB might be a redherring.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Mark<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<div>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:developers-bounces@admb-project.org" target="_blank">developers-bounces@admb-project.org</a> [mailto:<a href="mailto:developers-bounces@admb-project.org" target="_blank">developers-bounces@admb-project.org</a>]
<b>On Behalf Of </b>Steve Martell<br>
<b>Sent:</b> Tuesday, August 12, 2014 12:46 PM<br>
<b>To:</b> William Stockhausen - NOAA Federal<br>
<b>Cc:</b> <a href="mailto:developers@admb-project.org" target="_blank">developers@admb-project.org</a></span></p><div class=""><br>
<b>Subject:</b> Re: [Developers] libraries of functions<u></u><u></u></div><p></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">My bad <u></u><u></u></p><div><div class="h5">
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Should have been <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">FUNCTION dvariable Richards(...)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">S<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">On Aug 12, 2014, at 12:40 PM, William Stockhausen - NOAA Federal <<a href="mailto:william.stockhausen@noaa.gov" target="_blank">william.stockhausen@noaa.gov</a>> wrote:<u></u><u></u></p>
</div>
<p class="MsoNormal"><br>
<br>
<u></u><u></u></p>
<div>
<p class="MsoNormal">I don't think your suggestion will work, Steve (he said without having tried it). If I understand things correctly (going out on a looong limb here), "FUNCTION" is an identifier to the tpl2cpp translator that what follows is a function
 that 1) whose signature should be added to the model_parameters class declaration in tpl_name.htp and 2) whose implementation should be added to tpl_name.cpp.
<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">A nice (but probably tough to implement) feature in tpl2cpp would be the ability to put the following:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<p class="MsoNormal">FUNCTION dvariable model_parameters::Richards(const dvariable &age, const dvariable &Linf, const dvariable &K, const dvariable &t0, const dvariable &p)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">    dvariable Length=Linf*pow((1+(1/p)*exp(-K*(age-t0))),-p);<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">    return(Length);<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<div>
<p class="MsoNormal">into a file (functions.cxx, say) and be able to "include" that text in the tpl you're converting to cpp at a stage in the process before FUNCTIONs get converted to cpp equivalents. If such a feature is currently available, I haven't found
 it.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">Buck<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">On Mon, Aug 11, 2014 at 3:59 PM, Steve Martell <<a href="mailto:martell.steve@gmail.com" target="_blank">martell.steve@gmail.com</a>> wrote:<u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
<div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<p class="MsoNormal">Try: <u></u><u></u></p>
<div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">FUNCTION dvariable model_parameters::Richards(const dvariable &age, const dvariable &Linf, const dvariable &K, const dvariable &t0, const dvariable &p)<u></u><u></u></span></p>

</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">{<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">  {<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">    dvariable Length=Linf*pow((1+(1/p)*exp(-K*(age-t0))),-p);<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">    return(Length);<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">  }<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">}<u></u><u></u></span></p>
</div>
</div>
</blockquote>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Aug 11, 2014, at 3:49 PM, Mark Maunder <<a href="mailto:mmaunder@iattc.org" target="_blank">mmaunder@iattc.org</a>> wrote:<u></u><u></u></p>
</div>
<p class="MsoNormal"><br>
<br>
<u></u><u></u></p>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Why do I get an error if I put the following function in the file CAPAM_Growth.hpp and include it using #include<CAPAM_Growth.hpp> but if I put it in the tpl using the FUNCTION
 section I do not? The translator appears to just put it in the cpp with no changes<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">dvariable model_parameters::Richards(const dvariable &age, const dvariable &Linf, const dvariable &K, const dvariable &t0, const dvariable &p)<u></u><u></u></span></p>

</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">{<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">  {<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">    dvariable Length=Linf*pow((1+(1/p)*exp(-K*(age-t0))),-p);<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">    return(Length);<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">  }<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">}<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">The errors I get are<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">In file included from igm.cpp:3:0:<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">./CAPAM_Growth.hpp:130:142: error: invalid use of incomplete type 'struct model_parameters'<u></u><u></u></span></p>

</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">c:/ADMB/admb101-gcc452-win32\include/admodel.h:107:9: error: forward declaration of 'struct model_parameters'<u></u><u></u></span></p>

</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">igm.cpp: In member function 'virtual void model_parameters::userfunction()':<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">igm.cpp:127:46: error: no matching function for call to 'Richards(prevariable, named_dvariable&, named_dvariable&, param_init_number&, named_dvariable&)'<u></u><u></u></span></p>

</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">igm.cpp:128:58: error: no matching function for call to 'Richards(prevariable&, named_dvariable&, named_dvariable&, param_init_number&, named_dvariable&)'<u></u><u></u></span></p>

</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">igm.cpp:139:49: error: no matching function for call to 'Richards(double&, named_dvariable&, named_dvariable&, param_init_number&, named_dvariable&)'<u></u><u></u></span></p>

</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">The selectivity special issue of the journal Fisheries Research is now published<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><a href="http://www.sciencedirect.com/science/journal/01657836/158/supp/C" target="_blank">http://www.sciencedirect.com/science/journal/01657836/158/supp/C</a><u></u><u></u></span></p>

</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> <u></u><u></u></span></p>
</div>
<p class="MsoNormal" style="margin-bottom:6.0pt;background:white"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">The Stock Synthesis special issue of the journal Fisheries Research<u></u><u></u></span></p>

<p class="MsoNormal" style="margin-bottom:6.0pt;background:white"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><a href="http://www.sciencedirect.com/science/journal/01657836/142" target="_blank">http://www.sciencedirect.com/science/journal/01657836/142</a><u></u><u></u></span></p>

<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Mark Maunder         <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Head of the Stock Assessment Program                                          <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="ES-PE" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Inter-American  Tropical Tuna Commission                                     </span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><u></u><u></u></span></p>

</div>
<div>
<p class="MsoNormal"><span lang="ES-TRAD" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">8901 La Jolla Shores Dr.</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><u></u><u></u></span></p>

</div>
<div>
<p class="MsoNormal"><span lang="ES-TRAD" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">La Jolla, CA  92037-1508, USA</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><u></u><u></u></span></p>

</div>
<div>
<p class="MsoNormal"><span lang="ES-PE" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">  </span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><u></u><u></u></span></p>

</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Tel:
<a href="tel:%28858%29%20546-7027" target="_blank">(858) 546-7027</a><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Fax:
<a href="tel:%28858%29%20546-7133" target="_blank">(858) 546-7133</a><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><a href="mailto:mmaunder@iattc.org" target="_blank">mmaunder@iattc.org</a><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><a href="http://www.fisheriesstockassessment.com/TikiWiki/tiki-index.php?page=Mark+Maunder" target="_blank">http://www.fisheriesstockassessment.com/TikiWiki/tiki-index.php?page=Mark+Maunder</a><u></u><u></u></span></p>

</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Visit the Center for the Advancement of Population Assessment Methodology at<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><a href="http://www.capamresearch.org/" target="_blank">http://www.capamresearch.org/</a><u></u><u></u></span></p>

</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Visit the AD Model Builder project at<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> <a href="http://admb-project.org/" target="_blank">http://admb-project.org/</a><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">See the following website for information on fisheries stock assessment <a href="http://www.fisheriesstockassessment.com/" target="_blank">http://www.fisheriesstockassessment.com/</a><u></u><u></u></span></p>

</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> <u></u><u></u></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><span style="font-size:13.5pt;font-family:"Helvetica","sans-serif";color:#888888"><u></u> <u></u></span></p>
</div>
<p class="MsoNormal"><span><span style="font-size:13.5pt;font-family:"Helvetica","sans-serif";color:#888888">-- </span></span><span style="font-size:13.5pt;font-family:"Helvetica","sans-serif";color:#888888"><br>

<span>You received this message because you are subscribed to the Google Groups "admb-users" group.</span><br>
<span>To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:admb-users+unsubscribe@googlegroups.com" target="_blank"><span style="color:purple">admb-users+unsubscribe@googlegroups.com</span></a>.</span><br>

<span>To post to this group, send email to <a href="mailto:admb-users@googlegroups.com" target="_blank"><span style="color:purple">admb-users@googlegroups.com</span></a>.</span><br>
<span>Visit this group at <a href="http://groups.google.com/group/admb-users" target="_blank"><span style="color:purple">http://groups.google.com/group/admb-users</span></a>.</span><br>
<span>For more options, visit <a href="https://groups.google.com/d/optout" target="_blank"><span style="color:purple">https://groups.google.com/d/optout</span></a>.</span></span><span style="font-size:13.5pt;font-family:"Helvetica","sans-serif""><u></u><u></u></span></p>

</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<br>
Developers mailing list<br>
<a href="mailto:Developers@admb-project.org" target="_blank">Developers@admb-project.org</a><br>
<a href="http://lists.admb-project.org/mailman/listinfo/developers" target="_blank">http://lists.admb-project.org/mailman/listinfo/developers</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
Developers mailing list<br>
<a href="mailto:Developers@admb-project.org" target="_blank">Developers@admb-project.org</a><br>
<a href="http://lists.admb-project.org/mailman/listinfo/developers" target="_blank">http://lists.admb-project.org/mailman/listinfo/developers</a><u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="3" width="100%" align="center">
</div>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:gray"><br>
This internet e-mail message, and any files transmitted with it, contains confidential, privileged information that is intended only for the addressee. If you have received this e-mail message in error, please call us at <a href="tel:%28206%29%20634-1838" value="+12066341838" target="_blank">(206) 634-1838</a> collect if necessary)
 and ask to speak to the message sender. Nothing in this e-mail or the act of transmitting it, is to be construed as a waiver of any rights or privileges enjoyed by the sender or the International Pacific Halibut Commission pursuant to the International Organizations
 Immunities Act, 22 U.S.C. Sec. 288 et seq.</span><u></u><u></u></p>
</div></div></div>
</div>

</blockquote></div><br></div>