[ADMB Users] Compile Problem

William Stockhausen William.Stockhausen at noaa.gov
Thu Sep 1 12:58:27 PDT 2011


Justin,

As Jim correctly points out, if you're using h_f in calculating your 
objective function, then it needs to be declared in the parameter 
section as a "matrix" so that when the tpl code gets translated into c++ 
(the htp/cpp files) it gets declared as a dvar_matrix (i.e. a matrix 
carrying derivative information).  If it's declared in the data section 
as a "matrix" in the tpl code,  it gets declared as a dmatrix (with no 
derivative information) in the htp/cpp files.

However, if h_f is NOT used in calculating your objective function 
(e.g., you use it to calculate values in the report section based on the 
final parameter values), then you're perfectly fine declaring it in the 
data section--just use "h_f(j,i) = value(b96)" to make the assignment 
(as Weihai wrote) --value(x) strips off the derivative information from 
x and just--you guessed it--returns its value.

Cheers all,

Buck

-- 
***************************************************
* Dr. William T. Stockhausen                      *
*_________________________________________________*
* Resource Ecology and Fisheries Management       *
* Alaska Fisheries Science Center                 *
* National Marine Fisheries Service               *
* National Oceanic and Atmospheric Administration *
* 7600 Sand Point Way N.E.                        *
* Seattle, Washington 98115-6349                  *
*_________________________________________________*
* email: William.Stockhausen at noaa.gov             *
* voice: 206-526-4241 fax: 206-526-6723           *
* web  : http://www.afsc.noaa.gov                 *
***************************************************
All models are wrong, some are useful.--G.E.P. Box
Beware of geeks bearing equations.    --W. Buffett
***************************************************
Disclaimer: The opinions expressed above are personal
and do not necessarily reflect official NOAA policy.




More information about the Users mailing list